/* The handheld launcher belongs to the arena, using its faction colours and gold. */
html[data-phone-device='true'] body#top[data-page='play']:not(.game-active) {
  --lobby-field:#110c1e; --lobby-panel:#21162f; --lobby-panel-selected:#30203e;
  --lobby-line:#675077; --lobby-ink:#f8f2ff; --lobby-muted:#c8bad5;
  --lobby-accent:#ffd36a; --lobby-accent-ink:#241422; --lobby-p1:#58caff; --lobby-p2:#f074d5;
}
html[data-theme='light'][data-phone-device='true'] body#top[data-page='play']:not(.game-active) {
  --lobby-field:#f4eef7; --lobby-panel:#fbf7fc; --lobby-panel-selected:#e9dcf1;
  --lobby-line:#a28cab; --lobby-ink:#30223d; --lobby-muted:#685574;
  --lobby-accent:#8a5b11; --lobby-accent-ink:#fff9ee; --lobby-p1:#176c9f; --lobby-p2:#9c267e;
}
html[data-phone-device='true'] body#top[data-page='play'] #setup-screen.modal {
  background:radial-gradient(ellipse at 10% 40%,color-mix(in srgb,var(--lobby-p1) 10%,transparent),transparent 60%),radial-gradient(ellipse at 90% 65%,color-mix(in srgb,var(--lobby-p2) 12%,transparent),transparent 60%),var(--lobby-field)!important;
}
html[data-phone-device='true'] body#top[data-page='play'] #setup-screen .setup-panels-wrapper { background:linear-gradient(125deg,color-mix(in srgb,var(--lobby-p1) 6%,var(--lobby-panel)),color-mix(in srgb,var(--lobby-p2) 8%,var(--lobby-panel)))!important; }
@media(orientation:landscape) and (min-height:390px) and (max-height:599px) {
  html[data-phone-device='true'] body#top[data-page='play'] #setup-screen { --lobby-spacing-inset:clamp(10px,calc((100dvh - 370px) / 2),18px); }
  html[data-phone-device='true'] body#top[data-page='play'] #setup-device-note { margin-top:8px; }
}
@media(orientation:landscape) and (min-height:420px) and (max-height:599px) {
  html[data-phone-device='true'] body#top[data-page='play'] #setup-screen { --lobby-spacing-inset:clamp(10px,calc((100dvh - 400px) / 2),20px); }
}
/* The portrait gate uses the same arena material, with a stable manual fallback. */
html[data-play-device='rotate'] body#top[data-page='play']>.site-header { display:none!important; }
html[data-play-device='rotate'][data-phone-device] body#top[data-page='play'] #mobile-blocker {
  inset:0!important; height:100dvh; box-sizing:border-box;
  background:radial-gradient(ellipse at 0% 30%,#00a3ff20,transparent 65%),radial-gradient(ellipse at 100% 70%,#df178a25,transparent 65%),#130c21;
  color:#f8f1ff; padding:max(24px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left));
}
html[data-theme='light'][data-play-device='rotate'][data-phone-device] body#top[data-page='play'] #mobile-blocker { background:radial-gradient(ellipse at 0% 30%,#00a3ff14,transparent 65%),radial-gradient(ellipse at 100% 70%,#df178a14,transparent 65%),#f4eef7; color:#30223d; }
.device-notice-logo { display:block; width:70px; height:70px; margin:0 auto 26px; }
html[data-theme='light'] .device-notice-logo { filter:brightness(.15); }
.device-rotation-icon { display:block; width:104px; height:80px; margin:0 auto 24px; color:#ffcd6d; }
html[data-theme='light'] .device-rotation-icon { color:#8a5b11; }
html body#top[data-page='play'] #mobile-blocker .device-notice-link { color:inherit; border:1px solid currentColor; background:transparent; clip-path:none; border-radius:8px; }
/* Reserve prompts share the original confirmation surface and remain scroll-free. */
.row-popup .popup-roll-note { margin:0; font:500 11px/1.45 Inter,sans-serif; opacity:.8; text-align:center; }
.row-popup .popup-die-preview { display:flex; align-items:center; justify-content:center; min-height:44px; }
.row-popup .popup-die-preview svg { width:44px; height:44px; }
@media(orientation:landscape) and (max-width:1100px) and (max-height:599px) {
  body#top[data-page='play'].phone-match-active .row-popup {
    display:grid!important; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) 44px;
    align-content:stretch; align-items:stretch; justify-items:stretch; gap:4px; padding:4px!important; bottom:auto!important; min-height:0!important; max-height:none!important; overflow:hidden!important;
  }
  body#top[data-page='play'].phone-match-active .row-popup.popup-p1 { top:var(--phone-roll-top-p1)!important; height:var(--phone-roll-height-p1,96px)!important; }
  body#top[data-page='play'].phone-match-active .row-popup.popup-p2 { top:var(--phone-roll-top-p2)!important; height:var(--phone-roll-height-p2,96px)!important; }
  body#top[data-page='play'].phone-match-active .row-popup .popup-roll-note { font-size:10px; line-height:1.3; }
  body#top[data-page='play'].phone-match-active .row-popup .popup-die-preview { display:none!important; }
  body#top[data-page='play'].phone-match-active .row-popup.popup-unrolled { grid-template-rows:14px minmax(0,1fr) 44px; gap:3px; }
  body#top[data-page='play'].phone-match-active .row-popup.popup-unrolled .row-popup-lbl { position:static; grid-area:1 / 1; font-size:11px; line-height:14px; letter-spacing:0; }
  body#top[data-page='play'].phone-match-active .row-popup.popup-unrolled .popup-roll-note { grid-area:2 / 1; align-self:center; font-size:10px; line-height:1.1; }
  body#top[data-page='play'].phone-match-active .row-popup .popup-actions { grid-area:2 / 1; }
  body#top[data-page='play'].phone-match-active .row-popup.popup-unrolled .popup-actions { grid-area:3 / 1; }
  body#top[data-page='play'].phone-match-active .row-popup-lbl { text-align:center; font-size:11px; line-height:14px; }
  body#top[data-page='play'].phone-match-active .row-popup:not(.popup-unrolled) .row-popup-lbl { position:absolute; top:3px; left:6px; font-size:8px; line-height:10px; }
  body#top[data-page='play'].phone-match-active .row-popup .popup-big-val { min-height:0; height:100%; font-size:30px; }
  body#top[data-page='play'].phone-match-active .row-popup .popup-actions .btn { min-height:44px!important; height:44px!important; padding:4px 2px!important; font-size:11px; }
  body#top[data-page='play'].phone-match-active:is([data-phone-phase='DEPLOY_READY'],[data-phone-phase='DEPLOY_CONFIRM'])[data-phone-active='p1'] #phone-reserve-markers-p1,
  body#top[data-page='play'].phone-match-active:is([data-phone-phase='DEPLOY_READY'],[data-phone-phase='DEPLOY_CONFIRM'])[data-phone-active='p2'] #phone-reserve-markers-p2 { visibility:hidden; }
}
@media(orientation:landscape) and (max-height:300px) {
  body#top[data-page='play'].phone-match-active:has(.row-popup.popup-unrolled) { --phone-roll-width:max(102px,var(--phone-reserve-width)); }
  body#top[data-page='play'].phone-match-active .row-popup.popup-unrolled { grid-template-rows:11px minmax(0,1fr) 44px; gap:2px; padding:3px!important; width:max(102px,var(--phone-reserve-width))!important; min-width:102px!important; max-width:none!important; }
  body#top[data-page='play'].phone-match-active .row-popup.popup-unrolled .row-popup-lbl { font-size:10px; line-height:11px; }
  body#top[data-page='play'].phone-match-active .row-popup.popup-unrolled .popup-roll-note { font-size:9px; line-height:1; }
}
