/* Keep the orientation fallback inside the native fullscreen element when available. */
[data-player-fullscreen-host] { display: contents; }

html:has(.ar-library-player[open][data-player-phone]),
html:has(.ar-library-player[open][data-player-phone]) body {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

html body dialog.ar-library-player[open][data-player-phone] {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #070605 !important;
}
.ar-library-player[data-player-phone] [data-player-fullscreen-host] {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  overscroll-behavior: none;
  background: #070605;
}
html body .ar-library-player[data-player-phone] [data-player-surface] {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: hidden !important;
}
html body .ar-library-player[data-player-phone][data-player-rotated] [data-player-surface] {
  inset: 50% auto auto 50% !important;
  width: 100vh !important;
  width: 100dvh !important;
  height: 100vw !important;
  transform: translate(-50%, -50%) rotate(90deg) !important;
}
.ar-library-player[data-player-phone] [data-player-slot],
.ar-library-player[data-player-phone] iframe {
  overscroll-behavior: none;
}
.ar-library-player[data-player-phone] [data-player-fullscreen-host]:fullscreen { background: #070605; }
.ar-library-player[data-player-phone] .ar-library-player-actions > button { touch-action: manipulation; }

.woolly-choice96 [data-app-open] > .ar-launch-play-icon {
  width: 0.8em;
  height: 0.9em;
  flex: none;
  fill: currentColor;
}

.ar-game-download [data-play-action]::before {
  content: '';
  display: inline-block;
  width: .66em;
  height: .78em;
  margin-inline-end: .55em;
  background: currentColor;
  clip-path: polygon(0 0,100% 50%,0 100%);
}

/* Ember Rest on a phone enters a game surface, not the library toolbar view. */
html body .ar-library-player[data-ember-game-only][data-launch-state=ready] :is(#ar-player-controls,.ar-library-edge){display:none!important}
html body .ar-library-player[data-ember-game-only][data-launch-state=ready] .ar-library-frame-wrap{flex:1 1 100%;width:100%;min-height:0;margin:0!important;padding:0!important}

/* Keep the existing phone chevron; only desktop retains Sheep’s permanent flex runner.
   While native fullscreen is unavailable, the opened drawer offers a trusted retry. */
html body dialog.ar-library-player[open][data-player-app="sheep"][data-player-phone][data-phone-game-chevron][data-phone-game-hud=open] #ar-player-controls{position:absolute!important;inset:0 0 auto!important}
html body dialog.ar-library-player[open][data-player-app="sheep"][data-player-phone][data-phone-game-chevron][data-phone-game-hud=open]:not(:has([data-player-fullscreen-host]:fullscreen)) [data-player-fullscreen]{display:inline-flex!important}
