:root {
  --ink: #efe7d4; --dim: #b4ab98; --mute: #7d7668; --amber: #ffb347; --amber2: #f29a2e; --red: #ec4a3a; --gold: #ffd24a;
  --panel: rgba(18, 17, 15, 0.78); --panel2: rgba(30, 28, 24, 0.86); --line: rgba(239, 231, 212, 0.14);
  --font: "Bahnschrift", "DIN Condensed", "Barlow Condensed", "Oswald", "Roboto Condensed", "Ubuntu Condensed", "Open Sans Condensed", "Arial Narrow", "Liberation Sans Narrow", "Nimbus Sans Narrow", sans-serif;
  --hud: 1;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #14120f; color: var(--ink); font-family: var(--font); font-stretch: condensed; -webkit-user-select: none; user-select: none; touch-action: none; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; transition: filter 0.4s; }
canvas#game.thermal { filter: grayscale(1) contrast(1.55) brightness(0.95); }
button { font-family: inherit; }
kbd { display: inline-block; min-width: 1.7em; padding: 0.1em 0.45em; margin: 0 0.12em; border: 1px solid rgba(239, 231, 212, 0.4); border-bottom-width: 3px; border-radius: 3px; font: 600 0.85em var(--font); color: var(--ink); background: rgba(0, 0, 0, 0.35); text-align: center; }

/* ================= HUD ================= */
#hud { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s; font-size: calc(16px * var(--hud)); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); }
#hud.on { opacity: 1; }
#vignette { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, rgba(120, 0, 0, 0) 35%, rgba(130, 8, 4, 0.55) 70%, rgba(90, 0, 0, 0.92) 100%); }
#bloodFlash { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, rgba(180, 20, 10, 0) 20%, rgba(180, 20, 10, 0.6) 100%); mix-blend-mode: multiply; }
#lowhp { position: absolute; inset: 0; opacity: 0; box-shadow: inset 0 0 160px 60px rgba(150, 0, 0, 0.75); }
#suppress { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.55) 100%); }

#mmWrap { position: absolute; left: calc(22px * var(--hud)); top: calc(20px * var(--hud)); width: calc(200px * var(--hud)); height: calc(200px * var(--hud)); }
#minimap { width: 100%; height: 100%; border-radius: 50%; }
.mm-frame { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid rgba(239, 231, 212, 0.35); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), inset 0 0 18px rgba(0, 0, 0, 0.6); }
#uavBadge { position: absolute; right: -6px; bottom: 4px; display: none; background: var(--red); color: #fff; padding: 2px 7px; font-size: 0.8em; letter-spacing: 0.1em; font-weight: 700; }
#uavBadge.on { display: flex; gap: 6px; animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: 0.75; } to { opacity: 1; } }
#objective { position: absolute; left: calc(22px * var(--hud)); top: calc(236px * var(--hud)); width: calc(250px * var(--hud)); padding: 8px 10px; background: linear-gradient(90deg, rgba(10, 9, 8, 0.7), rgba(10, 9, 8, 0)); border-left: 3px solid var(--amber); }
#objTitle { font-weight: 700; letter-spacing: 0.08em; font-size: 0.95em; color: var(--amber); }
#objBody { font-size: 0.9em; color: var(--ink); margin-top: 2px; }
.objbar { height: 5px; margin-top: 6px; background: rgba(255, 255, 255, 0.15); }
.objbar div { height: 100%; width: 0; background: var(--gold); transition: width 0.2s; }
.objbar.contested div { background: var(--red); }
.objbar.capturing div { background: #7fd37a; }

#compassWrap { position: absolute; top: calc(12px * var(--hud)); left: 50%; transform: translateX(-50%); width: calc(520px * var(--hud)); }
#compass { width: 100%; display: block; -webkit-mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }
#bossbar { position: absolute; top: calc(72px * var(--hud)); left: 50%; transform: translateX(-50%); width: calc(420px * var(--hud)); display: none; text-align: center; }
#bossbar.on { display: block; }
.bb-name { font-weight: 700; letter-spacing: 0.35em; color: var(--red); font-size: 0.9em; }
.bb-bar { height: 8px; margin-top: 4px; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(236, 74, 58, 0.6); }
#bossFill { height: 100%; background: linear-gradient(90deg, #a01d12, var(--red)); width: 100%; transition: width 0.15s; }

#scorebox { position: absolute; right: calc(22px * var(--hud)); top: calc(18px * var(--hud)); width: calc(210px * var(--hud)); padding: 8px 12px; background: linear-gradient(270deg, rgba(10, 9, 8, 0.75), rgba(10, 9, 8, 0.15)); border-right: 3px solid var(--amber); text-align: right; }
.sb-row { display: flex; justify-content: space-between; font-weight: 700; letter-spacing: 0.06em; }
#waveNum { color: var(--amber); }
.sb-score { display: flex; justify-content: space-between; align-items: baseline; margin-top: 2px; }
.sb-score span { font-size: 0.75em; color: var(--dim); letter-spacing: 0.15em; }
.sb-score b { font-size: 1.55em; letter-spacing: 0.02em; }
#lives { display: flex; justify-content: flex-end; gap: 4px; margin-top: 4px; }
#lives i { width: 10px; height: 14px; background: var(--ink); clip-path: polygon(50% 0, 100% 30%, 100% 100%, 0 100%, 0 30%); }
#lives i.lost { background: rgba(239, 231, 212, 0.2); }
#killfeed { position: absolute; right: calc(22px * var(--hud)); top: calc(118px * var(--hud)); display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.kf { display: flex; align-items: center; gap: 6px; padding: 3px 9px; background: rgba(10, 9, 8, 0.62); font-size: 0.88em; animation: kfin 0.25s ease-out; transition: opacity 0.5s; }
.kf.out { opacity: 0; }
.kf-a { color: #8fd0ff; font-weight: 700; }
.kf.died .kf-a { color: var(--red); }
.kf.died .kf-v { color: #8fd0ff; }
.kf-v { color: var(--red); font-weight: 700; }
.kf-w { color: var(--dim); font-size: 0.85em; letter-spacing: 0.05em; }
.kf-i { color: var(--gold); display: flex; }
.ico { width: 14px; height: 14px; }
@keyframes kfin { from { transform: translateX(30px); opacity: 0; } }

#crosshair { position: absolute; left: 50%; top: 50%; transition: opacity 0.12s; }
#crosshair i { position: absolute; display: block; background: rgba(255, 255, 255, 0.92); box-shadow: 0 0 2px rgba(0, 0, 0, 0.9); }
#chL, #chR { width: 12px; height: 2px; }
#chT, #chB { width: 2px; height: 12px; }
#chDot { width: 2px; height: 2px; transform: translate(-1px, -1px); }
#chCircle { display: none; border: 2px solid rgba(255, 255, 255, 0.85); border-radius: 50%; background: none !important; transform: translate(-50%, -50%); box-shadow: 0 0 2px rgba(0, 0, 0, 0.8), inset 0 0 2px rgba(0, 0, 0, 0.8) !important; }
.hm { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; }
.hm.on { animation: hm 0.18s ease-out forwards; }
.hm.kill.on { animation: hm 0.35s ease-out forwards; }
.hm i { position: absolute; width: 11px; height: 2.5px; background: #fff; box-shadow: 0 0 2px #000; }
.hm i:nth-child(1) { transform: translate(-17px, -12px) rotate(45deg); }
.hm i:nth-child(2) { transform: translate(6px, -12px) rotate(-45deg); }
.hm i:nth-child(3) { transform: translate(-17px, 10px) rotate(-45deg); }
.hm i:nth-child(4) { transform: translate(6px, 10px) rotate(45deg); }
.hm.head i { background: var(--gold); }
.hm.kill i { background: var(--red); width: 14px; }
.hm.armor i { background: #9ad0ff; }
@keyframes hm { 0% { opacity: 1; transform: scale(1.35); } 60% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1); } }
#popTotal { position: absolute; left: 50%; top: calc(50% + 34px); transform: translateX(-50%); font-weight: 800; font-size: 1.7em; color: var(--gold); opacity: 0; transition: opacity 0.3s; letter-spacing: 0.03em; }
#popTotal.on { opacity: 1; }
#popTotal.bump { animation: bump 0.2s ease-out; }
@keyframes bump { 0% { transform: translateX(-50%) scale(1.35); } 100% { transform: translateX(-50%) scale(1); } }
#popups { position: absolute; left: 50%; top: calc(50% + 72px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 1px; }
.pop { font-weight: 700; font-size: 0.92em; letter-spacing: 0.1em; color: var(--ink); animation: popin 0.22s ease-out; transition: opacity 0.4s, transform 0.4s; white-space: nowrap; }
.pop b { color: var(--gold); margin-right: 4px; }
.pop.big { font-size: 1.15em; color: var(--gold); }
.pop.small { font-size: 0.8em; color: var(--dim); }
.pop.out { opacity: 0; transform: translateY(-6px); }
@keyframes popin { from { opacity: 0; transform: scale(1.4); } }
.announce { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); text-align: center; opacity: 0; transition: opacity 0.3s; }
.announce.on { opacity: 1; animation: annin 0.4s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes annin { from { transform: translateX(-50%) scale(1.3); letter-spacing: 0.4em; } }
.a-title { font-size: 2.6em; font-weight: 800; letter-spacing: 0.14em; color: var(--ink); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); }
.a-sub { margin-top: 2px; font-size: 1.05em; letter-spacing: 0.22em; color: var(--dim); }
.announce.ann-red .a-title { color: var(--red); }
.announce.ann-gold .a-title { color: var(--gold); }
.announce.ann-streak .a-title { color: var(--amber); font-size: 2.1em; }
#dmgDirs, #nadeInd { position: absolute; left: 50%; top: 50%; }
.dmgdir { position: absolute; left: -90px; top: -150px; width: 180px; height: 300px; transform-origin: 90px 150px; }
.dmgdir::before { content: ""; position: absolute; left: 50%; top: 0; width: 120px; height: 34px; transform: translateX(-50%); border-radius: 50% 50% 0 0 / 100% 100% 0 0; border-top: 7px solid rgba(220, 30, 20, 0.95); filter: blur(1px); }
.nadeind { position: absolute; left: -24px; top: -130px; width: 48px; height: 260px; transform-origin: 24px 130px; }
.ni-arrow { position: absolute; left: 50%; top: 0; width: 0; height: 0; transform: translateX(-50%); border-left: 9px solid transparent; border-right: 9px solid transparent; border-bottom: 12px solid var(--ink); }
.ni-ico { position: absolute; left: 12px; top: 14px; width: 24px; height: 24px; color: var(--ink); }
.ni-ico svg { width: 24px; height: 24px; }
.nadeind.close .ni-arrow { border-bottom-color: var(--red); }
.nadeind.close .ni-ico { color: var(--red); animation: pulse 0.2s infinite alternate; }
#cook { position: absolute; left: 50%; top: calc(50% + 40px); transform: translateX(-50%); width: 150px; text-align: center; display: none; }
#cook.on { display: block; }
#cookTxt { font-size: 0.8em; letter-spacing: 0.2em; color: var(--amber); }
.cook-bar { height: 4px; background: rgba(255, 255, 255, 0.2); margin-top: 3px; }
#cookFill { height: 100%; background: var(--red); }
#prompt { position: absolute; left: 50%; top: 68%; transform: translateX(-50%); text-align: center; display: none; padding: 7px 16px; background: rgba(10, 9, 8, 0.6); }
#prompt.on { display: block; }
.pr-txt b { color: var(--gold); }
.pr-bar { height: 3px; margin-top: 5px; background: rgba(255, 255, 255, 0.2); }
.pr-fill { height: 100%; width: 0; background: var(--gold); }

#hpWrap { position: absolute; left: calc(22px * var(--hud)); bottom: calc(24px * var(--hud)); width: calc(250px * var(--hud)); }
.hp-label { font-size: 0.72em; letter-spacing: 0.25em; color: var(--dim); }
.hp-bar { height: 8px; margin-top: 3px; background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(239, 231, 212, 0.25); }
#hpFill { height: 100%; width: 100%; background: var(--ink); transition: width 0.15s, background 0.3s; }
#hpFill.mid { background: var(--amber); }
#hpFill.crit { background: var(--red); }
.hp-regen { font-size: 0.7em; letter-spacing: 0.2em; color: #7fd37a; margin-top: 3px; opacity: 0; transition: opacity 0.3s; }
#hpWrap.regen .hp-regen { opacity: 1; }

#rightStack { position: absolute; right: calc(22px * var(--hud)); bottom: calc(22px * var(--hud)); width: calc(290px * var(--hud)); display: flex; flex-direction: column; gap: 10px; }
#streaks { display: flex; flex-direction: column; gap: 4px; }
#streakPips { display: flex; gap: 3px; justify-content: flex-end; }
#streakPips i { width: 22px; height: 5px; background: rgba(239, 231, 212, 0.18); }
#streakPips i.mark { box-shadow: 0 -3px 0 rgba(255, 179, 71, 0.7); }
#streakPips i.on { background: var(--amber); }
#streakList { display: flex; flex-direction: column; gap: 3px; }
.streak { display: flex; align-items: center; gap: 8px; padding: 3px 8px; background: linear-gradient(270deg, rgba(10, 9, 8, 0.6), rgba(10, 9, 8, 0)); opacity: 0.5; position: relative; }
.streak.ready { opacity: 1; background: linear-gradient(270deg, rgba(255, 179, 71, 0.35), rgba(255, 179, 71, 0)); }
.streak.active { opacity: 1; background: linear-gradient(270deg, rgba(236, 74, 58, 0.5), rgba(236, 74, 58, 0)); }
.streak.flash { animation: stflash 0.5s 3; }
@keyframes stflash { 50% { background: rgba(255, 210, 74, 0.7); } }
.st-ico { width: 22px; height: 22px; color: var(--ink); margin-left: auto; order: 2; }
.st-ico svg { width: 22px; height: 22px; }
.st-info { text-align: right; order: 1; margin-left: auto; }
.st-name { font-size: 0.8em; font-weight: 700; letter-spacing: 0.08em; }
.st-req { font-size: 0.65em; color: var(--dim); letter-spacing: 0.15em; }
.st-key { order: 3; min-width: 20px; height: 20px; border: 1px solid rgba(239, 231, 212, 0.5); display: flex; align-items: center; justify-content: center; font-size: 0.75em; font-weight: 700; }
.streak.ready .st-key { background: var(--amber); color: #111; border-color: var(--amber); }
.st-count { position: absolute; left: 4px; font-size: 0.75em; color: var(--gold); font-weight: 700; }
#ammo { padding: 8px 12px 8px 14px; background: linear-gradient(270deg, rgba(10, 9, 8, 0.78), rgba(10, 9, 8, 0.1)); border-right: 3px solid var(--amber); text-align: right; }
.am-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
#wName { font-weight: 800; font-size: 1.05em; letter-spacing: 0.08em; }
#wClass { font-size: 0.68em; color: var(--dim); letter-spacing: 0.15em; }
.am-mid { display: flex; justify-content: flex-end; align-items: baseline; gap: 6px; margin-top: -2px; }
#wMag { font-size: 3em; font-weight: 800; line-height: 1; letter-spacing: -0.01em; }
#wMag.low { color: var(--red); }
.am-sep { color: var(--mute); font-size: 1.4em; }
#wRes { font-size: 1.4em; color: var(--dim); font-weight: 600; min-width: 2.2em; text-align: left; }
#wRes.low { color: var(--amber); }
.pips { display: flex; justify-content: flex-end; flex-wrap: wrap-reverse; gap: 2px; margin-top: 4px; }
.pips i { width: 4px; height: 12px; background: var(--ink); }
.pips i.e { background: rgba(239, 231, 212, 0.18); }
.pips.bar { display: block; height: 6px; background: rgba(239, 231, 212, 0.18); }
.pips.bar .barfill { height: 100%; background: var(--ink); margin-left: auto; }
.am-bot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; min-height: 18px; }
#nades { display: flex; gap: 3px; color: var(--ink); }
#nades svg { width: 16px; height: 16px; }
#nades .none { font-size: 0.65em; color: var(--mute); letter-spacing: 0.12em; }
.hint { font-size: 0.78em; letter-spacing: 0.18em; color: var(--amber); font-weight: 700; }
.hint.red { color: var(--red); animation: pulse 0.4s infinite alternate; }

#scope { position: absolute; inset: 0; display: none; }
#scope.on { display: block; }
#scopeInner { position: absolute; inset: -20px; background: radial-gradient(circle at center, transparent 0, transparent calc(min(46vh, 46vw) - 2px), rgba(0, 0, 0, 0.95) calc(min(46vh, 46vw)), #000 calc(min(46vh, 46vw) + 30px)); }
#scopeInner::after { content: ""; position: absolute; left: 50%; top: 50%; width: calc(min(92vh, 92vw)); height: calc(min(92vh, 92vw)); transform: translate(-50%, -50%); border-radius: 50%; box-shadow: inset 0 0 60px 20px rgba(0, 0, 0, 0.75); }
.sc-h, .sc-v { position: absolute; left: 50%; top: 50%; background: #000; }
.sc-h { width: calc(min(92vh, 92vw)); height: 2px; transform: translate(-50%, -50%); background: linear-gradient(90deg, #000 0 35%, rgba(0, 0, 0, 0.85) 35% 65%, #000 65%); }
.sc-h::before { content: ""; position: absolute; inset: -3px 0; background: linear-gradient(90deg, #000 0 20%, transparent 20% 80%, #000 80%); }
.sc-v { height: calc(min(92vh, 92vw)); width: 2px; transform: translate(-50%, -50%); }
.sc-v::before { content: ""; position: absolute; inset: 0 -3px; background: linear-gradient(180deg, transparent 0 60%, #000 60%); }
.sc-dot { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; transform: translate(-50%, -50%); background: #d02010; border-radius: 50%; box-shadow: 0 0 4px #ff3020; }
.sc-mils { position: absolute; left: 50%; top: 50%; width: 180px; height: 180px; transform: translate(-50%, -50%); background: repeating-linear-gradient(90deg, transparent 0 28px, rgba(0, 0, 0, 0.8) 28px 30px) center / 180px 8px no-repeat, repeating-linear-gradient(180deg, transparent 0 28px, rgba(0, 0, 0, 0.8) 28px 30px) center / 8px 180px no-repeat; }
#breathWrap { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); text-align: center; font-size: 0.75em; letter-spacing: 0.2em; color: var(--dim); }
.br-bar { width: 140px; height: 3px; background: rgba(255, 255, 255, 0.2); margin: 4px auto 0; }
#breath { height: 100%; background: var(--ink); }
#breathWrap.empty #breath { background: var(--red); }

#gunshipHud, #designatorHud { position: absolute; inset: 0; display: none; }
#hud.gunship #gunshipHud { display: block; }
#hud.designate #designatorHud { display: block; }
#hud.gunship #crosshair, #hud.gunship #rightStack, #hud.gunship #hpWrap, #hud.gunship #prompt { visibility: hidden; }
.gs-corners i, .ds-frame i { position: absolute; width: 60px; height: 60px; border: 3px solid rgba(255, 255, 255, 0.85); }
.gs-corners i:nth-child(1), .ds-frame i:nth-child(1) { left: 6%; top: 10%; border-right: 0; border-bottom: 0; }
.gs-corners i:nth-child(2), .ds-frame i:nth-child(2) { right: 6%; top: 10%; border-left: 0; border-bottom: 0; }
.gs-corners i:nth-child(3), .ds-frame i:nth-child(3) { left: 6%; bottom: 10%; border-right: 0; border-top: 0; }
.gs-corners i:nth-child(4), .ds-frame i:nth-child(4) { right: 6%; bottom: 10%; border-left: 0; border-top: 0; }
.gs-reticle { position: absolute; left: 50%; top: 50%; }
.gs-reticle i { position: absolute; background: #fff; box-shadow: 0 0 3px #000; }
.gs-reticle i:nth-child(1) { width: 70px; height: 2px; left: 16px; top: -1px; }
.gs-reticle i:nth-child(2) { width: 70px; height: 2px; left: -86px; top: -1px; }
.gs-reticle i:nth-child(3) { width: 2px; height: 70px; top: 16px; left: -1px; }
.gs-reticle i:nth-child(4) { width: 2px; height: 70px; top: -86px; left: -1px; }
.gs-box { position: absolute; width: 150px; height: 150px; left: -75px; top: -75px; border: 2px solid rgba(255, 255, 255, 0.5); }
.gs-info { position: absolute; left: 7%; bottom: 13%; font-weight: 700; letter-spacing: 0.15em; line-height: 1.6; }
.gs-wpn { position: relative; opacity: 0.5; }
.gs-wpn.ready { opacity: 1; }
.gs-wpn span { font-size: 0.75em; color: var(--dim); margin-left: 8px; }
#gsReload { position: absolute; left: 0; bottom: -2px; height: 2px; width: 0; background: #fff; }
#gsReload.go { animation: gsr 1.5s linear; }
@keyframes gsr { from { width: 0; } to { width: 100%; } }
.gs-time b { font-size: 1.4em; color: var(--amber); }
.ds-cross { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; transform: translate(-50%, -50%); border: 2px solid var(--red); border-radius: 50%; box-shadow: 0 0 8px rgba(236, 74, 58, 0.8); }
.ds-cross::before, .ds-cross::after { content: ""; position: absolute; background: var(--red); }
.ds-cross::before { left: 50%; top: -14px; bottom: -14px; width: 2px; transform: translateX(-50%); }
.ds-cross::after { top: 50%; left: -14px; right: -14px; height: 2px; transform: translateY(-50%); }
.ds-frame i { border-color: rgba(236, 74, 58, 0.8); }
.ds-txt { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); font-weight: 700; letter-spacing: 0.2em; color: var(--red); background: rgba(0, 0, 0, 0.5); padding: 6px 14px; white-space: nowrap; }
#hud.dead #crosshair, #hud.dead #popTotal, #hud.dead #popups, #hud.dead #announce, #hud.dead #prompt, #hud.dead #cook, #hud.dead #hitmarker, #hud.dead #nadeInd, #hud.dead #dmgDirs { visibility: hidden; }
#fps { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); font-size: 0.7em; color: var(--dim); display: none; }

/* ================= SCREENS ================= */
#screens { position: fixed; inset: 0; pointer-events: none; }
.screen { position: absolute; inset: 0; display: none; pointer-events: auto; background: linear-gradient(90deg, rgba(12, 11, 9, 0.92) 0%, rgba(12, 11, 9, 0.6) 40%, rgba(12, 11, 9, 0.1) 75%); animation: fadein 0.35s ease-out; overflow-y: auto; }
.screen.on { display: block; }
.screen.dim { background: rgba(12, 11, 9, 0.72); backdrop-filter: blur(3px); }
@keyframes fadein { from { opacity: 0; } }
#sBoot { background: radial-gradient(ellipse at 50% 60%, rgba(40, 32, 22, 0.6), rgba(12, 11, 9, 0.97)); display: none; align-items: center; justify-content: center; }
#sBoot.on { display: flex; }
.boot-inner { text-align: center; }
.logo { font-weight: 900; font-size: clamp(56px, 11vw, 132px); letter-spacing: 0.02em; line-height: 0.9; }
.logo.small { font-size: clamp(44px, 7vw, 88px); }
.logo-a { color: var(--ink); }
.logo-b { color: var(--amber); }
.logo-sub { letter-spacing: 0.72em; color: var(--dim); font-size: clamp(12px, 1.6vw, 18px); margin-top: 6px; padding-left: 0.3em; }
.boot-status { margin-top: 44px; color: var(--dim); letter-spacing: 0.2em; font-size: 14px; }
.boot-bar { width: 280px; height: 3px; margin: 12px auto 0; background: rgba(255, 255, 255, 0.12); }
#bootFill { height: 100%; width: 0; background: var(--amber); transition: width 0.3s; }
.press-start { margin-top: 38px; background: none; border: 0; color: var(--ink); font-size: 20px; letter-spacing: 0.45em; cursor: pointer; animation: pulse 0.9s infinite alternate; padding: 12px 20px; }
.press-start:hover { color: var(--amber); }

.menu-col { position: absolute; left: clamp(24px, 7vw, 120px); top: 50%; transform: translateY(-50%); width: min(460px, 86vw); }
.menu-list { display: flex; flex-direction: column; gap: 4px; margin-top: 42px; }
.mbtn { position: relative; display: block; text-align: left; background: none; border: 0; color: var(--ink); font-size: 26px; font-weight: 700; letter-spacing: 0.12em; padding: 10px 18px 10px 20px; cursor: pointer; transition: background 0.15s, color 0.15s, padding 0.15s; }
.mbtn small { display: block; font-size: 13px; font-weight: 500; letter-spacing: 0.14em; color: var(--mute); margin-top: 2px; }
.mbtn::before { content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px; background: var(--amber); transform: scaleY(0); transition: transform 0.15s; }
.mbtn:hover, .mbtn:focus-visible { background: linear-gradient(90deg, rgba(255, 179, 71, 0.18), rgba(255, 179, 71, 0)); color: #fff; padding-left: 28px; outline: none; }
.mbtn:hover::before, .mbtn:focus-visible::before { transform: scaleY(1); }
.mbtn:hover small { color: var(--dim); }
.mbtn.big { font-size: 38px; }
.mbtn.primary { background: var(--amber); color: #15120e; padding: 12px 26px; font-size: 20px; text-align: center; }
.mbtn.primary:hover { background: #ffc46a; color: #000; padding-left: 26px; }
.mbtn.primary::before { display: none; }
.mbtn.ghost { border: 1px solid var(--line); font-size: 18px; padding: 11px 20px; text-align: center; }
.mbtn.ghost:hover { padding-left: 20px; border-color: var(--amber); }
.profile { position: absolute; right: clamp(20px, 5vw, 80px); top: 50%; transform: translateY(-50%); width: 320px; padding: 20px; background: var(--panel); border-top: 3px solid var(--amber); }
.pf-rank { display: flex; gap: 14px; align-items: center; }
.badge { width: 54px; height: 54px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 900; color: #15120e; background: var(--amber); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.pf-name { font-weight: 800; letter-spacing: 0.1em; font-size: 20px; }
.pf-xpbar { width: 200px; height: 4px; background: rgba(255, 255, 255, 0.14); margin-top: 6px; }
.pf-xpbar div { height: 100%; background: var(--amber); width: 0; transition: width 1.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.pf-xpbar.big { width: 100%; height: 8px; }
.pf-xptxt { font-size: 12px; color: var(--mute); letter-spacing: 0.1em; margin-top: 4px; }
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.pf-grid span { display: block; font-size: 11px; letter-spacing: 0.16em; color: var(--mute); }
.pf-grid b { font-size: 22px; }
.pf-loadout { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; color: var(--dim); letter-spacing: 0.08em; }
.pf-loadout b { color: var(--ink); }
.menu-foot { position: absolute; left: clamp(24px, 7vw, 120px); bottom: 22px; font-size: 13px; color: var(--mute); letter-spacing: 0.1em; }
.menu-foot b { color: var(--dim); }

.panel { position: relative; margin: 3vh auto; width: min(760px, 94vw); padding: 26px 30px; background: var(--panel2); border-top: 3px solid var(--amber); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.panel.wide { width: min(1120px, 96vw); }
.panel.narrow { width: min(520px, 92vw); margin-top: 18vh; }
.panel h2 { margin: 0 0 6px; font-size: 38px; letter-spacing: 0.14em; font-weight: 800; }
.panel h3 { margin: 16px 0 8px; font-size: 13px; letter-spacing: 0.3em; color: var(--amber); font-weight: 700; }
.panel p { line-height: 1.5; color: var(--dim); font-size: 16px; font-family: system-ui, sans-serif; font-stretch: normal; }
.panel p.muted { color: var(--mute); font-size: 14px; }
.big-title { font-size: 64px; letter-spacing: 0.16em; margin: 0; font-weight: 900; }
.btnrow { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.btnrow.right { justify-content: flex-end; }
.btnrow.center { justify-content: center; }
.cards { display: grid; gap: 10px; }
.cards.two { grid-template-columns: repeat(2, 1fr); }
.cards.four { grid-template-columns: repeat(4, 1fr); }
.card { position: relative; text-align: left; padding: 14px 16px 16px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); color: var(--ink); cursor: pointer; transition: border-color 0.15s, background 0.15s, transform 0.15s; }
.card:hover { border-color: rgba(255, 179, 71, 0.6); transform: translateY(-2px); }
.card.sel { border-color: var(--amber); background: linear-gradient(180deg, rgba(255, 179, 71, 0.18), rgba(0, 0, 0, 0.35)); box-shadow: inset 0 0 0 1px var(--amber); }
.card .c-name { font-size: 22px; font-weight: 800; letter-spacing: 0.1em; }
.card .c-tag { font-size: 11px; letter-spacing: 0.2em; color: var(--amber); margin-top: 2px; }
.card .c-desc { font-size: 14px; color: var(--dim); margin-top: 8px; line-height: 1.4; font-family: system-ui, sans-serif; font-stretch: normal; }
.card .c-meta { font-size: 12px; color: var(--mute); margin-top: 10px; letter-spacing: 0.1em; }
.card .c-best { position: absolute; right: 12px; top: 12px; font-size: 11px; color: var(--mute); letter-spacing: 0.1em; }
.diff-pips { display: flex; gap: 3px; margin-top: 8px; }
.diff-pips i { width: 16px; height: 4px; background: rgba(255, 255, 255, 0.15); }
.diff-pips i.on { background: var(--red); }
.deploy-foot { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.deploy-lo { font-size: 15px; color: var(--dim); letter-spacing: 0.08em; }
.deploy-lo b { color: var(--ink); }
.lo-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 26px; }
.wcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wcards.two { grid-template-columns: repeat(2, 1fr); }
.wcard { padding: 10px 12px; }
.wcard .c-name { font-size: 18px; }
.wcard canvas { display: block; width: 100%; height: 46px; margin-top: 4px; }
.lo-detail { padding: 4px 0; }
.ld-name { font-size: 30px; font-weight: 800; letter-spacing: 0.1em; }
.ld-cls { color: var(--amber); letter-spacing: 0.2em; font-size: 12px; }
.ld-desc { color: var(--dim); font-size: 14px; margin: 8px 0 12px; font-family: system-ui, sans-serif; font-stretch: normal; line-height: 1.4; }
.stat { display: grid; grid-template-columns: 90px 1fr 34px; align-items: center; gap: 8px; margin: 5px 0; font-size: 13px; letter-spacing: 0.12em; color: var(--dim); }
.stat .sbar { height: 5px; background: rgba(255, 255, 255, 0.12); }
.stat .sbar div { height: 100%; background: var(--ink); transition: width 0.3s; }
.stat b { color: var(--ink); text-align: right; }
.ld-specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.ld-specs div { background: rgba(0, 0, 0, 0.3); padding: 6px 8px; }
.ld-specs span { display: block; font-size: 10px; letter-spacing: 0.18em; color: var(--mute); }
.ld-specs b { font-size: 16px; }
.lo-eq { display: flex; flex-direction: column; gap: 2px; font-size: 15px; letter-spacing: 0.06em; }
.lo-eq span { color: var(--mute); font-size: 13px; }
.lo-streaks { display: flex; flex-direction: column; gap: 6px; }
.lo-streak { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 4px 8px; background: rgba(0, 0, 0, 0.3); }
.lo-streak svg { width: 26px; height: 26px; color: var(--amber); }
.lo-streak b { display: block; letter-spacing: 0.08em; }
.lo-streak span { font-size: 12px; color: var(--mute); font-family: system-ui, sans-serif; font-stretch: normal; }
.lo-streak em { font-style: normal; font-weight: 800; color: var(--amber); font-size: 18px; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 26px; margin-top: 14px; }
.set { display: grid; grid-template-columns: 1fr 150px 44px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 15px; letter-spacing: 0.08em; }
.set input[type="range"] { width: 100%; accent-color: var(--amber); }
.set output { text-align: right; color: var(--amber); font-weight: 700; }
.seg { display: flex; grid-column: span 2; justify-content: flex-end; }
.seg button { background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); color: var(--dim); font-size: 13px; letter-spacing: 0.1em; padding: 5px 10px; cursor: pointer; }
.seg button.on { background: var(--amber); color: #15120e; border-color: var(--amber); }
.manual { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 14px; }
.keys div { display: flex; align-items: center; gap: 4px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.keys span { margin-left: auto; color: var(--dim); letter-spacing: 0.06em; }
.tips ul { margin: 0; padding-left: 18px; color: var(--dim); font-size: 14px; line-height: 1.55; font-family: system-ui, sans-serif; font-stretch: normal; }
.pause-info { margin-top: 10px; color: var(--dim); letter-spacing: 0.1em; font-size: 15px; line-height: 1.6; }
.pause-info b { color: var(--ink); }
.lock-msg { margin-top: 18px; color: var(--amber); font-size: 14px; letter-spacing: 0.1em; min-height: 20px; }

.screen.death { background: radial-gradient(ellipse at center, rgba(60, 0, 0, 0.1), rgba(40, 0, 0, 0.65)); }
.death-card { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); text-align: center; width: min(520px, 92vw); }
.dc-title { font-size: 52px; font-weight: 900; letter-spacing: 0.14em; color: var(--red); text-shadow: 0 3px 16px #000; }
.dc-killer { margin-top: 12px; font-size: 18px; letter-spacing: 0.12em; }
.dc-killer b { color: var(--red); }
.dc-killer .hp { display: block; margin-top: 4px; font-size: 13px; color: var(--dim); }
.dc-lives { margin-top: 12px; letter-spacing: 0.2em; color: var(--dim); font-size: 14px; }
.dc-count { margin-top: 16px; font-size: 20px; letter-spacing: 0.25em; }
.dc-count b { color: var(--amber); font-size: 30px; }
.dc-tip { margin-top: 16px; font-size: 14px; color: var(--mute); font-family: system-ui, sans-serif; font-stretch: normal; }

.end { text-align: center; }
.end-title { font-size: clamp(56px, 9vw, 104px); font-weight: 900; letter-spacing: 0.16em; line-height: 1; }
.end-title.win { color: var(--gold); }
.end-title.lose { color: var(--red); }
.end-sub { letter-spacing: 0.25em; color: var(--dim); margin-top: 6px; }
.end-best { display: none; margin: 14px auto 0; padding: 4px 14px; width: fit-content; background: var(--gold); color: #15120e; font-weight: 800; letter-spacing: 0.25em; animation: pulse 0.6s infinite alternate; }
.end-best.on { display: block; }
.end-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 22px 0; }
.end-stats div { background: rgba(0, 0, 0, 0.35); padding: 12px 6px; opacity: 0; animation: statin 0.35s ease-out forwards; }
.end-stats span { display: block; font-size: 11px; letter-spacing: 0.18em; color: var(--mute); }
.end-stats b { font-size: 28px; }
.end-stats .hl b { color: var(--gold); }
@keyframes statin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; } }
.end-xp { width: min(520px, 100%); margin: 0 auto; text-align: left; }
.end-rank { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-weight: 800; letter-spacing: 0.1em; font-size: 20px; }
.end-rank .up { color: var(--gold); font-size: 14px; letter-spacing: 0.2em; }

#rotate { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; text-align: center; background: #14120f; letter-spacing: 0.3em; font-weight: 700; }
.rot-ico { width: 50px; height: 80px; margin: 0 auto 20px; border: 3px solid var(--amber); border-radius: 8px; animation: rot 1.6s ease-in-out infinite; }
@keyframes rot { 50% { transform: rotate(90deg); } }

/* ================= TOUCH ================= */
#touch { position: fixed; inset: 0; display: none; pointer-events: none; z-index: 5; }
#touch.on.play { display: block; }
#tStick { position: absolute; left: 0; top: 25%; bottom: 0; width: 40%; pointer-events: auto; }
#tLook { position: absolute; right: 0; top: 18%; bottom: 0; width: 60%; pointer-events: auto; }
#tKnob { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); display: none; pointer-events: none; }
#tKnob.on { display: block; }
#tKnob i { position: absolute; left: 35px; top: 35px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.tb { position: absolute; pointer-events: auto; width: 58px; height: 58px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); background: rgba(0, 0, 0, 0.3); color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; }
.tb.down { background: rgba(255, 179, 71, 0.55); }
.t-fire { right: 7%; bottom: 30%; width: 84px; height: 84px; font-size: 15px; border-color: rgba(236, 74, 58, 0.8); }
.t-ads { right: calc(7% + 96px); bottom: 38%; }
.t-jump { right: 3%; bottom: 10%; }
.t-crouch { right: calc(3% + 70px); bottom: 6%; }
.t-reload { right: calc(7% + 100px); bottom: 20%; }
.t-nade { right: calc(3% + 140px); bottom: 5%; }
.t-swap { right: 3%; bottom: calc(30% + 96px); }
.t-knife { right: calc(7% + 160px); bottom: 30%; }
.t-use { right: calc(7% + 96px); bottom: calc(38% + 70px); }
.t-s1, .t-s2, .t-s3 { width: 44px; height: 44px; font-size: 11px; top: 64px; left: calc(50% - 76px); opacity: 0.45; }
.t-s2 { left: calc(50% - 22px); }
.t-s3 { left: calc(50% + 32px); }
.tb.ready { opacity: 1; border-color: var(--amber); color: var(--amber); box-shadow: 0 0 10px rgba(255, 179, 71, 0.6); }
.t-pause { top: 10px; left: 50%; margin-left: 150px; width: 40px; height: 40px; }
body.touch #streaks { display: none; }
body.touch #rightStack { top: calc(112px * var(--hud)); bottom: auto; width: calc(220px * var(--hud)); }
body.touch #ammo { padding: 4px 10px; }
body.touch #wMag { font-size: 2.2em; }
body.touch #killfeed { top: calc(250px * var(--hud)); }
body.touch #hpWrap { left: 50%; transform: translateX(-50%); bottom: 8px; width: 200px; }
body.touch #prompt { top: 58%; }
body.touch .announce { top: 30%; }

@media (max-width: 700px) { .cards.four { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px), (max-height: 520px) {
  .card { padding: 8px 10px 10px; }
  .card .c-name { font-size: 17px; }
  .card .c-desc { font-size: 12px; margin-top: 4px; }
  .card .c-meta { margin-top: 4px; }
  .panel h3 { margin: 10px 0 6px; }
  .lo-grid, .manual, .settings { grid-template-columns: 1fr; }
  .wcards { grid-template-columns: repeat(2, 1fr); }
  .end-stats { grid-template-columns: repeat(3, 1fr); }
  .profile { display: none; }
  .panel { padding: 18px; margin: 2vh auto; }
  .panel h2 { font-size: 28px; }
  .mbtn { font-size: 20px; padding: 7px 14px; }
  .mbtn.big { font-size: 28px; }
  .menu-list { margin-top: 18px; }
  .big-title { font-size: 44px; }
  .menu-foot { display: none; }
  #objective { top: calc(228px * var(--hud)); }
  .a-title { font-size: 1.9em; }
  .dc-title { font-size: 36px; }
  .death-card { top: 50%; }
}
@media (max-height: 520px) {
  body.touch #killfeed { display: none; }
  .end-stats { grid-template-columns: repeat(5, 1fr); margin: 10px 0; }
  .end-stats b { font-size: 20px; }
  .end-title { font-size: 48px; }
}
@media (orientation: portrait) and (pointer: coarse) {
  #rotate { display: flex; }
}
