/* Arcade chrome: shared type roles and the Mission Comic print palette. */
:root{--cr-ink:#050608;--cr-panel:#0b0c10;--cr-bone:#ece4d3;--cr-muted:#b5b0a6;--cr-accent:#ff6b2c;--cr-line:rgba(236,228,211,.24);color-scheme:dark}
body{background:var(--cr-ink);color:var(--cr-bone);font-family:var(--type-body)}
#rsc-bar{background:var(--cr-ink);border-bottom:1px solid var(--cr-line);gap:8px}
#rsc-bar a{font-family:var(--type-button);font-size:14px;min-height:44px;display:flex;align-items:center;letter-spacing:.08em;color:var(--cr-bone)}
.rsc-brand{font-family:var(--type-eyebrow);font-size:14px;letter-spacing:.12em}.rsc-brand img{filter:none}.rsc-tag{color:var(--cr-accent)}
#gb-btn,.gb-tab,#gb-close,.crq-b,.crq-b.hot,.crq-b.sub,.tc-pill,.tc-btn,#tc-pause,#turn-hint button{
 border:1px solid var(--cr-line);border-radius:2px;background:var(--cr-panel);color:var(--cr-bone);font-family:var(--type-button);font-weight:600;box-shadow:none;text-shadow:none
}
#gb-btn,.gb-tab,#gb-close{min-height:44px;font-size:16px;letter-spacing:.12em}
.crq-b.hot,.gb-tab.on,.tc-pill.on,.tc-main{background:var(--cr-accent);border-color:var(--cr-accent);color:var(--cr-ink)}
.crq-b:hover,.gb-tab:hover,#gb-close:hover,#gb-btn:hover{border-color:var(--cr-accent)}
.crq-b:active,.crq-b.hot:active,.crq-b.sub:active,.tc-btn:active,#tc-pause.on{background:var(--cr-accent);color:var(--cr-ink);border-color:var(--cr-accent)}
:focus-visible,.crq-b:focus-visible{outline:2px solid var(--cr-accent);outline-offset:3px}
#global-board{background:rgba(5,6,8,.92);color:var(--cr-bone);font-family:var(--type-body)}
#global-board .gb-card{box-sizing:border-box;background:var(--cr-panel);border:1px solid var(--cr-line);border-radius:2px;max-height:82vh;max-height:82dvh;padding:20px}
#global-board h2{font:800 36px/1.1 var(--type-section);letter-spacing:.015em;color:var(--cr-bone);text-align:left;border-top:3px solid var(--cr-accent);padding-top:14px}
#gb-list li{border-color:var(--cr-line);font-size:18px;min-height:40px;gap:10px}
#gb-list .r,#gb-list .s,#gb-list li:nth-child(1) .r,#gb-list li:nth-child(2) .r,#gb-list li:nth-child(3) .r{font:500 14px/1.5 var(--type-data);color:var(--cr-accent)}
#gb-list .n{letter-spacing:.12em}#gb-list .d{font-size:12px}#gb-status{font:500 16px/1.4 var(--type-caption);color:var(--cr-muted)}
#touch-controls{background:rgba(5,6,8,.88);border-top:1px solid var(--cr-line)}
#tc-joy{background:var(--cr-panel);border-color:var(--cr-line)}#tc-thumb{background:var(--cr-muted)}
.tc-btn,.tc-pill{font-size:12px;letter-spacing:.02em}.tc-pill{height:44px}#tc-pause{border-radius:2px}
#rsc-radio,#rr-list,#turn-hint{background:var(--cr-panel);border:1px solid var(--cr-line);border-radius:2px;color:var(--cr-bone);font-family:var(--type-caption)}
#rsc-radio button,#rsc-radio .rr-toggle{min-width:44px;width:44px;height:44px;border-radius:2px;border-color:var(--cr-line);background:var(--cr-panel);color:var(--cr-bone)}
#rsc-radio span,.rr-row{font-family:var(--type-caption);font-size:14px}.rr-row{min-height:44px;border-radius:2px}.rr-row.active{color:var(--cr-accent)}
#turn-hint button{width:44px;height:44px}#turn-hint{font-size:14px}
@media(pointer:coarse){#cr-hud:not([hidden]){background:var(--cr-panel);border-bottom:1px solid var(--cr-line);color:var(--cr-bone);font:500 14px/22px var(--type-data)}#cr-hud .cr-sector{color:var(--cr-accent)}}
@media(max-width:430px){.rsc-brand{font-size:12px;letter-spacing:.04em}.rsc-brand img{width:22px;height:22px}#rsc-bar{padding-left:12px;padding-right:12px}#rsc-bar a{font-size:12px;letter-spacing:.04em}.tc-btn{font-size:12px}#rsc-radio span{max-width:70px}}
@media(pointer:coarse) and (orientation:landscape){#touch-controls{background:transparent;border-top:0}#touch-controls:not(.tc-narrow) .tc-btn{font-size:12px}}
@media(prefers-reduced-motion:reduce){#rsc-radio{transition:none}}
@media(max-width:430px){#rsc-bar{height:calc(60px + env(safe-area-inset-top));box-sizing:border-box;padding-top:env(safe-area-inset-top);padding-bottom:0}.rsc-brand{gap:4px;flex-shrink:0}.rsc-brand span{max-width:60px}#rsc-bar a{max-width:92px}}

/* Menu sheets stay in CSS pixels, independent of Phaser FIT scaling. */
.runner-menu-sheet{font-size:16px;line-height:1.5;overscroll-behavior:contain}
.runner-menu-sheet h3{font:800 24px/1.2 var(--type-section);color:var(--cr-accent)}
/* Bleed across the sheet padding so scrolling text stays under an opaque strip. */
.runner-menu-header{position:sticky;top:-20px;z-index:1;margin:0 -20px;padding:8px 20px;background:var(--cr-panel);border-bottom:1px solid var(--cr-line)}
.runner-menu-back{background:var(--cr-panel)!important}
.runner-help-row{display:flex;align-items:center;gap:12px;margin:10px 0}
.runner-help-row img{width:48px;height:48px;object-fit:contain;flex:none}
.runner-help-row p{margin:0;font-size:16px}
.runner-hangar-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.runner-hangar-grid button{display:flex;flex-direction:column;align-items:center;gap:8px;width:100%;font-size:16px;line-height:1.4}
.runner-hangar-grid img{width:100%;height:112px;object-fit:contain}
.runner-hangar-grid span{overflow-wrap:anywhere}
.runner-hangar-grid button[aria-pressed=true]{outline:2px solid var(--cr-accent);outline-offset:2px}
.runner-screen button{min-width:44px;min-height:44px}
.runner-screen button+button{margin-left:12px}
.runner-hangar-grid button+button{margin-left:0}
@media(min-width:700px){.runner-hangar-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Keep the unlock ladder visible in the readable Hangar. */
.runner-ship-preview{position:relative;width:100%}
.runner-hangar-grid button[aria-disabled=true] .runner-ship-preview img{filter:brightness(.32) saturate(.25)}
.runner-ship-lock{position:absolute;inset:0;display:grid;place-items:center;font-size:32px}
.runner-hangar-grid .runner-ship-state{font-size:16px;color:var(--cr-accent)}
.runner-hangar-grid button[aria-disabled=true] .runner-ship-state{color:#ece4d3}
.runner-hangar-grid button[aria-disabled=true]{border-style:dashed;cursor:default}
.runner-powerup-icon{filter:drop-shadow(0 0 5px #ffffff30)}

/* BOSS FILE cards */
.runner-boss-card{display:flex;flex-direction:column;align-items:center;gap:6px;padding:10px;border:2px dashed #6a6a80;border-radius:8px;font-size:16px;line-height:1.3;text-align:center}
.runner-boss-card.beaten{border:2px solid #ffd24a}
.runner-boss-art{position:relative;display:block;width:100%}
.runner-boss-card:not(.beaten) .runner-boss-art img{filter:brightness(.4) saturate(.4)}
.runner-boss-stamp{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) rotate(-12deg);padding:2px 10px;border:3px solid #ff5cc8;border-radius:6px;color:#ff5cc8;background:rgba(5,1,15,.7);font:800 22px/1.2 var(--type-section,inherit);letter-spacing:.08em;white-space:nowrap;pointer-events:none}
.runner-boss-move{color:#9fe8ff}
.runner-boss-card .runner-ship-state{font-size:16px;color:var(--cr-accent)}
.runner-boss-card:not(.beaten) .runner-ship-state{color:#ece4d3}
/* The old corner radio is hidden under the shared music bar (html.sn-on), so the Boss File sheet uses that space
   instead of reserving it (on a 390 px tall landscape phone the sheet was only 134 px tall). On narrow phones it also
   starts below the Cadet Bar + music bar (--sn-h); from 700 px up the existing 100 px top already clears them. */
html.sn-on .runner-screen.runner-bossfile{bottom:calc(12px + env(safe-area-inset-bottom))}
@media(max-width:699px){html.sn-on .runner-screen.runner-bossfile{top:calc(var(--sn-h,96px) + 8px)}}
@media(min-width:700px){html.sn-on .runner-screen.runner-bossfile{bottom:calc(24px + env(safe-area-inset-bottom))}}
/* Big screens: one wide file wall, all 12 cards in two rows of six with no scrolling. The Galaxy Top 50 corner
   button would peek out from under the wide sheet, so it steps aside while the Boss File is open. */
body:has(.runner-bossfile) #gb-btn{visibility:hidden}
@media(min-width:1100px) and (min-height:700px){
 .runner-screen.runner-bossfile{left:max(24px,calc((100vw - 1180px)/2));right:max(24px,calc((100vw - 1180px)/2))}
 .runner-bossfile-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
 .runner-bossfile-grid img{height:100px}
}
@media(max-height:500px){
 .runner-screen.runner-bossfile{padding-top:10px}
 .runner-screen.runner-bossfile h2{font-size:24px;margin:0 0 2px}
 .runner-bossfile .runner-menu-header{top:-10px;padding:2px 20px}
 .runner-bossfile [role=status]{margin:8px 0}
 .runner-bossfile-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
 .runner-bossfile-grid img{height:80px}
 .runner-boss-stamp{font-size:18px}
}

/* Reserve the actual chrome height while playing; keep Home available. */
:root{--cr-play-head:calc(66px + env(safe-area-inset-top))}

@media(pointer:fine){
 html.cr-running #rsc-radio{left:auto;right:24px;top:auto;bottom:calc(10px + env(safe-area-inset-bottom));transform:none}
  #phaser-game-container{position:absolute;top:var(--cr-play-head);height:calc(100% - var(--cr-play-head))}
}
@media(pointer:coarse){
 :root{--cr-hud-h:148px}
 #cr-hud:not([hidden]){grid-template-rows:repeat(5,22px)}
}
@media(pointer:coarse) and (orientation:landscape){
 :root{--cr-hud-h:76px}
 #cr-hud:not([hidden]){grid-template-columns:repeat(5,1fr);grid-template-rows:repeat(2,22px);gap:4px}
 html.cr-run-hud #phaser-game-container{position:absolute;top:calc(var(--cr-head) + var(--cr-hud-h));height:calc(100% - var(--cr-head) - var(--cr-hud-h))}
}

/* Scoped result/pause panels; help and Hangar retain their existing sheets. */
.runner-screen.runner-comic-panel{
 border:3px solid var(--cr-ink);outline:1px solid var(--cr-line);
 box-shadow:6px 6px 0 var(--cr-ink),8px 8px 0 var(--cr-accent);
 background:linear-gradient(90deg,var(--cr-accent),var(--cr-accent)) 20px 20px/calc(100% - 40px) 3px no-repeat,var(--cr-panel);
 padding:36px 20px 20px;scroll-padding:20px;
}
.runner-screen.runner-comic-panel h2{
 color:var(--cr-bone);font-family:var(--type-display);text-transform:uppercase;
 font-size:clamp(28px,5vw,40px);line-height:1.1;letter-spacing:.02em;
}
.runner-comic-panel button{border-radius:2px;min-height:44px;min-width:44px}
@media(max-height:450px){.runner-screen.runner-comic-panel{top:60px;bottom:20px;padding-top:28px;background-position:20px 12px}}
