:root {
  --font: "Arial Black", "Segoe UI Black", "Helvetica Neue", Arial, sans-serif;
  --navy: #262c3d; --navy2: #1b2030; --line: #d9dde6; --blue: #2f8be8; --blue2: #1a62c2;
  --green: #6ed12b; --green2: #3c9a12; --pink: #e8456f; --pink2: #b4234f; --gold: #ffc94a;
  --common: #c8ccd4; --rare: #3d8bff; --epic: #b05cff;
  --hud: 1;
  font-family: var(--font); color: #fff;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #2b2a28; -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
kbd { font: inherit; }
.stroke, .wave-title, .kills b, .banner, .title, .btn, .tip, h2, .hp-label b, .ammo, .num {
  paint-order: stroke fill; -webkit-text-stroke: 4px #141821; text-shadow: 0 3px 0 #141821;
}
#scene { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
/* Crosshair: the real cursor, so it never trails the mouse. */
body.aiming #scene { cursor: url("/sprites/cursor.png") 16 16, crosshair; }
.hitmark { position: fixed; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 15; opacity: 0; }
.hitmark i { position: absolute; left: -2px; top: -11px; width: 4px; height: 8px; background: #fff; border-radius: 2px; box-shadow: 0 0 0 1.5px #141821; transform-origin: 2px 11px; }
.hitmark i:nth-child(1) { transform: rotate(45deg) translateY(-6px); } .hitmark i:nth-child(2) { transform: rotate(135deg) translateY(-6px); }
.hitmark i:nth-child(3) { transform: rotate(225deg) translateY(-6px); } .hitmark i:nth-child(4) { transform: rotate(315deg) translateY(-6px); }
.hitmark.show { animation: hitmark .16s ease-out forwards; }
.hitmark.kill { animation: hitmark .26s ease-out forwards; } .hitmark.kill i { background: #ff4a3a; height: 10px; }
@keyframes hitmark { 0% { opacity: 1; scale: 1.5; } 40% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: 1.1; } }
.vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 55%, transparent 55%, rgba(10,8,6,.55) 100%); }
.hurt { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at 50% 70%, transparent 40%, rgba(220,30,20,.9) 100%); transition: opacity .25s; }
body.danger .vignette { animation: danger 1.1s ease-in-out infinite; background: radial-gradient(ellipse at 50% 55%, transparent 40%, rgba(170,20,14,.6) 100%); box-shadow: inset 0 0 90px 24px rgba(210,24,14,.7); }
@keyframes danger { 50% { opacity: .55; } }
.bump { animation: bump .22s ease-out; }
@keyframes bump { 40% { transform: scale(1.3); } }
.combo { margin: 6px 0 0 6px; font-size: 26px; color: #ffcf3a; paint-order: stroke fill; -webkit-text-stroke: 4px #141821; text-shadow: 0 3px 0 #141821; transform-origin: left center; }
.combo::after { content: ' COMBO'; font-size: 12px; color: #fff; }
.hp.shake { animation: hpshake .28s linear; }
@keyframes hpshake { 20% { transform: translate(-4px, 1px); } 40% { transform: translate(4px, -1px); } 60% { transform: translate(-3px, 0); } 80% { transform: translate(2px, 1px); } }
.ability.ready { animation: ready 1.2s ease-in-out infinite; }
@keyframes ready { 50% { box-shadow: 0 0 0 3px #ffc94a, 0 0 22px 6px rgba(255,201,74,.75), 0 4px 0 #141821; } }

/* ---------- world-anchored UI */
#world-ui, #labels, #bars, #numbers, #bubbles { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.ammo { position: absolute; left: 0; top: 0; font-size: 11px; -webkit-text-stroke-width: 3px; white-space: nowrap; text-align: center; transition: opacity .25s; will-change: transform; }
.ammo i { display: block; width: 46px; height: 5px; margin: 0 auto 3px; background: #1b1d24; border: 1px solid #141821; border-radius: 3px; overflow: hidden; }
.ammo i::after { content: ""; display: block; height: 100%; width: var(--fill, 100%); background: linear-gradient(#ffb24a, #f07a14); }
.ammo.reload i::after { background: linear-gradient(#9fd6ff, #3b8fe0); }
.ammo .mag { opacity: .8; margin-right: 3px; }
.ammo .you { display: none; position: absolute; left: 50%; bottom: calc(100% + 46px); transform: translateX(-50%); font-size: 11px; color: #6fd0ff; white-space: nowrap; }
.ammo.player .you { display: block; }
.ammo.player.idle .you::after { content: ' · HOLD TO FIRE'; color: #ffd84a; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.ebar { position: absolute; width: 64px; height: 7px; transform: translate(-50%, -50%); background: #1b1d24; border: 2px solid #141821; border-radius: 4px; overflow: hidden; }
.ebar i { display: block; height: 100%; background: linear-gradient(#ff5a4a, #c0221a); }
.num { position: absolute; left: 0; top: 0; font-size: 17px; -webkit-text-stroke-width: 3px; white-space: nowrap; will-change: transform, opacity; }
.num.crit { color: #ff5ad9; font-size: 24px; }
.num.explosive { color: #ffd84a; }
.num.energy { color: #6fdcff; }
.num.elemental { color: #d6a2ff; }
.num.burn { color: #ffa24a; font-size: 13px; }
.bubble { position: absolute; left: 0; top: 0; padding: 7px 12px 8px; background: #fff; color: #141821; border: 3px solid #141821; border-radius: 14px; font: 13px/1 var(--font); white-space: nowrap; box-shadow: 0 4px 0 rgba(0,0,0,.35); transform-origin: 50% 100%; will-change: transform, opacity; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -11px; margin-left: -8px; border: 8px solid transparent; border-top: 10px solid #141821; border-bottom: 0; }
.bubble::before { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -5px; border: 5px solid transparent; border-top: 7px solid #fff; border-bottom: 0; z-index: 1; }

/* ---------- HUD (scaled with the window through --hud) */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud button { pointer-events: auto; }
.hud-scale { scale: var(--hud); }
.top-left.hud-scale { transform-origin: 0 0; } .top-right.hud-scale { transform-origin: 100% 0; } .top-center.hud-scale { transform-origin: 50% 0; } .side-right.hud-scale { transform-origin: 100% 50%; }
.fit { transform-origin: 50% 50%; }
.top-left { position: absolute; left: 14px; top: 12px; }
.top-center { position: absolute; top: 12px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.top-right { position: absolute; right: 14px; top: 12px; display: flex; gap: 8px; }
.side-right { position: absolute; right: 14px; top: 0; bottom: 0; display: flex; align-items: center; pointer-events: none; }
.level { display: flex; align-items: center; }
.badge { position: relative; width: 40px; height: 44px; display: grid; place-items: center; z-index: 1;
  background: linear-gradient(#58b0ff, #1f6fd8); clip-path: polygon(50% 0, 100% 22%, 100% 70%, 50% 100%, 0 70%, 0 22%); }
.badge::before { content: ""; position: absolute; inset: 3px; background: linear-gradient(#3e9bf7, #1a5bb8); clip-path: inherit; }
.badge span { position: relative; font-size: 17px; paint-order: stroke fill; -webkit-text-stroke: 3px #0b2240; }
.xp { width: 140px; height: 16px; margin-left: -6px; background: #141821; border: 2px solid #141821; border-radius: 0 6px 6px 0; overflow: hidden; }
.xp i { display: block; height: 100%; width: 0; background: linear-gradient(#7fd2ff, #2f8be8); transition: width .25s; }
.kills { display: flex; align-items: center; gap: 6px; margin: 10px 0 0 4px; font-size: 18px; }
.skull { font-size: 24px; color: #f1ead8; text-shadow: 0 2px 0 #141821; }
.wave-title { font-size: 20px; color: var(--gold); white-space: nowrap; }
.square { width: 42px; height: 42px; border-radius: 8px; border: 2px solid #0e2a4d; background: linear-gradient(#4aa6ff, #1d64c9); box-shadow: inset 0 -4px 0 #134a9a, 0 2px 0 #0b1a30; font-size: 20px; display: grid; place-items: center; padding: 0; text-shadow: 0 2px 0 #0b2240; }
.square.off { filter: grayscale(.85) brightness(.75); position: relative; }
.square.off::after { content: ""; position: absolute; left: 7px; right: 7px; top: 50%; height: 3px; background: #ff5a4a; border-radius: 2px; transform: rotate(-40deg); box-shadow: 0 0 0 1.5px #141821; }
.pause-bars { width: 14px; height: 16px; border-left: 5px solid #fff; border-right: 5px solid #fff; filter: drop-shadow(0 1px 0 #0b2240); }
.ability { position: relative; width: 66px; height: 66px; border-radius: 50%; border: 3px solid #141821; background: radial-gradient(#3d4a64, #1d2333); box-shadow: 0 0 0 3px #ffc94a, 0 4px 0 #141821; display: grid; place-items: center; padding: 0; }
.ability img { width: 46px; height: 46px; pointer-events: none; }
.ability::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(rgba(8,10,16,.72) var(--cd, 0%), transparent 0); }
.ability:disabled { box-shadow: 0 0 0 3px #59606f, 0 4px 0 #141821; }
.ability span { position: absolute; z-index: 1; font-size: 18px; paint-order: stroke fill; -webkit-text-stroke: 3px #141821; }
.ability kbd { position: absolute; bottom: -20px; font: 9px var(--font); color: #e7e9ef; opacity: .8; }
#boss { width: min(380px, 60vw); text-align: center; }
.boss-name { font-size: 13px; color: #ffb0a0; paint-order: stroke fill; -webkit-text-stroke: 3px #141821; margin-bottom: 4px; }
.boss-track { height: 12px; border: 2px solid #141821; border-radius: 6px; background: #2a1414; overflow: hidden; }
.boss-track i { display: block; height: 100%; background: linear-gradient(#ff6a50, #c0221a); transition: width .15s; }
.hp { position: absolute; left: 14px; right: 14px; bottom: max(12px, env(safe-area-inset-bottom)); height: 18px; }
.hp-track { position: relative; height: 14px; border: 2px solid #141821; border-radius: 4px; background: #182016; overflow: hidden; }
.hp-track i { position: absolute; left: 0; top: 0; bottom: 0; }
#hp-bar { background: linear-gradient(#5ee66a, #1fa63a); z-index: 1; }
#hp-loss { background: #e8e1c8; transition: width .6s .25s; }
.hp.low #hp-bar { background: linear-gradient(#ff7a5a, #d42a1a); }
.hp-label { position: absolute; right: 8px; top: -6px; display: flex; align-items: center; gap: 4px; z-index: 2; }
.hp-label b { font-size: 13px; -webkit-text-stroke-width: 3px; }
.shield { font-size: 22px; color: #6fb6ff; text-shadow: 0 2px 0 #141821; }
.tip { position: absolute; right: 18px; top: calc(70px * var(--hud) + 22px); max-width: 260px; padding: 10px 14px; background: #fff; color: #141821; border-radius: 12px; font: 13px/1.35 var(--font); -webkit-text-stroke: 0; text-shadow: none; box-shadow: 0 4px 0 rgba(0,0,0,.35); animation: tipIn .3s ease-out; }
.tip::after { content: ""; position: absolute; bottom: -10px; left: 30px; border: 10px solid transparent; border-top-color: #fff; border-bottom: 0; }
@keyframes tipIn { from { transform: scale(.7); opacity: 0; } }
.banner { position: absolute; top: 15%; left: 50%; transform: translate(-50%, 0) scale(.6); font-size: clamp(30px, 6vh, 46px); opacity: 0; white-space: nowrap; letter-spacing: 1px; }
.banner.show { animation: banner 1.6s ease-out forwards; }
.banner.red { color: #ff6a5a; font-size: clamp(24px, 4.5vh, 32px); }
.banner.gold { color: var(--gold); }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, 0) scale(.5); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.12); } 22% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -12px) scale(1); } }
body.cinematic #hud, body.cinematic #world-ui { opacity: 0; }
#hud, #world-ui { transition: opacity .5s; }

/* ---------- buttons */
.btn { border: 2px solid #141821; border-radius: 10px; padding: 10px 26px; font-size: 18px; min-height: 48px; transition: transform .08s, filter .12s; }
.btn:hover:not(:disabled) { filter: brightness(1.1); }
.btn:active:not(:disabled) { transform: translateY(3px); }
.btn.blue { background: linear-gradient(#5cc0ff, #1f7fe0); box-shadow: inset 0 -5px 0 #1658b0, 0 3px 0 #141821; }
.btn.green { background: linear-gradient(#8ee84a, #3faa16); box-shadow: inset 0 -5px 0 #2d7f0e, 0 3px 0 #141821; }
.btn.red { background: linear-gradient(#ff7a6a, #d6382a); box-shadow: inset 0 -5px 0 #a3241a, 0 3px 0 #141821; }
.btn.grey { background: linear-gradient(#8b93a6, #5a6172); box-shadow: inset 0 -5px 0 #434957, 0 3px 0 #141821; }
.btn.big { font-size: 26px; padding: 12px 54px; min-height: 62px; }
.btn.wide { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; position: relative; padding: 10px 18px; }
.btn.wide .ico { position: absolute; left: 16px; width: 26px; text-align: center; font-size: 18px; }

/* ---------- menu */
.menu { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; background: radial-gradient(ellipse at center, rgba(20,16,12,.25), rgba(12,10,8,.7)); overflow: hidden; }
.menu-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; width: min(760px, calc(100vw - 24px)); }
.title { text-align: center; line-height: .85; font-size: 112px; -webkit-text-stroke-width: 8px; text-shadow: 0 7px 0 #141821; transform: rotate(-3deg); }
.title .t1 { color: #f2ead2; } .title .t2 { color: #ff5a4a; }
.title small { display: block; font-size: .2em; color: var(--gold); letter-spacing: 6px; margin-top: 12px; -webkit-text-stroke-width: 5px; }
.menu-card { width: 100%; padding: 18px 22px 16px; background: rgba(27,32,48,.94); border: 3px solid var(--line); border-radius: 14px; text-align: center; box-shadow: 0 8px 0 rgba(0,0,0,.35); }
.menu-card p { margin: 0 0 14px; font: 14px/1.45 var(--font); color: #cfd5e2; }
.difficulty { display: flex; gap: 6px; justify-content: center; margin: 0 auto 16px; max-width: 420px; }
.menu-label { font: 12px var(--font); letter-spacing: 2px; color: var(--gold); text-transform: uppercase; margin-bottom: 8px; }
.maps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.map-card { position: relative; padding: 0 0 8px; border: 3px solid #3a4258; border-radius: 10px; background: #1b2030; overflow: hidden; display: flex; flex-direction: column; text-align: left; transition: transform .1s, border-color .1s; }
.map-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; filter: saturate(.8) brightness(.85); }
.map-card:hover { transform: translateY(-2px); border-color: #8f9ab5; }
.map-card.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255,201,74,.35), 0 6px 0 rgba(0,0,0,.35); }
.map-card.on img { filter: none; }
.map-card.on::after { content: '✔'; position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #3a2400; display: grid; place-items: center; font-size: 13px; }
.map-name { font-size: 14px; margin: 7px 8px 2px; paint-order: stroke fill; -webkit-text-stroke: 3px #141821; }
.map-twist { font: 10px var(--font); color: #ffb35a; margin: 0 8px; }
.map-best { font: 9px var(--font); color: #8f9ab5; margin: 4px 8px 0; }
.map-blurb { min-height: 34px; margin: 10px 0 12px !important; font-size: 12px !important; color: #aab3c6 !important; }
.difficulty button { flex: 1; border: 2px solid #141821; border-radius: 8px; padding: 9px 0; background: #3a4258; color: #c9cfdc; font-size: 15px; box-shadow: inset 0 -4px 0 #2a3043; }
.difficulty button.on { background: linear-gradient(#ffd96a, #f0a91a); color: #3a2400; box-shadow: inset 0 -4px 0 #b97b0a; }
.play-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.play-row #howto { justify-self: end; font-size: 14px; padding: 8px 14px; min-height: 44px; }
.menu-audio { justify-self: start; display: flex; gap: 6px; }
.record { margin-top: 12px; font: 13px var(--font); color: var(--gold); min-height: 16px; }
.quick-help { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin-top: 10px; font: 11px var(--font); color: #9aa3b8; }
.quick-help kbd, .howto-row kbd, .pause-keys kbd { display: inline-block; min-width: 26px; padding: 3px 6px 4px; margin-right: 4px; border: 2px solid #141821; border-radius: 6px; background: linear-gradient(#f2f4f8, #c7ccd8); color: #1b2030; box-shadow: 0 2px 0 #141821; font: 10px var(--font); text-align: center; }

/* ---------- loading */
.loading { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at 50% 40%, #2c3346 0%, #171b27 60%, #0e1119 100%); }
.loading::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(255,201,74,.035) 0 22px, transparent 22px 44px); pointer-events: none; }
.loading.done { opacity: 0; pointer-events: none; transition: opacity .55s; }
.load-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; width: min(460px, calc(100vw - 32px)); }
.title.small { font-size: 88px; }
.load-skulls { display: flex; gap: 18px; font-size: 26px; color: #f1ead8; }
.load-skulls span { animation: skull 1.2s ease-in-out infinite; text-shadow: 0 3px 0 #141821; }
.load-skulls span:nth-child(2) { animation-delay: .2s; } .load-skulls span:nth-child(3) { animation-delay: .4s; }
@keyframes skull { 0%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-8px); opacity: 1; color: #ff5a4a; } }
.load-bar { width: 100%; height: 22px; padding: 3px; background: #0d1018; border: 3px solid var(--line); border-radius: 12px; box-shadow: 0 5px 0 rgba(0,0,0,.4); overflow: hidden; }
.load-bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: repeating-linear-gradient(-45deg, #ffd96a 0 10px, #f0a91a 10px 20px); background-size: 28px 28px; animation: stripes .6s linear infinite; box-shadow: 0 0 12px rgba(255,201,74,.6); }
@keyframes stripes { to { background-position: 28px 0; } }
.load-row { width: 100%; display: flex; justify-content: space-between; font-size: 14px; color: #dfe4ee; }
.load-row b { color: var(--gold); }
.load-tip { margin: 0; min-height: 34px; text-align: center; font: 12px/1.45 var(--font); color: #9aa3b8; }

/* ---------- intro */
.intro { position: fixed; inset: 0; z-index: 18; pointer-events: auto; cursor: pointer; }
.letterbox { position: absolute; left: 0; right: 0; height: 12vh; background: #07080c; transform: scaleY(0); transition: transform .45s cubic-bezier(.3,.8,.3,1); }
.letterbox.top { top: 0; transform-origin: top; } .letterbox.bottom { bottom: 0; transform-origin: bottom; }
.intro.run .letterbox { transform: scaleY(1); }
.intro.out .letterbox { transform: scaleY(0); }
.intro-text { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; opacity: 0; }
.intro.run .intro-text { animation: introText var(--dur, 3s) ease-out forwards; }
.intro.out .intro-text { animation: none; opacity: 0; transition: opacity .3s; }
.intro-map { font-size: clamp(14px, 2.4vh, 18px); letter-spacing: 8px; color: var(--gold); paint-order: stroke fill; -webkit-text-stroke: 4px #141821; }
.intro-title { white-space: nowrap; font-size: clamp(30px, min(10vh, 12vw), 92px); color: #f2ead2; paint-order: stroke fill; -webkit-text-stroke: 8px #141821; text-shadow: 0 6px 0 #141821; letter-spacing: 2px; }
.intro-sub { font-size: clamp(12px, 2vh, 15px); color: #ffb35a; paint-order: stroke fill; -webkit-text-stroke: 3px #141821; letter-spacing: 1px; }
@keyframes introText { 0%, 18% { opacity: 0; transform: translateY(-50%) scale(1.25); letter-spacing: 14px; } 34% { opacity: 1; transform: translateY(-50%) scale(1); letter-spacing: 2px; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-50%) scale(.96); } }
.intro-skip { position: absolute; bottom: calc(12vh + 10px); left: 0; right: 0; text-align: center; font: 11px var(--font); color: rgba(255,255,255,.55); letter-spacing: 1px; }
.intro.out { pointer-events: none; }

/* ---------- modals */
.modal { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 10px; background: rgba(6,8,14,.66); animation: fadeIn .18s ease-out; }
@keyframes fadeIn { from { opacity: 0; } }
#modal-box { transform-origin: 50% 50%; flex: none; width: min(760px, calc(100vw - 20px)); display: flex; flex-direction: column; align-items: center; animation: boxIn .22s cubic-bezier(.2,1.3,.4,1); }
#modal-box.narrow { width: min(440px, calc(100vw - 20px)); }
#modal-box.wide { width: min(820px, calc(100vw - 20px)); }
@keyframes boxIn { from { transform: scale(.9); opacity: 0; } }
.ribbon { position: relative; width: 100%; padding: 12px 20px 16px; text-align: center; font-size: 22px; margin-bottom: 18px; clip-path: polygon(0 0, 100% 0, 100% 78%, 96% 100%, 88% 84%, 75% 100%, 60% 86%, 45% 100%, 30% 86%, 15% 100%, 5% 84%, 0 100%); }
.ribbon.green { background: linear-gradient(#9cf04f 0 40%, #5cc41f 41%); }
.ribbon.pink { width: min(420px, 100%); background: linear-gradient(#ff6a90 0 40%, #e3346a 41%); clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%); padding-bottom: 26px; }
.ribbon.blue { width: min(420px, 100%); background: linear-gradient(#5cc0ff 0 40%, #2f8be8 41%); clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%); padding-bottom: 26px; }
.ribbon.red { width: min(420px, 100%); background: linear-gradient(#ff7a6a 0 40%, #cc3324 41%); clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%); padding-bottom: 26px; }
.ribbon span { paint-order: stroke fill; -webkit-text-stroke: 4px #141821; text-shadow: 0 3px 0 #141821; }
.ribbon small { display: block; font-size: 11px; margin-top: 3px; color: #e9f0ff; -webkit-text-stroke: 0; text-shadow: none; }

/* weapon boxes */
.cards { display: flex; gap: 14px; justify-content: center; flex-wrap: nowrap; }
.wcard { width: 224px; display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.wbox { flex: 1; position: relative; padding: 10px 12px 12px; border-radius: 12px; border: 3px solid #141821;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, #2b3247) 0%, #1c2131 55%, #161a26 100%);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent), 0 6px 0 rgba(0,0,0,.45); transition: transform .15s, box-shadow .15s; }
.wcard:hover .wbox { transform: translateY(-4px); box-shadow: inset 0 0 0 2px var(--accent), 0 0 24px color-mix(in srgb, var(--accent) 45%, transparent), 0 10px 0 rgba(0,0,0,.45); }
.whead { display: flex; justify-content: space-between; align-items: center; font-size: 10px; letter-spacing: 1px; }
.wtype { padding: 3px 8px; border-radius: 20px; background: color-mix(in srgb, var(--accent) 30%, #141821); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); text-transform: uppercase; }
.wpower { color: var(--gold); }
.wbox h3 { margin: 6px 0 8px; text-align: center; font-size: 18px; paint-order: stroke fill; -webkit-text-stroke: 4px #141821; text-shadow: 0 3px 0 #141821; }
.wshow { position: relative; height: 118px; margin: 0 -2px 8px; border-radius: 8px; overflow: hidden; border: 2px solid #0e1119;
  background: radial-gradient(ellipse at 50% 42%, color-mix(in srgb, var(--accent) 38%, #3b4460) 0%, #232a3c 48%, #12151f 100%); box-shadow: inset 0 0 22px rgba(0,0,0,.6); }
.wshow::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 14px 14px; mask-image: radial-gradient(ellipse at 50% 50%, #000 30%, transparent 75%); }
.wfloor { position: absolute; left: 18%; right: 18%; bottom: 12px; height: 12px; border-radius: 50%; background: radial-gradient(ellipse, color-mix(in srgb, var(--accent) 70%, transparent), transparent 70%); filter: blur(2px); opacity: .8; }
.gunview { position: relative; z-index: 1; display: block; width: 100%; height: 100%; }
.gunfallback { position: relative; z-index: 1; display: block; width: 110px; height: 110px; margin: 4px auto; filter: drop-shadow(0 3px 2px rgba(0,0,0,.5)); }
.corner { position: absolute; z-index: 2; width: 12px; height: 12px; border: 3px solid var(--accent); opacity: .85; }
.corner.tl { left: 5px; top: 5px; border-right: 0; border-bottom: 0; } .corner.tr { right: 5px; top: 5px; border-left: 0; border-bottom: 0; }
.corner.bl { left: 5px; bottom: 5px; border-right: 0; border-top: 0; } .corner.br { right: 5px; bottom: 5px; border-left: 0; border-top: 0; }
.tags { display: flex; justify-content: center; gap: 4px; margin-bottom: 8px; }
.tags span { font: 9px var(--font); padding: 2px 7px; border-radius: 4px; background: #141821; color: #ffb35a; letter-spacing: .5px; }
.wstats { display: flex; flex-direction: column; gap: 4px; }
.wstat { display: grid; grid-template-columns: 70px 1fr 44px; align-items: center; gap: 6px; font: 11px var(--font); color: #ffd98a; }
.wstat b { color: #fff; text-align: right; font-size: 11px; }
.wstat.plain { grid-template-columns: 1fr auto; }
.wbar { height: 7px; border-radius: 4px; background: #0d1018; border: 1px solid #000; overflow: hidden; }
.wbar i { display: block; height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent)); border-radius: 3px; }
.trait { font: 11px/1.35 var(--font); color: #fff; margin-top: 8px; padding-top: 8px; min-height: 38px; border-top: 1px dashed rgba(255,255,255,.18); text-align: center; }
.trait g, .rows g { color: #6eea4a; } .trait r { color: #ff5a4a; }
.choose { width: 100%; }

.rows { display: flex; flex-direction: column; gap: 8px; width: min(380px, 100%); }
.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px 8px 8px; background: var(--navy); border: 2px solid #3d4459; border-radius: 6px; text-align: left; box-shadow: 0 4px 0 rgba(0,0,0,.4); transition: transform .08s, border-color .1s; }
.row:hover, .row:focus-visible { border-color: #fff; transform: translateX(3px); }
.ricon { width: 56px; height: 56px; flex: none; border-radius: 5px; border: 3px solid var(--common); background: linear-gradient(#5a6175, #3c4256); display: grid; place-items: center; }
.ricon img { width: 46px; height: 46px; }
.row.rare .ricon { border-color: var(--rare); background: linear-gradient(#3b78e0, #1d4aa6); }
.row.epic .ricon { border-color: var(--epic); background: linear-gradient(#9a4ee0, #5c22a6); }
.rname { font-size: 17px; paint-order: stroke fill; -webkit-text-stroke: 3px #141821; }
.rname g { margin-left: 4px; }
.rval { font: 13px var(--font); color: #e3e6ee; margin-top: 4px; }
.row.rare .rname g { color: #6fb6ff; } .row.epic .rname g { color: #d79bff; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.panel { width: min(520px, 100%); padding: 18px; background: var(--navy2); border: 2px solid var(--line); border-radius: 10px; }
.rewards { display: flex; gap: 10px; justify-content: center; margin: 4px 0 6px; flex-wrap: wrap; }
.reward { width: 92px; padding: 10px 4px 8px; border: 3px solid #6fdc3a; border-radius: 8px; background: linear-gradient(#3f8a2a, #2b5c1d); text-align: center; }
.reward.blue { border-color: #4aa6ff; background: linear-gradient(#2c66b8, #1c3f7a); }
.reward.purple { border-color: #c27cff; background: linear-gradient(#7a3fc0, #4b2280); }
.reward b { display: block; font-size: 22px; paint-order: stroke fill; -webkit-text-stroke: 3px #141821; }
.reward span { font: 10px var(--font); color: #e9f0ff; }
.reward .ico { font-size: 26px; display: block; margin-bottom: 2px; }
.note { font: 12px/1.5 var(--font); color: #aab3c6; text-align: center; margin-top: 12px; }
.attrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 6px; width: 100%; }
.attr { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 9px; background: linear-gradient(#2d5ea8, #1f4479); border: 2px solid #4f7fcf; border-radius: 6px; font: 12px var(--font); }
.attr img { width: 20px; height: 20px; }
.attr span { flex: 1; } .attr b.up { color: #6eea4a; }
.squad-list { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 12px 0 0; }
.squad-list div { width: 64px; height: 64px; border: 2px solid var(--line); border-radius: 6px; background: linear-gradient(#5b6278, #3a4054); display: grid; place-items: center; }
.squad-list img { width: 70px; }
#fatal { position: fixed; inset: 20%; z-index: 40; padding: 30px; background: #262c3d; border: 3px solid #fff; border-radius: 12px; font: 18px/1.5 var(--font); }

/* sheets: pause menu and how to play share one style */
.sheet { width: 100%; padding: 0 20px 20px; background: linear-gradient(#262d42, #1a1f2e); border: 3px solid var(--line); border-radius: 16px; box-shadow: 0 10px 0 rgba(0,0,0,.4), 0 20px 50px rgba(0,0,0,.5); }
.sheet-head { position: relative; margin: 0 -20px 16px; padding: 16px 20px 14px; text-align: center; border-bottom: 3px solid #141821; border-radius: 13px 13px 0 0; background: linear-gradient(#5cc0ff 0 45%, #2f8be8 46%); }
.sheet-head h2 { margin: 0; font-size: 28px; letter-spacing: 1px; }
.sheet-head small { display: block; margin-top: 4px; font: 12px var(--font); color: #e9f3ff; }
.sheet-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; background: #141821; display: grid; place-items: center; font-size: 22px; color: #fff; box-shadow: 0 0 0 3px #fff; }
.sheet-icon .pause-bars { width: 13px; height: 15px; }
.pause-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.pause-stats div { padding: 8px 4px 7px; text-align: center; border-radius: 8px; background: #141821; border: 2px solid #3a4258; }
.pause-stats b { display: block; font-size: 18px; color: var(--gold); }
.pause-stats span { font: 10px var(--font); color: #9aa3b8; letter-spacing: 1px; text-transform: uppercase; }
.pause-buttons { display: flex; flex-direction: column; gap: 10px; }
.pause-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pause-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 2px dashed rgba(255,255,255,.12); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border: 2px solid #3a4258; border-radius: 10px; background: #141821; font-size: 13px; color: #c9cfdc; }
.toggle i { position: relative; width: 38px; height: 22px; border-radius: 11px; background: #3a4258; transition: background .15s; flex: none; }
.toggle i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #c9cfdc; transition: transform .15s; }
.toggle.on { color: #fff; } .toggle.on i { background: var(--green2); } .toggle.on i::after { transform: translateX(16px); background: #fff; }
.pause-keys { margin-top: 14px; text-align: center; font: 11px var(--font); color: #8f9ab5; }
.sheet-actions { display: flex; justify-content: center; margin-top: 16px; }
.sheet-actions .btn { max-width: 260px; }
.howto-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; text-align: left; }
.howto-group { padding: 12px 14px; border-radius: 10px; background: #141821; border: 2px solid #3a4258; }
.howto-group:first-child { grid-row: span 2; }
.howto-group h4 { margin: 0 0 10px; font-size: 13px; color: var(--gold); letter-spacing: 2px; text-transform: uppercase; }
.howto-row { display: grid; grid-template-columns: 76px 1fr; align-items: start; gap: 10px; margin-bottom: 10px; font: 12px/1.45 var(--font); color: #dfe4ee; }
.howto-row:last-child { margin-bottom: 0; }
.howto-row kbd { margin: 0; padding: 5px 6px 6px; font-size: 11px; }

@media (max-width: 700px) {
  .maps { grid-template-columns: repeat(2, 1fr); }
  .title { font-size: 64px; } .title.small { font-size: 60px; }
  .xp { width: 96px; }
  .cards { gap: 8px; }
  .wcard { width: calc(33.3% - 6px); min-width: 0; }
  .wbox { padding: 8px 6px; } .wbox h3 { font-size: 13px; }
  .wshow { height: 76px; } .whead { font-size: 8px; } .wpower { display: none; }
  .wstat { grid-template-columns: 1fr; gap: 2px; font-size: 9px; } .wstat b { text-align: left; } .trait { font-size: 9px; }
  .ribbon { font-size: 18px; }
  .btn { padding: 8px 14px; font-size: 15px; }
  .play-row { grid-template-columns: 1fr; } .play-row #howto, .menu-audio { justify-self: center; }
  .howto-grid { grid-template-columns: 1fr; } .howto-group:first-child { grid-row: auto; }
  .side-right { top: auto; bottom: 110px; } .side-right.hud-scale { transform-origin: 100% 100%; } .ability kbd { display: none; }
  .top-center { top: calc(64px * var(--hud) + 12px); }
}
@media (prefers-reduced-motion: reduce) { .banner.show, .tip, .intro.run .intro-text { animation-duration: .01s; } }
#kills { display: inline-block; }

/* Tactical interface: restrained panels, clear hierarchy, comfortably sized controls. */
:root { --font: 'Segoe UI', Arial, sans-serif; --navy: #222922; --navy2: #171d19; --line: #485148; --gold: #dfbd74; --blue: #7ec7bc; --green: #bad58c; --green2: #638347; color: #edf0e7; }
button { font-weight: 650; touch-action: manipulation; }
button:focus-visible { outline: 2px solid #f4d68f; outline-offset: 4px; }
.stroke, .wave-title, .kills b, .title, .btn, h2, .ribbon span, .wbox h3, .rname, .map-name, .reward b { -webkit-text-stroke: 0; text-shadow: none; }
.menu { display: flex; padding: 40px 32px; overflow: auto; background: linear-gradient(100deg, #0d1413ed, #0d1413c9 70%, #0d1413aa); backdrop-filter: blur(5px); }
.menu-inner { width: min(1060px, 100%); margin: auto; gap: 26px; flex-shrink: 0; }
.menu-header { display: flex; justify-content: space-between; align-items: flex-end; width: 100%; padding: 0 4px; }
.eyebrow { color: #a7b3a6; font-size: 11px; font-weight: 650; letter-spacing: 2.4px; margin: 0 0 14px; }
.title { margin: 0; text-align: left; font: 900 78px/.9 Impact, 'Arial Narrow', sans-serif; letter-spacing: 1px; transform: none; }
.title .t1 { color: #edf0e5; } .title .t2 { color: var(--gold); }
.title small { font: 600 12px var(--font); letter-spacing: 7px; margin: 14px 0 0 3px; -webkit-text-stroke: 0; color: #bcc5b8; }
.mission-stats { display: flex; gap: 30px; padding-bottom: 4px; }
.mission-stats span { display: flex; flex-direction: column; gap: 6px; font-size: 10px; letter-spacing: 1.7px; color: #a0ad9f; }
.mission-stats b { font: 500 30px/1 'Segoe UI', sans-serif; color: #e7ebdd; letter-spacing: 1px; }
.menu-card { padding: 28px; text-align: left; border: 1px solid #59634c70; border-radius: 16px; background: #17201aef; box-shadow: 0 24px 80px #0005; }
.briefing-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.briefing-heading .eyebrow { color: var(--gold); font-size: 10px; margin-bottom: 9px; }
.briefing-heading h2 { font-size: 26px; letter-spacing: -.6px; font-weight: 600; margin: 0 0 8px; }
.mode-tag { border: 1px solid #58634a; border-radius: 4px; font-size: 10px; letter-spacing: 2px; padding: 8px 10px; color: #c6d6b1; }
.menu-card p.menu-lead { font: 14px/1.6 var(--font); color: #a4b0a3; margin-bottom: 24px; }
.menu-label { text-align: left; color: #b8c2b3; font-size: 10px; letter-spacing: 1.8px; margin-bottom: 10px; }
.maps { gap: 12px; }
.map-card { border: 1px solid #424d3c; border-radius: 8px; padding-bottom: 13px; background: #111913; transition: border-color .16s, transform .16s, background .16s; }
.map-card img { aspect-ratio: 16 / 10; filter: saturate(.7) brightness(.75); transition: filter .2s; }
.map-card:hover { transform: translateY(-3px); border-color: #b3bd9d; }
.map-card:hover img, .map-card.on img { filter: saturate(.85) brightness(.95); }
.map-card.on { border-color: var(--gold); background: #292b1d; box-shadow: 0 0 0 1px #dfbd7440; }
.map-card.on::after { width: 22px; height: 22px; top: 10px; right: 10px; font-size: 12px; border-radius: 4px; background: var(--gold); }
.map-name { font-size: 15px; font-weight: 700; margin: 13px 13px 6px; }
.map-twist { color: #b4bea5; font-size: 12px; margin: 0 13px; line-height: 1.4; min-height: 34px; }
.map-best { color: #83917e; font-size: 11px; margin: 6px 13px 0; }
.selected-brief { display: flex; gap: 12px; align-items: center; border-bottom: 1px solid #394530; margin: 16px 0 22px; padding-bottom: 18px; }
.selected-brief img { width: 36px; height: 36px; opacity: .75; }
.selected-brief b { font-size: 13px; color: var(--gold); }
.map-blurb { margin: 4px 0 0 !important; min-height: 0; font-size: 13px !important; line-height: 1.5 !important; color: #a7b29f !important; }
.deployment-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.difficulty-wrap { width: 260px; flex-shrink: 0; }
.difficulty { gap: 3px; margin: 0; padding: 4px; background: #0c140e; border: 1px solid #35422e; border-radius: 7px; }
.difficulty button { background: transparent; border: 0; box-shadow: none; border-radius: 4px; font-size: 13px; color: #9eac97; padding: 10px 12px; }
.difficulty button.on { background: #45513a; color: #f1ebcf; box-shadow: none; }
.btn { font-size: 14px; font-weight: 700; border: 1px solid #526046; border-radius: 6px; min-height: 46px; letter-spacing: .3px; padding: 11px 22px; }
.btn.green { background: #d9bc78; color: #202719; border-color: #e5cc94; box-shadow: 0 3px 12px #0003; }
.btn.blue { background: #6dafa3; color: #0b2922; border-color: #8ac7ba; box-shadow: none; }
.btn.grey { background: #2a3427; color: #d6ddcb; border-color: #4c5944; box-shadow: none; }
.btn.red { background: #9d4b3d; border-color: #c0715c; box-shadow: none; }
.btn.big { font-size: 14px; min-height: 48px; padding: 12px 28px; letter-spacing: 1.5px; }
.play-row { display: flex; flex-wrap: wrap; gap: 10px; }
.play-row #howto { font-size: 13px; min-height: 48px; }
.menu-audio { gap: 6px; }
.square { width: 44px; height: 44px; border: 1px solid #53604a; border-radius: 6px; background: #202a20e8; box-shadow: none; font-size: 18px; text-shadow: none; }
.menu-audio .square { width: 40px; height: 48px; }
.record { margin-top: 14px; font-size: 12px; min-height: 0; }
.record:empty { display: none; }
.quick-help { justify-content: flex-start; border-top: 1px solid #394530; padding-top: 18px; margin-top: 22px; gap: 10px 20px; font-size: 11px; color: #96a38f; }
.quick-help kbd, .howto-row kbd, .pause-keys kbd, .combat-footer kbd { border: 1px solid #506048; border-radius: 4px; background: #263022; color: #d3dcc7; box-shadow: 0 2px 0 #0b130d; font-size: 10px; padding: 3px 6px; }
/* In-game status sits outside the central firing lane. */
.top-left, .top-right { top: max(22px, env(safe-area-inset-top)); }
.top-left { left: 24px; padding: 12px; border: 1px solid #6c785e66; border-radius: 9px; background: #101a12e8; }
.top-right { right: 24px; }
.badge, .badge::before { background: #62816a; clip-path: none; border-radius: 6px; }
.badge { width: 36px; height: 36px; } .badge span { -webkit-text-stroke: 0; font-size: 16px; }
.xp { height: 6px; margin-left: 10px; width: 110px; border: 0; border-radius: 4px; background: #38442f; }
.xp i { background: #83cbbd; }
.kills { margin: 8px 0 0; gap: 8px; } .kills img { width: 24px; height: 24px; } .kills b { font-size: 19px; }
.kills span { font-size: 9px; letter-spacing: 1.3px; color: #b1bfa5; }
.top-center { top: 22px; gap: 5px; }
.hud-map { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: #d7deca; text-shadow: 0 1px 6px #000; }
.wave-title { font-size: 19px; letter-spacing: 2px; color: #f0dca9; background: #111b14ee; padding: 9px 22px; border: 1px solid #6c785e80; border-radius: 6px; }
.wave-track { width: 156px; height: 3px; background: #182317; border-radius: 2px; overflow: hidden; }
.wave-track i { display: block; height: 100%; width: 0; background: #d9bc78; transition: width .3s; }
.side-right { right: 30px; }
.ability { width: 66px; height: 66px; border-radius: 12px; border: 1px solid #ccae69; background: #202a20ef; box-shadow: 0 0 0 4px #10181099; }
.ability::after { border-radius: 11px; } .ability.ready { animation: none; box-shadow: 0 0 0 3px #dfbd7430, 0 0 26px #dfbd7420; }
.ability:disabled { box-shadow: 0 0 0 3px #18201880; border-color: #5c6753; }
.ability kbd { font-size: 10px; letter-spacing: 1px; bottom: -23px; }
.hp { left: max(24px, calc(50% - 240px)); right: max(24px, calc(50% - 240px)); bottom: max(24px, env(safe-area-inset-bottom)); height: 38px; }
.hp-heading { font-size: 10px; letter-spacing: 1.8px; margin-bottom: 9px; color: #d4dfc7; text-shadow: 0 1px 5px #000; }
.hp-track { height: 8px; background: #0a120c; border: 1px solid #5a6b4a; border-radius: 3px; }
#hp-bar { background: #96c47c; } .hp-label { top: -5px; right: 0; gap: 5px; } .hp-label img { width: 22px; height: 22px; }
.hp-label b { font-size: 12px; -webkit-text-stroke-width: 2px; font-variant-numeric: tabular-nums; }
.combat-footer { position: absolute; bottom: 82px; left: 24px; right: 24px; display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: #dae3cd; text-shadow: 0 1px 4px #000; letter-spacing: 1px; }
.combat-footer b { color: #dfbd74; margin-left: 8px; }
.tip { top: 110px; right: 24px; background: #17241bec; color: #d8e2ce; border: 1px solid #6f8060; border-radius: 7px; font: 13px/1.6 var(--font); box-shadow: 0 8px 24px #0003; }
.tip::after { display: none; }
.bubble { background: #e1e5d7; border-width: 1px; border-radius: 6px; font-size: 12px; box-shadow: 0 3px 10px #0003; }
/* Responsive dialogs scroll rather than shrinking text to fit. */
.modal { padding: 24px; overflow-y: auto; background: #071009c9; backdrop-filter: blur(7px); }
#modal-box { width: min(920px, 100%); max-height: calc(100dvh - 48px); overflow-y: auto; padding: 5px; scale: 1 !important; scrollbar-width: thin; scrollbar-color: #6c785e #17201a; }
#modal-box.narrow { width: min(460px, 100%); } #modal-box.wide { width: min(860px, 100%); }
.ribbon, .ribbon.green, .ribbon.pink, .ribbon.blue, .ribbon.red { width: 100%; flex-shrink: 0; clip-path: none; background: transparent; text-align: left; border-bottom: 1px solid #5a684d; padding: 8px 0 20px; margin-bottom: 22px; font-size: 28px; font-weight: 650; color: #eddfbb; }
.ribbon small { color: #a9b79e; font-size: 13px; font-weight: 400; line-height: 1.5; margin-top: 8px; }
.cards { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.wcard { width: auto; gap: 12px; }
.wbox { border: 1px solid #5d6850; border-radius: 10px; padding: 18px; background: linear-gradient(155deg, #30382a, #172018 65%); box-shadow: none; }
.wcard:hover .wbox { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--accent); }
.whead { font-size: 10px; letter-spacing: .3px; } .wtype { padding: 4px 7px; border-radius: 4px; background: #121a13; border: 0; } .wpower { font-size: 11px; }
.wbox h3 { font-size: 20px; text-align: left; margin: 14px 0; font-weight: 650; }
.wshow { height: 154px; background: radial-gradient(ellipse, #59604470, #101911); border: 1px solid #4f5b40; border-radius: 6px; box-shadow: none; }
.weapon-sprite { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 6px #0008); transition: transform .2s; }
.wcard:hover .weapon-sprite { transform: scale(1.08) rotate(-3deg); }
.wshow { overflow: hidden; }
.recruit-portrait { display: block; position: relative; z-index: 1; width: 154px; height: 154px; margin: auto; background-size: 800% 400%; background-position: 14.285714% 0; background-repeat: no-repeat; transform: scale(1.65) translateY(-5%); filter: drop-shadow(0 9px 5px #0008); transition: transform .2s; }
.wcard:hover .recruit-portrait { transform: scale(1.72) translateY(-5%); }
.corner { border-width: 1px; opacity: .6; width: 9px; height: 9px; } .wfloor { opacity: .25; }
.tags { justify-content: flex-start; margin: 10px 0 16px; gap: 6px; } .tags span { font-size: 10px; color: #b6c3a5; background: #101a11; padding: 4px 7px; }
.wstats { gap: 9px; } .wstat { grid-template-columns: 74px 1fr 42px; color: #afbda0; font-size: 12px; } .wstat b { font-size: 12px; font-variant-numeric: tabular-nums; }
.wbar { height: 4px; border: 0; background: #0c140d; } .wbar i { background: #b9c697; }
.trait { font-size: 12px; line-height: 1.6; text-align: left; min-height: 60px; border-top: 1px solid #425036; padding-top: 13px; margin-top: 15px; color: #bac7ad; }
.rows { width: min(500px, 100%); } .row { background: #202a1e; border: 1px solid #515d44; border-radius: 8px; box-shadow: none; padding: 12px; }
.rname { font-size: 17px; font-weight: 600; } .rval { font-size: 13px; color: #aebda2; }
.panel, .sheet { background: #1b251b; border: 1px solid #5b684d; border-radius: 10px; box-shadow: 0 16px 50px #0004; flex-shrink: 0; }
.sheet { padding: 0 22px 22px; } .sheet-head { background: #2b3926; border-bottom: 1px solid #5b684d; border-radius: 9px 9px 0 0; margin: 0 -22px 20px; }
.sheet-head h2 { font-size: 25px; font-weight: 600; } .sheet-head small { color: #b4c3a6; }
.sheet-icon { box-shadow: none; background: #162014; color: #d4c28d; }
.howto-group, .pause-stats div { background: #111b13; border: 1px solid #3f4e35; border-radius: 6px; }
.howto-row { font-size: 13px; line-height: 1.6; color: #becab4; } .howto-group h4 { font-size: 12px; }
.toggle { background: #111b13; border: 1px solid #425338; border-radius: 6px; }
.attr { background: #23311f; border: 1px solid #526347; font-size: 12px; }
.note { font-size: 13px; color: #b5c4a7; } .pause-keys { color: #a3b197; font-size: 12px; }
.reward, .reward.blue, .reward.purple { border-width: 1px; border-color: #566b44; background: #24361e; } .reward span { font-size: 12px; }
.loading { background: #101a13; } .loading::before { display: none; } .title.small { font-size: 76px; }
.load-bar { height: 7px; padding: 0; border: 0; box-shadow: none; } .load-bar i { background: #d9bc78; box-shadow: none; animation: none; }
.load-tip { font: 13px/1.6 var(--font); color: #a8b89c; } .load-skulls { color: #c2cdb3; }
@media (min-width: 1500px) { .menu-inner { width: 1160px; } .map-card img { aspect-ratio: 16 / 11; } }
@media (max-width: 960px) {
  .menu { padding: 24px; } .menu-card { padding: 22px; } .mission-stats { gap: 18px; }
  .deployment-row { align-items: stretch; flex-direction: column; gap: 20px; } .difficulty-wrap { width: 100%; } .difficulty { max-width: none; }
  .play-row { justify-content: flex-end; } .play-row #play { flex: 1; } .play-row #howto { justify-self: auto; }
  .wbox { padding: 12px; } .wstat { grid-template-columns: 65px 1fr 38px; font-size: 11px; }
}
@media (max-width: 600px) {
  .menu { padding: 24px 16px; display: block; } .menu-inner { gap: 24px; } .menu-header { align-items: center; }
  .title { font-size: 56px; } .title small { font-size: 10px; letter-spacing: 4px; } .eyebrow { font-size: 9px; letter-spacing: 1.4px; }
  .mission-stats { display: none; } .menu-card { padding: 18px; border-radius: 10px; }
  .briefing-heading h2 { font-size: 21px; } .mode-tag { display: none; } .menu-card p.menu-lead { font-size: 13px; margin-bottom: 20px; }
  .maps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .map-card img { aspect-ratio: 16 / 9; }
  .map-name { font-size: 14px; margin: 10px 10px 5px; } .map-twist { margin: 0 10px; font-size: 11px; } .map-best { margin: 5px 10px 0; font-size: 10px; }
  .selected-brief { align-items: flex-start; } .selected-brief img { width: 28px; height: 28px; } .map-blurb { font-size: 12px !important; }
  .play-row { display: grid; grid-template-columns: 1fr auto; } .play-row #play { grid-column: 1 / -1; grid-row: 1; width: 100%; min-height: 52px; } .menu-audio { justify-self: end; }
  .play-row #howto { justify-self: stretch; } .quick-help { gap: 10px; font-size: 10px; } .quick-help span { width: calc(50% - 5px); }
  .modal { padding: 14px; } #modal-box { max-height: calc(100dvh - 28px); }
  .cards { grid-template-columns: 1fr; gap: 18px; } .wcard { width: 100%; min-width: 0; }
  .wbox { padding: 16px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
  .whead { grid-column: 1 / -1; font-size: 10px; } .wpower { display: block; } .wbox h3 { grid-column: 1 / -1; font-size: 20px; }
  .wshow { grid-column: 1; grid-row: 3 / 5; height: 130px; margin: 0; } .wstats { grid-column: 2; grid-row: 3 / 5; }
  .recruit-portrait { width: 130px; height: 130px; }
  .wstat { grid-template-columns: 1fr auto; gap: 3px; font-size: 11px; } .wstat b { text-align: right; font-size: 11px; } .wbar { display: none; }
  .tags { grid-column: 1 / -1; margin: 12px 0 0; } .trait { grid-column: 1 / -1; min-height: 0; margin-top: 10px; padding-top: 10px; font-size: 12px; }
  .choose { min-height: 48px; } .ribbon { font-size: 24px; } .ribbon small { font-size: 13px; }
  .top-left { top: 16px; left: 12px; padding: 9px; } .top-right { top: 16px; right: 12px; gap: 5px; }
  .top-center { top: 90px; } .wave-title { font-size: 16px; padding: 7px 18px; } .hud-map { font-size: 10px; }
  .side-right { top: auto; bottom: 130px; right: 18px; } .tip { top: 153px; right: 12px; max-width: 205px; font-size: 12px; padding: 8px 11px; }
  .combat-footer { bottom: 76px; left: 16px; right: 16px; font-size: 9px; letter-spacing: .4px; }
  .hp { left: 16px; right: 16px; bottom: max(20px, env(safe-area-inset-bottom)); }
  .howto-grid { grid-template-columns: 1fr; } .howto-row { grid-template-columns: 64px 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ===================================================================== UI pass: popups, text and buttons */
:root {
  --ui-bg: #182219; --ui-bg-2: #111a13; --ui-line: #4f5d45; --ui-line-2: #3a4733; --ui-text: #e9eee0; --ui-dim: #a9b59d;
  --ui-gold: #e3c27b; --ui-gold-2: #c9a253; --ui-red: #d9765f; --ui-radius: 12px;
}
/* ---------- buttons: primary (green class = amber), secondary (blue), quiet (grey), danger (red) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 22px; border-radius: 9px;
  font: 650 14px/1.1 var(--font); letter-spacing: .35px; cursor: pointer; white-space: nowrap;
  transition: background-color .14s, border-color .14s, color .14s, transform .08s, box-shadow .14s; }
.btn:hover:not(:disabled) { filter: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; }
.btn.green { background: linear-gradient(#eccf8b, #d2ac60); color: #1c2313; border: 1px solid #f3dda5; box-shadow: inset 0 1px 0 #fff6, 0 3px 0 #6d5420, 0 6px 16px #0004; }
.btn.green:hover:not(:disabled) { background: linear-gradient(#f3d99a, #dcb86d); box-shadow: inset 0 1px 0 #fff6, 0 3px 0 #6d5420, 0 6px 22px #e3c27b33; }
.btn.green:active:not(:disabled) { box-shadow: inset 0 1px 0 #fff6, 0 1px 0 #6d5420; transform: translateY(2px); }
.btn.blue { background: #2a3726; color: #e7eddc; border: 1px solid #6b7d58; box-shadow: 0 2px 0 #0a110b; }
.btn.blue:hover:not(:disabled) { background: #34442f; border-color: #9fb184; }
.btn.grey { background: transparent; color: #cdd6c1; border: 1px solid #4c5943; box-shadow: none; }
.btn.grey:hover:not(:disabled) { background: #ffffff0c; border-color: #7d8d6c; color: #eef2e6; }
.btn.red { background: #33201b; color: #f2b8a6; border: 1px solid #8a4a3b; box-shadow: 0 2px 0 #0a110b; }
.btn.red:hover:not(:disabled) { background: #432620; border-color: #c06a55; color: #ffd3c6; }
.btn .ico { position: static; width: auto; font-size: 13px; opacity: .85; }
.btn.wide { width: 100%; }
.btn.wide .ico { position: absolute; left: 16px; }
.btn:focus-visible, .row:focus-visible, .toggle:focus-visible, .map-card:focus-visible { outline: 2px solid #f4d68fcc; outline-offset: 3px; }
.square:hover { border-color: #8e9e7c; background: #2a3628; }

/* ---------- sheet: the one popup layout */
.modal { padding: 16px; background: radial-gradient(ellipse at 50% 40%, #0a130cbb, #050906e6); backdrop-filter: blur(6px); }
#modal-box { width: min(980px, 100%); max-height: calc(100dvh - 32px); padding: 0; overflow: visible; display: flex; flex-direction: column; animation: sheetIn .24s cubic-bezier(.2, .9, .3, 1.15); }
#modal-box.narrow { width: min(500px, 100%); } #modal-box.wide { width: min(880px, 100%); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.sheet { display: flex; flex-direction: column; width: 100%; max-height: calc(100dvh - 32px); padding: 0; overflow: hidden;
  background: linear-gradient(180deg, #1d281d, var(--ui-bg) 140px); border: 1px solid var(--ui-line); border-radius: var(--ui-radius);
  box-shadow: 0 0 0 1px #00000055, 0 24px 70px #000a; color: var(--ui-text); text-align: left; }
.sheet-head { position: relative; display: flex; align-items: center; gap: 14px; margin: 0; padding: 18px 22px 16px; text-align: left;
  background: linear-gradient(180deg, #2c3a27, #222e1f); border: 0; border-bottom: 1px solid var(--ui-line); border-radius: 0; flex-shrink: 0; }
.sheet-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--ui-gold), transparent 70%); opacity: .7; }
.sheet-icon { position: static; transform: none; flex: none; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  background: #121b12; border: 1px solid #5d6c4d; box-shadow: inset 0 0 12px #0008; color: var(--ui-gold); font: 700 20px var(--font); }
.sheet-icon img { width: 30px; height: 30px; filter: drop-shadow(0 2px 3px #0008); }
.sheet-icon .pause-bars { width: 14px; height: 16px; border-left-width: 5px; border-right-width: 5px; border-color: var(--ui-gold); filter: none; }
.sheet-titles { min-width: 0; }
.sheet-head h2 { margin: 0; font: 650 23px/1.2 var(--font); letter-spacing: .1px; color: #f1e6c8; }
.sheet-head p { margin: 4px 0 0; font: 400 13px/1.45 var(--font); color: var(--ui-dim); }
.sheet-body { padding: 20px 22px; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: #6c785e transparent; }
.sheet-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 22px; flex-shrink: 0; border-top: 1px solid var(--ui-line-2); background: #121a13; }
.sheet-foot .btn { min-width: 130px; }
.sheet-label { margin: 20px 0 10px; font: 650 11px var(--font); letter-spacing: 1.8px; text-transform: uppercase; color: var(--ui-dim); }
.sheet.victory .sheet-head { background: linear-gradient(180deg, #3a3a22, #262a1a); } .sheet.victory .sheet-head::after { background: linear-gradient(90deg, #f1d38a, transparent 70%); }
.sheet.defeat .sheet-head { background: linear-gradient(180deg, #3a2420, #261a17); } .sheet.defeat .sheet-head::after { background: linear-gradient(90deg, var(--ui-red), transparent 70%); }
.sheet.defeat .sheet-head h2 { color: #f6d3c7; } .sheet.defeat .sheet-icon { border-color: #8a4a3b; }
.record-tag { display: inline-block; padding: 1px 8px; border-radius: 20px; background: var(--ui-gold); color: #241c09; font-weight: 700; font-size: 11px; letter-spacing: .4px; }
kbd { font: 650 10px/1 var(--font); }
.sheet kbd, .quick-help kbd { display: inline-grid; place-items: center; min-width: 22px; padding: 4px 6px; border: 1px solid #56654a; border-bottom-width: 2px; border-radius: 5px; background: #222d1f; color: #dce4cf; box-shadow: none; letter-spacing: .5px; }

/* ---------- recruit cards */
.sheet.recruit .sheet-body { padding: 18px; }
.cards { gap: 14px; }
.wcard { gap: 10px; }
.wbox { padding: 14px; border-radius: 10px; border-color: #56634a; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 9%, #2d3628), #151e16 70%); transition: border-color .15s, transform .15s, box-shadow .15s; }
.wcard:hover .wbox { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 60%, #8b9a76); box-shadow: 0 10px 26px #0006, 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.whead { font-size: 10px; } .wtype { color: var(--accent); background: #0f1710; padding: 4px 8px; border-radius: 20px; letter-spacing: .6px; text-transform: uppercase; }
.wpower { color: var(--ui-gold); font-weight: 650; }
.wbox h3 { margin: 10px 0 10px; font: 700 19px var(--font); color: #f1ead4; }
.wshow { position: relative; height: 128px; border-radius: 8px; border-color: #46533c; background: radial-gradient(ellipse at 50% 60%, color-mix(in srgb, var(--accent) 16%, #3c4630), #0f1710 75%); }
.recruit-portrait { width: 128px; height: 128px; }
.pick-key { position: absolute; z-index: 3; right: 8px; top: 8px; opacity: .8; }
.tags { margin: 10px 0 12px; } .tags span { border-radius: 4px; font-weight: 650; }
.wstats { gap: 7px; } .wstat { font-size: 12px; color: #b3c0a6; } .wstat b { color: #f0f2e8; }
.wbar { height: 5px; border-radius: 3px; } .wbar i { border-radius: 3px; background: linear-gradient(90deg, #8fa56f, var(--ui-gold)); }
.trait { margin: 12px 0 0; padding-top: 11px; min-height: 0; font-size: 12.5px; line-height: 1.5; color: #c8d3bb; }
.trait g { color: #a9e07a; } .trait r { color: #f2937e; }
.choose { width: 100%; min-height: 44px; }

/* ---------- upgrade rows */
.rows { width: 100%; gap: 10px; }
.row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; width: 100%; padding: 12px 14px 12px 12px; border-radius: 10px;
  background: #1f2a1d; border: 1px solid #4f5d45; text-align: left; cursor: pointer; transition: border-color .14s, background .14s, transform .12s; }
.row:hover { transform: translateX(3px); border-color: #a7b88d; background: #263322; }
.ricon { width: 52px; height: 52px; border-width: 2px; border-radius: 9px; }
.ricon img { width: 40px; height: 40px; }
.rtext { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rname { font: 650 16px var(--font); color: #f0ecdc; }
.rname g { margin-left: 2px; color: #a9e07a; font-weight: 700; }
.rval { font: 13px var(--font); color: var(--ui-dim); font-variant-numeric: tabular-nums; }
.rval i { font-style: normal; color: #7f8e72; margin: 0 3px; } .rval b { color: #eef2e6; }
.rmeta { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.rarity { font: 700 10px var(--font); letter-spacing: 1px; text-transform: uppercase; padding: 3px 8px; border-radius: 20px; background: #2c3829; color: #c4cdb8; }
.row.rare { border-color: #4a6ea0; } .row.rare .rarity { background: #1f3552; color: #8fc2ff; } .row.rare .rname g { color: #8fc2ff; }
.row.epic { border-color: #7a52a8; background: linear-gradient(90deg, #2a2236, #1f2a1d 60%); } .row.epic .rarity { background: #3a2650; color: #d6a9ff; } .row.epic .rname g { color: #d6a9ff; }
.row.rare:hover { border-color: #8fc2ff; } .row.epic:hover { border-color: #d6a9ff; }

/* ---------- attributes */
.attrs { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.attr { padding: 8px 10px; gap: 10px; border-radius: 8px; background: #1f2a1d; border: 1px solid #45523c; font: 13px var(--font); color: #c9d3bc; }
.attr img { width: 22px; height: 22px; }
.attr b { font-variant-numeric: tabular-nums; color: #8e9c81; font-weight: 650; }
.attr.up { border-color: #6f8a52; background: #24331f; } .attr.up b { color: #b9e88c; } .attr.up span { color: #eef2e6; }

/* ---------- squad portraits (attributes and end screens) */
.squad-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.squad-strip figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 82px; }
.squad-strip figcaption { font: 600 11px var(--font); color: var(--ui-dim); text-align: center; }
.merc-face { display: block; width: 72px; height: 72px; border-radius: 10px; border: 1px solid #56654a; background-color: #121b12;
  background-size: 800% 400%; background-position: 14.285714% 0; background-repeat: no-repeat; box-shadow: inset 0 0 14px #000a; }

/* ---------- pause */
.pause-stats { gap: 8px; margin-bottom: 16px; }
.pause-stats div { padding: 10px 4px 9px; border-radius: 8px; }
.pause-stats b { font: 650 19px var(--font); color: var(--ui-gold); font-variant-numeric: tabular-nums; }
.pause-stats span { font-size: 10px; letter-spacing: 1.4px; color: var(--ui-dim); }
.pause-buttons { gap: 10px; }
.pause-buttons #resume { min-height: 52px; font-size: 15px; }
.pause-toggles { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--ui-line-2); gap: 10px; }
.toggle { min-height: 44px; padding: 8px 12px; border-radius: 9px; color: #c9d3bc; font: 600 13px var(--font); }
.toggle.on { color: #f0f2e8; } .toggle.on i { background: #7d9a5c; }
.sheet.pause .sheet-foot { justify-content: space-between; }
.sheet.pause .sheet-foot .btn { flex: 1; }

/* ---------- end screen */
.note { margin: 0 0 16px; font: 14px/1.55 var(--font); color: #c4cfb7; text-align: left; }
.rewards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0; }
.reward, .reward.blue, .reward.purple { width: auto; padding: 12px 6px 10px; border-radius: 10px; background: #1f2a1d; border: 1px solid #4a5841; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.reward img { width: 30px; height: 30px; }
.reward b { font: 700 22px var(--font); color: #f2ecd6; font-variant-numeric: tabular-nums; }
.reward span { font: 600 10px var(--font); letter-spacing: 1.3px; text-transform: uppercase; color: var(--ui-dim); }

/* ---------- how to play */
.howto-grid { gap: 12px; }
.howto-group { padding: 14px 16px; border-radius: 10px; background: #141e15; border: 1px solid #3f4e36; }
.howto-group h4 { margin: 0 0 12px; font: 700 11px var(--font); letter-spacing: 1.8px; text-transform: uppercase; color: var(--ui-gold); }
.howto-row { grid-template-columns: 78px 1fr; gap: 12px; margin-bottom: 12px; font: 13px/1.55 var(--font); color: #c6d1b9; align-items: start; }
.howto-key { display: flex; justify-content: center; }
.howto-key img { width: 28px; height: 28px; }
.howto-row kbd { width: 100%; padding: 6px 4px; }

/* ---------- main menu. Narrow screens: one column in reading order (the column wrappers dissolve).
   Landscape: briefing and Deploy on the left, the four maps on the right, so everything fits without scrolling. */
.menu-col { display: contents; }
.menu-card { display: flex; flex-direction: column; }
.menu-brand { display: none; }
.menu-card .briefing-heading, .menu-card .menu-lead { order: 1; }
.menu-right > * { order: 2; }
.menu-left > :not(.briefing-heading):not(.menu-lead):not(.menu-brand) { order: 3; }
@media (min-width: 900px) and (min-aspect-ratio: 4/3) {
  .menu { padding: 22px 32px; }
  .menu-inner { gap: 16px; width: min(1120px, 100%); }
  .title { font-size: clamp(48px, 9vh, 78px); }
  .eyebrow { margin-bottom: 8px; }
  .menu-card { flex-direction: row; align-items: flex-start; gap: 28px; padding: 22px 24px; }
  .menu-col { display: flex; flex-direction: column; min-width: 0; }
  .menu-left { flex: .9 1 300px; } .menu-right { flex: 1.25 1 420px; }
  .menu-left > *, .menu-right > * { order: 0 !important; }
  .menu-card p.menu-lead { margin-bottom: 14px; }
  .selected-brief { margin: 0 0 16px; padding: 14px 0; border-top: 1px solid #394530; }
  .deployment-row { flex-direction: column; align-items: stretch; gap: 14px; }
  .difficulty-wrap { width: 100%; }
  .play-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
  .play-row #play { grid-row: 1; grid-column: 1 / -1; min-height: 52px; font-size: 15px; letter-spacing: 2px; }
  .play-row #howto { grid-row: 2; grid-column: 1; min-height: 44px; justify-self: stretch; }
  .play-row .menu-audio { grid-row: 2; grid-column: 2; }
  .menu-audio .square { height: 44px; }
  .quick-help { margin-top: 14px; padding-top: 14px; }
  .maps { grid-template-columns: repeat(2, 1fr); }
  .map-card img { aspect-ratio: 16 / 7.2; }
  .map-name { margin: 9px 11px 3px; } .map-twist { margin: 0 11px; min-height: 0; } .map-best { margin: 4px 11px 0; }
  .map-card { padding-bottom: 10px; }
}
/* Short landscape windows: the big title gives way to a compact wordmark inside the card. */
@media (min-width: 900px) and (min-aspect-ratio: 4/3) and (max-height: 700px) {
  .menu-header { display: none; }
  .menu-brand { display: block; margin-bottom: 14px; font: 900 34px/1 Impact, "Arial Narrow", sans-serif; letter-spacing: 1px; color: #edf0e5; }
  .menu-brand { color: var(--ui-gold); } .menu-brand span { color: #edf0e5; }
  .menu { padding: 14px 24px; } .menu-card { padding: 18px 22px; }
  .quick-help, .mode-tag { display: none; }
  .briefing-heading h2 { font-size: 23px; }
  .selected-brief { margin-bottom: 12px; padding: 10px 0; }
}
@media (max-height: 560px) and (min-width: 700px) { .cards .wshow { height: 96px; } .recruit-portrait { width: 96px; height: 96px; } .sheet-head { padding: 12px 18px; } .sheet-body { padding: 14px 18px; } }
@media (max-width: 600px) {
  .sheet-head { padding: 14px 16px; gap: 12px; } .sheet-icon { width: 38px; height: 38px; } .sheet-head h2 { font-size: 20px; }
  .sheet-body { padding: 16px; } .sheet-foot { padding: 12px 16px; } .sheet-foot .btn { flex: 1; min-width: 0; padding: 0 12px; }
  .rewards { grid-template-columns: repeat(2, 1fr); } .row { gap: 10px; padding: 10px; } .ricon { width: 44px; height: 44px; } .rmeta kbd { display: none; }
  .pick-key { display: none; } .squad-strip figure { width: 70px; } .merc-face { width: 62px; height: 62px; }
}

/* Phones: keep Deploy reachable without scrolling the whole briefing. */
@media (max-width: 600px) {
  .menu { padding-bottom: 96px; }
  .play-row #play { position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); width: auto; z-index: 5; box-shadow: 0 10px 30px #000c, 0 0 0 1px #f3d48a55; }
  .play-row { grid-template-rows: auto; }
  .play-row #howto { grid-row: 1; grid-column: 1; }
  .play-row .menu-audio { grid-row: 1; grid-column: 2; }
}

/* Gem collected: the XP badge and bar flash cyan. */
.level.gem-flash .xp { animation: gemFlash .45s ease-out; }
.level.gem-flash .badge { animation: gemBadge .45s ease-out; }
@keyframes gemFlash { 0% { box-shadow: 0 0 0 0 #8ff0ff00; filter: brightness(1); } 25% { box-shadow: 0 0 14px 3px #8ff0ffcc; filter: brightness(1.8); } 100% { box-shadow: 0 0 0 0 #8ff0ff00; filter: brightness(1); } }
@keyframes gemBadge { 0% { scale: 1; } 30% { scale: 1.18; filter: drop-shadow(0 0 8px #8ff0ff); } 100% { scale: 1; } }

/* Version label: a small stencilled serial on the loading screen, the menu plate and the pause popup. */
.version-tag { margin: 0; font: 600 11px/1 var(--fk-label); letter-spacing: 2px; text-transform: uppercase; color: #8e977c; opacity: .8; }
.load-inner .version-tag { margin-top: 14px; text-align: center; }
.menu-card .menu-version { position: absolute; right: 22px; bottom: 9px; order: 9; pointer-events: none; }
.sheet.pause .version-tag { margin-top: 14px; text-align: right; }
@media (max-width: 899px), (max-aspect-ratio: 4/3) { .menu-card .menu-version { position: static; align-self: flex-end; margin-top: 12px; } }

/* ===================================================================== Combat feedback */
/* Damage numbers in the stencil voice; crits hot orange; the killing blow punches up in gold. */
.num { font-family: var(--fk-stencil); font-weight: 400; letter-spacing: .5px; -webkit-text-stroke-width: 4px; paint-order: stroke fill; }
.num.crit { color: #ff8a2a; font-size: 27px; text-shadow: 0 0 14px #ff5a1a88; }
.num.killed { color: #ffd23a; font-size: 30px; text-shadow: 0 0 16px #ffb21a99; }
.num.crit.killed { color: #ffe36a; font-size: 34px; }

/* Combo: stencil count with a draining timer bar underneath. */
.combo { font-family: var(--fk-stencil); font-size: 30px; color: var(--fk-amber); padding-bottom: 6px;
  background: linear-gradient(90deg, var(--fk-amber) var(--t, 100%), #00000080 0) left bottom / 100% 4px no-repeat; }
.combo::after { font-family: var(--fk-label); font-weight: 700; letter-spacing: 2px; -webkit-text-stroke: 0; color: #f3ead2; }

/* Callouts: shouted under the wave title. */
.callout { position: absolute; top: 19%; left: 50%; translate: -50% 0; z-index: 6; pointer-events: none; white-space: nowrap; opacity: 0;
  font: 400 clamp(24px, 4.6vh, 38px)/1 var(--fk-stencil); letter-spacing: 3px; text-transform: uppercase; color: #fff3cf;
  -webkit-text-stroke: 5px #120e06; paint-order: stroke fill; text-shadow: 0 4px 0 #120e06, 0 0 24px #f2b63266; }
.callout.show { animation: callout 1.3s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.callout.spree { color: var(--fk-amber); text-shadow: 0 4px 0 #120e06, 0 0 30px #f2b632aa; }
.callout.danger { color: #ff5a3c; text-shadow: 0 4px 0 #120e06, 0 0 30px #ff2a1aaa; }
.callout.danger.show { animation: callout 1.3s cubic-bezier(.2, 1.4, .4, 1) forwards, calloutShake .09s linear 6; }
@keyframes callout { 0% { opacity: 0; scale: 2.2; } 12% { opacity: 1; scale: .92; } 20% { scale: 1.05; } 28% { scale: 1; } 78% { opacity: 1; scale: 1; translate: -50% 0; } 100% { opacity: 0; scale: .96; translate: -50% -14px; } }
@keyframes calloutShake { 50% { margin-left: 4px; } }
@media (prefers-reduced-motion: reduce) { .callout.show { animation-duration: .01s, .01s; opacity: 1; } }

/* ===================================================================== Arcade UI
   Popups in the same voice as the HUD: chunky outlined lettering, thick ink outlines, navy panels, glossy candy
   buttons, a ribbon banner for every title, rarity-coloured cards. Display font: Lilita One. */
:root {
  --display: "Lilita One", "Arial Black", "Segoe UI Black", sans-serif;
  --ink: #141821;
  --panel: #2f3750; --panel-2: #242a3e; --well: #1a1f2e; --well-line: #3b4462;
  --txt: #ffffff; --txt-dim: #aab3cf; --yellow: #ffd23f;
  /* names kept for the combat-feedback and version blocks */
  --fk-stencil: var(--display); --fk-label: var(--display); --fk-amber: var(--yellow); --fk-ink: #fff; --fk-dim: var(--txt-dim);
}
.outline { paint-order: stroke fill; -webkit-text-stroke: 5px var(--ink); text-shadow: 0 3px 0 var(--ink); }

/* ---------- backdrop + pop-in */
.modal { background: radial-gradient(ellipse at 50% 40%, #141821a8, #0a0c12e8); backdrop-filter: blur(4px); }
#modal-box { animation: arcadePop .34s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes arcadePop { 0% { opacity: 0; transform: scale(.7); } 60% { opacity: 1; } }

/* ---------- panel */
.sheet { position: relative; overflow: visible; margin-top: 26px; max-height: calc(100dvh - 58px); border: 4px solid var(--ink); border-radius: 22px; color: var(--txt);
  background: linear-gradient(180deg, #3a4462 0%, var(--panel) 90px, var(--panel-2) 100%);
  box-shadow: inset 0 3px 0 #ffffff26, inset 0 -6px 0 #00000040, 0 8px 0 var(--ink), 0 30px 70px #000c; }

/* ---------- ribbon title */
.sheet-head { flex-direction: column; justify-content: center; gap: 2px; padding: 0 20px 12px; background: none; border: 0; text-align: center; }
.sheet-head::before, .sheet-head::after { display: none; }
.sheet-icon { display: none; }
.sheet-titles { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.sheet-head h2 { position: relative; z-index: 1; margin: -30px 0 0; padding: 8px 40px 10px; max-width: 100%;
  font: 400 32px/1 var(--display); letter-spacing: .5px; text-transform: none; color: #fff;
  paint-order: stroke fill; -webkit-text-stroke: 6px var(--ink); text-shadow: 0 4px 0 var(--ink);
  background: linear-gradient(180deg, #ffb340 0 48%, #f08a14 52%, #d26a06); border: 4px solid var(--ink); border-radius: 14px;
  box-shadow: inset 0 3px 0 #ffe1a0, inset 0 -5px 0 #a54e00, 0 5px 0 var(--ink); }
/* ribbon tails */
.sheet-head h2::before, .sheet-head h2::after { content: ""; position: absolute; z-index: -1; top: 14px; width: 34px; height: 100%;
  background: #b55606; border: 4px solid var(--ink); }
.sheet-head h2::before { left: -24px; border-right: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 36% 50%); }
.sheet-head h2::after { right: -24px; border-left: 0; clip-path: polygon(0 0, 100% 0, 64% 50%, 100% 100%, 0 100%); }
.sheet-head p { margin: 8px 0 0; font: 400 15px/1.3 var(--display); letter-spacing: .3px; text-transform: none; color: var(--txt-dim); }
.sheet.victory .sheet-head h2 { background: linear-gradient(180deg, #9ae84a 0 48%, #6ed12b 52%, #3c9a12); box-shadow: inset 0 3px 0 #d6ffab, inset 0 -5px 0 #2a7208, 0 5px 0 var(--ink); }
.sheet.victory .sheet-head h2::before, .sheet.victory .sheet-head h2::after { background: #2f7d0c; }
.sheet.defeat .sheet-head h2 { background: linear-gradient(180deg, #ff6b6b 0 48%, #e8456f 52%, #b4234f); box-shadow: inset 0 3px 0 #ffb3b3, inset 0 -5px 0 #8a1238, 0 5px 0 var(--ink); }
.sheet.defeat .sheet-head h2::before, .sheet.defeat .sheet-head h2::after { background: #8d1a3d; }
.sheet.defeat .sheet-head h2 { color: #fff; } .sheet.defeat .sheet-head { background: none; }
.record-tag { display: inline-block; margin-left: 4px; padding: 2px 10px 3px; border: 3px solid var(--ink); border-radius: 10px; background: var(--yellow); color: var(--ink);
  font: 400 13px var(--display); transform: rotate(-4deg); box-shadow: 0 3px 0 var(--ink); }

/* ---------- body well + footer */
.sheet-body { margin: 0 14px; padding: 16px; border: 3px solid var(--ink); border-radius: 16px; background: var(--well); box-shadow: inset 0 4px 10px #0009, 0 1px 0 #ffffff1a; }
.sheet-foot { justify-content: center; gap: 12px; padding: 16px 18px 18px; border: 0; background: none; box-shadow: none; }
.sheet-foot .btn { min-width: 150px; }
.sheet-label { margin: 18px 0 10px; font: 400 16px var(--display); letter-spacing: .3px; text-transform: none; color: var(--yellow); opacity: 1; paint-order: stroke fill; -webkit-text-stroke: 4px var(--ink); }
.sheet-label::after { display: none; }

/* ---------- candy buttons */
.btn { position: relative; min-height: 52px; padding: 0 24px 4px; border: 4px solid var(--ink); border-radius: 16px;
  font: 400 21px/1 var(--display); letter-spacing: .4px; text-transform: none; color: #fff;
  paint-order: stroke fill; -webkit-text-stroke: 5px var(--ink); text-shadow: 0 3px 0 var(--ink);
  transition: transform .08s, filter .12s, box-shadow .08s; }
.btn::before { content: ""; position: absolute; left: 6px; right: 6px; top: 4px; height: 38%; border-radius: 10px 10px 18px 18px; background: #ffffff38; pointer-events: none; }
.btn:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(4px); }
.btn.green { background: linear-gradient(180deg, #8fe33d, #5cc21c 55%, #45a812); box-shadow: inset 0 -6px 0 #2f7d0c, 0 5px 0 var(--ink); color: #fff; }
.btn.blue { background: linear-gradient(180deg, #5cb6ff, #2f8be8 55%, #2373d4); box-shadow: inset 0 -6px 0 #1a4f9e, 0 5px 0 var(--ink); }
.btn.red { background: linear-gradient(180deg, #ff7a8e, #e8456f 55%, #cf2f5a); box-shadow: inset 0 -6px 0 #8a1238, 0 5px 0 var(--ink); color: #fff; }
.btn.grey { background: linear-gradient(180deg, #8b94ad, #6b7389 55%, #5a6278); box-shadow: inset 0 -6px 0 #3c4256, 0 5px 0 var(--ink); color: #fff; }
.btn.green:hover:not(:disabled), .btn.blue:hover:not(:disabled), .btn.red:hover:not(:disabled), .btn.grey:hover:not(:disabled) { border-color: var(--ink); }
.btn:active:not(:disabled) { box-shadow: inset 0 -3px 0 #0005, 0 1px 0 var(--ink); }
.btn .ico { font-size: 18px; opacity: 1; }
.btn:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }

/* ---------- keycaps */
.sheet kbd, .quick-help kbd { display: inline-grid; place-items: center; min-width: 26px; padding: 4px 7px 6px; border: 3px solid var(--ink); border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #d9dde6); color: var(--ink); font: 400 12px/1 var(--display); letter-spacing: .5px; box-shadow: inset 0 -3px 0 #a9afbf, 0 2px 0 var(--ink); }

/* ---------- recruit cards */
.wbox { padding: 12px; border: 4px solid var(--ink); border-radius: 18px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 28%, #3a4462), #2a3148 60%);
  box-shadow: inset 0 3px 0 #ffffff26, inset 0 -5px 0 #0004, 0 5px 0 var(--ink); }
.wcard:hover .wbox { transform: translateY(-4px) rotate(-.4deg); border-color: var(--ink); box-shadow: inset 0 3px 0 #ffffff26, inset 0 -5px 0 #0004, 0 9px 0 var(--ink), 0 0 26px color-mix(in srgb, var(--accent) 45%, transparent); }
.whead { align-items: center; }
.wtype { padding: 4px 10px 5px; border: 3px solid var(--ink); border-radius: 10px; background: var(--accent); color: #fff; font: 400 12px var(--display); letter-spacing: .4px;
  paint-order: stroke fill; -webkit-text-stroke: 3px var(--ink); border-left-width: 3px; }
.wpower { font: 400 16px var(--display); color: var(--yellow); paint-order: stroke fill; -webkit-text-stroke: 4px var(--ink); }
.wbox h3 { margin: 8px 0 8px; font: 400 28px/1 var(--display); letter-spacing: .4px; color: #fff; paint-order: stroke fill; -webkit-text-stroke: 6px var(--ink); text-shadow: 0 4px 0 var(--ink); }
.wshow { border: 4px solid var(--ink); border-radius: 14px; background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--accent) 45%, #4a5578), #1a1f2e 75%); box-shadow: inset 0 0 18px #000a; }
.wshow .corner { display: none; }
.tags span { padding: 3px 9px 4px; border: 3px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); font: 400 12px var(--display); letter-spacing: .3px; text-transform: none; }
.wstat { font: 400 14px var(--display); letter-spacing: .3px; text-transform: none; color: var(--txt-dim); }
.wstat b { font: 400 15px var(--display); color: #fff; }
.wbar { height: 10px; border: 2px solid var(--ink); border-radius: 6px; background: #141821; }
.wbar i { border-radius: 3px; background: linear-gradient(180deg, #9ef05a, #5cc21c); box-shadow: inset 0 2px 0 #ffffff55; }
.trait { padding: 8px 10px; margin-top: 10px; border: 0; border-radius: 10px; background: #00000040; font: 13px/1.4 system-ui, "Segoe UI", sans-serif; font-weight: 600; color: #dfe5f5; }
.trait g { color: #9ef05a; } .trait r { color: #ff8a9e; }
.pick-key { right: 8px; top: 8px; }

/* ---------- level-up rows: big rarity cards */
.rows { gap: 12px; }
.row { gap: 14px; padding: 10px 14px 12px 10px; border: 4px solid var(--ink); border-radius: 18px; color: #fff;
  background: linear-gradient(180deg, #56607e, #3c4560); box-shadow: inset 0 3px 0 #ffffff2e, inset 0 -6px 0 #0004, 0 5px 0 var(--ink); }
.row:hover { transform: translateY(-2px) scale(1.015); border-color: var(--ink); background: linear-gradient(180deg, #626d8e, #444e6c); box-shadow: inset 0 3px 0 #ffffff2e, inset 0 -6px 0 #0004, 0 7px 0 var(--ink), 0 0 22px #ffffff22; }
.row.rare { border-color: var(--ink); background: linear-gradient(180deg, #4ea0ff, #2a6fd6); box-shadow: inset 0 3px 0 #b8dcff88, inset 0 -6px 0 #1a4f9e, 0 5px 0 var(--ink); }
.row.epic { border-color: var(--ink); background: linear-gradient(180deg, #c27bff, #8a3fe0); box-shadow: inset 0 3px 0 #e8c8ff88, inset 0 -6px 0 #5a1fa8, 0 5px 0 var(--ink), 0 0 24px #b05cff55; }
.row.rare:hover, .row.epic:hover { border-color: var(--ink); filter: brightness(1.08); }
.ricon { width: 58px; height: 58px; border: 4px solid var(--ink); border-radius: 14px; box-shadow: inset 0 -4px 0 #0004, 0 3px 0 var(--ink); }
.rname { font: 400 22px/1 var(--display); letter-spacing: .3px; text-transform: none; color: #fff; paint-order: stroke fill; -webkit-text-stroke: 5px var(--ink); text-shadow: 0 3px 0 var(--ink); }
.rname g, .row.rare .rname g, .row.epic .rname g { color: var(--yellow); font-weight: 400; }
.rval { font: 400 14px var(--display); letter-spacing: .3px; color: #ffffffcc; } .rval b { color: #fff; } .rval i { color: #ffffff99; }
.rarity { padding: 4px 10px 5px; border: 3px solid var(--ink); border-radius: 10px; transform: rotate(4deg); font: 400 12px var(--display); letter-spacing: .4px; text-transform: none;
  background: #fff; color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.row.rare .rarity { background: #bfe0ff; color: #0d3a7a; } .row.epic .rarity { background: #ffd23f; color: #4a1a00; }

/* ---------- attributes */
.attr { gap: 10px; padding: 8px 10px; border: 3px solid var(--ink); border-radius: 12px; background: linear-gradient(180deg, #3a4462, #2c3450);
  font: 400 15px var(--display); letter-spacing: .2px; text-transform: none; color: #dfe5f5; box-shadow: inset 0 2px 0 #ffffff1f, 0 3px 0 var(--ink); }
.attr b { font: 400 16px var(--display); color: #8f98b5; }
.attr.up { border-color: var(--ink); background: linear-gradient(180deg, #5cc21c, #3c9a12); box-shadow: inset 0 2px 0 #ffffff40, 0 3px 0 var(--ink); }
.attr.up span, .attr.up b { color: #fff; paint-order: stroke fill; -webkit-text-stroke: 3px var(--ink); }

/* ---------- squad portraits */
.merc-face { border: 4px solid var(--ink); border-radius: 14px; background-color: #3a4462; box-shadow: inset 0 0 12px #0008, 0 3px 0 var(--ink); transform: none !important; }
.squad-strip figcaption { font: 400 13px var(--display); letter-spacing: .2px; text-transform: none; color: var(--txt-dim); }

/* ---------- big-number tiles (pause, end) */
.pause-stats div, .reward, .reward.blue, .reward.purple { border: 3px solid var(--ink); border-radius: 14px; background: linear-gradient(180deg, #3a4462, #2c3450); box-shadow: inset 0 2px 0 #ffffff1f, 0 4px 0 var(--ink); }
.pause-stats b, .reward b { font: 400 30px/1 var(--display); letter-spacing: .5px; color: var(--yellow); paint-order: stroke fill; -webkit-text-stroke: 6px var(--ink); text-shadow: 0 3px 0 var(--ink); }
.pause-stats span, .reward span { font: 400 13px var(--display); letter-spacing: .4px; text-transform: none; color: var(--txt-dim); }
.reward img { width: 34px; height: 34px; filter: drop-shadow(0 2px 0 var(--ink)); }
.note { margin: 0 0 14px; text-align: center; font: 400 18px/1.3 var(--display); letter-spacing: .2px; color: #fff; }
.sheet.defeat .note { color: #ffd0d8; }
.pause-toggles { border-top: 0; padding-top: 4px; }
.toggle { border: 3px solid var(--ink); border-radius: 14px; background: linear-gradient(180deg, #3a4462, #2c3450); font: 400 16px var(--display); letter-spacing: .2px; text-transform: none; box-shadow: 0 3px 0 var(--ink); }
.toggle i { width: 46px; height: 26px; border: 3px solid var(--ink); border-radius: 13px; } .toggle i::after { left: 2px; top: 2px; width: 16px; height: 16px; border: 2px solid var(--ink); box-sizing: content-box; top: 1px; left: 1px; } .toggle.on i::after { transform: translateX(19px); }
.toggle.on i { background: #5cc21c; }
.version-tag { font: 400 12px/1 var(--display); letter-spacing: .5px; text-transform: none; color: #7d86a3; }

/* ---------- how to play */
.howto-group { border: 3px solid var(--ink); border-radius: 14px; background: linear-gradient(180deg, #2f3750, #262c41); box-shadow: inset 0 2px 0 #ffffff1a, 0 3px 0 var(--ink); }
.howto-group h4 { font: 400 20px var(--display); letter-spacing: .3px; text-transform: none; color: var(--yellow); paint-order: stroke fill; -webkit-text-stroke: 5px var(--ink); text-shadow: 0 3px 0 var(--ink); }
.howto-row { font: 600 14px/1.45 system-ui, "Segoe UI", sans-serif; color: #dfe5f5; }

/* ---------- main menu in the same arcade frame */
.menu-card { border: 4px solid var(--ink); border-radius: 22px; background: linear-gradient(180deg, #3a4462f2 0%, #2f3750f2 120px, #242a3ef2 100%);
  box-shadow: inset 0 3px 0 #ffffff26, inset 0 -6px 0 #00000040, 0 8px 0 var(--ink), 0 30px 70px #000c; }
.briefing-heading h2, .menu-brand { font-family: var(--display); font-weight: 400; letter-spacing: .5px; text-transform: none; }
.briefing-heading h2 { font-size: 30px; color: #fff; paint-order: stroke fill; -webkit-text-stroke: 6px var(--ink); text-shadow: 0 4px 0 var(--ink); }
.menu-brand { font-size: 40px; color: var(--yellow); paint-order: stroke fill; -webkit-text-stroke: 7px var(--ink); text-shadow: 0 5px 0 var(--ink); }
.menu-brand span { color: #fff; }
.eyebrow, .menu-label, .mode-tag, .mission-stats span { font-family: var(--display); font-weight: 400; letter-spacing: .6px; }
.menu-label { font-size: 15px; color: var(--yellow); text-transform: none; }
#play.btn { min-height: 62px; font: 400 30px/1 var(--display); letter-spacing: 1px; -webkit-text-stroke-width: 6px; }
.difficulty { border: 3px solid var(--ink); border-radius: 14px; background: var(--well); padding: 4px; }
.difficulty button { border-radius: 10px; font: 400 17px var(--display); letter-spacing: .3px; text-transform: none; color: var(--txt-dim); }
.difficulty button.on { color: #fff; background: linear-gradient(180deg, #5cb6ff, #2f8be8); border: 3px solid var(--ink); paint-order: stroke fill; -webkit-text-stroke: 4px var(--ink); box-shadow: inset 0 -4px 0 #1a4f9e; }
.map-card { border: 4px solid var(--ink); border-radius: 16px; background: linear-gradient(180deg, #3a4462, #2a3148); box-shadow: inset 0 2px 0 #ffffff1f, 0 5px 0 var(--ink); }
.map-card.on { border-color: var(--ink); box-shadow: 0 0 0 4px var(--yellow), 0 5px 0 var(--ink), 0 0 26px #ffd23f66; }
.map-name { font: 400 22px var(--display); letter-spacing: .3px; text-transform: none; color: #fff; paint-order: stroke fill; -webkit-text-stroke: 5px var(--ink); text-shadow: 0 3px 0 var(--ink); }
.wave-title { font-family: var(--display); letter-spacing: 1px; }

/* ---------- fit */
@media (max-height: 760px) and (min-width: 700px) {
  .sheet.recruit .sheet-body { padding: 10px 12px; } .sheet.recruit .wbox { padding: 9px 10px; } .sheet.recruit .wbox h3 { margin: 4px 0 6px; font-size: 24px; }
  .sheet.recruit .wshow { height: 96px; } .sheet.recruit .recruit-portrait { width: 96px; height: 96px; }
  .sheet.recruit .tags { margin: 6px 0; } .sheet.recruit .wstats { gap: 3px; } .sheet.recruit .trait { margin-top: 6px; padding: 6px 8px; font-size: 12px; line-height: 1.3; }
  .sheet.recruit .choose { min-height: 46px; font-size: 19px; } .sheet.recruit .sheet-head { padding-bottom: 8px; }
  .sheet .sheet-foot { padding: 12px 16px 14px; }
}
@media (max-width: 600px) {
  .sheet-head h2 { font-size: 25px; padding: 7px 24px 9px; } .sheet-head h2::before { left: -18px; width: 26px; } .sheet-head h2::after { right: -18px; width: 26px; }
  .sheet-body { margin: 0 8px; padding: 12px; } .btn { font-size: 18px; min-height: 48px; } .sheet-foot .btn { min-width: 0; padding: 0 10px 4px; }
}
/* Footer buttons share one row; level-up cards compact on short windows so all four fit. */
.sheet-foot { flex-wrap: nowrap; } .sheet-foot .btn { flex: 1 1 0; min-width: 0; max-width: 240px; padding: 0 14px 4px; }
@media (max-height: 760px) {
  .rows { gap: 9px; } .row { padding: 6px 12px 9px 8px; } .ricon { width: 48px; height: 48px; } .ricon img { width: 34px; height: 34px; }
  .rname { font-size: 20px; } .rmeta { gap: 4px; } .sheet.upgrade .sheet-body { padding: 12px; }
}
.pause-buttons #resume { min-height: 58px; font-size: 26px; }
.play-row #howto { font-size: 19px; min-height: 48px; }
.menu-card { position: relative; }
.menu-card .eyebrow { font-size: 13px; color: var(--yellow); }
.menu-audio .square, .top-right .square { border: 3px solid var(--ink); border-radius: 12px; background: linear-gradient(180deg, #8b94ad, #6b7389 55%, #5a6278); box-shadow: inset 0 -4px 0 #3c4256, 0 3px 0 var(--ink); }
.menu-audio .square:hover, .top-right .square:hover { filter: brightness(1.1); border-color: var(--ink); }

/* ===================================================================== Arcade HUD */
/* Level + kills plate (top left) */
.top-left { padding: 10px 14px 10px 10px; border: 4px solid var(--ink); border-radius: 18px;
  background: linear-gradient(180deg, #3a4462, #2a3148); box-shadow: inset 0 3px 0 #ffffff26, inset 0 -5px 0 #0004, 0 5px 0 var(--ink); }
.level { gap: 0; }
.badge, .badge::before { clip-path: none; }
.badge { width: 46px; height: 46px; border: 4px solid var(--ink); border-radius: 50%; background: linear-gradient(180deg, #5cb6ff, #2f8be8 55%, #1f66c4); box-shadow: inset 0 -5px 0 #1a4f9e, inset 0 3px 0 #b8dcff, 0 3px 0 var(--ink); }
.badge::before { display: none; }
.badge span { font: 400 24px/1 var(--display); color: #fff; paint-order: stroke fill; -webkit-text-stroke: 5px var(--ink); text-shadow: 0 2px 0 var(--ink); }
.xp { width: 130px; height: 16px; margin-left: -8px; border: 3px solid var(--ink); border-left: 0; border-radius: 0 10px 10px 0; background: #141821; }
.xp i { background: linear-gradient(180deg, #a6f0ff, #3cc6ff 50%, #1d8fe0); box-shadow: inset 0 2px 0 #ffffff66; border-radius: 0 6px 6px 0; }
.kills { margin: 8px 0 0 2px; gap: 8px; }
.kills img { width: 30px; height: 30px; filter: drop-shadow(0 2px 0 var(--ink)); }
.kills b { font: 400 28px/1 var(--display); color: #fff; -webkit-text-stroke: 6px var(--ink); text-shadow: 0 3px 0 var(--ink); }
.kills span { font: 400 14px var(--display); letter-spacing: .4px; color: var(--yellow); paint-order: stroke fill; -webkit-text-stroke: 4px var(--ink); }
.kills.bump b, #kills.bump { animation: killBump .25s ease-out; }
@keyframes killBump { 40% { scale: 1.35; } }

/* Wave plate (top centre): map name, ribbon wave title, progress bar */
.top-center { gap: 6px; }
.hud-map { font: 400 15px var(--display); letter-spacing: .6px; text-transform: none; color: #fff; paint-order: stroke fill; -webkit-text-stroke: 4px var(--ink); text-shadow: 0 2px 0 var(--ink); }
.wave-title { position: relative; padding: 7px 26px 9px; border: 4px solid var(--ink); border-radius: 14px; font: 400 26px/1 var(--display); letter-spacing: .6px; color: #fff;
  -webkit-text-stroke: 6px var(--ink); text-shadow: 0 3px 0 var(--ink);
  background: linear-gradient(180deg, #ffb340 0 48%, #f08a14 52%, #d26a06); box-shadow: inset 0 3px 0 #ffe1a0, inset 0 -5px 0 #a54e00, 0 5px 0 var(--ink); }
.wave-track { width: 200px; height: 14px; border: 3px solid var(--ink); border-radius: 8px; background: #141821; box-shadow: 0 3px 0 var(--ink); }
.wave-track i { background: linear-gradient(180deg, #fff09a, #ffd23f 50%, #f0a800); box-shadow: inset 0 2px 0 #ffffff88; border-radius: 5px; }
.boss-name { font: 400 18px var(--display); color: #ff8a8a; -webkit-text-stroke: 5px var(--ink); }
.boss-track { height: 16px; border: 3px solid var(--ink); border-radius: 9px; }

/* Barricade bar (bottom) */
.hp-heading { font: 400 15px var(--display); letter-spacing: .5px; color: #fff; paint-order: stroke fill; -webkit-text-stroke: 4px var(--ink); text-shadow: 0 2px 0 var(--ink); margin-bottom: 6px; }
.hp-track { height: 18px; border: 3px solid var(--ink); border-radius: 10px; background: #141821; box-shadow: 0 3px 0 var(--ink); }
#hp-bar { background: linear-gradient(180deg, #a8f060, #6ed12b 50%, #3c9a12); box-shadow: inset 0 2px 0 #ffffff66; }
.hp.low #hp-bar { background: linear-gradient(180deg, #ff9a8a, #ff4a3a 50%, #c0221a); }
.hp-label { top: -8px; } .hp-label img { width: 22px; height: 22px; filter: drop-shadow(0 2px 0 var(--ink)); }
.hp-label b { font: 400 17px var(--display); -webkit-text-stroke: 4px var(--ink); }
.combat-footer { font: 400 15px var(--display); letter-spacing: .3px; color: #fff; paint-order: stroke fill; -webkit-text-stroke: 4px var(--ink); text-shadow: 0 2px 0 var(--ink); }
.combat-footer b { color: var(--yellow); }
.combat-footer kbd { -webkit-text-stroke: 0; }

/* Mortar button (right) */
.ability { border: 4px solid var(--ink); border-radius: 50%; background: radial-gradient(circle at 50% 35%, #5a6585, #2a3148); box-shadow: inset 0 -5px 0 #0005, 0 5px 0 var(--ink); }
.ability::after { border-radius: 50%; }
.ability.ready { box-shadow: inset 0 -5px 0 #0005, 0 5px 0 var(--ink), 0 0 0 4px var(--yellow), 0 0 24px #ffd23f88; animation: abilityPulse 1.2s ease-in-out infinite; }
@keyframes abilityPulse { 50% { scale: 1.06; } }
.ability:disabled { box-shadow: inset 0 -5px 0 #0005, 0 5px 0 var(--ink); }
.ability span { font: 400 22px var(--display); -webkit-text-stroke: 5px var(--ink); }
.ability kbd { bottom: -26px; padding: 2px 6px 3px; border: 3px solid var(--ink); border-radius: 7px; background: #fff; color: var(--ink); font: 400 11px var(--display); opacity: 1; }

/* Text pop-ups: tip card, speech bubbles, wave banners, merc tags */
.tip { padding: 12px 16px 14px; max-width: 280px; border: 4px solid var(--ink); border-radius: 16px; background: #fff; color: var(--ink);
  font: 700 14px/1.4 system-ui, "Segoe UI", sans-serif; box-shadow: 0 5px 0 var(--ink), 0 14px 30px #0006; }
.tip::before { content: "TIP"; display: inline-block; margin-right: 8px; padding: 2px 8px 3px; border: 3px solid var(--ink); border-radius: 8px; background: var(--yellow);
  font: 400 13px var(--display); letter-spacing: .5px; vertical-align: 1px; }
.tip::after { display: block; content: ""; position: absolute; left: auto; right: 34px; top: -14px; bottom: auto; width: 18px; height: 18px; border: 4px solid var(--ink); border-right: 0; border-bottom: 0;
  background: #fff; transform: rotate(45deg); }
.bubble { padding: 7px 13px 9px; border: 4px solid var(--ink); border-radius: 14px; background: #fff; color: var(--ink); font: 400 15px/1 var(--display); letter-spacing: .3px; box-shadow: 0 4px 0 var(--ink); }
.bubble::after { bottom: -14px; border-top-width: 12px; } .bubble::before { bottom: -7px; }
.banner { font-family: var(--display); font-weight: 400; letter-spacing: 1px; -webkit-text-stroke: 8px var(--ink); text-shadow: 0 5px 0 var(--ink), 0 0 30px #0008; font-size: clamp(40px, 8vh, 64px); }
.banner.gold { color: var(--yellow); } .banner.red { color: #ff6a6a; font-size: clamp(30px, 6vh, 46px); }
.ammo .you { font: 400 14px var(--display); color: #fff; -webkit-text-stroke: 4px var(--ink); letter-spacing: .3px; }
.ammo.player.idle .you::after { content: ' · Hold to fire'; color: var(--yellow); }
.ammo { font: 400 13px var(--display); -webkit-text-stroke-width: 4px; }
.ammo i { width: 50px; height: 8px; border: 2px solid var(--ink); border-radius: 5px; }
/* the player's rounds live in the ammo panel now; keep only the YOU tag over their head */
.ammo.player i, .ammo.player .mag, .ammo.player .n { display: none; }

/* ---------- Ammo panel (bottom right) */
.ammo-panel { position: absolute; right: 24px; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 3; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px 12px 10px; border: 4px solid var(--ink); border-radius: 18px; background: linear-gradient(180deg, #3a4462, #2a3148);
  box-shadow: inset 0 3px 0 #ffffff26, inset 0 -5px 0 #0004, 0 5px 0 var(--ink); pointer-events: none; transform-origin: 100% 100%; }
.ap-gun { display: grid; place-items: center; width: 64px; height: 64px; border: 4px solid var(--ink); border-radius: 14px;
  background: radial-gradient(circle at 50% 40%, #ffd98a, #f0a020 70%); box-shadow: inset 0 -5px 0 #b06a00, 0 3px 0 var(--ink); }
.ap-gun img { width: 48px; height: 48px; filter: drop-shadow(0 2px 0 var(--ink)); }
.ap-body { display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.ap-count { display: flex; align-items: baseline; gap: 4px; line-height: 1; }
.ap-count b { font: 400 40px/1 var(--display); color: #fff; paint-order: stroke fill; -webkit-text-stroke: 7px var(--ink); text-shadow: 0 3px 0 var(--ink); font-variant-numeric: tabular-nums; }
.ap-max { font: 400 20px var(--display); color: var(--txt-dim); paint-order: stroke fill; -webkit-text-stroke: 5px var(--ink); }
.ap-max i { font-style: normal; }
.ap-state { display: none; margin-left: auto; padding: 3px 9px 5px; border: 3px solid var(--ink); border-radius: 9px; background: #2f8be8; color: #fff; font: 400 15px var(--display); font-style: normal;
  paint-order: stroke fill; -webkit-text-stroke: 4px var(--ink); box-shadow: 0 3px 0 var(--ink); }
.ap-pips { display: flex; flex-wrap: wrap; gap: 3px; max-width: 220px; }
.ap-pips i { width: 8px; height: 18px; border: 2px solid var(--ink); border-radius: 3px 3px 2px 2px; background: #141821; }
.ap-pips i.on { background: linear-gradient(180deg, #fff3b0, #ffd23f 45%, #e09200); }
.ammo-panel:not(.many) .ap-pips:has(i:nth-child(16)) i { width: 6px; height: 14px; }
.ap-bar { display: none; height: 12px; border: 3px solid var(--ink); border-radius: 8px; background: #141821; overflow: hidden; }
.ap-bar i { display: block; height: 100%; width: 0; background: linear-gradient(180deg, #a6dcff, #3b9cff 50%, #1d64c9); }
.ammo-panel.many .ap-pips { display: none; } .ammo-panel.many .ap-bar { display: block; }
.ammo-panel.many .ap-bar i { background: linear-gradient(180deg, #fff3b0, #ffd23f 45%, #e09200); }
/* reloading: big blue bar + tag, pips hidden */
.ammo-panel.reloading .ap-state { display: inline-block; animation: apBlink .5s steps(2) infinite; }
.ammo-panel.reloading .ap-pips { display: none; } .ammo-panel.reloading .ap-bar { display: block; }
.ammo-panel.reloading .ap-bar i { background: linear-gradient(180deg, #a6dcff, #3b9cff 50%, #1d64c9); }
.ammo-panel.reloading .ap-count b { color: #8fb8ff; }
@keyframes apBlink { 50% { opacity: .55; } }
/* low ammo: red count and pulsing frame */
.ammo-panel.low .ap-count b { color: #ff5a4a; }
.ammo-panel.low { animation: apLow .6s ease-in-out infinite; }
@keyframes apLow { 50% { box-shadow: inset 0 3px 0 #ffffff26, inset 0 -5px 0 #0004, 0 5px 0 var(--ink), 0 0 0 4px #ff4a3a, 0 0 22px #ff4a3a99; } }
.ammo-panel.low .ap-pips i.on { background: linear-gradient(180deg, #ffb3a8, #ff5a4a 45%, #c0221a); }
/* keep the HOLD hint clear of the panel */
.combat-footer span:last-child { margin-right: 250px; }
@media (max-width: 1100px) {
  .ammo-panel { right: 12px; bottom: 96px; padding: 7px 10px 8px 7px; gap: 8px; } .ap-gun { width: 46px; height: 46px; } .ap-gun img { width: 34px; height: 34px; }
  .ap-count b { font-size: 30px; } .ap-body { min-width: 110px; } .ap-pips { max-width: 150px; } .combat-footer span:last-child { margin-right: 0; }
}
/* Ammo panel: fixed width, pips always on one row (they slim down for big magazines). The HOLD hint moves into the tip. */
.ap-body { width: 214px; min-width: 0; }
.ap-pips { flex-wrap: nowrap; max-width: none; gap: 2px; }
.ap-pips i { flex: 1 1 0; min-width: 3px; max-width: 12px; height: 20px; }
.ammo-panel:not(.many) .ap-pips:has(i:nth-child(16)) i { height: 18px; border-width: 1.5px; border-radius: 2px; }
.combat-footer span:last-child { display: none; }
@media (max-width: 1100px) { .ap-body { width: 150px; } }
@media (max-width: 600px) {
  .ammo-panel { top: calc(64px + env(safe-area-inset-top)); bottom: auto; right: 8px; padding: 5px 9px 7px; border-width: 3px; border-radius: 14px; transform-origin: 100% 0; }
  .ap-gun { display: none; } .ap-body { width: 100px; gap: 3px; } .ap-count b { font-size: 26px; -webkit-text-stroke-width: 5px; } .ap-max { font-size: 15px; }
  .ap-state { padding: 2px 6px 3px; font-size: 12px; } .ap-pips i { height: 12px; } .ap-bar { height: 9px; }
}

/* ===================================================================== Arcade loading screen */
.loading { background: #141821; overflow: hidden; }
.loading::before { display: none; }
.load-bg { position: absolute; inset: -40px; background: url("/art/thumbs/map-city.jpg") center / cover; filter: blur(14px) saturate(1.1) brightness(.45); transform: scale(1.1); animation: loadPan 18s ease-in-out infinite alternate; }
.load-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, transparent 20%, #0a0c12 85%); }
@keyframes loadPan { to { transform: scale(1.18) translateY(-20px); } }
.load-inner { gap: 14px; width: min(520px, calc(100vw - 32px)); }
.load-logo { margin: 0; font: 400 clamp(64px, 14vw, 112px)/.9 var(--display); letter-spacing: 1px; transform: rotate(-4deg);
  paint-order: stroke fill; -webkit-text-stroke: 12px var(--ink); text-shadow: 0 8px 0 var(--ink), 0 18px 40px #000c; animation: logoIn .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.load-logo .l1 { color: #fff; } .load-logo .l2 { color: var(--yellow); }
@keyframes logoIn { from { opacity: 0; transform: rotate(-4deg) scale(.4); } }
.load-ribbon { position: relative; margin-top: -6px; padding: 6px 30px 8px; border: 4px solid var(--ink); border-radius: 12px; transform: rotate(-2deg);
  font: 400 24px/1 var(--display); letter-spacing: .5px; color: #fff; paint-order: stroke fill; -webkit-text-stroke: 5px var(--ink); text-shadow: 0 3px 0 var(--ink);
  background: linear-gradient(180deg, #ffb340 0 48%, #f08a14 52%, #d26a06); box-shadow: inset 0 3px 0 #ffe1a0, inset 0 -5px 0 #a54e00, 0 5px 0 var(--ink); }
.load-skulls { gap: 16px; margin-top: 10px; }
.load-skulls img { width: 40px; height: 40px; filter: drop-shadow(0 3px 0 var(--ink)); animation: skullHop .9s ease-in-out infinite; }
.load-skulls img:nth-child(2) { animation-delay: .15s; } .load-skulls img:nth-child(3) { animation-delay: .3s; }
@keyframes skullHop { 0%, 100% { transform: translateY(0) rotate(0); } 40% { transform: translateY(-14px) rotate(-8deg); } 60% { transform: translateY(-14px) rotate(8deg); } }
.load-bar { position: relative; height: 34px; padding: 4px; border: 4px solid var(--ink); border-radius: 18px; background: #141821; box-shadow: inset 0 3px 8px #000c, 0 5px 0 var(--ink); overflow: hidden; }
.load-bar i { border-radius: 12px; background: repeating-linear-gradient(-45deg, #8fe33d 0 12px, #5cc21c 12px 24px); background-size: 34px 34px; animation: stripes .6s linear infinite;
  box-shadow: inset 0 3px 0 #ffffff66, inset 0 -4px 0 #2f7d0c; transition: width .2s; }
.load-bar b { position: absolute; inset: 0; display: grid; place-items: center; font: 400 18px/1 var(--display); color: #fff; paint-order: stroke fill; -webkit-text-stroke: 5px var(--ink); }
.load-row { justify-content: center; font: 400 17px var(--display); letter-spacing: .3px; color: #fff; paint-order: stroke fill; -webkit-text-stroke: 4px var(--ink); text-shadow: 0 2px 0 var(--ink); }
.load-tip { position: relative; margin-top: 6px; min-height: 0; max-width: 440px; padding: 10px 14px 12px; border: 4px solid var(--ink); border-radius: 14px; background: #fff; color: var(--ink);
  text-align: left; font: 700 14px/1.4 system-ui, "Segoe UI", sans-serif; box-shadow: 0 5px 0 var(--ink); }
.load-tip:empty { display: none; }
.load-tip::before { content: "TIP"; display: inline-block; margin-right: 8px; padding: 2px 8px 3px; border: 3px solid var(--ink); border-radius: 8px; background: var(--yellow); font: 400 13px var(--display); letter-spacing: .5px; vertical-align: 1px; }
.load-inner .version-tag { color: #aab3cf; paint-order: stroke fill; -webkit-text-stroke: 3px var(--ink); }
