/* One reachable display control position, including browser expansion fallback. */
:root{--game-bar-size:0px;--game-bar-layout-height:0px;--game-bar-height:0px;--game-screen-height:100svh}
@supports(height:100dvh){:root{--game-screen-height:100dvh}}
body.game-screen-page{padding-top:0}
/* The Menu panel floats independently; neither open nor closed controls own a row. */
.game-screen-page .game-screen-bar{position:fixed;inset:calc(var(--game-controls-top,calc(env(safe-area-inset-top,0px) + 2px)) + 52px) max(8px,env(safe-area-inset-right,0px)) auto auto;z-index:2147480002;width:min(400px,calc(100vw - 16px));height:auto;max-height:calc(var(--game-screen-height) - var(--game-controls-top,env(safe-area-inset-top,0px)) - env(safe-area-inset-bottom,0px) - 64px);display:flex;flex-wrap:wrap;align-items:center;align-content:start;gap:8px;padding:12px;background:#0c0912f5;border:1px solid #887098;border-radius:10px;overflow:auto;overscroll-behavior:contain;font:11px monospace;letter-spacing:0;box-shadow:0 12px 40px #000a}
.game-screen-bar .game-screen-navigation{display:flex;flex-wrap:wrap;align-items:center;gap:8px;width:100%;min-width:0}
.game-screen-bar .game-screen-brand{display:none}
.game-screen-page .game-screen-bar :is(footer,.demo-footer,.lounge-footer){position:static;display:flex;flex-wrap:wrap;justify-content:start;width:100%;min-height:0;margin:0;padding:8px 0 0;border:0;border-top:1px solid #665374;background:none;gap:8px;font-size:10px;letter-spacing:0}
.game-screen-bar footer>span,.game-screen-bar .demo-footer>span{display:none}
.game-screen-bar footer>div{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.game-screen-bar :is(label,.controller-status){margin:0;min-height:44px;display:flex;align-items:center;line-height:1.4}
.game-screen-bar .controller-status{min-height:0;text-align:left;font-size:10px}
.game-screen-bar .voice-controls,.game-screen-bar .next-registration{display:flex;flex-wrap:wrap;width:100%;gap:6px}
.game-screen-bar .voice-controls label{display:flex}
.game-screen-bar .voice-controls input{max-width:100px}
.game-screen-page .game-screen-bar button,.game-screen-page .game-screen-bar a{display:inline-flex;justify-content:center;align-items:center;flex:0 0 auto;min-width:44px;min-height:44px;padding:6px 8px;font:700 11px/1.2 monospace;letter-spacing:0;white-space:nowrap;touch-action:manipulation}
.game-screen-page .game-screen-bar [data-game-fullscreen]{grid-column:2;grid-row:1;order:0;margin:0;width:116px;min-height:44px;gap:6px;padding:4px;border:2px solid #ad66e2;border-right-color:#b7f668;border-radius:6px;background:linear-gradient(110deg,#53256ad9,#101515cf 66%,#243518c2),url('assets/ui/menu-plate.webp') center/100% 100% no-repeat;box-shadow:inset 0 0 0 1px #ffffff25,0 0 10px #ad66e233;color:#fff;font:900 11px/1.2 monospace;text-shadow:0 1px 2px #000}
.game-screen-page .game-screen-bar [data-game-fullscreen]::before{content:"";flex:0 0 12px;width:12px;height:12px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1 6V1h5M10 1h5v5M15 10v5h-5M6 15H1v-5' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E") center/contain no-repeat}
.game-screen-page .game-screen-bar [data-game-fullscreen]:hover{border-color:#b7f668;filter:brightness(1.15)}
.game-screen-page .game-screen-bar [data-game-fullscreen][aria-pressed="true"]{gap:2px;background:linear-gradient(110deg,#b7f668,#9bc46a);border-color:#fff;color:#08090c;font-size:10px;text-shadow:none}
.game-screen-page .game-screen-bar #lounge-sound{min-height:44px}
.game-screen-bar :focus-visible{outline:3px solid #b7f668;outline-offset:-3px}
.game-screen-page .asset-loading,.game-screen-page .console-boot,.game-screen-page .story-progress-panel{top:var(--game-bar-layout-height)}
.game-screen-page dialog{top:var(--game-bar-layout-height);max-height:calc(var(--game-screen-height) - var(--game-bar-layout-height) - env(safe-area-inset-bottom,0px) - 16px);overflow:auto}
@media(max-width:900px){.game-screen-page .game-screen-bar .game-screen-brand{display:none}.game-screen-bar .game-screen-navigation{gap:4px}.game-screen-page .game-screen-bar button,.game-screen-page .game-screen-bar a{padding-inline:5px}}
@media(max-width:360px){.game-screen-page .game-screen-bar button,.game-screen-page .game-screen-bar a{font-size:10px}}

/* The lounge retains the one visible fullscreen/menu bar around featured screens. */
:root[data-system-clash-lounge-child="1"]{--game-bar-size:0px;--game-bar-layout-height:0px;--game-bar-height:0px}
[data-system-clash-lounge-child="1"] .game-screen-bar{display:none}
[data-system-clash-lounge-child="1"] #fight-frame{height:var(--game-screen-height)}

/* Only explicit screen navigation fades; the combat canvas remains untouched. */
iframe[data-system-clash-screen][data-screen-state="loading"]{opacity:0;pointer-events:none}
iframe[data-system-clash-screen][data-screen-state="ready"]{opacity:1;transition:opacity 140ms ease-out}
iframe[data-system-clash-screen][data-motion-reduced="true"]{transition:none}
@media(prefers-reduced-motion:reduce){iframe[data-system-clash-screen]{transition:none}}

/* Locally bundled arcade type and labels inside their authored plates. */
@font-face{font-family:"Clash Oxanium";src:url("assets/fonts/Oxanium.ttf") format("truetype");font-style:normal;font-weight:400 800;font-display:swap}
.game-screen-page button,.game-screen-page .game-screen-bar button,.game-screen-page .title-modes button .mode-label{font-family:"Clash Oxanium",Arial,sans-serif;font-weight:700}
.game-screen-page .title-modes button{min-height:58px;font-size:clamp(14px,1.8vw,18px);line-height:1.15;padding:12px 20px;letter-spacing:.05em}

/* Collapse only chrome; the active screen and its state remain in place. */
:root[data-system-clash-bar-state="collapsed"]{--game-bar-height:0px}
:root[data-system-clash-bar-state="delegated"]{--game-bar-layout-height:0px;--game-bar-height:0px}
.game-bar-restore{position:fixed;z-index:2147480003;left:auto;right:max(8px,env(safe-area-inset-right,0px));top:var(--game-controls-top,calc(env(safe-area-inset-top,0px) + 2px));transform:none;min-width:44px;min-height:44px;padding:4px 8px;border:2px solid #b7f668;border-radius:6px;background:#17121ef5;color:#fff;font:700 11px/1.2 Arial,sans-serif;touch-action:manipulation}
.game-bar-restore:focus-visible{outline:3px solid #fff;outline-offset:2px}
.game-bar-restore[hidden]{display:none!important}

:root:has(#spectator-presentation) .game-bar-restore{display:none!important}

/* Symmetric arrow space keeps the mode label on the plate's actual center. */
.game-screen-page .title-modes button{grid-template-columns:1em minmax(0,1fr) 1em;gap:6px}
.game-screen-page .title-modes button .mode-label{grid-column:2}
.game-screen-page .title-modes button i{grid-column:3}
/* Three selector actions share narrow screens without desktop-sized side insets. */
@media(max-width:1000px){.game-screen-page .selection-actions button{flex:1 1 0;min-height:48px;padding:8px 16px;line-height:1.2;overflow-wrap:normal;word-break:normal}}
/* Short title screens keep all modes readable inside the recovered viewport. */
@media(orientation:portrait) and (max-height:700px){
 .game-screen-page .title-modes button{min-height:44px;padding:6px 12px;font-size:14px}
 .game-screen-page .title-modes{gap:4px}
 .game-screen-page .title-content>.signal-label{display:none}
 .game-screen-page .title-content h1{margin:4px 0}
 .game-screen-page .title-logo{max-height:14svh}
 .game-screen-page .title-tagline{font-size:9px;margin:4px 0 8px}
 .game-screen-page .demo-scope{font-size:9px;margin:6px 0 2px}
}
@media(orientation:landscape) and (max-height:600px){
 .game-screen-page .title-modes button{min-height:48px;padding:6px 12px;font-size:clamp(11px,1.7vw,13px);line-height:1.15}
 .game-screen-page .title-content>:is(.signal-label,.title-tagline,.demo-scope),.game-screen-page .demo-load:not(.error){display:none}
}
@media(orientation:landscape) and (max-height:600px) and (max-width:700px){.game-screen-page .title-modes{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Authored display:grid must never override a collapsed controls bar. */
.game-screen-page .game-screen-bar[hidden]{display:none!important}

/* The existing illustrated loader owns every navigation gap, including the
   first painted destination frame; the game canvas is never faded underneath. */
.game-screen-page #asset-loading[data-screen-transition]{inset:0;z-index:2147480004;visibility:visible!important}
iframe[data-system-clash-screen][data-screen-state="presenting"]{opacity:1;pointer-events:none}
