/* Match the cast controls while showing the selected television's live output. */
body:has(.remote-play-shell) { background: #060606; }
.remote-play-shell { max-width: none; min-height: 100dvh; padding: 0; background: #060606; box-shadow: none; }
.remote-play { max-width: 680px; min-height: 100dvh; margin: 0 auto; }
.remote-play .cast-play-main { width: 100%; }
.remote-play .cast-play-stage-frame { aspect-ratio: 16 / 9; }
.remote-stage-canvas { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; }
.remote-stage-canvas iframe { position: absolute; inset: 0 auto auto 0; width: 1920px; height: 1080px; max-width: none; border: 0; pointer-events: none; transform-origin: top left; }
.remote-play .cast-play-stage-frame:fullscreen { width: 100vw; height: 100dvh; aspect-ratio: auto; }
.remote-play .cast-play-stage-frame:fullscreen .remote-stage-canvas { width: min(100vw, 177.7778dvh); }
.remote-play-new { width: min(100%,680px); margin: 12px auto 0; }
.remote-play .remote-play-new button { width: 100%; border-color: #735d39; background: #1c1710; color: #efdaa9; font-size: .82rem; font-weight: 800; }
body:has(.remote-play-shell) .poker-device-bar { max-width: 680px !important; border-color: #79613d !important; background: #19150f !important; }
body:has(.remote-play-shell) .poker-device-sheet { background: #15120f !important; border-color: #6d5636 !important; color: #f5eee1 !important; }

/* An in-page stage also works where iPhone Safari has no element Fullscreen API. */
body.remote-stage-fullscreen-open { overscroll-behavior: none; }
body.remote-stage-fullscreen-open [data-remote-stage-frame].remote-stage-expanded {
  position: fixed !important; inset: auto !important;
  left: var(--remote-fullscreen-left,0px) !important; top: var(--remote-fullscreen-top,0px) !important;
  width: var(--remote-fullscreen-width,100vw) !important;
  height: var(--remote-fullscreen-height,100vh) !important;
  display: flex !important; align-items: center; justify-content: center;
  min-width: 0; min-height: 0; max-width: none; max-height: none;
  margin: 0 !important; padding: 0 !important; aspect-ratio: auto !important;
  overflow: hidden !important; border: 0 !important; border-radius: 0 !important;
  background: #000 !important; box-shadow: none !important; z-index: 2147483000;
  overscroll-behavior: none; touch-action: manipulation;
}
body.remote-stage-fullscreen-open [data-remote-stage-frame].remote-stage-expanded .remote-stage-canvas {
  flex: none; width: var(--remote-fullscreen-canvas-width) !important;
  height: var(--remote-fullscreen-canvas-height) !important; aspect-ratio: 16 / 9;
}
body.remote-stage-fullscreen-open [data-remote-stage-frame].remote-stage-expanded > [data-ranking-preview-frame] {
  position: absolute !important; left: var(--remote-fullscreen-canvas-left) !important;
  top: var(--remote-fullscreen-canvas-top) !important;
  transform: scale(var(--remote-fullscreen-scale)) !important; transform-origin: top left;
}
.remote-stage-placeholder { pointer-events: none; visibility: hidden; }
[data-remote-stage-frame] > .remote-stage-close { display: none; }
body.remote-stage-fullscreen-open [data-remote-stage-frame].remote-stage-expanded > .remote-stage-close {
  display: block; position: absolute; top: max(12px,env(safe-area-inset-top));
  right: max(12px,env(safe-area-inset-right)); z-index: 3; pointer-events: auto;
  min-width: 88px; min-height: 44px; padding: 9px 14px; margin: 0;
  border: 1px solid #d3b571; border-radius: 8px; background: #15120ee8;
  color: #f6dfae; font: 600 14px/1.4 -apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif;
  touch-action: manipulation;
}
@media (orientation: landscape) and (max-height: 600px) {
  .remote-play .cast-play-main { display: flex; padding: 8px 16px; }
  .remote-play .cast-play-title { display: block; }
  .remote-play :is(.cast-play-next,.cast-play-stats,.cast-play-fine-stats,.cast-play-stage-caption) { display: flex; }
  .remote-play .cast-play-stats { display: grid; }
}
