/* POINT RESCUE AAA — UI / HUD styles.  All sizes scale with --u (1 unit = 1px at 1280x720). */
:root {
  --u: min(0.078125vw, 0.13888889vh);
  --yellow: #fff561;
  --amber: #ffc53d;
  --amber-deep: #ff9d00;
  --red: #ff3b30;
  --ink: #06080c;
  --panel: rgba(8, 12, 18, 0.72);
  --panel-edge: rgba(255, 213, 90, 0.35);
  --font-hud: 'Russo One', 'Arial Black', sans-serif;
  --font-logo: 'Black Ops One', 'Russo One', sans-serif;
  --font-ui: 'Rajdhani', 'Helvetica Neue', sans-serif;
  --font-num: 'Teko', 'Russo One', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body { color: #fff; font-family: var(--font-ui); user-select: none; -webkit-user-select: none; }
#stage { position: fixed; inset: 0; overflow: hidden; background: #000; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: none; }
body.retro #gl { image-rendering: pixelated; }
.hidden { display: none !important; }

/* ---------- crosshair ---------- */
/* V2: Z_FMV's crosshair (fps-fmv index.html #crosshair): its sizes in px, glow and the ring's pulse on a shot */
#crosshair {
  position: absolute; left: 0; top: 0; width: 80px; height: 80px; margin: -40px 0 0 -40px;
  pointer-events: none; z-index: 60; will-change: transform;
  animation: crosshairGlow 2s ease-in-out infinite;
}
@keyframes crosshairGlow { 0%, 100% { filter: drop-shadow(0 0 8px rgba(0,255,255,0.6)); } 50% { filter: drop-shadow(0 0 20px rgba(0,255,255,0.9)); } }
#crosshair > i { position: absolute; display: block; }
#crosshair .outer-ring { width: 68px; height: 68px; left: 6px; top: 6px; box-sizing: border-box; border: 2.5px solid rgba(0,255,255,0.7); border-radius: 50%;
  box-shadow: 0 0 15px rgba(0,255,255,0.5), 0 0 30px rgba(0,255,255,0.2), inset 0 0 12px rgba(0,255,255,0.15); }
#crosshair .inner-ring { width: 36px; height: 36px; box-sizing: border-box; border: 1.5px solid rgba(0,255,255,0.5); border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 8px rgba(0,255,255,0.3); }
#crosshair .cross-h { width: 22px; height: 2px; top: 50%; transform: translateY(-50%); background: linear-gradient(90deg, transparent, rgba(0,255,255,0.8) 40%, #fff 50%, rgba(0,255,255,0.8) 60%, transparent); }
#crosshair .cross-h.left { left: 0; } #crosshair .cross-h.right { right: 0; }
#crosshair .cross-v { width: 2px; height: 22px; left: 50%; transform: translateX(-50%); background: linear-gradient(180deg, transparent, rgba(0,255,255,0.8) 40%, #fff 50%, rgba(0,255,255,0.8) 60%, transparent); }
#crosshair .cross-v.top { top: 0; } #crosshair .cross-v.bottom { bottom: 0; }
#crosshair .center-dot { width: 4px; height: 4px; background: #00ffff; border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 6px #00ffff, 0 0 12px rgba(0,255,255,0.5); }
#crosshair .bracket { width: 0; height: 0; border-style: solid; filter: drop-shadow(0 0 4px rgba(0,255,255,0.5)); }
#crosshair .bracket.tl { top: 3px; left: 50%; transform: translateX(-50%); border-width: 8px 5px 0 5px; border-color: rgba(0,255,255,0.8) transparent transparent transparent; }
#crosshair .bracket.bl { bottom: 3px; left: 50%; transform: translateX(-50%); border-width: 0 5px 8px 5px; border-color: transparent transparent rgba(0,255,255,0.8) transparent; }
#crosshair .bracket.tr { top: 50%; right: 3px; transform: translateY(-50%); border-width: 5px 8px 5px 0; border-color: transparent rgba(0,255,255,0.8) transparent transparent; }
#crosshair .bracket.br { top: 50%; left: 3px; transform: translateY(-50%); border-width: 5px 0 5px 8px; border-color: transparent transparent transparent rgba(0,255,255,0.8); }
#crosshair.shooting .outer-ring { animation: crosshairShoot 0.1s ease-out; }
@keyframes crosshairShoot { 0% { transform: scale(1); } 50% { transform: scale(0.85); border-color: #fff; box-shadow: 0 0 25px #fff; } 100% { transform: scale(1); } }
/* the menu's own pointer, and the crosshair switched off */
#crosshair.menu { background: url('../../assets/ui/cursor.svg') center / contain no-repeat; width: calc(var(--u)*40); height: calc(var(--u)*40); margin: calc(var(--u) * -6) 0 0 calc(var(--u) * -6); animation: none; }
#crosshair.menu > i, #crosshair.off > i { display: none; }
body.cursor-visible, body.cursor-visible * { cursor: auto; }
/* the crosshair is the OS cursor: the system draws it, so it never lags behind the mouse, whatever the
   frame rate (a DOM crosshair moves only when the next frame is presented) */
#crosshair { display: none !important; }
body.ingame, body.ingame * { cursor: url('../../assets/ui/crosshair_cursor.png') 32 32, crosshair !important; }
body.ingame, body.ingame * { cursor: -webkit-image-set(url('../../assets/ui/crosshair_cursor.png') 1x, url('../../assets/ui/crosshair_cursor@2x.png') 2x) 32 32, crosshair !important; }
body.ingame.nocursor, body.ingame.nocursor * { cursor: none !important; }

#sinden { position: absolute; inset: 0; border: calc(var(--u) * 22) solid #fff; pointer-events: none; z-index: 70; }
#flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 40; mix-blend-mode: screen; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 30; font-family: var(--font-hud); }
.hud-btn { pointer-events: auto; }
#pauseBtn {
  position: absolute; left: calc(var(--u) * 28); top: calc(var(--u) * 22);
  width: calc(var(--u) * 58); height: calc(var(--u) * 58);
  background: linear-gradient(160deg, rgba(40,48,60,.85), rgba(10,14,20,.85));
  border: calc(var(--u) * 2) solid rgba(255, 230, 120, .55); border-radius: calc(var(--u) * 10);
  display: flex; gap: calc(var(--u) * 9); align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 calc(var(--u)*4) calc(var(--u)*14) rgba(0,0,0,.5), inset 0 0 calc(var(--u)*10) rgba(255,210,80,.12);
}
#pauseBtn i { display: block; width: calc(var(--u) * 10); height: calc(var(--u) * 28); background: var(--yellow); border-radius: calc(var(--u) * 2); box-shadow: 0 0 calc(var(--u)*8) rgba(255,230,90,.7); }
#pauseBtn:hover { border-color: var(--yellow); }
#cameraBtn { position: absolute; left: calc(var(--u) * 28); top: calc(var(--u) * 96);
  min-height: 36px; padding: 8px 12px; color: var(--yellow); background: rgba(8,12,18,.82);
  border: 1px solid var(--panel-edge); border-radius: 6px; font: 700 max(12px, calc(var(--u)*15)) var(--font-ui);
  touch-action: manipulation; }
#cameraBtn:hover, #cameraBtn:focus-visible { border-color: var(--yellow); }
.camera-options { display: flex; gap: calc(var(--u)*8); margin-top: calc(var(--u)*10); }
.camera-options .tbtn { flex: 1; text-align: center; padding: calc(var(--u)*10); }
.camera-options [aria-pressed="true"] { color: var(--yellow); background: rgba(255,197,61,.15); border-color: var(--yellow); }
.camera-hint { color: #abb4bf; font: 600 calc(var(--u)*15) var(--font-ui); margin: calc(var(--u)*8) 0 calc(var(--u)*18); text-align: center; }

#hearts { position: absolute; top: calc(var(--u) * 24); left: 50%; transform: translateX(-50%); display: flex; gap: calc(var(--u) * 8); }
.heart { width: calc(var(--u) * 46); height: calc(var(--u) * 42); background: url('../../assets/ui/heart.svg') center / contain no-repeat; filter: drop-shadow(0 calc(var(--u)*3) calc(var(--u)*4) rgba(0,0,0,.6)); transition: opacity .2s; }
.heart.empty { background-image: url('../../assets/ui/heart_empty.svg'); opacity: .75; }
.heart.pop { animation: heartpop .45s ease-out; }
.heart.lost { animation: heartlost .6s ease-out; }
@keyframes heartpop { 0% { transform: scale(1.6); } 60% { transform: scale(.9); } 100% { transform: scale(1); } }
@keyframes heartlost { 0% { transform: scale(1.5) rotate(-8deg); filter: brightness(3); } 100% { transform: scale(1); } }

#scoreBox { position: absolute; right: calc(var(--u) * 34); top: calc(var(--u) * 16); text-align: right; }
#scoreLabel { font-family: var(--font-ui); font-weight: 700; letter-spacing: calc(var(--u) * 5); font-size: calc(var(--u) * 16); color: rgba(255,255,255,.75); text-shadow: 0 0 calc(var(--u)*6) #000; }
#score { font-family: var(--font-num); font-weight: 600; font-size: calc(var(--u) * 64); line-height: .85; color: var(--yellow);
  text-shadow: 0 calc(var(--u)*2) 0 #7a5a00, 0 0 calc(var(--u)*18) rgba(255,190,40,.55), 0 calc(var(--u)*4) calc(var(--u)*10) rgba(0,0,0,.8);
  font-variant-numeric: tabular-nums; }
#score.bump { animation: bump .25s ease-out; }
@keyframes bump { 0% { transform: scale(1.18); } 100% { transform: scale(1); } }
#multiRow { font-family: var(--font-num); font-weight: 600; color: #fff; font-size: calc(var(--u) * 52); line-height: .9; margin-top: calc(var(--u) * 2);
  text-shadow: 0 0 calc(var(--u)*14) rgba(255,160,20,.7), 0 calc(var(--u)*3) calc(var(--u)*6) rgba(0,0,0,.8); }
#multiX { font-size: .7em; margin-right: calc(var(--u) * 4); color: var(--amber); }
#multiRow.hot { color: var(--amber); }
#multiRow.max { color: #ff6a3d; animation: pulse .5s infinite alternate; }
#multiRow.up { animation: multiup .22s ease-out; }
@keyframes multiup { 0% { transform: scale(1.35) skewX(-8deg); } 100% { transform: scale(1); } }
@keyframes pulse { from { filter: brightness(1); } to { filter: brightness(1.6); } }
#chain { display: flex; justify-content: flex-end; gap: calc(var(--u) * 3); margin-top: calc(var(--u) * 6); }
#chain i { display: block; width: calc(var(--u) * 14); height: calc(var(--u) * 6); background: rgba(255,255,255,.18); transform: skewX(-20deg); }
#chain i.on { background: var(--amber); box-shadow: 0 0 calc(var(--u)*6) var(--amber-deep); }

#ammoBox { position: absolute; left: calc(var(--u) * 30); bottom: calc(var(--u) * 26); }
/* V2: the player's bombs (G / middle button) */
#bombBox { position: absolute; left: calc(var(--u) * 30); bottom: calc(var(--u) * 160); display: flex; align-items: center; gap: calc(var(--u) * 8); }
#bombs { display: flex; gap: calc(var(--u) * 6); }
.bomb { width: calc(var(--u) * 26); height: calc(var(--u) * 30); border-radius: 48% 48% 44% 44%; position: relative;
  background: radial-gradient(circle at 35% 35%, #7d8f4a, #3d4a24 55%, #1e2612); box-shadow: 0 calc(var(--u)*3) calc(var(--u)*4) rgba(0,0,0,.7); }
.bomb::before { content: ''; position: absolute; left: 34%; top: calc(var(--u) * -6); width: 32%; height: calc(var(--u) * 8); background: #a8acb0; border-radius: calc(var(--u) * 2); }
.bomb::after { content: ''; position: absolute; left: 44%; top: calc(var(--u) * -9); width: calc(var(--u) * 5); height: calc(var(--u) * 5); border-radius: 50%; background: #40ff50; box-shadow: 0 0 calc(var(--u)*6) #40ff50; }
.bomb.spent { opacity: .18; filter: grayscale(1); }
.bomb.spent::after { display: none; }
.bombKey { font-family: var(--font-ui); font-weight: 700; font-size: calc(var(--u) * 15); color: rgba(255,255,255,.75); border: calc(var(--u)*2) solid rgba(255,255,255,.5);
  border-radius: calc(var(--u) * 4); padding: 0 calc(var(--u) * 6); text-shadow: 0 0 calc(var(--u)*4) #000; }
#ammo { display: flex; align-items: flex-end; height: calc(var(--u) * 92); }
.bullet { width: calc(var(--u) * 26); height: calc(var(--u) * 88); margin-right: calc(var(--u) * -3); background: url('../../assets/ui/bullet.svg') bottom / contain no-repeat; filter: drop-shadow(calc(var(--u)*2) calc(var(--u)*3) calc(var(--u)*3) rgba(0,0,0,.7)); }
.bullet.shell { background-image: url('../../assets/ui/shell.svg'); width: calc(var(--u) * 30); height: calc(var(--u) * 80); margin-right: calc(var(--u) * 1); }
.bullet.smg { width: calc(var(--u) * 15); height: calc(var(--u) * 64); margin-right: calc(var(--u) * -1); }
.bullet.spent { opacity: .16; filter: grayscale(1); }
.bullet.fire { animation: fire .18s ease-out; }
@keyframes fire { 0% { transform: translateY(calc(var(--u)*-18)) rotate(25deg); opacity: 1; } 100% { transform: none; } }
#weaponName { font-family: var(--font-ui); font-weight: 700; letter-spacing: calc(var(--u) * 4); font-size: calc(var(--u) * 16); color: rgba(255,255,255,.8); margin-top: calc(var(--u) * 4); text-shadow: 0 0 calc(var(--u)*6) #000; }
#weaponName.special { color: var(--amber); }
#reloadBar { width: calc(var(--u) * 150); height: calc(var(--u) * 8); background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.35); margin-bottom: calc(var(--u) * 8); opacity: 0; transition: opacity .1s; transform: skewX(-20deg); }
#reloadBar.on { opacity: 1; }
#reloadFill { height: 100%; width: 0; background: linear-gradient(90deg, var(--amber-deep), var(--yellow)); box-shadow: 0 0 calc(var(--u)*8) var(--amber); }

#bossBar { position: absolute; right: calc(var(--u) * 34); bottom: calc(var(--u) * 34); display: flex; align-items: center; gap: calc(var(--u) * 14); }
#bossLabel { font-family: var(--font-logo); font-size: calc(var(--u) * 30); color: #fff; text-shadow: 0 0 calc(var(--u)*10) rgba(255,60,40,.8), 0 calc(var(--u)*2) calc(var(--u)*4) #000; letter-spacing: calc(var(--u)*2); }
#bossTrack { position: relative; width: calc(var(--u) * 340); height: calc(var(--u) * 34); background: rgba(10,10,10,.7); border: calc(var(--u) * 2) solid rgba(255,255,255,.8); transform: skewX(-16deg); overflow: hidden; box-shadow: 0 0 calc(var(--u)*16) rgba(255,40,20,.4); }
#bossFill { position: absolute; inset: 0; width: 100%; background: linear-gradient(180deg, #ff6b4a, #d8190b 60%, #8e0a02); transition: width .15s; }
#bossFill.hit { filter: brightness(2); }
#bossPct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-num); font-size: calc(var(--u) * 30); transform: skewX(16deg); text-shadow: 0 calc(var(--u)*2) calc(var(--u)*3) #000; }

#reloadPrompt { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); font-family: var(--font-logo); font-size: calc(var(--u) * 58); color: var(--red);
  text-shadow: 0 0 calc(var(--u)*18) rgba(255,40,20,.9), 0 calc(var(--u)*4) calc(var(--u)*6) #000; animation: blink .25s steps(2) infinite; letter-spacing: calc(var(--u)*4); }
@keyframes blink { 50% { opacity: .25; } }

#banner { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-family: var(--font-logo); font-size: calc(var(--u) * 64); color: #fff; letter-spacing: calc(var(--u) * 6);
  text-shadow: 0 0 calc(var(--u)*24) rgba(255,190,50,.8), 0 calc(var(--u)*4) calc(var(--u)*8) #000; }
#banner .sub { display: block; font-family: var(--font-ui); font-weight: 700; font-size: calc(var(--u) * 22); letter-spacing: calc(var(--u) * 10); color: var(--amber); margin-top: calc(var(--u) * 6); }
#banner.show { animation: bannerIn .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes bannerIn { 0% { transform: scale(2.2); opacity: 0; filter: blur(8px); } 100% { transform: none; opacity: 1; filter: none; } }

#popups { position: absolute; inset: 0; }
.popup { position: absolute; transform: translate(-50%, -50%); font-family: var(--font-num); font-size: calc(var(--u) * 34); font-weight: 600; color: var(--yellow); white-space: nowrap;
  text-shadow: 0 0 calc(var(--u)*8) rgba(255,170,0,.8), 0 calc(var(--u)*2) calc(var(--u)*3) #000; animation: popup 1s ease-out forwards; }
.popup.good { color: #7dff9b; text-shadow: 0 0 calc(var(--u)*10) rgba(40,255,120,.7), 0 calc(var(--u)*2) calc(var(--u)*3) #000; }
.popup.bad { color: #ff5a4f; text-shadow: 0 0 calc(var(--u)*10) rgba(255,40,40,.7), 0 calc(var(--u)*2) calc(var(--u)*3) #000; }
@keyframes popup { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }

#headshot { position: absolute; transform: translate(-50%, -150%); font-family: var(--font-logo); font-size: calc(var(--u) * 40); color: #fff;
  text-shadow: 0 0 calc(var(--u)*14) rgba(255,60,30,1), 0 calc(var(--u)*3) calc(var(--u)*4) #000; white-space: nowrap; }
#headshot.show { animation: scaleOnShow .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes scaleOnShow { 0% { scale: .2; } 100% { scale: 1; } }
#hostageCross { position: absolute; width: calc(var(--u) * 96); height: calc(var(--u) * 96); transform: translate(-50%, -50%); background: url('../../assets/ui/cross.svg') center / contain no-repeat; filter: drop-shadow(0 0 calc(var(--u)*10) rgba(255,0,0,.9)); }

.dmg { position: absolute; opacity: 0; transition: opacity 0s; }
.dmg.on { opacity: 1; transition: opacity 1s linear .1s; }
.dmg.fade { opacity: 0; transition: opacity 1s linear .1s; }
#dmgFront { inset: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(200, 0, 0, .55) 100%); }
#dmgBack { left: 0; right: 0; bottom: 0; height: 22%; background: linear-gradient(0deg, rgba(220,0,0,.5), transparent); }
#dmgLeft { left: 0; top: 0; bottom: 0; width: 14%; background: linear-gradient(90deg, rgba(220,0,0,.5), transparent); }
#dmgRight { right: 0; top: 0; bottom: 0; width: 14%; background: linear-gradient(270deg, rgba(220,0,0,.5), transparent); }
#lowHealth { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 50%, rgba(140, 0, 0, .45) 100%); opacity: 0; }
#lowHealth.on { animation: heartbeat 1s infinite; }
@keyframes heartbeat { 0%, 100% { opacity: .2; } 15% { opacity: .9; } 30% { opacity: .35; } 45% { opacity: .75; } }
/* ---------- AAA edition: cover, hit markers, streak callouts, hints ---------- */
#coverShade { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .12s;
  background: radial-gradient(ellipse at 50% 38%, transparent 40%, rgba(0,4,10,.62) 100%); }
#hud.in-cover #coverShade { opacity: 1; }
#coverTag { position: absolute; left: 50%; bottom: calc(var(--u) * 34); transform: translateX(-50%) translateY(calc(var(--u) * 10)); opacity: 0; transition: opacity .12s, transform .12s;
  font-family: var(--font-ui); font-weight: 700; letter-spacing: calc(var(--u) * 8); font-size: calc(var(--u) * 22); color: #a8e6ff;
  text-shadow: 0 0 calc(var(--u)*12) rgba(60,180,255,.85), 0 calc(var(--u)*2) calc(var(--u)*4) #000; display: flex; align-items: center; gap: calc(var(--u) * 10); }
#coverTag::before { content: ''; width: calc(var(--u) * 18); height: calc(var(--u) * 22); background: #a8e6ff; box-shadow: 0 0 calc(var(--u)*10) #3cb4ff;
  clip-path: polygon(50% 0, 100% 18%, 100% 55%, 50% 100%, 0 55%, 0 18%); }
#hud.in-cover #coverTag { opacity: 1; transform: translateX(-50%); }
#hitmarker { position: absolute; left: 0; top: 0; width: calc(var(--u) * 38); height: calc(var(--u) * 38); margin: calc(var(--u) * -19) 0 0 calc(var(--u) * -19); opacity: 0; pointer-events: none; z-index: 58;
  background: linear-gradient(45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%);
  -webkit-mask: radial-gradient(circle, transparent 36%, #000 37%); mask: radial-gradient(circle, transparent 36%, #000 37%);
  filter: drop-shadow(0 0 calc(var(--u)*2) rgba(0,0,0,.9)); }
#hitmarker.kill { background: linear-gradient(45deg, transparent 43%, #ff3b30 43%, #ff3b30 57%, transparent 57%), linear-gradient(-45deg, transparent 43%, #ff3b30 43%, #ff3b30 57%, transparent 57%);
  filter: drop-shadow(0 0 calc(var(--u)*6) rgba(255,40,20,.9)); }
#hitmarker.show { animation: hitmark .2s ease-out; }
@keyframes hitmark { 0% { opacity: 1; transform: scale(1.4); } 60% { opacity: 1; } 100% { opacity: 0; transform: scale(1); } }
#callouts { position: absolute; left: 0; right: 0; top: 19%; display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 4); pointer-events: none; }
.callout { font-family: var(--font-logo); font-size: calc(var(--u) * 52); letter-spacing: calc(var(--u) * 4); color: var(--yellow); white-space: nowrap; transform: skewX(-8deg);
  text-shadow: 0 0 calc(var(--u)*18) rgba(255,150,0,.9), 0 calc(var(--u)*4) calc(var(--u)*6) #000; animation: calloutIn 1.4s ease-out forwards; text-align: center; }
.callout .pts { display: block; font-family: var(--font-num); font-size: calc(var(--u) * 34); color: #fff; letter-spacing: calc(var(--u) * 2); margin-top: calc(var(--u) * -4); }
.callout.clear { color: #7dff9b; font-size: calc(var(--u) * 64); text-shadow: 0 0 calc(var(--u)*22) rgba(40,255,120,.8), 0 calc(var(--u)*4) calc(var(--u)*6) #000; }
@keyframes calloutIn { 0% { opacity: 0; transform: scale(2.3) skewX(-8deg); filter: blur(6px); } 12% { opacity: 1; transform: scale(1) skewX(-8deg); filter: none; }
  78% { opacity: 1; transform: scale(1) skewX(-8deg); } 100% { opacity: 0; transform: translateY(calc(var(--u) * -24)) skewX(-8deg); } }
#hint { position: absolute; left: 50%; bottom: calc(var(--u) * 132); transform: translateX(-50%); padding: calc(var(--u) * 12) calc(var(--u) * 28);
  background: rgba(6,10,16,.78); border: 1px solid var(--panel-edge); font-family: var(--font-ui); font-weight: 700; letter-spacing: calc(var(--u) * 4);
  font-size: calc(var(--u) * 24); color: #fff; white-space: nowrap; box-shadow: 0 calc(var(--u)*8) calc(var(--u)*24) rgba(0,0,0,.5); }
#hint b { color: var(--yellow); }
#hint.show { animation: hintIn .4s cubic-bezier(.2,1.4,.4,1); }
@keyframes hintIn { 0% { opacity: 0; transform: translateX(-50%) translateY(calc(var(--u) * 20)); } 100% { opacity: 1; transform: translateX(-50%); } }

#touchReload { position: absolute; right: calc(var(--u) * 30); bottom: calc(var(--u) * 110); padding: calc(var(--u)*12) calc(var(--u)*20); background: var(--panel); border: 2px solid var(--amber); font-family: var(--font-ui); font-weight: 700; font-size: calc(var(--u)*22); }

#letterbox .lb { position: absolute; left: 0; right: 0; height: 0; background: #000; z-index: 35; transition: height .8s cubic-bezier(.4,0,.2,1); pointer-events: none; }
#letterbox .top { top: 0; } #letterbox .bottom { bottom: 0; }
#letterbox.on .lb { height: 10.5%; }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.panel-screen { background: radial-gradient(ellipse at center, rgba(0,0,0,.35), rgba(0,0,0,.78)); backdrop-filter: blur(3px) saturate(.8); }
.logo { display: flex; flex-direction: column; line-height: .9; }
.logo .l1 { font-family: var(--font-logo); font-size: calc(var(--u) * 92); color: #fff; letter-spacing: calc(var(--u) * 2);
  background: linear-gradient(180deg, #fff 0%, #ffe9a8 45%, #ffb21e 55%, #ff7a00 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 calc(var(--u)*4) 0 #3b1d00) drop-shadow(0 0 calc(var(--u)*24) rgba(255,140,0,.45)); }
.logo .l2 { font-family: var(--font-ui); font-weight: 700; font-size: calc(var(--u) * 30); letter-spacing: calc(var(--u) * 26); color: #fff; margin-top: calc(var(--u) * 6); padding-left: calc(var(--u) * 8); text-shadow: 0 0 calc(var(--u)*10) rgba(0,0,0,.9); }
.logo.small .l1 { font-size: calc(var(--u) * 64); }
.logo.small .l2 { font-size: calc(var(--u) * 20); letter-spacing: calc(var(--u) * 18); }

#screen-loading { background: radial-gradient(ellipse at 50% 40%, #1b2330, #05070a 70%); z-index: 90; }
#loadBar { width: calc(var(--u) * 460); height: calc(var(--u) * 6); background: rgba(255,255,255,.12); margin-top: calc(var(--u) * 50); transform: skewX(-20deg); overflow: hidden; }
#loadFill { height: 100%; width: 0; background: linear-gradient(90deg, var(--amber-deep), var(--yellow)); box-shadow: 0 0 calc(var(--u)*12) var(--amber); transition: width .2s; }
#loadText { margin-top: calc(var(--u) * 14); font-weight: 700; letter-spacing: calc(var(--u) * 6); font-size: calc(var(--u) * 16); color: rgba(255,255,255,.7); }
#loadTip { margin-top: calc(var(--u) * 40); max-width: calc(var(--u) * 700); text-align: center; font-size: calc(var(--u) * 20); font-weight: 500; color: rgba(255,230,160,.8); min-height: 2em; }
.boot-identity { display: none; }
/* This first paint precedes platform detection and font downloads. Keep it readable without touch-ed. */
@media (max-width: 900px), (pointer: coarse) {
  #screen-loading:not(.attract) .boot-identity { display: block; color: var(--amber); font: 800 clamp(22px, 4vw, 30px)/1.2 system-ui, sans-serif; letter-spacing: 2px; }
  #screen-loading:not(.attract) #loadBar { width: min(68vw, 320px); height: 5px; margin-top: 24px; }
  #screen-loading:not(.attract) #loadText { font-family: system-ui, sans-serif; margin-top: 14px; }
  #screen-loading #loadText { font-size: 14px; letter-spacing: 2px; }
  #screen-loading #loadTip { max-width: min(600px, 90%); margin-top: 16px; font-size: 14px; }
}

/* V2: the loading screen as a SEGA arcade attract (ui/attract.js lays its intro out as Web Animations): shots on the
   glass, letters slammed in, the red stripe of ARCADE, CRT scanlines, an arcade loading bar */
#screen-loading.attract { background: radial-gradient(ellipse at 50% 42%, #1a1f2c 0%, #07090d 62%, #000 100%); overflow: hidden; }
#screen-loading.attract::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 6;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.28) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.65) 100%); }
.at-stage { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; will-change: transform; }
.at-white { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 7; }
.at-hole { position: absolute; z-index: 5; pointer-events: none; opacity: 0; }
.at-bang { position: absolute; z-index: 8; pointer-events: none; opacity: 0; border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255,255,240,1) 0%, rgba(255,210,120,.6) 30%, rgba(255,160,60,0) 70%); }
.at-logo { display: flex; flex-direction: column; align-items: center; }
.at-title { display: flex; font-family: var(--font-logo); font-size: calc(var(--u) * 118); line-height: 1; letter-spacing: calc(var(--u) * 2);
  filter: drop-shadow(0 calc(var(--u)*5) 0 #3b1d00) drop-shadow(0 0 calc(var(--u)*22) rgba(255,140,0,.45)); }
.at-title span { display: inline-block; opacity: 0; color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(180deg, #fff 0%, #ffe9a8 42%, #ffb21e 55%, #ff7a00 78%, #b34700 100%); }
.at-sub { margin-top: calc(var(--u) * 12); opacity: 0; padding: calc(var(--u)*6) calc(var(--u)*64); transform: skewX(-18deg);
  background: linear-gradient(180deg, #ff2a3a, #c4001a 60%, #8a0012); box-shadow: 0 0 calc(var(--u)*26) rgba(255,30,50,.5), inset 0 calc(var(--u)*2) 0 rgba(255,255,255,.35); }
.at-sub span { display: block; transform: skewX(18deg); font-family: var(--font-hud); font-style: italic; font-size: calc(var(--u) * 56); letter-spacing: calc(var(--u) * 26);
  padding-left: calc(var(--u) * 22); color: #fff; text-shadow: 0 calc(var(--u)*3) 0 #5a0008; }
#screen-loading.attract #loadBar { width: calc(var(--u) * 520); height: calc(var(--u) * 14); margin-top: calc(var(--u) * 58);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,200,80,.35); opacity: 0; transition: opacity .3s; }
#screen-loading.attract #loadFill { background: repeating-linear-gradient(90deg, #ffd23f 0 calc(var(--u)*14), transparent calc(var(--u)*14) calc(var(--u)*18)); box-shadow: 0 0 calc(var(--u)*12) rgba(255,190,40,.6); }
#screen-loading.attract #loadText, #screen-loading.attract #loadTip { opacity: 0; transition: opacity .3s; }
#screen-loading.attract #loadText { font-family: var(--font-hud); letter-spacing: calc(var(--u) * 8); color: #ffd23f; animation: atBlink 1s steps(2) infinite; }
#screen-loading.at-ready #loadBar, #screen-loading.at-ready #loadText, #screen-loading.at-ready #loadTip { opacity: 1; }
@keyframes atBlink { 50% { opacity: .25; } }
.at-foot { position: absolute; bottom: calc(var(--u) * 18); left: 0; right: 0; z-index: 3; text-align: center; font-family: var(--font-hud); font-size: calc(var(--u) * 13); letter-spacing: calc(var(--u) * 6); color: rgba(255,255,255,.45); }
#screen-loading:not(.attract) .at-foot { display: none; }
#screen-splash { background: #000; cursor: pointer; z-index: 80; }
.splash-inner { max-width: calc(var(--u) * 820); text-align: center; animation: fadein 1.2s ease; }
.splash-kicker { font-weight: 700; letter-spacing: calc(var(--u) * 10); color: var(--amber); font-size: calc(var(--u) * 18); }
.splash-title { font-family: var(--font-logo); font-size: calc(var(--u) * 84); margin: calc(var(--u) * 10) 0 calc(var(--u) * 26); }
.splash-inner p { font-size: calc(var(--u) * 21); line-height: 1.45; color: rgba(255,255,255,.85); font-weight: 500; }
.dim { color: rgba(255,255,255,.55) !important; }
.press { margin-top: calc(var(--u) * 40); font-weight: 700; letter-spacing: calc(var(--u) * 8); font-size: calc(var(--u) * 20); color: var(--yellow); animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }


.tbtn { pointer-events: auto; background: none; border: none; color: #fff; font-family: var(--font-hud); font-size: calc(var(--u) * 40); letter-spacing: calc(var(--u) * 3);
  padding: calc(var(--u) * 4) calc(var(--u) * 10); cursor: pointer; text-shadow: 0 calc(var(--u)*3) calc(var(--u)*6) rgba(0,0,0,.9); position: relative; transition: color .08s, transform .08s; outline: none; }
.tbtn.small { font-size: calc(var(--u) * 24); }
.tbtn:hover, .tbtn:focus-visible, .tbtn.focus { color: var(--yellow); transform: translateX(calc(var(--u) * 8)); }
.tbtn:hover::before, .tbtn.focus::before { content: ''; position: absolute; left: calc(var(--u) * -18); top: 50%; width: calc(var(--u) * 10); height: calc(var(--u) * 10); background: var(--yellow); transform: translateY(-50%) rotate(45deg); box-shadow: 0 0 calc(var(--u)*10) var(--amber); }

.panel { background: var(--panel); border: 1px solid var(--panel-edge); padding: calc(var(--u) * 34) calc(var(--u) * 50); min-width: calc(var(--u) * 560);
  box-shadow: 0 calc(var(--u)*20) calc(var(--u)*60) rgba(0,0,0,.6), inset 0 0 calc(var(--u)*40) rgba(255,190,60,.05);
  clip-path: polygon(0 calc(var(--u)*18), calc(var(--u)*18) 0, 100% 0, 100% calc(100% - calc(var(--u)*18)), calc(100% - calc(var(--u)*18)) 100%, 0 100%);
  display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 8); }
.panel.narrow { min-width: calc(var(--u) * 420); }
.panel.wide { min-width: calc(var(--u) * 760); }
.panel.scroll { max-height: 86vh; overflow: auto; }
.panel-title { font-family: var(--font-logo); font-size: calc(var(--u) * 48); letter-spacing: calc(var(--u) * 4); margin-bottom: calc(var(--u) * 14);
  background: linear-gradient(180deg, #fff, #ffcf5a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tabs { display: flex; gap: calc(var(--u) * 12); margin-bottom: calc(var(--u) * 12); }
/* V2: 40 chapters in the high-score tabs: they wrap, smaller */
#scoreTabs { flex-wrap: wrap; gap: calc(var(--u) * 2) calc(var(--u) * 10); max-height: calc(var(--u) * 150); overflow-y: auto; }
#scoreTabs .tbtn { font-size: calc(var(--u) * 15); letter-spacing: calc(var(--u) * 1); }
.tab { font-size: calc(var(--u) * 24); opacity: .6; }
.tab.active { opacity: 1; color: var(--yellow); border-bottom: 2px solid var(--yellow); }
.tab-body { width: 100%; }
.setrow { display: flex; justify-content: space-between; align-items: center; width: 100%; font-weight: 700; font-size: calc(var(--u) * 22); letter-spacing: calc(var(--u) * 3); border-bottom: 1px solid rgba(255,255,255,.08); padding: calc(var(--u) * 2) 0; }
.setrow .tbtn { font-size: calc(var(--u) * 26); min-width: calc(var(--u) * 150); text-align: right; }
.tbtn.back { margin-top: calc(var(--u) * 18); font-size: calc(var(--u) * 30); }

.dead-title { font-family: var(--font-logo); font-size: calc(var(--u) * 110); color: #ff2a1f; text-shadow: 0 0 calc(var(--u)*30) rgba(255,0,0,.8), 0 calc(var(--u)*6) calc(var(--u)*10) #000; margin-bottom: calc(var(--u) * 30); animation: bannerIn .7s ease-out; }
#screen-dead { background: radial-gradient(ellipse at center, rgba(60,0,0,.35), rgba(20,0,0,.85)); }

.stats-grid { display: flex; gap: calc(var(--u) * 40); align-items: center; }
#statsList { min-width: calc(var(--u) * 420); }
.stat { display: flex; justify-content: space-between; font-size: calc(var(--u) * 24); font-weight: 700; letter-spacing: calc(var(--u) * 3); padding: calc(var(--u) * 3) 0; border-bottom: 1px solid rgba(255,255,255,.08); opacity: 0; animation: statIn .3s ease-out forwards; }
.stat b { font-family: var(--font-num); font-weight: 600; font-size: calc(var(--u) * 34); line-height: .9; color: var(--yellow); }
.stat.total b { font-size: calc(var(--u) * 46); }
@keyframes statIn { from { opacity: 0; transform: translateX(calc(var(--u) * -20)); } to { opacity: 1; transform: none; } }
#rankBox { text-align: center; min-width: calc(var(--u) * 220); }
.rank-label { font-weight: 700; letter-spacing: calc(var(--u) * 10); font-size: calc(var(--u) * 20); color: rgba(255,255,255,.7); }
#rank { font-family: var(--font-logo); font-size: calc(var(--u) * 190); line-height: 1; color: var(--yellow); text-shadow: 0 0 calc(var(--u)*40) rgba(255,170,0,.8), 0 calc(var(--u)*8) 0 #6b3f00; opacity: 0; }
#rank.show { animation: rankIn .6s cubic-bezier(.2,1.6,.4,1) forwards; }
@keyframes rankIn { 0% { opacity: 0; transform: scale(3) rotate(-12deg); } 100% { opacity: 1; transform: none; } }
.credits p { font-size: calc(var(--u) * 19); line-height: 1.5; color: rgba(255,255,255,.85); max-width: calc(var(--u) * 720); }
.credits b { color: var(--yellow); }

#screen-quit, #screen-credits { background: #000; z-index: 85; }
.quit-msg { font-family: var(--font-logo); font-size: calc(var(--u) * 56); text-align: center; }
.quit-msg span { font-family: var(--font-ui); font-size: calc(var(--u) * 22); color: rgba(255,255,255,.6); }
.roll { text-align: center; animation: fadein 2s ease; }
.roll .logo { align-items: center; margin-bottom: calc(var(--u) * 40); }
.roll p { font-size: calc(var(--u) * 24); font-weight: 700; letter-spacing: calc(var(--u) * 4); }
.roll p.big { font-family: var(--font-logo); font-size: calc(var(--u) * 54); color: var(--yellow); }

#fps { position: absolute; right: calc(var(--u) * 8); bottom: calc(var(--u) * 6); z-index: 95; font: 12px/1.2 monospace; color: #9f9; background: rgba(0,0,0,.5); padding: 2px 6px; pointer-events: none; }
#fatal { position: absolute; inset: 0; z-index: 99; background: rgba(40,0,0,.95); color: #fff; font: 14px/1.5 monospace; padding: 30px; white-space: pre-wrap; overflow: auto; }

/* ---------- V2: threats, laser glare, difficulty, route callouts ---------- */
#diffTag { margin-top: calc(var(--u) * 6); font-family: var(--font-ui); font-weight: 700; letter-spacing: calc(var(--u) * 5); font-size: calc(var(--u) * 13); color: rgba(255,255,255,.55); text-shadow: 0 0 calc(var(--u)*6) #000; }
#warnTag { position: absolute; left: 50%; top: calc(var(--u) * 96); transform: translateX(-50%); padding: calc(var(--u) * 6) calc(var(--u) * 22);
  font-family: var(--font-logo); font-size: calc(var(--u) * 30); letter-spacing: calc(var(--u) * 4); color: #fff; white-space: nowrap;
  background: linear-gradient(90deg, rgba(160,0,0,0), rgba(190,10,10,.78) 18%, rgba(190,10,10,.78) 82%, rgba(160,0,0,0));
  text-shadow: 0 0 calc(var(--u)*10) rgba(255,60,40,.9), 0 calc(var(--u)*2) calc(var(--u)*3) #000; }
#warnTag.show { animation: warnIn .9s ease-out; }
/* V2: a hostage hit by mistake */
#warnTag.hostage { font-size: calc(var(--u) * 46); letter-spacing: calc(var(--u) * 10); top: calc(var(--u) * 150);
  background: linear-gradient(90deg, rgba(200,0,0,0), rgba(225,16,16,.9) 16%, rgba(225,16,16,.9) 84%, rgba(200,0,0,0)); }
#warnTag.hostage.show { animation: hostageWarn 1.8s ease-out; }
@keyframes hostageWarn { 0% { opacity: 0; transform: translateX(-50%) scale(1.8); } 8% { opacity: 1; transform: translateX(-50%) scale(1); }
  18% { opacity: .15; } 28% { opacity: 1; } 38% { opacity: .15; } 48%, 100% { opacity: 1; } }
@keyframes warnIn { 0% { opacity: 0; transform: translateX(-50%) scale(1.6); } 12% { opacity: 1; transform: translateX(-50%) scale(1); } 30%, 50% { opacity: 1; } 40% { opacity: .35; } 100% { opacity: 1; } }
#sniperGlare { position: absolute; left: 0; top: 0; width: calc(var(--u) * 260); height: calc(var(--u) * 260); margin: calc(var(--u) * -130) 0 0 calc(var(--u) * -130); opacity: 0; pointer-events: none; z-index: 29;
  background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,70,50,.95) 5%, rgba(255,20,10,.45) 16%, rgba(255,0,0,.12) 38%, rgba(255,0,0,0) 62%);
  mix-blend-mode: screen; }
#sniperGlare::after { content: ''; position: absolute; left: 50%; top: 50%; width: 220%; height: calc(var(--u) * 3); transform: translate(-50%, -50%);
  background: linear-gradient(90deg, rgba(255,40,20,0), rgba(255,80,60,.8) 50%, rgba(255,40,20,0)); }
#lockVignette { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(255, 0, 0, .38) 100%); }
#lockVignette.on { animation: lockPulse .2s steps(2) infinite; }
@keyframes lockPulse { 0% { opacity: .9; } 100% { opacity: .25; } }
.callout.route { color: #8fe9ff; font-size: calc(var(--u) * 58); text-shadow: 0 0 calc(var(--u)*22) rgba(40,200,255,.85), 0 calc(var(--u)*4) calc(var(--u)*6) #000; }

/* ---------- V2: level select, difficulty, high scores ---------- */
.diff-cards { display: flex; gap: calc(var(--u) * 18); margin: calc(var(--u) * 6) 0 calc(var(--u) * 4); }
.diff-card { pointer-events: auto; width: calc(var(--u) * 220); padding: calc(var(--u) * 22) calc(var(--u) * 16); background: rgba(10,14,20,.8); border: 2px solid rgba(255,213,90,.25); color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 10); font-family: var(--font-ui); transition: transform .08s, border-color .08s, background .08s;
  clip-path: polygon(0 calc(var(--u)*14), calc(var(--u)*14) 0, 100% 0, 100% calc(100% - calc(var(--u)*14)), calc(100% - calc(var(--u)*14)) 100%, 0 100%); }
.diff-card b { font-family: var(--font-logo); font-size: calc(var(--u) * 40); letter-spacing: calc(var(--u) * 3); font-weight: 400; }
.diff-card span { font-weight: 600; font-size: calc(var(--u) * 17); color: rgba(255,255,255,.75); text-align: center; line-height: 1.3; min-height: 2.6em; }
.diff-card i { font-style: normal; font-weight: 700; letter-spacing: calc(var(--u) * 4); font-size: calc(var(--u) * 15); color: var(--amber); }
.diff-card:hover, .diff-card.sel { border-color: var(--yellow); background: rgba(40,30,8,.85); transform: translateY(calc(var(--u) * -4)); }
.diff-card[data-diff="easy"] b { color: #7dff9b; }
.diff-card[data-diff="normal"] b { color: var(--yellow); }
.diff-card[data-diff="hard"] b { color: #ff5a4f; }
#statsBest { margin-top: calc(var(--u) * 10); font-weight: 700; letter-spacing: calc(var(--u) * 4); font-size: calc(var(--u) * 16); color: rgba(255,255,255,.65); }
#hsEntry { margin-top: calc(var(--u) * 10); display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 8); }
.hs-new { font-family: var(--font-logo); font-size: calc(var(--u) * 34); color: var(--yellow); letter-spacing: calc(var(--u) * 3); text-shadow: 0 0 calc(var(--u)*18) rgba(255,170,0,.8); animation: pulse .5s infinite alternate; }
.hs-row { display: flex; align-items: center; gap: calc(var(--u) * 14); font-weight: 700; letter-spacing: calc(var(--u) * 4); font-size: calc(var(--u) * 18); }
#hsName { width: calc(var(--u) * 120); font-family: var(--font-logo); font-size: calc(var(--u) * 40); text-align: center; letter-spacing: calc(var(--u) * 8); text-transform: uppercase;
  background: rgba(0,0,0,.5); color: var(--yellow); border: 2px solid var(--amber); outline: none; padding: calc(var(--u) * 2) 0; pointer-events: auto; cursor: text; }
#scoreTabs { flex-wrap: wrap; justify-content: center; }
#scoreTabs .tab { font-size: calc(var(--u) * 18); }
#scoreTable { width: 100%; min-width: calc(var(--u) * 640); }
.hs-line { display: grid; grid-template-columns: calc(var(--u) * 50) calc(var(--u) * 110) 1fr calc(var(--u) * 70) calc(var(--u) * 110) calc(var(--u) * 110); align-items: center;
  font-weight: 700; font-size: calc(var(--u) * 21); letter-spacing: calc(var(--u) * 2); padding: calc(var(--u) * 3) calc(var(--u) * 8); border-bottom: 1px solid rgba(255,255,255,.07); }
.hs-line .n { color: rgba(255,255,255,.5); }
.hs-line .nm { font-family: var(--font-logo); font-weight: 400; letter-spacing: calc(var(--u) * 5); }
.hs-line .sc { font-family: var(--font-num); font-weight: 600; font-size: calc(var(--u) * 30); color: var(--yellow); text-align: right; padding-right: calc(var(--u) * 20); }
.hs-line .rk { font-family: var(--font-logo); font-weight: 400; color: #fff; text-align: center; }
.hs-line .df { font-size: calc(var(--u) * 14); letter-spacing: calc(var(--u) * 3); text-align: center; }
.hs-line .df.easy { color: #7dff9b; } .hs-line .df.normal { color: var(--yellow); } .hs-line .df.hard { color: #ff5a4f; }
.hs-line .dt { font-size: calc(var(--u) * 14); color: rgba(255,255,255,.45); text-align: right; }
.hs-line.cpu { opacity: .55; }
.hs-line.me { background: linear-gradient(90deg, rgba(255,197,61,.28), rgba(255,197,61,.05)); animation: pulse .6s infinite alternate; }
.hs-head { font-size: calc(var(--u) * 13); letter-spacing: calc(var(--u) * 4); color: rgba(255,255,255,.45); border-bottom: 1px solid rgba(255,255,255,.2); }
.hs-head .sc { font-family: var(--font-ui); font-size: calc(var(--u) * 13); color: rgba(255,255,255,.45); }

/* V2: the editor's stop preview (index.html?preview=…): the scene only */
body.preview #hud, body.preview #crosshair, body.preview #letterbox, body.preview #fps { display: none !important; }

/* ---------- V2: the editions (ΕΚΔΟΣΗ), gamepad focus, phones, VR ---------- */
.plat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(var(--u) * 16); margin: calc(var(--u) * 8) 0; }
.plat-card { pointer-events: auto; padding: calc(var(--u) * 20) calc(var(--u) * 14); background: rgba(10,14,20,.8); border: 2px solid rgba(255,213,90,.25); color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 8); font-family: var(--font-ui); text-align: center; transition: transform .08s, border-color .08s, background .08s;
  clip-path: polygon(0 calc(var(--u)*14), calc(var(--u)*14) 0, 100% 0, 100% calc(100% - calc(var(--u)*14)), calc(100% - calc(var(--u)*14)) 100%, 0 100%); }
.plat-card .pi { font-size: calc(var(--u) * 54); line-height: 1; }
.plat-card b { font-family: var(--font-logo); font-size: calc(var(--u) * 26); letter-spacing: calc(var(--u) * 2); font-weight: 400; color: var(--yellow); }
.plat-card span { font-weight: 600; font-size: calc(var(--u) * 15); color: rgba(255,255,255,.78); line-height: 1.3; }
.plat-card i { font-style: normal; font-weight: 700; letter-spacing: calc(var(--u) * 2); font-size: calc(var(--u) * 13); color: var(--amber); min-height: 1.2em; }
.plat-card:hover, .plat-card.sel, .plat-card.gp-focus { border-color: var(--yellow); background: rgba(40,30,8,.85); transform: translateY(calc(var(--u) * -4)); }
.plat-card:disabled { opacity: .45; cursor: default; transform: none; }
.plat-card:disabled i { color: var(--red); }
.plat-note { font-size: calc(var(--u) * 15); color: rgba(255,255,255,.7); text-align: center; max-width: calc(var(--u) * 900); line-height: 1.4; }
.gp-focus { outline: calc(var(--u) * 3) solid var(--yellow); outline-offset: calc(var(--u) * 3); }
.overlay { position: absolute; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u) * 14);
  background: rgba(3,5,8,.88); text-align: center; font-family: var(--font-ui); }
.overlay b { font-family: var(--font-logo); font-size: calc(var(--u) * 40); color: var(--yellow); letter-spacing: calc(var(--u) * 2); font-weight: 400; }
.overlay p { font-size: calc(var(--u) * 18); color: rgba(255,255,255,.8); line-height: 1.45; margin: 0; }
.tbtn.big { font-size: calc(var(--u) * 42); }
/* console: the crosshair is drawn by the page (the pad moves it), no OS cursor */
body.plat-console.ingame #crosshair, body.pad-active.ingame #crosshair { display: block !important; }
body.plat-console.ingame, body.plat-console.ingame *, body.pad-active.ingame, body.pad-active.ingame * { cursor: none !important; }
/* Touch editions keep COVER and bombs directly accessible. */
body.touch-ed #touchReload { display: block !important; font-size: calc(var(--u)*26); padding: calc(var(--u)*14) calc(var(--u)*24); }
body.plat-mobile #touchReload { font-size: calc(var(--u)*32); padding: calc(var(--u)*20) calc(var(--u)*30); }
body.touch-ed #bombBox { pointer-events: auto; cursor: pointer; }
body.plat-mobile #pauseBtn { transform: scale(1.35); transform-origin: top left; }
#rotateHint { display: none; }
/* console on a TV: the HUD and the screens keep off the edges (overscan) */
body.plat-console #hud, body.plat-console .screen { inset: 4vh 4vw; }
#rotateHint .rot, #swipeUp .swipe-hand { font-size: calc(var(--u) * 110); color: var(--amber); animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(calc(var(--u) * -28)); } }
/* Keep the scroll room after a soft-fullscreen swipe; collapsing it brings Safari's bars back. */
html.ios-swipe, html:has(body.ios-swipe), body.ios-swipe { overflow-y: auto; height: auto; }
body.ios-swipe { min-height: calc(100vh + 260px); }
body.ios-swipe.ios-swipe-long { min-height: calc(100vh + 1600px); }
#swipeUp { touch-action: pan-y; background: rgba(3,5,8,.7); }
body.ingame #swipeUp { display: none !important; }
body.in-xr #hud, body.in-xr #crosshair { display: none !important; }
@media (max-width: 900px) { .plat-cards { grid-template-columns: repeat(2, 1fr); } }

/* Campaign progress and transitions. */
.pause-where { margin: calc(var(--u) * -6) 0 calc(var(--u) * 14); text-align: center; font-family: var(--font-ui); font-weight: 700; font-size: calc(var(--u) * 15);
  letter-spacing: calc(var(--u) * 3); color: var(--amber); }
#areaFade { position: absolute; inset: 0; z-index: 49; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #000;
  opacity: 0; pointer-events: none; transition: opacity .6s ease; }
#areaFade.on { opacity: 1; pointer-events: auto; }
#areaFade .af-kicker { font-family: var(--font-ui); font-weight: 700; font-size: calc(var(--u) * 17); letter-spacing: calc(var(--u) * 8); color: var(--amber); }
#areaFade .af-title { margin-top: calc(var(--u) * 10); text-align: center; font-family: var(--font-logo); font-size: calc(var(--u) * 52); letter-spacing: calc(var(--u) * 4); color: #fff; }
#areaFade .af-bar { width: calc(var(--u) * 260); height: calc(var(--u) * 4); margin-top: calc(var(--u) * 28); background: rgba(255,255,255,.12); }
#afFill { width: 0; height: 100%; background: var(--amber); transition: width .15s linear; }

/* Touch controls use CSS pixels rather than the scene's shrinking 1280x720 unit. Menus scroll as one document;
   desktop, console and headset layouts retain their authored sizes. Safe areas also cover Home Screen installs. */
body.touch-ed {
  --safe-top: env(safe-area-inset-top, 0px); --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px); --safe-left: env(safe-area-inset-left, 0px);
}
body.touch-ed.ingame #gl { touch-action: none; -webkit-touch-callout: none; }
body.touch-ed .hud-btn, body.touch-ed #bombBox, body.touch-ed .ship-flare { -webkit-touch-callout: none; }
body.touch-ed .screen:not(#screen-loading), body.touch-ed .overlay {
  --u: 0.85px;
  padding: calc(var(--safe-top) + 12px) calc(var(--safe-right) + 16px)
    calc(var(--safe-bottom) + 12px) calc(var(--safe-left) + 16px);
}
body.touch-ed .screen:not(#screen-loading), body.touch-ed .panel-screen {
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  touch-action: pan-y; justify-content: flex-start;
}
body.touch-ed #loadText { font-size: 14px; letter-spacing: 2px; }
body.touch-ed #loadTip { font-size: 14px; max-width: min(600px, 90%); margin-top: 16px; }
body.touch-ed .at-foot { font-size: 10px; letter-spacing: 2px; bottom: calc(var(--safe-bottom) + 10px); }
body.touch-ed .tbtn, body.touch-ed .pst-var button, body.touch-ed .hud-btn {
  min-width: 44px; min-height: 44px; touch-action: manipulation;
}
body.touch-ed .tbtn { font-size: 20px; line-height: 1.25; letter-spacing: 1px; padding: 10px 12px; }
body.touch-ed .tbtn.small, body.touch-ed .tab, body.touch-ed .tbtn.back { font-size: 16px; }
body.touch-ed .tbtn:hover, body.touch-ed .tbtn:focus-visible, body.touch-ed .tbtn.focus { transform: none; }
body.touch-ed .tbtn:hover::before { display: none; }
body.touch-ed .tbtn:focus-visible { outline: 2px solid var(--yellow); outline-offset: -2px; }
body.touch-ed .panel, body.touch-ed .panel.narrow, body.touch-ed .panel.wide {
  min-width: 0; width: min(100%, 720px); max-height: none; flex-shrink: 0; padding: 16px;
  margin-block: auto; gap: 8px; clip-path: none; overflow: visible;
}
body.touch-ed .panel.narrow { max-width: 480px; }
body.touch-ed .panel-title { font-size: 28px; letter-spacing: 2px; margin-bottom: 8px; text-align: center; }
body.touch-ed .tabs { width: 100%; justify-content: center; gap: 4px; margin-bottom: 8px; }
body.touch-ed .tabs .tbtn { flex: 1; padding-inline: 6px; font-size: 16px; }
body.touch-ed .setrow { font-size: 16px; line-height: 1.25; letter-spacing: 0.5px; gap: 10px; padding-block: 2px; }
body.touch-ed .setrow > span { min-width: 0; }
body.touch-ed .setrow .tbtn { flex: 0 0 auto; min-width: 130px; max-width: 52%; font-size: 16px; overflow-wrap: anywhere; }
body.touch-ed .camera-options { width: 100%; gap: 4px; margin-top: 2px; }
body.touch-ed .camera-options .tbtn { padding: 8px 4px; font-size: 14px; }
body.touch-ed .camera-hint, body.touch-ed .pause-where { font-size: 14px; letter-spacing: 0.5px; margin: 4px 0 8px; }
body.touch-ed .diff-cards, body.touch-ed .plat-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 8px; margin: 4px 0; }
body.touch-ed .diff-card, body.touch-ed .plat-card { width: auto; min-width: 0; min-height: 44px; padding: 14px 10px; gap: 8px; clip-path: none; touch-action: manipulation; }
body.touch-ed .diff-card b { font-size: 26px; letter-spacing: 1px; }
body.touch-ed .plat-card b { font-size: 19px; letter-spacing: 0.5px; }
body.touch-ed .plat-card .pi { font-size: 32px; }
body.touch-ed .diff-card span, body.touch-ed .plat-card span, body.touch-ed .plat-note { font-size: 14px; line-height: 1.35; }
body.touch-ed .diff-card i, body.touch-ed .plat-card i { font-size: 12px; letter-spacing: 1px; }
body.touch-ed .plat-note { max-width: 100%; }

body.touch-ed #screen-splash { justify-content: center; }
body.touch-ed .splash-inner { flex: 0 0 auto; width: 100%; max-width: 800px; margin-block: auto; }
body.touch-ed .splash-kicker { font-size: 12px; line-height: 1.4; letter-spacing: 2px; }
body.touch-ed .splash-title { font-size: clamp(28px, 6vw, 48px); margin: 10px 0 14px; }
body.touch-ed .splash-inner p { font-size: 14px; line-height: 1.4; margin-block: 10px; }
body.touch-ed .press { min-height: 44px; font-size: 17px; margin-top: 12px; letter-spacing: 2px; padding: 12px; }
body.touch-ed .dead-title { font-size: clamp(32px, 7vw, 56px); margin: 8px 0; }
body.touch-ed .credits p, body.touch-ed .roll p { font-size: 16px; line-height: 1.5; }
body.touch-ed .stats-grid { width: 100%; gap: 16px; }
body.touch-ed #statsList { min-width: 0; flex: 1; }
body.touch-ed #rankBox { min-width: 90px; }
body.touch-ed .stat { font-size: 15px; letter-spacing: 0.5px; }
body.touch-ed #rank { font-size: 80px; }
body.touch-ed #scoreTabs { max-height: none; }
body.touch-ed #scoreTabs .tbtn { flex: 0 1 auto; font-size: 14px; }
body.touch-ed #scoreTable { min-width: 0; overflow-x: auto; }
body.touch-ed .hs-line { min-width: 500px; grid-template-columns: 28px 70px 1fr 44px 70px 94px; font-size: 15px; letter-spacing: 0.5px; }
body.touch-ed .hs-row { flex-wrap: wrap; justify-content: center; font-size: 15px; letter-spacing: 1px; }
body.touch-ed #hsName { min-height: 44px; font-size: 24px; }
body.touch-ed .overlay b { font-size: 22px; line-height: 1.3; }
body.touch-ed .overlay p { font-size: 15px; }
body.touch-ed #rotateHint .rot { font-size: 80px; }
body.touch-ed #swipeUp {
  inset: auto; left: calc(var(--safe-left) + 8px); bottom: calc(var(--safe-bottom) + 8px);
  width: min(480px, calc(100% - var(--safe-left) - var(--safe-right) - 16px));
  padding: 16px; gap: 8px; background: rgba(3,5,8,.96); border: 1px solid var(--panel-edge); border-radius: 10px;
}
body.touch-ed #swipeUp .swipe-hand { font-size: 32px; animation: none; }
body.touch-ed #swipeUp b { font-size: 18px; }
body.touch-ed #dismissSwipe { width: 100%; background: rgba(255,197,61,.12); }

/* Reserve independent corners for touch actions; the central band remains available for aiming. */
body.touch-ed #pauseBtn { left: calc(var(--safe-left) + 10px); top: calc(var(--safe-top) + 10px); width: 44px; height: 44px; transform: none; gap: 7px; border-radius: 8px; }
body.touch-ed #pauseBtn i { width: 7px; height: 22px; }
body.touch-ed #cameraBtn { left: calc(var(--safe-left) + 10px); top: calc(var(--safe-top) + 62px); width: 148px; min-height: 44px; font-size: 14px; padding: 8px; line-height: 1.2; }
body.touch-ed #hearts { top: calc(var(--safe-top) + 12px); gap: 4px; }
body.touch-ed .heart { width: 26px; height: 24px; }
body.touch-ed #scoreBox { right: calc(var(--safe-right) + 10px); top: calc(var(--safe-top) + 8px); }
body.touch-ed #scoreLabel { font-size: 11px; letter-spacing: 2px; }
body.touch-ed #score { font-size: 36px; }
body.touch-ed #multiRow { font-size: 28px; }
body.touch-ed #diffTag { font-size: 11px; letter-spacing: 1px; }
body.touch-ed #ammoBox { left: 50%; bottom: calc(var(--safe-bottom) + 10px); transform: translateX(-50%); max-width: 44%; }
body.touch-ed #ammo { height: 45px; }
body.touch-ed .bullet { height: 44px; width: 14px; margin-right: -2px; }
body.touch-ed .bullet.shell { height: 40px; width: 17px; margin-right: 1px; }
body.touch-ed .bullet.smg { height: 34px; width: 8px; margin-right: -1px; }
body.touch-ed #weaponName { font-size: 12px; letter-spacing: 2px; text-align: center; }
body.touch-ed #reloadBar { margin-inline: auto; }
body.touch-ed #bombBox { left: calc(var(--safe-left) + 10px); bottom: calc(var(--safe-bottom) + 10px); min-width: 104px; min-height: 52px; padding: 12px 10px 8px; justify-content: center; gap: 6px; border: 1px solid var(--panel-edge); border-radius: 8px; background: var(--panel); touch-action: manipulation; }
body.touch-ed #bombs { gap: 6px; }
body.touch-ed .bomb { width: 18px; height: 23px; }
body.touch-ed .bombKey { display: none; }
body.touch-ed #touchReload { right: calc(var(--safe-right) + 10px); bottom: calc(var(--safe-bottom) + 10px); min-width: 112px; min-height: 56px; font-size: 18px; padding: 15px 16px; border-radius: 8px; text-align: center; }
body.touch-ed #bossBar { right: calc(var(--safe-right) + 12px); bottom: calc(var(--safe-bottom) + 90px); max-width: 36%; gap: 8px; }
body.touch-ed #bossLabel { font-size: 16px; }
body.touch-ed #bossTrack { width: 160px; min-width: 0; height: 22px; }
body.touch-ed #bossPct { font-size: 20px; }
body.touch-ed #hint { bottom: calc(var(--safe-bottom) + 88px); max-width: 48%; font-size: 14px; letter-spacing: 0.5px; white-space: normal; text-align: center; padding: 8px; }
body.touch-ed #warnTag { top: calc(var(--safe-top) + 58px); max-width: 48%; font-size: 18px; line-height: 1.25; letter-spacing: 1px; white-space: normal; text-align: center; }
body.touch-ed #warnTag.hostage { top: calc(var(--safe-top) + 94px); font-size: 22px; }
body.touch-ed .ship-instruments { left: calc(var(--safe-left) + 10px); bottom: calc(var(--safe-bottom) + 84px); width: 232px; grid-template-columns: 68px minmax(0, 1fr); gap: 5px 8px; }
body.touch-ed .ship-tracker { grid-column: 1; grid-row: 1; width: 68px; height: 68px; }
body.touch-ed .ship-tracker-label { grid-column: 1 / -1; grid-row: 2; font-size: 10px; letter-spacing: 0.5px; }
body.touch-ed .ship-flare { grid-column: 2; grid-row: 1; align-self: center; min-height: 44px; font-size: 12px; padding: 10px 4px; touch-action: manipulation; }
body.touch-ed .ship-conveyor { grid-column: 1 / -1; grid-row: 3; font-size: 12px; padding: 6px; }
body.touch-ed .ship-escape { top: calc(var(--safe-top) + 100px); font-size: 22px; padding: 6px 12px; }

@media (max-width: 599px) {
  body.touch-ed .plat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.touch-ed .diff-cards { grid-template-columns: minmax(0, 1fr); }
  body.touch-ed .diff-card { padding: 12px; }
  body.touch-ed .diff-card span { min-height: 0; }
  body.touch-ed .setrow { font-size: 14px; }
  body.touch-ed .setrow .tbtn { min-width: 100px; }
}
/* The mission board uses device-independent sizes; all eleven missions remain directly reachable. */
#screen-menu {
  --menu-line: #ffffff17; --menu-muted: #a8acb5;
  display: grid; grid-template-columns: clamp(190px, 17vw, 250px) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 52px); align-items: start; justify-content: normal;
  padding: clamp(24px, 3.3vw, 60px); overflow: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #ffc53d70 #080b10;
  background: radial-gradient(ellipse at 100% 0%, #30302445, transparent 45%),
    linear-gradient(135deg, #10151c, #080b10 65%); color: #f7f4e8;
}
.menu-left { position: static; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.menu-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
#screen-menu .menu-settings { display: none; }
.menu-left .logo { gap: 4px; }
.menu-left .logo .l1 { font-size: clamp(23px, 2.15vw, 32px); letter-spacing: -.7px; color: var(--amber); background: none; filter: none; }
.menu-left .logo .l2 { margin: 0; padding: 0; font: 700 12px/1 var(--font-ui); letter-spacing: 8px; color: #e1e2df; text-shadow: none; }
.menu-edition { display: flex; justify-content: space-between; padding: 12px 0; border-block: 1px solid var(--menu-line); font: 700 11px/1 var(--font-ui); letter-spacing: 2px; color: var(--menu-muted); }
.menu-edition span { color: var(--amber); }
.menu-buttons { display: flex; flex-direction: column; gap: 4px; align-items: stretch; margin: 0; }
#screen-menu .menu-buttons .tbtn { display: flex; justify-content: space-between; align-items: center; min-height: 44px; padding: 12px; border: 1px solid transparent; border-radius: 3px; text-align: left; font: 700 14px/1.3 var(--font-ui); letter-spacing: 1px; text-shadow: none; color: #c4c7cd; transform: none; transition: background .15s, border-color .15s, color .15s; }
#screen-menu .menu-buttons .tbtn::before { display: none; }
#screen-menu .menu-buttons .tbtn:hover, #screen-menu .menu-buttons .tbtn[aria-pressed="true"] { color: #fff1c7; border-color: #ffc53d32; background: #ffc53d0c; }
#screen-menu .menu-buttons .menu-start { min-height: 56px; margin-bottom: 12px; padding-inline: 16px; background: var(--amber); color: #16130d; border-color: var(--amber); font: 400 25px/1.1 var(--font-logo); letter-spacing: 1px; }
#screen-menu .menu-buttons .menu-start:hover { background: #ffdb79; color: #16130d; }
.menu-start span { font-family: var(--font-ui); font-weight: 700; font-size: 28px; }
.menu-device-note { color: #717b87; font: 700 10px/1.5 var(--font-ui); letter-spacing: 1.3px; }
.mission-board { min-width: 0; }
.mission-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 0 0 24px; padding-bottom: 24px; border-bottom: 1px solid var(--menu-line); }
.mission-eyebrow { color: var(--amber); font: 700 11px/1.3 var(--font-ui); letter-spacing: 3px; margin-bottom: 9px; }
#menuHeading { margin: 0; font: 400 clamp(25px, 2.55vw, 42px)/1.16 var(--font-hud); letter-spacing: -.7px; }
#menuSubheading { margin: 10px 0 0; font: 500 16px/1.45 var(--font-ui); color: var(--menu-muted); }
.mission-count { flex: 0 0 auto; border: 1px solid #ffc53d40; border-radius: 3px; padding: 10px 12px; font: 700 11px/1.1 var(--font-ui); letter-spacing: 1.5px; color: #f0d491; text-align: right; }
#levelMenu, #pisteMenu { position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 16px; padding: 0; overflow: visible; background: none; border: none; max-height: none; box-shadow: none; }
#levelMenu .lvl-card { --mission-accent: #ffc53d; position: relative; display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding: 0; overflow: hidden; background: #121820; border: 1px solid #ffffff1d; border-radius: 5px; text-align: left; color: #fff; cursor: pointer; touch-action: manipulation; transition: border-color .18s, transform .18s, background .18s; }
#levelMenu .lvl-card:hover { transform: translateY(-3px); border-color: var(--mission-accent); background: #18212b; }
#levelMenu .lvl-art { display: block; position: relative; width: 100%; aspect-ratio: 1.95; background: var(--mission-image, linear-gradient(135deg, #26384c, #111923)) center / cover no-repeat; }
#levelMenu .lvl-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #00000008 30%, #05070aa6); pointer-events: none; }
#levelMenu .lvl-number { position: absolute; top: 11px; left: 12px; z-index: 1; color: #fff; text-shadow: 0 2px 10px #000; font: 500 32px/1 var(--font-num); letter-spacing: 1px; }
#levelMenu .lvl-state { position: absolute; top: 12px; right: 10px; z-index: 1; padding: 5px 7px; border: 1px solid #ffffff27; border-radius: 2px; background: #080c12ba; color: #ecebdd; font: 700 10px/1.1 var(--font-ui); letter-spacing: .7px; }
#levelMenu .lvl-copy { display: flex; flex: 1; flex-direction: column; align-items: stretch; gap: 7px; padding: 16px; }
#levelMenu .lvl-kicker { font: 700 10px/1.2 var(--font-ui); letter-spacing: 1.6px; color: var(--mission-accent); }
#levelMenu .lvl-title { font: 400 clamp(17px, 1.4vw, 24px)/1.15 var(--font-hud); letter-spacing: -.2px; white-space: normal; overflow-wrap: anywhere; }
#levelMenu .lvl-route { min-height: 2.65em; font: 500 13px/1.35 var(--font-ui); color: #aeb7c2; white-space: normal; }
#levelMenu .lvl-meta { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; margin-top: auto; padding-top: 11px; border-top: 1px solid #ffffff12; font: 600 11px/1.3 var(--font-ui); letter-spacing: .8px; color: #808d9a; }
#levelMenu .lvl-meta strong { color: #e7e9e9; font-size: 13px; letter-spacing: .5px; }
#levelMenu .lvl-card.locked, #levelMenu .lvl-card:disabled { cursor: default; opacity: .63; }
#levelMenu .lvl-card.locked .lvl-art, #levelMenu .lvl-card:disabled .lvl-art { filter: saturate(.3); }
#levelMenu .lvl-card.locked:hover, #levelMenu .lvl-card:disabled:hover { transform: none; border-color: #ffffff1d; background: #121820; }
#pisteMenu .pst-group { grid-column: 1 / -1; margin-top: 8px; padding: 12px 0; border-bottom: 1px solid var(--menu-line); font: 700 15px/1.3 var(--font-ui); letter-spacing: 1.4px; color: #f0d491; }
.pst-card { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: #121820; border: 1px solid #ffffff1d; border-radius: 4px; }
.pst-main { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 6px 9px; width: 100%; min-height: 100px; border: 0; padding: 14px 12px; color: #fff; background: none; text-align: left; cursor: pointer; touch-action: manipulation; }
.pst-number { grid-row: 1 / 3; color: var(--amber); font: 500 30px/1 var(--font-num); }
.pst-title { font: 400 15px/1.25 var(--font-hud); overflow-wrap: anywhere; }
.pst-sub { grid-column: 2; color: #aeb7c2; font: 600 12px/1.35 var(--font-ui); }
.pst-main:hover { background: #ffc53d0d; }
.pst-var { display: flex; justify-content: flex-end; gap: 8px; margin: 0 12px 12px; padding-top: 10px; border-top: 1px solid #ffffff10; }
.pst-var button { min-width: 44px; min-height: 44px; padding: 8px 12px; background: #ffffff08; border: 1px solid #ffffff24; border-radius: 3px; color: #d7dce4; font: 700 14px/1 var(--font-ui); cursor: pointer; touch-action: manipulation; }
.pst-var button:hover { background: var(--amber); color: #13100c; }
.area-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 16px; }
.area-filters button { min-height: 44px; padding: 10px 13px; border: 1px solid #ffffff20; border-radius: 3px; background: #ffffff04; color: #b5bdc8; font: 700 12px/1.2 var(--font-ui); letter-spacing: .5px; cursor: pointer; touch-action: manipulation; }
.area-filters button:hover, .area-filters button[aria-pressed="true"] { background: #ffc53d18; border-color: #ffc53d70; color: #ffdc82; }
#screen-menu button:focus-visible, #screen-menu a:focus-visible, #screen-menu .gp-focus { outline: 3px solid #ffe093; outline-offset: -3px; }
#screen-menu .lvl-card:focus-visible, #screen-menu .lvl-card.gp-focus { border-color: #ffe093; box-shadow: 0 0 0 2px #05070b, 0 0 0 4px #ffe093; outline-offset: -4px; }
.menu-board-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 24px; margin-top: 10px; border-top: 1px solid var(--menu-line); }
.menu-foot { color: #788390; font: 700 10px/1.4 var(--font-ui); letter-spacing: 1.5px; }
#screen-menu .steam-link { position: static; flex-shrink: 0; display: inline-flex; align-items: center; min-height: 44px; padding: 10px 0; font: 700 11px/1.3 var(--font-ui); letter-spacing: .8px; color: #b1b8c1; text-decoration: none; text-shadow: none; }
#screen-menu .steam-link::before { display: none; }

/* A horizontal navigation rail keeps the mission artwork visible on compact screens. */
@media (max-width: 1000px) {
  #screen-menu { grid-template-columns: 180px minmax(0, 1fr); gap: 24px; padding: 24px; }
  #levelMenu, #pisteMenu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mission-heading { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .mission-count { padding: 7px 9px; }
}
@media (max-width: 700px), (pointer: coarse) {
  #screen-menu, body.touch-ed #screen-menu { display: flex; flex-direction: column; align-items: stretch; gap: 22px; padding: calc(var(--safe-top, 0px) + 18px) calc(var(--safe-right, 0px) + 16px) calc(var(--safe-bottom, 0px) + 18px) calc(var(--safe-left, 0px) + 16px); }
  .menu-left { position: static; flex: 0 0 auto; gap: 13px; }
  .menu-left .logo { min-width: 0; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
  .menu-left .logo .l1 { font-size: clamp(19px, 5.5vw, 27px); }
  .menu-left .logo .l2 { font-size: 10px; letter-spacing: 3px; }
  #screen-menu .menu-settings { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px; border: 1px solid #ffc53d60; border-radius: 4px; background: #ffc53d12; color: #ffe093; font: 700 12px/1.2 var(--font-ui); letter-spacing: .5px; text-shadow: none; transform: none; }
  #screen-menu .menu-settings span { font-size: 20px; line-height: 1; }
  #screen-menu .menu-settings::before { display: none; }
  #screen-menu .menu-buttons [data-act="settings"] { display: none; }
  body.touch-ed #screen-menu { touch-action: pan-x pan-y; }
  .menu-edition, .menu-device-note { display: none; }
  .menu-buttons { flex-direction: row; flex-wrap: nowrap; align-items: stretch; gap: 5px; padding: 2px 0 7px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: #ffc53d70 transparent; touch-action: pan-x; }
  #screen-menu .menu-buttons .tbtn { flex: 0 0 auto; min-height: 44px; padding: 10px 12px; font-size: 12px; white-space: nowrap; }
  #screen-menu .menu-buttons .menu-start { min-height: 44px; margin: 0 5px 0 0; padding-inline: 14px; gap: 20px; font-size: 20px; }
  .menu-start span { font-size: 23px; }
  .mission-heading { flex-wrap: wrap; gap: 12px; padding-bottom: 18px; margin-bottom: 16px; }
  .mission-eyebrow { margin-bottom: 7px; font-size: 9px; letter-spacing: 2px; }
  #menuHeading { font-size: clamp(21px, 4.6vw, 32px); }
  #menuSubheading { margin-top: 8px; font-size: 14px; }
  .mission-count { max-width: 100%; font-size: 10px; line-height: 1.5; padding: 6px 8px; }
  #levelMenu, #pisteMenu { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #levelMenu .lvl-copy { padding: 12px 10px; gap: 6px; }
  #levelMenu .lvl-number { top: 8px; left: 9px; font-size: 27px; }
  #levelMenu .lvl-state { top: 8px; right: 7px; padding: 4px 5px; font-size: 8px; }
  #levelMenu .lvl-kicker { font-size: 9px; letter-spacing: .8px; }
  #levelMenu .lvl-title { font-size: 16px; }
  #levelMenu .lvl-route { font-size: 12px; min-height: 3.9em; }
  #levelMenu .lvl-meta { align-items: flex-start; flex-wrap: wrap; gap: 4px; padding-top: 8px; font-size: 10px; }
  #levelMenu .lvl-meta strong { font-size: 12px; }
  #levelMenu .lvl-card:hover { transform: none; }
  .pst-main { grid-template-columns: 24px minmax(0, 1fr); min-height: 100px; padding: 12px 9px; gap: 5px 6px; }
  .pst-number { font-size: 25px; }
  .pst-title { font-size: 13px; }
  .pst-sub { font-size: 11px; }
  .pst-var { margin: 0 9px 10px; gap: 6px; }
  .pst-var button { flex: 1; font-size: 13px; padding-inline: 8px; }
  .area-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; touch-action: pan-x; }
  .area-filters button { flex: 0 0 auto; }
  .menu-board-foot { margin-top: 4px; padding-top: 12px; gap: 10px; }
  .menu-foot { font-size: 9px; letter-spacing: .5px; }
  #screen-menu .steam-link { font-size: 10px; }
}
@media (max-width: 359px) {
  #levelMenu, #pisteMenu { grid-template-columns: minmax(0, 1fr); }
  .mission-heading { flex-wrap: wrap; }
  #levelMenu .lvl-art { aspect-ratio: 2.7; }
  #levelMenu .lvl-route { min-height: 0; }
  .menu-left .logo .l1 { font-size: 19px; }
  .menu-left .logo .l2 { font-size: 9px; letter-spacing: 1px; }
}
@media (min-width: 701px) and (pointer: coarse) and (orientation: landscape) {
  #levelMenu, #pisteMenu { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (orientation: landscape) and (max-height: 450px) {
  body.touch-ed #screen-menu { gap: 12px; padding-block: calc(var(--safe-top) + 10px) calc(var(--safe-bottom) + 10px); }
  body.touch-ed .menu-left { gap: 8px; }
  body.touch-ed .menu-left .logo .l1 { font-size: 23px; }
  body.touch-ed .mission-heading { align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 12px; }
  body.touch-ed .mission-eyebrow, body.touch-ed #menuSubheading { display: none; }
  body.touch-ed #menuHeading { font-size: 23px; }
  body.touch-ed .mission-count { font-size: 9px; padding: 5px 8px; }
  body.touch-ed .area-filters { margin-bottom: 8px; }
  body.touch-ed #pisteMenu .pst-group { margin-top: 0; padding-block: 8px; }
}
/* TV overscan is already applied to .screen; focus stays inside every clipped card. */
body.plat-console #screen-menu { padding: clamp(24px, 2vw, 48px); grid-template-columns: clamp(220px, 18vw, 300px) minmax(0, 1fr); }
body.plat-console #screen-menu .menu-buttons .tbtn { min-height: 48px; font-size: clamp(16px, 1.1vw, 22px); }
body.plat-console #screen-menu .menu-buttons .menu-start { min-height: 60px; font-size: 30px; }
body.plat-console #levelMenu .lvl-title { font-size: clamp(19px, 1.65vw, 30px); }
body.plat-console #levelMenu .lvl-route { font-size: clamp(15px, 1.05vw, 20px); }
body.plat-console #levelMenu .lvl-meta { font-size: clamp(12px, .9vw, 17px); }
body.plat-console #screen-menu .gp-focus { outline-width: 4px; outline-offset: -4px; }
body.plat-console .panel-screen { overflow-y: auto; justify-content: flex-start; padding: 24px; }
body.plat-console .panel-screen .panel { margin-block: auto; flex-shrink: 0; }
#tvActions, #tvControlHint { display: none; }
body.plat-console #tvActions { display: grid; gap: 6px; width: 100%; padding: 12px 0; margin: 4px 0; border-block: 1px solid var(--panel-edge); }
body.plat-console #tvActions .tbtn { min-height: 44px; font-size: max(17px, calc(var(--u) * 21)); }
#tvActions .tbtn:disabled { opacity: .4; cursor: default; }
body.tv-remote-active #tvControlHint { display: block; position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); max-width: 48%; text-align: center; font: 700 max(12px, calc(var(--u) * 13))/1.25 var(--font-ui); letter-spacing: 1px; color: #e9d5a5; background: #080b10a6; padding: 4px 8px; }
body.in-xr #tvActions, body.in-xr #tvControlHint, body.in-xr #rotateHint { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  #screen-menu *, #screen-menu *::before, #screen-menu *::after { animation: none !important; transition: none !important; }
}

/* Portrait play reserves separate top and bottom bands; the middle stays clear for aiming. */
@media (orientation: portrait) {
  body.touch-ed #pauseBtn { left: calc(var(--safe-left) + 10px); top: calc(var(--safe-top) + 10px); }
  body.touch-ed #hearts { top: calc(var(--safe-top) + 21px); gap: 3px; }
  body.touch-ed .heart { width: 20px; height: 19px; }
  body.touch-ed #cameraBtn { top: calc(var(--safe-top) + 64px); width: 148px; font-size: 13px; }
  body.touch-ed #scoreBox { top: calc(var(--safe-top) + 64px); max-width: calc(100% - var(--safe-left) - var(--safe-right) - 182px); }
  body.touch-ed #scoreLabel { font-size: 10px; }
  body.touch-ed #score { font-size: 32px; }
  body.touch-ed #multiRow { font-size: 23px; }
  body.touch-ed #chain { margin-top: 3px; }
  body.touch-ed #diffTag { font-size: 10px; }
  body.touch-ed #bossBar { left: calc(var(--safe-left) + 12px); right: calc(var(--safe-right) + 12px); top: calc(var(--safe-top) + 160px); bottom: auto; max-width: none; gap: 8px; }
  body.touch-ed #bossLabel { font-size: 14px; }
  body.touch-ed #bossTrack { flex: 1; height: 20px; }
  body.touch-ed #bossPct { font-size: 18px; }
  body.touch-ed #ammoBox { left: 50%; bottom: calc(var(--safe-bottom) + 80px); width: max-content; max-width: calc(100% - var(--safe-left) - var(--safe-right) - 32px); }
  body.touch-ed #ammo { height: 30px; justify-content: center; }
  body.touch-ed .bullet { width: 12px; height: 30px; margin-right: -1px; flex-shrink: 1; }
  body.touch-ed .bullet.shell { width: 15px; height: 28px; margin-right: 1px; }
  body.touch-ed .bullet.smg { width: 7px; height: 26px; margin-right: -1px; }
  body.touch-ed #weaponName { font-size: 11px; margin-top: 2px; }
  body.touch-ed #reloadBar { width: 130px; height: 4px; margin-bottom: 5px; }
  body.touch-ed #bombBox { min-height: 56px; }
  body.touch-ed #touchReload { min-width: 128px; }
  body.touch-ed .ship-instruments { left: calc(var(--safe-left) + 10px); right: calc(var(--safe-right) + 10px); bottom: calc(var(--safe-bottom) + 154px); width: auto; grid-template-columns: 60px minmax(0, 1fr) minmax(0, 1fr); gap: 6px 8px; align-items: center; }
  body.touch-ed .ship-tracker { width: 60px; height: 60px; grid-column: 1; grid-row: 1; }
  body.touch-ed .ship-tracker-label { grid-column: 1 / -1; grid-row: 2; font-size: 9px; text-align: left; }
  body.touch-ed .ship-flare { grid-column: 2; grid-row: 1; min-height: 52px; font-size: 11px; line-height: 1.3; padding: 8px 5px; }
  body.touch-ed .ship-conveyor { grid-column: 3; grid-row: 1; padding: 8px 5px; font-size: 10px; line-height: 1.35; }
  body.touch-ed .ship-escape { top: calc(var(--safe-top) + 198px); font-size: 23px; }
  body.touch-ed #coverTag { bottom: calc(var(--safe-bottom) + 130px); font-size: 12px; letter-spacing: 2px; }
  body.touch-ed #hint { bottom: calc(var(--safe-bottom) + 244px); max-width: calc(100% - var(--safe-left) - var(--safe-right) - 32px); font-size: 13px; padding: 7px; }
  body.touch-ed #warnTag { top: calc(var(--safe-top) + 240px); max-width: 85%; font-size: 18px; }
  body.touch-ed #warnTag.hostage { top: calc(var(--safe-top) + 272px); font-size: 20px; }
  body.touch-ed #callouts { top: 35%; }
  body.touch-ed .callout { font-size: 25px; }
  body.touch-ed .callout.clear { font-size: 28px; }
  body.touch-ed #banner { top: 35%; padding-inline: 12px; font-size: 30px; letter-spacing: 1px; }
  body.touch-ed #banner .sub { font-size: 15px; letter-spacing: 2px; }
  body.touch-ed #reloadPrompt { font-size: 30px; }
}

/* Optional thumb controls. Direct-touch play keeps its existing HUD and cursor rules. */
.touch-control-setting, #touchpadControls, #touchpadReticle { display: none; }
body.touch-ed .touch-control-setting { display: flex; }
/* each scheme shows only its own extra row */
body.touch-ed:not(.thumbs-mode) .thumbs-setting, body.touch-ed.thumbs-mode .touchpad-setting { display: none; }
.touch-control-setting small { display: block; max-width: 190px; margin-top: 3px; color: #9caeba; font: 500 12px/1.25 var(--font-ui); letter-spacing: 0; }
body.touch-ed.touchpad-mode {
  --touchpad-height: 112px;
  --touchpad-utility: 140px;
  --touchpad-ship: 202px;
}
/* The game owns gestures, while pause/settings keep their own scrollable panels.
   A locked iPhone soft-fullscreen session retains its spacer and scroll offset. */
html.touchpad-active:not(.ios-fs-lock), body.touchpad-active:not(.ios-fs-lock) {
  height: 100%; min-height: 100%; overflow: hidden;
}
html.touchpad-active, body.touchpad-active, html.ios-fs-lock, body.ios-fs-lock { overscroll-behavior: none; }
body.touchpad-active #stage, body.ios-fs-lock.ingame #stage { touch-action: none; }
body.touch-ed.ios-fs-lock { --safe-bottom: max(env(safe-area-inset-bottom, 0px), 84px); }
@media (orientation: landscape) {
  body.touch-ed.ios-fs-lock { --safe-bottom: max(env(safe-area-inset-bottom, 0px), 34px); }
}
body.touch-ed.touchpad-mode.ingame #touchpadControls { display: grid; }
body.touch-ed.touchpad-mode.ingame #touchpadReticle { display: block; }
body.touch-ed.touchpad-mode #touchReload { display: none !important; }
body.preview #touchpadControls, body.preview #touchpadReticle,
body.in-xr #touchpadControls, body.in-xr #touchpadReticle { display: none !important; }
#touchpadControls {
  position: absolute;
  left: calc(max(var(--safe-left, 0px), var(--safe-right, 0px)) + 10px);
  right: calc(max(var(--safe-left, 0px), var(--safe-right, 0px)) + 10px);
  bottom: calc(var(--safe-bottom, 0px) + 12px); height: var(--touchpad-height);
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end; gap: 12px; pointer-events: none; z-index: 3;
}
#aimPad {
  --pad-x: 0px; --pad-y: 0px;
  position: relative; grid-column: 2; grid-row: 1;
  width: clamp(132px, 37vw, 184px); height: 100%; overflow: hidden;
  border: 1px solid #91d8e35c; border-radius: 22px; color: #c8ebee;
  background: linear-gradient(145deg, #0c2029ba, #07131bb3);
  box-shadow: inset 0 0 24px #8adeee09, 0 3px 14px #0003;
  pointer-events: auto; touch-action: none; -webkit-touch-callout: none;
}
.aim-pad-label, .aim-pad-hint { position: absolute; left: 12px; right: 12px; pointer-events: none; font: 700 10px/1.2 var(--font-ui); letter-spacing: 1.2px; }
.aim-pad-label { top: 11px; }
.aim-pad-hint { bottom: 10px; color: #88a9b2; font-size: 9px; letter-spacing: .8px; }
.aim-pad-guide { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border: 1px dashed #a8e6ee38; border-radius: 50%; pointer-events: none; }
.aim-pad-guide::before, .aim-pad-guide::after { content: ''; position: absolute; background: #a8e6ee26; }
.aim-pad-guide::before { left: -12px; right: -12px; top: 26px; height: 1px; }
.aim-pad-guide::after { top: -8px; bottom: -8px; left: 26px; width: 1px; }
.aim-pad-guide i { position: absolute; left: 14px; top: 14px; width: 24px; height: 24px; border: 1px solid #a9e6ee80; border-radius: 50%; background: #aadfe521; transform: translate(var(--pad-x), var(--pad-y)); }
#aimPad.active, #aimPad.is-active { border-color: #bceef6; background: linear-gradient(145deg, #153842d9, #0b1a25c9); }
#aimPad.active .aim-pad-guide i, #aimPad.is-active .aim-pad-guide i { background: #c5f1f64d; border-color: #d7faff; }
.touchpad-actions { display: contents; pointer-events: none; }
#touchFire, #touchHide {
  grid-row: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: clamp(64px, 18vw, 78px); height: clamp(64px, 18vw, 78px); min-width: 64px; min-height: 64px;
  padding: 8px 4px; border: 1px solid #ffd77c91; border-radius: 19px; background: #3b2b14d9; color: #ffdf8a;
  box-shadow: inset 0 1px 0 #fff1, 0 3px 14px #0004;
  pointer-events: auto; touch-action: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
}
#touchFire { grid-column: 3; justify-self: start; }
#touchHide { grid-column: 1; justify-self: end; border-color: #a4d5e485; background: #142a36d9; color: #c3e9f3; }
.touchpad-actions strong { font: 700 20px/1 var(--font-ui); letter-spacing: 1px; }
.touchpad-actions span { font: 700 9px/1 var(--font-ui); letter-spacing: .7px; }
#touchFire.active, #touchFire.is-active, #touchFire:active { background: #ffc53ded; color: #251a06; border-color: #ffe5a3; }
#touchHide.active, #touchHide.is-active, #touchHide:active { background: #b5e1eced; color: #0c2732; border-color: #e3faff; }
#touchFire:focus-visible, #touchHide:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
#touchpadReticle {
  position: absolute; left: 50%; top: 50%; width: 32px; height: 32px; margin: -16px 0 0 -16px;
  border: 1px solid #d5fbffdc; border-radius: 50%; background: radial-gradient(circle, #fff 0 2px, transparent 2.5px);
  box-shadow: 0 0 0 1px #03131899, 0 0 5px #031318; pointer-events: none; z-index: 4;
}
#touchpadReticle::before, #touchpadReticle::after { content: ''; position: absolute; background: #a6f1ffd9; box-shadow: 0 0 2px #031318; }
#touchpadReticle::before { left: -5px; right: -5px; top: 15px; height: 1px; }
#touchpadReticle::after { top: -5px; bottom: -5px; left: 15px; width: 1px; }
body.touch-ed.touchpad-mode #bombBox {
  bottom: calc(var(--safe-bottom) + var(--touchpad-utility)); min-width: 88px; min-height: 44px;
  padding: 10px 8px 6px; border-radius: 10px;
}
body.touch-ed.touchpad-mode #ammoBox {
  left: auto; right: calc(var(--safe-right) + 10px); bottom: calc(var(--safe-bottom) + var(--touchpad-utility));
  width: max-content; max-width: 52%; transform: none;
}
body.touch-ed.touchpad-mode #ammo { height: 30px; justify-content: flex-end; }
body.touch-ed.touchpad-mode .bullet { width: 12px; height: 30px; margin-right: -1px; flex-shrink: 1; }
body.touch-ed.touchpad-mode .bullet.shell { width: 15px; height: 28px; margin-right: 1px; }
body.touch-ed.touchpad-mode .bullet.smg { width: 7px; height: 26px; margin-right: -1px; }
body.touch-ed.touchpad-mode #weaponName { font-size: 11px; margin-top: 2px; text-align: right; }
body.touch-ed.touchpad-mode #reloadBar { width: 110px; height: 4px; margin: 0 0 5px auto; }
body.touch-ed.touchpad-mode #coverTag { bottom: calc(var(--safe-bottom) + 122px); font-size: 11px; letter-spacing: 1px; }
body.touch-ed.touchpad-mode .ship-instruments {
  left: calc(var(--safe-left) + 10px); right: auto; bottom: calc(var(--safe-bottom) + var(--touchpad-ship));
  width: min(300px, calc(100% - var(--safe-left) - var(--safe-right) - 20px));
  grid-template-columns: 52px minmax(80px, 1fr) minmax(68px, 1fr); align-items: center; gap: 5px 7px;
}
body.touch-ed.touchpad-mode .ship-tracker { grid-column: 1; grid-row: 1; width: 52px; height: 52px; }
body.touch-ed.touchpad-mode .ship-tracker-label { grid-column: 1 / -1; grid-row: 2; font-size: 9px; text-align: left; }
body.touch-ed.touchpad-mode .ship-flare { grid-column: 2; grid-row: 1; min-height: 44px; padding: 6px 4px; font-size: 11px; }
body.touch-ed.touchpad-mode .ship-conveyor { grid-column: 3; grid-row: 1; padding: 6px 4px; font-size: 10px; }
body.touch-ed.touchpad-mode #hint { bottom: calc(var(--safe-bottom) + 280px); }
@media (orientation: landscape) {
  body.touch-ed.touchpad-mode #bossBar { bottom: calc(var(--safe-bottom) + 212px); }
}
@media (min-width: 700px) and (min-height: 600px) {
  body.touch-ed.touchpad-mode { --touchpad-height: 136px; --touchpad-utility: 164px; --touchpad-ship: 226px; }
  body.touch-ed.touchpad-mode #aimPad { width: 204px; }
  body.touch-ed.touchpad-mode #touchFire, body.touch-ed.touchpad-mode #touchHide { width: 84px; height: 84px; }
  body.touch-ed.touchpad-mode #coverTag { bottom: calc(var(--safe-bottom) + 148px); }
  body.touch-ed.touchpad-mode #hint { bottom: calc(var(--safe-bottom) + 306px); }
}
@media (orientation: landscape) and (max-height: 450px) {
  body.touch-ed.touchpad-mode { --touchpad-height: 88px; --touchpad-utility: 110px; --touchpad-ship: 168px; }
  body.touch-ed.touchpad-mode #touchpadControls { bottom: calc(var(--safe-bottom) + 10px); }
  body.touch-ed.touchpad-mode #aimPad { width: 164px; border-radius: 18px; }
  body.touch-ed.touchpad-mode #touchFire, body.touch-ed.touchpad-mode #touchHide { width: 64px; height: 64px; }
  body.touch-ed.touchpad-mode .aim-pad-label { top: 8px; }
  body.touch-ed.touchpad-mode .aim-pad-hint { bottom: 7px; font-size: 8px; }
  body.touch-ed.touchpad-mode .aim-pad-guide { width: 42px; height: 42px; margin: -21px; }
  body.touch-ed.touchpad-mode .aim-pad-guide::before { top: 20px; }
  body.touch-ed.touchpad-mode .aim-pad-guide::after { left: 20px; }
  body.touch-ed.touchpad-mode .aim-pad-guide i { left: 8px; top: 8px; }
  body.touch-ed.touchpad-mode #cameraBtn { left: calc(var(--safe-left) + 64px); top: calc(var(--safe-top) + 10px); width: 136px; font-size: 12px; }
  body.touch-ed.touchpad-mode #hearts { top: calc(var(--safe-top) + 20px); gap: 3px; }
  body.touch-ed.touchpad-mode .heart { width: 20px; height: 19px; }
  body.touch-ed.touchpad-mode #coverTag { bottom: calc(var(--safe-bottom) + 98px); }
  body.touch-ed.touchpad-mode .ship-instruments { width: 270px; grid-template-columns: 44px minmax(86px, 1fr) minmax(72px, 1fr); }
  body.touch-ed.touchpad-mode .ship-tracker { width: 44px; height: 44px; }
  body.touch-ed.touchpad-mode .ship-tracker-label { display: none; }
  body.touch-ed.touchpad-mode #bossBar { top: calc(var(--safe-top) + 66px); left: calc(var(--safe-left) + 220px); right: calc(var(--safe-right) + 110px); bottom: auto; max-width: none; }
  body.touch-ed.touchpad-mode #bossTrack { width: auto; flex: 1; }
  body.touch-ed.touchpad-mode #hint { bottom: calc(var(--safe-bottom) + 226px); font-size: 12px; }
}

/* ΑΝΤΙΧΕΙΡΕΣ (platform/thumbs.js): a thumb anywhere on the picture aims and holds the trigger; the other thumb has
   a big BOMB and a smaller COVER. Portrait and landscape both play. */
#thumbControls, #thumbReticle { display: none; }
body.touch-ed.thumbs-mode { --thumb-bomb: clamp(88px, 27vh, 128px); --thumb-cover: clamp(64px, 19vh, 92px); }
html.thumbs-active:not(.ios-fs-lock), body.thumbs-active:not(.ios-fs-lock) { height: 100%; min-height: 100%; overflow: hidden; }
html.thumbs-active, body.thumbs-active { overscroll-behavior: none; }
body.thumbs-active #stage { touch-action: none; }
body.touch-ed.thumbs-mode.ingame #thumbControls, body.touch-ed.thumbs-mode.ingame #thumbReticle { display: block; }
body.touch-ed.thumbs-mode #touchReload, body.touch-ed.thumbs-mode #bombBox { display: none !important; }
body.preview #thumbControls, body.preview #thumbReticle,
body.in-xr #thumbControls, body.in-xr #thumbReticle { display: none !important; }
#thumbControls { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
#thumbBomb, #thumbCover {
  position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  margin: 0; padding: 0; border-radius: 50%; font-family: var(--font-ui);
  pointer-events: auto; touch-action: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#thumbBomb {
  right: calc(var(--safe-right, 0px) + 16px); bottom: calc(var(--safe-bottom, 0px) + 14px);
  width: var(--thumb-bomb); height: var(--thumb-bomb);
  border: 2px solid #ffd77cd1; color: #ffe7a6;
  background: radial-gradient(circle at 35% 28%, #7a4416eb, #2c1706eb 72%);
  box-shadow: inset 0 2px 0 #fff2, 0 4px 18px #0008;
}
#thumbBomb strong { font: 700 clamp(20px, 6.6vh, 30px)/1 var(--font-ui); letter-spacing: 1.5px; }
#thumbBomb span { font: 600 clamp(15px, 4.6vh, 22px)/1 var(--font-num); letter-spacing: 1px; color: #fff; }
#thumbBomb.active { background: #ffc53df2; color: #2a1904; border-color: #fff0c2; transform: scale(.95); }
#thumbBomb.active span { color: #2a1904; }
#thumbBomb.empty { opacity: .45; filter: grayscale(.85); }
#thumbCover {
  right: calc(var(--safe-right, 0px) + var(--thumb-bomb) + 28px); bottom: calc(var(--safe-bottom, 0px) + 14px);
  width: var(--thumb-cover); height: var(--thumb-cover);
  border: 1px solid #a4d5e4b0; background: #142a36e0; color: #c3e9f3;
  box-shadow: inset 0 1px 0 #fff1, 0 3px 14px #0006;
}
#thumbCover strong { font: 700 clamp(13px, 4.2vh, 18px)/1 var(--font-ui); letter-spacing: 1px; }
#thumbCover span { font: 700 clamp(8px, 2.4vh, 10px)/1 var(--font-ui); letter-spacing: .7px; }
#thumbCover.active { background: #b5e1ecf0; color: #0c2732; border-color: #e3faff; transform: scale(.95); }
#thumbBomb:focus-visible, #thumbCover:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
/* the crosshair the thumb drags (thumbs.js moves it with a transform); amber while the trigger is held, red on
   something worth a round, green while the trigger waits over a hostage */
#thumbReticle {
  position: absolute; left: 0; top: 0; width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border: 2px solid #a8f3ffe6; border-radius: 50%; background: radial-gradient(circle, #fff 0 2px, transparent 2.6px);
  box-shadow: 0 0 0 1px #031318a6, 0 0 8px #00e5ff73; pointer-events: none; z-index: 4; will-change: transform;
}
#thumbReticle::before, #thumbReticle::after { content: ''; position: absolute; background: #a6f1ffe0; box-shadow: 0 0 2px #031318; }
#thumbReticle::before { left: -7px; right: -7px; top: 20px; height: 2px; -webkit-mask: linear-gradient(90deg, #000 0 13px, transparent 13px 43px, #000 43px); mask: linear-gradient(90deg, #000 0 13px, transparent 13px 43px, #000 43px); }
#thumbReticle::after { top: -7px; bottom: -7px; left: 20px; width: 2px; -webkit-mask: linear-gradient(180deg, #000 0 13px, transparent 13px 43px, #000 43px); mask: linear-gradient(180deg, #000 0 13px, transparent 13px 43px, #000 43px); }
#thumbReticle.firing { border-color: #ffd97a; box-shadow: 0 0 0 1px #031318a6, 0 0 10px #ffb30080; }
#thumbReticle.hot { border-color: #ff6a4d; box-shadow: 0 0 0 1px #031318a6, 0 0 12px #ff3b3099; }
#thumbReticle.safe { border-color: #7dff9b; box-shadow: 0 0 0 1px #031318a6, 0 0 10px #28ff7880; opacity: .8; }
/* the corner the right thumb owns stays clear */
@media (orientation: landscape) {
  /* (the score box grows with the screen: the bar keeps clear of it on a tablet too) */
  body.touch-ed.thumbs-mode #bossBar { top: calc(var(--safe-top) + 66px); left: calc(var(--safe-left) + 180px); right: calc(var(--safe-right) + max(150px, 16vw)); bottom: auto; max-width: none; }
  body.touch-ed.thumbs-mode #bossTrack { width: auto; flex: 1; }
}
/* portrait: the same two buttons sized by the width, the magazine in the free corner on the left */
@media (orientation: portrait) {
  body.touch-ed.thumbs-mode { --thumb-bomb: clamp(92px, 26vw, 116px); --thumb-cover: clamp(66px, 19vw, 84px); }
  body.touch-ed.thumbs-mode #ammoBox {
    left: calc(var(--safe-left) + 12px); bottom: calc(var(--safe-bottom) + 14px); transform: none; width: max-content;
    max-width: calc(100% - var(--safe-left) - var(--safe-right) - var(--thumb-bomb) - var(--thumb-cover) - 60px);
  }
  body.touch-ed.thumbs-mode #ammo { justify-content: flex-start; }
  body.touch-ed.thumbs-mode #weaponName { text-align: left; }
  body.touch-ed.thumbs-mode #reloadBar { margin: 0 0 5px 0; }
}
