/* Phone presentation: opposing players, a quiet battlefield and reachable actions. */
body#top[data-page='play'] :where(.phone-group-tabs, .phone-reserve-toggle, .phone-match-status, .phone-match-tools, #phone-log-toggle, .phone-action-icon) { display: none; }
body#top[data-page='play'] #phone-unit-inspector:not([open]) { display: none; }
@media (max-width: 900px) {
  body#top[data-page='play'] #setup-screen .mode-card-title { font-size: 13px; letter-spacing: .4px; }
  body#top[data-page='play'] #setup-screen .mode-card-sub { font-size: 11px; line-height: 1.3; }
  body#top[data-page='play'] #setup-screen :is(button, input) { min-width: 44px; min-height: 44px; }
  body#top[data-page='play'] #input-join-code { padding-inline: 8px !important; font: 700 12px/1.3 Inter, sans-serif !important; letter-spacing: 1px !important; }
  body#top[data-page='play'] #input-join-code::placeholder { font: 500 11px/1.3 Inter, sans-serif; letter-spacing: .3px; }
}
@media (orientation: landscape) and (max-width: 1100px) and (max-height: 599px) {
  body#top[data-page='play'] #setup-screen .mode-card { height: 88px; min-height: 88px; gap: 6px; padding: 8px 4px; }
}
@media (orientation: landscape) and (max-width: 1100px) and (max-height: 599px) {
  body#top[data-page='play'].phone-match-active {
    --site-header-height: 0px; --game-site-header-height: 0px;
    --phone-board-start: max(8px, env(safe-area-inset-left, 0px));
    --phone-controls-end: max(8px, env(safe-area-inset-right, 0px));
    --phone-footer-inset: max(6px, env(safe-area-inset-bottom, 0px)); --phone-side-width: 140px;
    --phone-board-left: calc(var(--phone-board-start) + var(--phone-side-width) + 8px);
    --phone-board-right: calc(var(--phone-controls-end) + var(--phone-side-width) + 8px);
    --phone-board-width: calc(100vw - var(--phone-board-left) - var(--phone-board-right));
    --hud-w: 140px; --die-chip-size: clamp(44px, calc((100dvh - 248px) / 2), 63px);
    --die-svg-size: calc(var(--die-chip-size) - 22px); --die-chip-gap: 4px;
    --phone-ink: #f3f6fb; --phone-muted: #b6c0d0; --phone-line: #758398;
    --phone-surface: #151d2a; --phone-field: #09101a;
    background: var(--phone-field); color: var(--phone-ink);
  }
  html[data-theme='light'] body#top[data-page='play'].phone-match-active {
    --phone-ink: #142337; --phone-muted: #42556c; --phone-line: #66798d;
    --phone-surface: #eff4f8; --phone-field: #d9e4ed;
  }
  body#top[data-page='play'].phone-match-active::before,
  body#top[data-page='play'].phone-match-active :is(.holo-bg, .celophane-wrap, .glass-overlay, .lightning-flash) { display: none; }
  body#top[data-page='play'].phone-match-active #topographic-bg-container { opacity: .1 !important; }
  body#top[data-page='play'].phone-match-active #game-screen { inset: 0; padding: 0; height: 100dvh; background: var(--phone-field) !important; }
  body#top[data-page='play'].phone-match-active #main-game-area {
    position: fixed !important; inset: 0 var(--phone-board-right) calc(56px + var(--phone-footer-inset)) var(--phone-board-left);
    width: var(--phone-board-width) !important; height: auto; padding: 0 !important;
  }
  body#top[data-page='play'].phone-match-active #board-col { width: 100%; flex: 1; padding: 2px !important; outline-offset: -3px; }
  body#top[data-page='play'].phone-match-active #hex-board { display: block; flex: 0 0 auto; }
  body#top[data-page='play'].phone-match-active.phone-board-zoomed #board-col { overflow: auto; display: block; overscroll-behavior: contain; touch-action: pan-x pan-y; scrollbar-width: thin; scrollbar-color: var(--phone-line) var(--phone-field); }
  body#top[data-page='play'].phone-match-active #board-col::-webkit-scrollbar { width: 6px; height: 6px; background: var(--phone-field); }
  body#top[data-page='play'].phone-match-active #board-col::-webkit-scrollbar-thumb { background: var(--phone-line); border-radius: 3px; }
  body#top[data-page='play'].phone-match-active.phone-board-zoomed #hex-board { width: 140%; height: 140%; max-width: none; max-height: none; }
  body#top[data-page='play'].phone-match-active .hex-poly { fill: #121c2b !important; stroke: #71819a !important; stroke-width: 1.5px !important; filter: none !important; }
  body#top[data-page='play'].phone-match-active .hex-poly.hex-control { fill: #332c1d !important; stroke: #a89360 !important; }
  body#top[data-page='play'].phone-match-active .hex-poly.hex-center { fill: #675224 !important; stroke: #e2cf8d !important; }
  body#top[data-page='play'].phone-match-active .hex-poly:is(.can-move, .can-move-p1, .can-move-p2, .can-attack, .can-attack-p1, .can-attack-p2) { stroke-width: 2.5px !important; stroke: #c5def4 !important; }
  body#top[data-page='play'].phone-match-active .hex-poly.hex-deploy-p1 { fill: #123044 !important; stroke: #74b9ed !important; }
  body#top[data-page='play'].phone-match-active .hex-poly.hex-deploy-p2 { fill: #38203e !important; stroke: #d995dd !important; }
  body#top[data-page='play'].phone-match-active .hex-poly:is(.hex-valid, .hex-deploy-valid-p1, .hex-deploy-valid-p2) { fill: #204234 !important; stroke: #bbf67b !important; stroke-width: 3px !important; }
  body#top[data-page='play'].phone-match-active .hex-poly.hex-attack { fill: #552e32 !important; stroke: #ffac9a !important; stroke-width: 3px !important; }
  body#top[data-page='play'].phone-match-active .hex-poly:is(.hex-selected, .hex-selected-p1, .hex-selected-p2) { stroke: #fff !important; stroke-width: 3px !important; }
  html[data-theme='light'] body#top[data-page='play'].phone-match-active .hex-poly { fill: #eff4f8 !important; stroke: #66798d !important; }
  html[data-theme='light'] body#top[data-page='play'].phone-match-active .hex-poly.hex-control { fill: #e5d7ad !important; stroke: #716034 !important; }
  html[data-theme='light'] body#top[data-page='play'].phone-match-active .hex-poly.hex-center { fill: #d8c07a !important; stroke: #62501b !important; }
  html[data-theme='light'] body#top[data-page='play'].phone-match-active .hex-poly.hex-deploy-p1 { fill: #b9daf3 !important; stroke: #286490 !important; }
  html[data-theme='light'] body#top[data-page='play'].phone-match-active .hex-poly.hex-deploy-p2 { fill: #e4c6ec !important; stroke: #81438e !important; }
  html[data-theme='light'] body#top[data-page='play'].phone-match-active .hex-poly:is(.hex-valid, .hex-deploy-valid-p1, .hex-deploy-valid-p2) { fill: #c5e7ae !important; stroke: #346625 !important; }
  html[data-theme='light'] body#top[data-page='play'].phone-match-active .hex-poly:is(.hex-selected, .hex-selected-p1, .hex-selected-p2) { stroke: #102235 !important; }
  /* Names and tokens never share their column with the portrait. */
  body#top[data-page='play'].phone-match-active #action-bar-wrapper { position: fixed; inset: 8px 0 auto; width: 100% !important; height: 60px; margin: 0 !important; }
  body#top[data-page='play'].phone-match-active :is(.bar-left, .bar-right) { position: absolute; top: 0; margin: 0 !important; }
  body#top[data-page='play'].phone-match-active .bar-left { left: var(--phone-board-start); }
  body#top[data-page='play'].phone-match-active .bar-right { right: var(--phone-controls-end); }
  body#top[data-page='play'].phone-match-active .hud-player { width: 140px; height: 60px; padding: 6px; cursor: default; background: var(--phone-surface); border: 1px solid var(--phone-line); box-shadow: none; border-radius: 8px; }
  body#top[data-page='play'].phone-match-active .hud-player.active { border-width: 2px; }
  body#top[data-page='play'].phone-match-active[data-phone-active='p1'] #hud-p1 { border: 2px solid #71c5ff; }
  body#top[data-page='play'].phone-match-active[data-phone-active='p2'] #hud-p2 { border: 2px solid #eda7f2; }
  html[data-theme='light'] body#top[data-page='play'].phone-match-active[data-phone-active='p1'] #hud-p1 { border-color: #286490; }
  html[data-theme='light'] body#top[data-page='play'].phone-match-active[data-phone-active='p2'] #hud-p2 { border-color: #81438e; }
  body#top[data-page='play'].phone-match-active .hp-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding-left: 34px; gap: 4px; }
  body#top[data-page='play'].phone-match-active #hud-p2 .hp-main { padding-left: 0; padding-right: 34px; }
  body#top[data-page='play'].phone-match-active :is(.hp-name-col, .hp-tokens-slot) { width: 100% !important; align-items: center !important; justify-content: center !important; }
  body#top[data-page='play'].phone-match-active .hp-name-row { gap: 4px; justify-content: center !important; }
  body#top[data-page='play'].phone-match-active .hp-name { font-size: 13px; letter-spacing: .5px; color: var(--phone-ink); }
  body#top[data-page='play'].phone-match-active .hp-dot { width: 6px; height: 6px; box-shadow: none; }
  body#top[data-page='play'].phone-match-active .hp-actions-row { display: none; }
  body#top[data-page='play'].phone-match-active .player-identity-label { font: 700 10px/1.2 Inter, sans-serif; }
  body#top[data-page='play'].phone-match-active .plaque-mascot { height: 28px; width: 30px; left: 5px; top: 50%; transform: translateY(-50%); filter: none; }
  body#top[data-page='play'].phone-match-active #hud-p2 .plaque-mascot { left: auto; right: 5px; transform: translateY(-50%); }
  body#top[data-page='play'].phone-match-active .hp-pips { gap: 5px; }
  body#top[data-page='play'].phone-match-active .pip { width: 12px; height: 14px; animation: none; filter: none; }
  body#top[data-page='play'].phone-match-active .phone-match-status { display: block; position: fixed; left: var(--phone-board-start); top: 74px; width: 140px; z-index: 55; }
  body#top[data-page='play'].phone-match-active .phone-status-title { font: 800 12px/1.4 Inter, sans-serif; color: var(--phone-ink); }
  body#top[data-page='play'].phone-match-active .phone-status-prompt { font: 500 11px/1.3 Inter, sans-serif; color: var(--phone-muted); }
  body#top[data-page='play'].phone-match-active .phone-status-compact { display: none; }
  body#top[data-page='play'].phone-match-active .phone-group-tabs { display: flex; position: fixed; top: 124px; width: 140px; height: 44px; gap: 4px; z-index: 55; }
  body#top[data-page='play'].phone-match-active .phone-tabs-p1 { left: var(--phone-board-start); }
  body#top[data-page='play'].phone-match-active .phone-tabs-p2 { right: var(--phone-controls-end); }
  body#top[data-page='play'].phone-match-active .phone-group-tabs .btn { display: flex; flex-direction: column; flex: 1; min-width: 44px; min-height: 44px; padding: 3px 0; gap: 2px; border-radius: 6px; text-transform: none; font: 700 11px/1.2 Inter, sans-serif; letter-spacing: 0; background: var(--phone-surface); border-color: var(--phone-line); color: var(--phone-muted); }
  body#top[data-page='play'].phone-match-active .phone-tab-count { font-size: 12px; color: var(--phone-ink); }
  body#top[data-page='play'].phone-match-active:has(.row-popup.popup-p1) .phone-tabs-p1,
  body#top[data-page='play'].phone-match-active:has(.row-popup.popup-p2) .phone-tabs-p2 { visibility: hidden; }
  body#top[data-page='play'].phone-match-active .phone-tabs-p1 [aria-selected='true'] { border-color: #71c5ff; color: #a9ddff; background: #183649; }
  body#top[data-page='play'].phone-match-active .phone-tabs-p2 [aria-selected='true'] { border-color: #eda7f2; color: #f3c9f6; background: #3b2747; }
  html[data-theme='light'] body#top[data-page='play'].phone-match-active .phone-group-tabs [aria-selected='true'] { color: #142337; background: #d0e3ec; border-color: #356781; }
  body#top[data-page='play'].phone-match-active:not(.combat-active) .side-stash { position: fixed; top: 172px; bottom: calc(56px + var(--phone-footer-inset)); width: 140px !important; height: auto !important; max-height: none !important; padding: 4px !important; margin: 0 !important; border: 1px solid var(--phone-line) !important; border-radius: 8px !important; background: var(--phone-surface) !important; box-shadow: none !important; overflow: auto; z-index: 54 !important; }
  body#top[data-page='play'].phone-match-active .stash-p1 { left: var(--phone-board-start); right: auto; }
  body#top[data-page='play'].phone-match-active .stash-p2 { right: var(--phone-controls-end); left: auto; }
  body#top[data-page='play'].phone-match-active .stash-grid-wrapper { width: 100%; height: 100%; justify-content: flex-start; }
  body#top[data-page='play'].phone-match-active .stash-group-vert { display: none; }
  body#top[data-page='play'].phone-match-active .stash-group-vert.phone-group-open { display: flex; flex-direction: column; gap: 4px; }
  body#top[data-page='play'].phone-match-active .sg-head { display: none !important; }
  body#top[data-page='play'].phone-match-active .stash-row { display: flex; justify-content: center; gap: 4px; }
  body#top[data-page='play'].phone-match-active .die-chip { display: flex; flex-direction: column; justify-content: center; gap: 2px; width: var(--die-chip-size); height: var(--die-chip-size); opacity: 1; background: var(--phone-field); border-color: var(--phone-line); }
  body#top[data-page='play'].phone-match-active .phone-die-label { font: 800 12px/1 Inter, sans-serif; color: var(--phone-ink); }
  body#top[data-page='play'].phone-match-active .phone-die-state { font: 600 10px/1 Inter, sans-serif; color: var(--phone-muted); }
  body#top[data-page='play'].phone-match-active .die-chip:is(.chip-deployed, .chip-destroyed) .chip-svg { display: none; }
  body#top[data-page='play'].phone-match-active .die-chip[aria-disabled='true'] { opacity: 1 !important; cursor: default; }
  body#top[data-page='play'].phone-match-active .die-chip[aria-disabled='true'] .chip-svg { opacity: .55; }
  /* Primary actions use the original engine controls. */
  body#top[data-page='play'].phone-match-active #action-bar { position: fixed; inset: auto auto var(--phone-footer-inset) var(--phone-board-left); transform: none; margin: 0; width: var(--phone-board-width); height: 48px; padding: 0; border: 0; background: transparent; box-shadow: none; }
  body#top[data-page='play'].phone-match-active #action-bar::before,
  body#top[data-page='play'].phone-match-active #action-bar::after { display: none; }
  body#top[data-page='play'].phone-match-active:not(.combat-active) #action-bar .bar-center { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; height: 48px; gap: 4px; }
  body#top[data-page='play'].phone-match-active .act-btn { justify-content: center; min-height: 48px; min-width: 44px; padding: 6px; border-radius: 8px; border-color: var(--phone-line); color: var(--phone-ink); background: var(--phone-surface); animation: none !important; box-shadow: none; }
  body#top[data-page='play'].phone-match-active .act-text { font: 800 14px/1.2 Inter, sans-serif; text-transform: none; letter-spacing: 0; }
  body#top[data-page='play'].phone-match-active .act-btn:disabled { opacity: 1 !important; color: var(--phone-muted); border-color: var(--phone-line); background: var(--phone-field); }
  body#top[data-page='play'].phone-match-active .ab-p1 .act-btn.act-active { background: #9bd7ff; color: #092137; border-color: #9bd7ff; }
  body#top[data-page='play'].phone-match-active .ab-p2 .act-btn.act-active { background: #e9b5f0; color: #2d1637; border-color: #e9b5f0; }
  /* Site utilities are collected in the match menu. */
  html[data-theme] body#top[data-page='play'].phone-match-active .site-header { height: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; pointer-events: none; }
  html[data-theme] body#top[data-page='play'].phone-match-active .site-header :is(a, button, .main-nav, details, summary) { pointer-events: auto; }
  html[data-theme] body#top[data-page='play'].phone-match-active .site-header :is(.brand, .game-site-mode) { display: none !important; }
  html[data-theme] body#top[data-page='play'].phone-match-active .site-header .menu-toggle { position: fixed !important; inset: auto var(--phone-controls-end) var(--phone-footer-inset) auto !important; width: 48px !important; height: 48px !important; border: 1px solid var(--phone-line); border-radius: 8px; background: var(--phone-surface); color: var(--phone-ink); }
  body#top[data-page='play'].phone-match-active #phone-board-zoom { display: flex !important; position: fixed; top: 74px; right: calc(var(--phone-controls-end) + 48px); width: 44px !important; height: 44px !important; border: 1px solid var(--phone-line); background: var(--phone-surface); color: var(--phone-ink); border-radius: 8px; z-index: 55; }
  body#top[data-page='play'].phone-match-active #phone-board-zoom svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; }
  html[data-theme] body#top[data-page='play'].phone-match-active .site-header .main-nav.open { position: fixed !important; inset: 0 !important; height: 100dvh !important; max-height: 100dvh !important; display: grid !important; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, minmax(44px, auto)); align-content: start; gap: 8px 24px !important; padding: 64px 24px 20px !important; overflow-y: auto; background: var(--phone-field) !important; }
  html[data-theme] body#top[data-page='play'].phone-match-active .main-nav > .nav-link { grid-column: 2; min-height: 44px; padding: 4px !important; font-size: 20px !important; display: flex; align-items: center; justify-content: center; }
  html.site-menu-open body#top[data-page='play'].phone-match-active .site-header .brand { display: flex !important; position: fixed !important; inset: 8px auto auto 24px !important; width: 44px !important; height: 44px !important; min-width: 44px !important; z-index: 1; }
  html.site-menu-open body#top[data-page='play'].phone-match-active .site-header .game-site-mode { display: block !important; position: fixed; inset: 23px auto auto 80px; transform: none; font-size: 12px; border: 0; padding: 0; z-index: 1; }
  html.site-menu-open body#top[data-page='play'].phone-match-active .site-header .menu-toggle { inset: 8px var(--phone-controls-end) auto auto !important; }
  body#top[data-page='play'].phone-match-active .phone-match-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-column: 1; grid-row: 1 / 5; gap: 8px; align-content: start; }
  body#top[data-page='play'].phone-match-active .phone-match-tools :is(.phone-tool-button, .theme-toggle, summary) { position: static !important; inset: auto !important; transform: none !important; width: auto !important; min-width: 44px !important; height: auto !important; min-height: 44px !important; margin: 0 !important; padding: 8px !important; border: 1px solid var(--phone-line); border-radius: 6px; background: var(--phone-surface); color: var(--phone-ink); font: 700 13px/1.3 Inter, sans-serif; letter-spacing: 0; display: flex; justify-content: center; align-items: center; gap: 8px; }
  body#top[data-page='play'].phone-match-active .phone-match-tools :is(.theme-label) { display: inline; }
  body#top[data-page='play'].phone-match-active .phone-match-tools .theme-toggle svg { flex: 0 0 20px; width: 20px; height: 20px; }
  body#top[data-page='play'].phone-match-active .phone-match-tools :is(#left-sidebar, #rb-sidebar) { display: flex !important; flex-wrap: wrap; grid-column: 1 / -1; position: static !important; inset: auto !important; transform: none !important; width: 100% !important; height: auto !important; margin: 0 !important; padding: 0 !important; border: 0 !important; clip-path: none !important; background: transparent !important; gap: 6px !important; }
  body#top[data-page='play'].phone-match-active .phone-match-tools :is(#left-sidebar, #rb-sidebar)::before,
  body#top[data-page='play'].phone-match-active .phone-match-tools :is(#left-sidebar, #rb-sidebar)::after { display: none; }
  body#top[data-page='play'].phone-match-active .phone-match-tools .rb-help-icon { display: flex !important; width: 100% !important; min-width: 44px !important; height: 44px !important; border: 1px solid var(--phone-line); border-radius: 6px; gap: 8px; background: var(--phone-surface); color: var(--phone-ink); font-size: 13px; }
  body#top[data-page='play'].phone-match-active .phone-tool-label { display: inline; font: 700 13px/1.3 Inter, sans-serif; }
  body#top[data-page='play'].phone-match-active .phone-match-tools .rb-hover-btn { position: static; inset: auto; transform: none; }
  body#top[data-page='play'].phone-match-active .phone-match-tools .reference-expanded .rb-hover-btn { display: grid !important; width: 44px !important; height: 44px !important; }
  body#top[data-page='play'].phone-match-active #phone-log-toggle { display: flex; }
  body#top[data-page='play'].phone-match-active .phone-tutorial-details { grid-column: 1 / -1; }
  body#top[data-page='play'].phone-match-active .phone-tutorial-details[hidden] { display: none; }
  body#top[data-page='play'].phone-match-active .phone-tutorial-instruction { margin: 8px 0; font: 500 13px/1.5 Inter, sans-serif; color: var(--phone-ink); }
  body#top[data-page='play'].phone-match-active #game-site-audio { grid-column: 2; padding: 4px 0 !important; }
  body#top[data-page='play'].phone-match-active #game-site-audio .ghdr-right { justify-content: center; }
  body#top[data-page='play'].phone-match-active #game-site-audio #btn-exit-game { width: 64px !important; min-width: 44px !important; height: 44px !important; min-height: 44px !important; border-radius: 6px !important; gap: 4px; }
  body#top[data-page='play'].phone-match-active #game-site-audio #btn-exit-game::after { content: 'Exit'; font: 700 12px/1 Inter, sans-serif; }
  body#top[data-page='play'].phone-match-active #online-turn-banner-container { top: 0 !important; right: var(--phone-board-right); max-width: var(--phone-board-width); }
  /* Shared header rules are deliberately overridden only inside an active match. */
  html[data-theme] body#top[data-page='play'].phone-match-active .site-header .main-nav.open { align-items: start !important; justify-content: stretch !important; }
  html[data-theme] body#top[data-page='play'].phone-match-active .site-header .phone-match-tools { align-self: start; }
  html[data-theme] body#top[data-page='play'].phone-match-active .site-header .phone-match-tools :is(.theme-toggle) { position: static !important; inset: auto !important; width: auto !important; height: 44px !important; padding: 8px !important; display: flex !important; border: 1px solid var(--phone-line) !important; border-radius: 6px !important; background: var(--phone-surface) !important; color: var(--phone-ink) !important; }
  html[data-theme] body#top[data-page='play'].phone-match-active .site-header .menu-toggle { background: var(--phone-surface) !important; border: 1px solid var(--phone-line) !important; border-radius: 8px !important; }
  body#top[data-page='play'].phone-match-active #phone-board-zoom { border-radius: 8px !important; }
  html.site-menu-open body#top[data-page='play'].phone-match-active #phone-board-zoom { display: none !important; }
  body#top[data-page='play'].phone-match-active .phone-match-tools #phone-inspect-toggle { order: 1; }
  body#top[data-page='play'].phone-match-active .phone-match-tools #phone-log-toggle { order: 2; }
  body#top[data-page='play'].phone-match-active .phone-match-tools .theme-toggle { order: 3; }
  body#top[data-page='play'].phone-match-active .phone-match-tools #left-sidebar { order: 5; }
  body#top[data-page='play'].phone-match-active .phone-match-tools #rb-sidebar { order: 6; }
  body#top[data-page='play'].phone-match-active .phone-tutorial-details { order: 7; }
  body#top[data-page='play'].phone-match-active .phone-match-tools :is(#left-sidebar, #rb-sidebar) .rb-help-icon { width: 100% !important; font-size: 0 !important; margin: 0 !important; background: var(--phone-surface) !important; border: 1px solid var(--phone-line) !important; color: var(--phone-ink) !important; }
  html[data-theme] body#top[data-page='play'].phone-match-active .site-header .phone-match-tools :is(.theme-label) { display: inline !important; }
  body#top[data-page='play'].phone-match-active .phone-match-tools .rb-help-icon::before { display: none !important; }
  body#top[data-page='play'].phone-match-active .modal.active { z-index: 1800 !important; }
  body#top[data-page='play'].phone-match-active .phone-match-tools button::before,
  body#top[data-page='play'].phone-match-active .phone-match-tools button::after { display: none !important; pointer-events: none !important; }
  body#top[data-page='play'].phone-match-active #phone-unit-inspector[open] { display: block; position: fixed; inset: 0; margin: auto; width: min(320px, calc(100vw - 32px)); max-height: calc(100dvh - 24px); padding: 24px; border: 2px solid #71c5ff; border-radius: 12px; background: var(--phone-surface); color: var(--phone-ink); z-index: 500; box-shadow: 0 12px 60px #0008; }
  body#top[data-page='play'].phone-match-active #phone-unit-inspector[data-player='p2'] { border-color: #eda7f2; }
  body#top[data-page='play'].phone-match-active #phone-unit-inspector::backdrop { background: #020813b3; }
  body#top[data-page='play'].phone-match-active .phone-inspector-close { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; min-width: 44px; min-height: 44px; font-size: 28px; color: var(--phone-ink); }
  body#top[data-page='play'].phone-match-active .phone-inspector-title { padding-right: 24px; margin: 0 0 16px; font: 800 18px/1.3 Inter, sans-serif; }
  body#top[data-page='play'].phone-match-active .phone-inspector-power { font: 800 26px/1.4 Inter, sans-serif; }
  body#top[data-page='play'].phone-match-active .phone-inspector-movement { font: 500 15px/1.5 Inter, sans-serif; color: var(--phone-muted); }
  body#top[data-page='play'].phone-match-active :is(button, summary, [role='button'], [role='tab']):focus-visible { outline: 2px solid var(--phone-ink); outline-offset: 2px; }
  body#top[data-page='play'].phone-match-active.combat-active :is(.phone-group-tabs, .phone-reserve-toggle, #phone-board-zoom) { display: none !important; }
  body#top[data-page='play'].phone-match-active.combat-active .phone-match-status { display: none; }
}
@media (orientation: landscape) and (max-width: 700px) and (max-height: 599px) {
  body#top[data-page='play'].phone-match-active { --phone-board-left: calc(var(--phone-board-start) + 52px); --phone-board-right: calc(var(--phone-controls-end) + 52px); }
  body#top[data-page='play'].phone-match-active .phone-match-status { width: 44px; top: 76px; }
  body#top[data-page='play'].phone-match-active .phone-status-title { font-size: 11px; }
  body#top[data-page='play'].phone-match-active .phone-status-prompt { display: none; }
  body#top[data-page='play'].phone-match-active .phone-status-compact { display: block; margin-top: 4px; font: 600 12px/1.3 Inter, sans-serif; color: var(--phone-muted); }
  body#top[data-page='play'].phone-match-active .phone-reserve-toggle { display: flex; position: fixed; flex-direction: column; gap: 3px; width: 44px; height: 64px; padding: 4px; font: 700 12px/1.2 Inter, sans-serif; color: var(--phone-ink); border-color: var(--phone-line); background: var(--phone-surface); border-radius: 8px; z-index: 56; }
  body#top[data-page='play'].phone-match-active #phone-reserve-p1 { top: 148px; left: var(--phone-board-start); }
  body#top[data-page='play'].phone-match-active #phone-reserve-p2 { top: 128px; right: var(--phone-controls-end); }
  body#top[data-page='play'].phone-match-active .phone-reserve-count { font-size: 18px; }
  body#top[data-page='play'].phone-match-active #phone-board-zoom { top: 76px; right: var(--phone-controls-end); }
  body#top[data-page='play'].phone-match-active .phone-group-tabs { display: none; top: 112px; }
  body#top[data-page='play'].phone-match-active:not(.combat-active) .side-stash { display: none !important; top: 160px; }
  body#top[data-page='play'].phone-match-active.phone-reserve-p1-open .phone-tabs-p1,
  body#top[data-page='play'].phone-match-active.phone-reserve-p2-open .phone-tabs-p2 { display: flex; }
  body#top[data-page='play'].phone-match-active.phone-reserve-p1-open .phone-match-status { width: 140px; }
  body#top[data-page='play'].phone-match-active.phone-reserve-p2-open #phone-board-zoom { display: none !important; }
  body#top[data-page='play'].phone-match-active.phone-reserve-p1-open:not(.combat-active) .stash-p1,
  body#top[data-page='play'].phone-match-active.phone-reserve-p2-open:not(.combat-active) .stash-p2 { display: flex !important; }
  body#top[data-page='play'].phone-match-active.phone-reserve-p1-open #phone-reserve-p1,
  body#top[data-page='play'].phone-match-active.phone-reserve-p2-open #phone-reserve-p2 { visibility: hidden; }
}
@media (orientation: landscape) and (min-width: 701px) and (max-width: 1000px) and (max-height: 340px) {
  body#top[data-page='play'].phone-match-active .phone-status-prompt { display: none; }
  body#top[data-page='play'].phone-match-active .phone-status-compact { display: block; font: 600 11px/1.3 Inter, sans-serif; }
  body#top[data-page='play'].phone-match-active .phone-group-tabs { top: 108px; }
  body#top[data-page='play'].phone-match-active:not(.combat-active) .side-stash { top: 156px; }
}
@media (prefers-reduced-motion: reduce) {
  body#top[data-page='play'].phone-match-active #topographic-bg-container { visibility: hidden; }
  body#top[data-page='play'].phone-match-active :is(.pip, .hud-player, .act-btn, .side-stash, .die-chip, .hex-poly) { animation: none !important; transition: none !important; }
}
