/* Wirecut — tactical HUD skin. Fonts: Anton (banners/wordmark) + Saira
   Condensed (HUD) — both SIL OFL, self-hosted latin subsets in ./fonts/. */
@font-face {
  font-family: 'Anton'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/anton-400.woff2) format('woff2');
}
@font-face {
  font-family: 'Saira Condensed'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/saira-cond-500.woff2) format('woff2');
}
@font-face {
  font-family: 'Saira Condensed'; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/saira-cond-700.woff2) format('woff2');
}

:root {
  --brk: #ff8c3a; --wrd: #4fd8ef;
  --sand: #d9b98a; --ink: #171310; --panel: rgba(16, 13, 10, 0.72);
  --line: rgba(255, 235, 200, 0.16); --txt: #f3e9d8; --dim: #b7a88e;
  --hud: 'Saira Condensed', 'Arial Narrow', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --disp: 'Anton', 'Arial Narrow', sans-serif;
  --sys: system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--ink); color: var(--txt);
  font-family: var(--sys); touch-action: none; overscroll-behavior: none; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font-family: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ------------------------------- screens ------------------------------ */
.scr { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: max(18px, env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
  background: radial-gradient(120% 90% at 50% 10%, rgba(64, 46, 26, 0.92), rgba(18, 14, 10, 0.97)), var(--ink);
  text-align: center; overflow-y: auto; }
.backlink { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 16px; color: var(--dim);
  text-decoration: none; font-family: var(--hud); font-weight: 700; letter-spacing: 0.04em; font-size: 15px; }
.backlink:hover { color: var(--txt); }
.backlink.static { position: static; margin-top: 10px; }
.game-title { font-family: var(--disp); font-weight: 400; font-size: clamp(52px, 11vw, 108px);
  letter-spacing: 0.04em; line-height: 1; color: var(--txt);
  text-shadow: 0 3px 0 rgba(0,0,0,0.5), 0 0 44px rgba(255, 140, 58, 0.25); }
.game-title .cut { color: var(--brk); position: relative; }
.game-title .cut::after { content: ''; position: absolute; left: -4%; right: -2%; top: 52%; height: 3px;
  background: var(--txt); transform: rotate(-7deg); box-shadow: 0 0 10px rgba(243, 233, 216, 0.8); }
.game-sub { font-family: var(--hud); font-weight: 500; color: var(--dim); font-size: clamp(15px, 2.4vw, 19px);
  letter-spacing: 0.14em; text-transform: uppercase; }
.map-note { font-family: var(--hud); color: var(--dim); font-size: 13px; letter-spacing: 0.1em; }

.modes { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 860px; }
.modecard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px;
  width: min(250px, 86vw); text-align: left; color: var(--txt); transition: border-color 0.15s, transform 0.15s; }
.modecard b { display: block; font-family: var(--hud); font-weight: 700; font-size: 19px; letter-spacing: 0.06em;
  text-transform: uppercase; }
.modecard span { display: block; margin-top: 4px; color: var(--dim); font-size: 12.5px; line-height: 1.45; }
.modecard.sel { border-color: var(--brk); box-shadow: 0 0 0 1px var(--brk), 0 6px 22px rgba(0,0,0,0.4); transform: translateY(-2px); }

.optrows { display: flex; flex-direction: column; gap: 8px; }
.optrow { display: flex; align-items: center; gap: 12px; justify-content: center; }
.optrow label { font-family: var(--hud); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  font-size: 13px; color: var(--dim); min-width: 72px; text-align: right; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { padding: 7px 14px; font-family: var(--hud); font-weight: 500; font-size: 14px; color: var(--dim);
  background: rgba(0,0,0,0.25); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.sel { background: rgba(255, 235, 200, 0.14); color: var(--txt); font-weight: 700; }
.seg button.side-brk.sel { color: var(--brk); } .seg button.side-wrd.sel { color: var(--wrd); }

.btn { display: block; min-width: 250px; margin: 2px 0; padding: 12px 26px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--panel); color: var(--txt); font-family: var(--hud); font-weight: 700;
  font-size: 17px; letter-spacing: 0.08em; text-transform: uppercase; }
.btn:hover { border-color: var(--brk); }
.btn.primary { background: linear-gradient(180deg, #e07b2c, #b85a17); border-color: #f7a35a; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4); box-shadow: 0 6px 20px rgba(224, 123, 44, 0.3); }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.btnrow .btn { min-width: 0; }
.foot { display: flex; gap: 18px; align-items: center; margin-top: 6px; }
.foot a { color: var(--dim); font-size: 13px; }
.langbtn { border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px; color: var(--dim); font-size: 14px; }
.langbtn:hover { color: var(--txt); }

h2 { font-family: var(--disp); font-weight: 400; font-size: clamp(30px, 6vw, 46px); letter-spacing: 0.05em; }
.helpbody { max-width: 640px; text-align: left; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px 22px; font-size: 14.5px; line-height: 1.65; color: var(--txt); }
.helpbody h4 { font-family: var(--hud); letter-spacing: 0.08em; text-transform: uppercase; color: var(--brk); margin: 10px 0 4px; }
.helpbody table { border-collapse: collapse; width: 100%; margin: 6px 0; }
.helpbody td { padding: 3px 8px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.helpbody td:first-child { font-family: var(--hud); font-weight: 700; white-space: nowrap; }
.setbody { display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px 22px; max-width: 520px; width: min(520px, 92vw); }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.setrow label { font-family: var(--hud); font-weight: 500; font-size: 15px; color: var(--txt); }
.setrow input[type=range] { width: 46%; accent-color: var(--brk); }
.setrow input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brk); }
#set-xcolor button { font-size: 16px; color: #3ce27b; }

/* ------------------------------- results ------------------------------ */
#res-title { font-size: clamp(40px, 9vw, 76px); }
#res-title.win { color: #3ce27b; text-shadow: 0 0 34px rgba(60, 226, 123, 0.35); }
#res-title.loss { color: #e0503a; } #res-title.draw { color: var(--sand); }
.res-score { font-family: var(--disp); font-size: clamp(26px, 5vw, 40px); letter-spacing: 0.1em; }
.c-brk { color: var(--brk); } .c-wrd { color: var(--wrd); }
.res-cols { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; max-width: 900px; }
.res-stats, .res-medals { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 18px; min-width: min(310px, 88vw); }
.res-stats table { border-collapse: collapse; font-family: var(--hud); font-size: 15px; width: 100%; }
.res-stats td { padding: 3px 10px; text-align: left; color: var(--dim); }
.res-stats td:last-child { text-align: right; color: var(--txt); font-weight: 700; }
.res-medals { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.res-medals .medal { font-family: var(--hud); font-size: 15px; }
.res-medals .medal b { color: #ffd23e; margin-right: 6px; }
.res-xp { width: min(420px, 88vw); }
.xp-rank { font-family: var(--hud); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; font-size: 15px; }
.xp-bar { height: 9px; border-radius: 6px; background: rgba(255,255,255,0.1); overflow: hidden; margin: 6px 0; }
.xp-bar div { height: 100%; width: 0; background: linear-gradient(90deg, var(--brk), #ffd23e); transition: width 1.2s ease; }
.xp-note { color: var(--dim); font-family: var(--hud); font-size: 13px; }

/* --------------------------------- HUD -------------------------------- */
#hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; font-family: var(--hud); }
#hud > * { pointer-events: none; }
#topbar { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: stretch; gap: 8px; }
.score { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 4px 12px; font-weight: 700; letter-spacing: 0.08em; }
.score b { font-size: 24px; font-variant-numeric: tabular-nums; }
.score span { font-size: 12px; opacity: 0.85; }
#timerbox { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 2px 14px; text-align: center; }
#timer { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.05em; }
#timer.fuse { color: #ff5a3a; animation: fusepulse 1s infinite; }
@keyframes fusepulse { 50% { opacity: 0.55; } }
#round-num { font-size: 10.5px; color: var(--dim); letter-spacing: 0.14em; }

#minimap { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 10px; width: 176px; height: 176px;
  border-radius: 10px; border: 1px solid var(--line); background: rgba(10, 8, 6, 0.78); }

#killfeed { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 12px; list-style: none;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
#killfeed li { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 3px 10px;
  font-size: 13.5px; font-weight: 500; letter-spacing: 0.03em; animation: kfin 0.15s ease-out; }
#killfeed li.me { border-color: var(--brk); }
@keyframes kfin { from { transform: translateX(12px); opacity: 0; } }

#radio { position: absolute; left: 12px; top: 210px; display: flex; flex-direction: column; gap: 3px; max-width: 260px; }
#radio div { background: rgba(10, 8, 6, 0.55); border-left: 2px solid var(--wrd); border-radius: 3px;
  padding: 2px 8px; font-size: 12px; color: var(--dim); }
#radio div.brk { border-left-color: var(--brk); }

#banner { position: absolute; top: 21%; left: 0; right: 0; text-align: center; font-family: var(--disp);
  font-size: clamp(30px, 7vw, 58px); letter-spacing: 0.1em; color: var(--txt);
  text-shadow: 0 3px 0 rgba(0,0,0,0.55), 0 0 40px rgba(255, 140, 58, 0.3); opacity: 0; transition: opacity 0.2s; }
#banner.on { opacity: 1; }
#banner.brk { color: var(--brk); } #banner.wrd { color: var(--wrd); } #banner.gold { color: #ffd23e; }
#subbanner { position: absolute; top: calc(21% + clamp(38px, 8vw, 66px)); left: 0; right: 0; text-align: center;
  font-size: clamp(14px, 2.6vw, 18px); font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--dim); opacity: 0; transition: opacity 0.2s; }
#subbanner.on { opacity: 1; }

#progresswrap { position: absolute; bottom: 27%; left: 50%; transform: translateX(-50%); width: min(320px, 70vw); text-align: center; }
#progress-label { font-size: 14px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 5px; }
.pbar { height: 8px; border-radius: 5px; background: rgba(0,0,0,0.55); border: 1px solid var(--line); overflow: hidden; }
#progress { height: 100%; width: 0; background: var(--brk); }
#interact-tip { position: absolute; bottom: 33%; left: 0; right: 0; text-align: center; font-size: 15px;
  font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--txt);
  text-shadow: 0 1px 3px rgba(0,0,0,0.8); }

#lowbar { position: absolute; left: 0; right: 0; bottom: max(10px, env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; align-items: flex-end; padding: 0 14px; gap: 10px; }
#vitals { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px;
  display: flex; align-items: center; gap: 10px; min-width: 150px; }
.vnum { display: flex; align-items: baseline; gap: 5px; }
.vnum > span:first-child { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.vlab { font-size: 11px; color: var(--dim); letter-spacing: 0.12em; }
.vbars { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 70px; }
.vbar { height: 6px; border-radius: 4px; background: rgba(255,255,255,0.09); overflow: hidden; }
.vbar div { height: 100%; width: 100%; background: #3ce27b; }
.vbar.armor div { background: var(--wrd); width: 0; }
#hp-num.low { color: #ff5a3a; }
#creditbox { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px;
  display: flex; align-items: baseline; gap: 6px; }
#cr-num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: #ffd23e; }
#buy-hint { font-size: 11px; color: var(--dim); letter-spacing: 0.1em; margin-left: 6px; }
#ammobox { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px;
  text-align: right; min-width: 130px; }
#wpn-name { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; color: var(--dim); }
#ammo-mag { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
#ammo-mag.warn { color: #ffb03a; } #ammo-mag.crit { color: #ff5a3a; }
.ammores { font-size: 14px; color: var(--dim); font-variant-numeric: tabular-nums; }
#nadebox { font-size: 13px; color: var(--dim); letter-spacing: 0.06em; margin-top: 2px; }
#nadebox b { color: var(--txt); }

/* crosshair — geometry set from settings via CSS vars */
#xhair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; --xc: #3ce27b; --xs: 7px; --xg: 4px; }
.xh { position: absolute; background: var(--xc); box-shadow: 0 0 2px rgba(0,0,0,0.9); }
.xh-t { left: -1px; bottom: var(--xg); width: 2px; height: var(--xs); }
.xh-b { left: -1px; top: var(--xg); width: 2px; height: var(--xs); }
.xh-l { top: -1px; right: var(--xg); height: 2px; width: var(--xs); }
.xh-r { top: -1px; left: var(--xg); height: 2px; width: var(--xs); }
.xh-dot { left: -1px; top: -1px; width: 2px; height: 2px; display: none; }
#xhair.dot .xh-dot { display: block; }
#xhair.spread { --xg: 9px; }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px; opacity: 0; }
#hitmarker::before, #hitmarker::after { content: ''; position: absolute; inset: 0; border: 2px solid #fff;
  border-radius: 2px; clip-path: polygon(0 0, 28% 0, 28% 28%, 0 28%, 0 100%, 28% 100%, 28% 72%, 0 72%,
    100% 0, 72% 0, 72% 28%, 100% 28%, 100% 100%, 72% 100%, 72% 72%, 100% 72%); }
#hitmarker.on { opacity: 1; transform: rotate(45deg) scale(1.05); transition: none; }
#hitmarker.head::before { border-color: #ffd23e; }
#hitmarker.fade { opacity: 0; transform: rotate(45deg) scale(0.8); transition: opacity 0.25s, transform 0.25s; }

#scopeoverlay { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, transparent 26%, rgba(5,4,3,0.97) 27%); }
.scopering { position: absolute; left: 50%; top: 50%; width: min(54vh, 54vw); height: min(54vh, 54vw);
  transform: translate(-50%, -50%); border: 2px solid rgba(240, 230, 210, 0.5); border-radius: 50%; }
.sc-h, .sc-v { position: absolute; left: 50%; top: 50%; background: rgba(20, 18, 14, 0.9); }
.sc-h { width: min(54vh, 54vw); height: 1.5px; transform: translate(-50%, -50%); }
.sc-v { height: min(54vh, 54vw); width: 1.5px; transform: translate(-50%, -50%); }

#dmgflash { position: absolute; inset: 0; background: radial-gradient(circle, transparent 55%, rgba(224, 60, 40, 0.5)); opacity: 0; }
#dmgflash.on { opacity: 1; } #dmgflash.fade { opacity: 0; transition: opacity 0.4s; }
#blindflash { position: absolute; inset: 0; background: #fff; opacity: 0; }
.dmgdir { position: absolute; opacity: 0; transition: opacity 0.5s; }
#dmg-l { left: 0; top: 20%; bottom: 20%; width: 26px; background: linear-gradient(90deg, rgba(224,60,40,0.75), transparent); }
#dmg-r { right: 0; top: 20%; bottom: 20%; width: 26px; background: linear-gradient(-90deg, rgba(224,60,40,0.75), transparent); }
#dmg-t { top: 0; left: 20%; right: 20%; height: 26px; background: linear-gradient(180deg, rgba(224,60,40,0.75), transparent); }
#dmg-b { bottom: 0; left: 20%; right: 20%; height: 26px; background: linear-gradient(0deg, rgba(224,60,40,0.75), transparent); }
.dmgdir.on { opacity: 1; transition: none; }

#btn-fs { position: fixed; right: 10px; top: max(8px, env(safe-area-inset-top)); z-index: 45; width: 38px; height: 38px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--dim); font-size: 19px;
  pointer-events: auto; }
#btn-fs:hover { color: var(--txt); }
#hud #btn-fs { top: max(52px, calc(env(safe-area-inset-top) + 44px)); right: 12px; }

/* ------------------------------ overlays ------------------------------ */
.overlay { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 30;
  background: rgba(14, 11, 8, 0.94); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px;
  max-height: 86vh; overflow-y: auto; font-family: var(--hud); box-shadow: 0 18px 60px rgba(0,0,0,0.6);
  width: min(680px, 94vw); }
.overlay h3 { font-family: var(--disp); font-weight: 400; letter-spacing: 0.08em; font-size: 26px; margin-bottom: 2px; }
.buysub { color: var(--dim); font-size: 14px; margin-bottom: 10px; }
.buysub span { font-variant-numeric: tabular-nums; }
#buygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.buycat { grid-column: 1 / -1; font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--brk); margin-top: 6px; }
.buyitem { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; text-align: left;
  background: rgba(255,255,255,0.03); color: var(--txt); }
.buyitem b { display: block; font-size: 15px; letter-spacing: 0.06em; }
.buyitem i { display: block; font-style: normal; font-size: 11.5px; color: var(--dim); margin-top: 1px; }
.buyitem .pr { float: right; color: #ffd23e; font-weight: 700; font-variant-numeric: tabular-nums; }
.buyitem:not(.cant):hover { border-color: var(--brk); }
.buyitem.cant { opacity: 0.4; cursor: default; }
.buyitem.owned { border-color: rgba(60, 226, 123, 0.5); }
#btn-buy-close { margin: 12px auto 0; min-width: 0; }
#kitgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }

#scoreboard { width: min(560px, 94vw); }
#sb-body table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
#sb-body th { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim);
  text-align: right; padding: 4px 8px; }
#sb-body th:first-child { text-align: left; }
#sb-body td { padding: 4px 8px; text-align: right; font-variant-numeric: tabular-nums; border-top: 1px solid var(--line); }
#sb-body td:first-child { text-align: left; font-weight: 500; }
#sb-body tr.me td { color: #ffd23e; }
#sb-body tr.dead td { opacity: 0.45; }
#sb-body .teamhead td { font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; border-top: 0; padding-top: 12px; }

/* -------------------------------- touch ------------------------------- */
#touchlayer { position: fixed; inset: 0; z-index: 22; pointer-events: auto; }
#stick { position: fixed; z-index: 24; width: 120px; height: 120px; border-radius: 50%; border: 1.5px solid var(--line);
  background: rgba(255,255,255,0.05); display: none; pointer-events: none; }
#stick.on { display: block; }
#stick-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px; border-radius: 50%;
  background: rgba(243, 233, 216, 0.25); border: 1.5px solid rgba(243, 233, 216, 0.4); }
/* thumb-arc button layout (Lanternfall pattern): each button placed by hand
   around the two thumbs' resting arcs; NEVER a stacked grid — in portrait it
   swallows the aim area, in landscape it climbs off-screen. */
#tbtns { position: fixed; inset: 0; z-index: 24; display: none; pointer-events: none; }
body.touch #tbtns { display: block; }
body.touch #buy-hint { display: none; }
.tbtn { position: absolute; display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%; border: 1.5px solid var(--line);
  background: rgba(16, 13, 10, 0.55); color: var(--txt); font-family: var(--hud); font-weight: 700;
  font-size: 13px; letter-spacing: 0.05em; pointer-events: auto; }
.tbtn:active, .tbtn.held { background: rgba(255, 140, 58, 0.3); }
/* right thumb: FIRE big in the corner sweet spot, AIM beside it, R / swap above */
#tb-fire { right: calc(22px + env(safe-area-inset-right)); bottom: calc(90px + env(safe-area-inset-bottom));
  width: 92px; height: 92px; background: rgba(122, 60, 20, 0.5); border-color: rgba(255, 160, 80, 0.6); }
#tb-fire svg { width: 46px; height: 46px; }
#tb-scope { right: calc(140px + env(safe-area-inset-right)); bottom: calc(110px + env(safe-area-inset-bottom)); width: 62px; height: 62px; }
#tb-swap { right: calc(118px + env(safe-area-inset-right)); bottom: calc(182px + env(safe-area-inset-bottom)); }
#tb-reload { right: calc(34px + env(safe-area-inset-right)); bottom: calc(210px + env(safe-area-inset-bottom)); }
/* left thumb: USE (hold to plant/defuse) + grenade above the stick zone, WALK by the corner */
#tb-use { left: 40px; bottom: calc(212px + env(safe-area-inset-bottom)); width: 64px; height: 64px; }
#tb-nade { left: 122px; bottom: calc(224px + env(safe-area-inset-bottom)); width: 54px; height: 54px; }
#tb-walk { left: 40px; bottom: calc(132px + env(safe-area-inset-bottom)); width: 54px; height: 54px; }
/* BUY only exists during freeze (nobody moves): center-bottom, easy to find */
#tb-buy { left: 50%; margin-left: -34px; bottom: calc(150px + env(safe-area-inset-bottom));
  width: 68px; height: 68px; border-color: rgba(255, 210, 62, 0.5); color: #ffd23e; display: none; }
body.touch.freeze #tb-buy { display: flex; }
/* landscape phones: keep the left cluster below the minimap */
@media (max-height: 480px) {
  #tb-use { bottom: calc(140px + env(safe-area-inset-bottom)); }
  #tb-nade { bottom: calc(152px + env(safe-area-inset-bottom)); }
}
/* left-handed: mirror every placement */
body.lefty #tb-fire { right: auto; left: calc(22px + env(safe-area-inset-left)); }
body.lefty #tb-scope { right: auto; left: calc(136px + env(safe-area-inset-left)); }
body.lefty #tb-swap { right: auto; left: calc(118px + env(safe-area-inset-left)); }
body.lefty #tb-reload { right: auto; left: calc(34px + env(safe-area-inset-left)); }
body.lefty #tb-use { left: auto; right: 40px; }
body.lefty #tb-nade { left: auto; right: 122px; }
body.lefty #tb-walk { left: auto; right: 40px; }

@media (max-width: 760px) {
  #minimap { width: 118px; height: 118px; }
  #radio { top: 150px; max-width: 190px; }
  .vnum > span:first-child { font-size: 24px; }
  #ammo-mag { font-size: 24px; }
  #lowbar { padding: 0 8px; }
  #creditbox { padding: 6px 10px; }
  .modecard { width: min(320px, 92vw); }
  .modecard span { font-size: 12px; }
}
@media (max-height: 460px) { /* landscape phones: tighten menus */
  .scr { gap: 7px; }
  .game-title { font-size: 44px; }
  .modes { gap: 6px; }
  .modecard { padding: 8px 12px; }
  .btn { padding: 9px 20px; }
}
