:root {
  --bg: #0d1014;
  --panel: rgba(14, 18, 24, 0.88);
  --line: rgba(255, 255, 255, 0.12);
  --text: #eef1f4;
  --muted: #9aa5b1;
  --accent: #f2b13a;
  --a: #5aa9ff;
  --b: #ff6a5a;
  --good: #59e08f;
  --bad: #ff5a5a;
  --hud: rgba(10, 13, 17, 0.55);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'Bahnschrift', 'DIN Alternate', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); user-select: none; -webkit-user-select: none; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
.ta { color: var(--a); }
.tb { color: var(--b); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; font-family: var(--mono); }
#radar { position: absolute; left: calc(16px + env(safe-area-inset-left)); top: 16px; width: 190px; height: 190px; border-radius: 50%; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5); }
#topbar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; }
#topbar .team { display: flex; align-items: center; gap: 10px; background: var(--hud); padding: 6px 12px; border-radius: 8px; }
#topbar .team b { font-size: 28px; line-height: 1; min-width: 26px; text-align: center; }
#topbar .mid { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--hud); padding: 6px 14px; border-radius: 8px; min-width: 92px; }
#timer { font-size: 24px; font-weight: 600; letter-spacing: 0.04em; }
#timer.freeze { color: var(--accent); }
#timer.low { color: var(--bad); }
.dots { display: flex; gap: 4px; }
.dots i { width: 8px; height: 16px; border-radius: 2px; background: currentColor; opacity: 0.95; }
.dots i.dead { opacity: 0.2; }
.dots i.me { outline: 1px solid #fff; outline-offset: 1px; }
#hostages { display: flex; gap: 5px; }
#hostages:empty { display: none; }
#hostages i { width: 10px; height: 10px; border-radius: 50%; background: #ffd23f; }
#hostages i.h-follow { background: #fff; box-shadow: 0 0 6px #ffd23f; }
#hostages i.h-rescued { background: var(--good); }
#hostages i.h-dead { background: #555; }
#feed { position: absolute; top: 14px; right: calc(16px + env(safe-area-inset-right)); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 14px; }
.feed-row { background: var(--hud); padding: 4px 10px; border-radius: 6px; white-space: nowrap; animation: pop 0.2s ease-out; }
.feed-row.mine { outline: 1px solid rgba(255, 80, 70, 0.8); }
.feed-row i { color: var(--muted); font-style: normal; margin: 0 6px; font-size: 12px; }
@keyframes pop { from { transform: translateX(20px); opacity: 0; } }

/* the crosshair: shape, colour, length, thickness and gap come from the settings */
.xhair { --gap: 4px; --chc: #6dff7a; --chl: 9px; --cht: 2px; position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.xhair i { position: absolute; background: var(--chc); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55); }
.xhair .l, .xhair .r { width: var(--chl); height: var(--cht); top: var(--cho, -1px); }
.xhair .u, .xhair .d { width: var(--cht); height: var(--chl); left: var(--cho, -1px); }
.xhair .l { right: var(--gap); }
.xhair .r { left: var(--gap); }
.xhair .u { bottom: var(--gap); }
.xhair .d { top: var(--gap); }
.xhair .c { width: var(--cht); height: var(--cht); left: var(--cho, -1px); top: var(--cho, -1px); }
.xhair .o { display: none; left: 0; top: 0; transform: translate(-50%, -50%); width: calc(var(--gap) * 2 + var(--chl)); height: calc(var(--gap) * 2 + var(--chl)); box-sizing: border-box; background: none; border: var(--cht) solid var(--chc); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(0, 0, 0, 0.55); }
.xhair[data-xh='circle'] .o { display: block; }
.xhair[data-xh='circle'] :is(.l, .r, .u, .d), .xhair[data-xh='dot'] :is(.l, .r, .u, .d), .xhair[data-xh='tee'] .u { display: none; }
.xhair[data-xh='dot'] .c { width: calc(var(--cht) * 2 + 2px); height: calc(var(--cht) * 2 + 2px); left: 0; top: 0; transform: translate(-50%, -50%); border-radius: 50%; }
.hitmark { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; }
.hitmark.show { opacity: 1; }
.hitmark i { position: absolute; width: 10px; height: 2px; background: #fff; box-shadow: 0 0 2px #000; }
.hitmark i:nth-child(1) { transform: translate(5px, 5px) rotate(45deg); }
.hitmark i:nth-child(2) { transform: translate(-15px, 5px) rotate(-45deg); }
.hitmark i:nth-child(3) { transform: translate(5px, -7px) rotate(-45deg); }
.hitmark i:nth-child(4) { transform: translate(-15px, -7px) rotate(45deg); }
.hitmark.head i { background: #ffcf3a; }
.hitmark.kill i { background: var(--bad); width: 14px; }
#hurt-layer .hurt { position: absolute; left: 50%; top: 50%; width: 260px; height: 260px; pointer-events: none; animation: fade 0.9s ease-out forwards; }
#hurt-layer .hurt::before { content: ''; position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 90px; height: 16px; border-radius: 50% 50% 0 0; background: radial-gradient(ellipse at 50% 100%, rgba(255, 40, 30, 0.95), rgba(255, 40, 30, 0) 70%); }
@keyframes fade { to { opacity: 0; } }
#vignette { position: absolute; inset: 0; opacity: 0; transition: opacity 0.25s; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(170, 0, 0, 0.7) 100%); }
#flash-white { position: absolute; inset: 0; background: #fff; }
#scope { position: absolute; inset: 0; }
#scope .hole { position: absolute; left: 50%; top: 50%; width: min(92vh, 92vw); height: min(92vh, 92vw); transform: translate(-50%, -50%); border-radius: 50%; box-shadow: 0 0 0 200vmax #000, inset 0 0 40px 10px rgba(0, 0, 0, 0.85); }
#scope .sh { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #000; }
#scope .sv { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: #000; }
#center-msg { position: absolute; left: 50%; top: 27%; transform: translateX(-50%); font-size: 22px; font-weight: 600; text-shadow: 0 2px 8px #000; opacity: 0; transition: opacity 0.2s; white-space: nowrap; }
#center-msg.show { opacity: 1; }
.banner { position: absolute; left: 50%; top: 16%; transform: translateX(-50%); padding: 14px 34px; border-radius: 10px; text-align: center; background: var(--panel); border-top: 3px solid; animation: drop 0.3s ease-out; }
.banner.good { border-color: var(--good); }
.banner.bad { border-color: var(--bad); }
.banner b { display: block; font-size: 30px; letter-spacing: 0.02em; }
.banner span { color: var(--muted); font-size: 15px; }
@keyframes drop { from { transform: translate(-50%, -20px); opacity: 0; } }
#prompt { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); background: var(--hud); padding: 6px 14px; border-radius: 6px; font-size: 15px; }
#spec { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); background: var(--hud); padding: 8px 18px; border-radius: 6px; font-size: 17px; }
#reloading { position: absolute; left: 50%; top: calc(50% + 34px); transform: translateX(-50%); width: 46px; height: 3px; background: var(--accent); border-radius: 2px; animation: rl 0.6s linear infinite alternate; }
@keyframes rl { from { opacity: 0.3; } }
#vitals { position: absolute; left: calc(16px + env(safe-area-inset-left)); bottom: 16px; display: flex; align-items: flex-end; gap: 10px; }
.vbox { display: flex; align-items: center; gap: 8px; background: var(--hud); padding: 6px 14px; border-radius: 8px; }
.vbox svg { width: 20px; height: 20px; fill: var(--text); opacity: 0.85; }
.vbox b { font-size: 34px; line-height: 1; min-width: 56px; }
.vbox.low b, .vbox.low svg { color: var(--bad); fill: var(--bad); }
#money { background: var(--hud); padding: 8px 14px; border-radius: 8px; font-size: 22px; color: var(--good); }
#weapon { position: absolute; right: calc(16px + env(safe-area-inset-right)); bottom: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#slots { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13px; }
#slots span { color: rgba(255, 255, 255, 0.45); background: rgba(10, 13, 17, 0.35); padding: 1px 8px; border-radius: 4px; }
#slots span.on { color: var(--accent); }
#wname { font-size: 14px; color: var(--muted); }
#ammo-box { background: var(--hud); padding: 6px 14px; border-radius: 8px; display: flex; align-items: baseline; gap: 6px; }
#ammo-box b { font-size: 38px; line-height: 1; }
#ammo-box span { font-size: 18px; color: var(--muted); }
#ammo-box.low b { color: var(--bad); }
#fps { position: absolute; left: 216px; top: 16px; font-size: 12px; color: var(--muted); }
#board { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(760px, calc(100vw - 32px)); background: var(--panel); padding: 16px; border-radius: 12px; font-family: var(--font); }
#board-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; padding: 2px 4px 14px; }
#board-head .bh-team { font-size: 20px; font-weight: 700; }
#board-head .bh-team.tb { text-align: right; }
#board-head .bh-score { font-family: var(--mono); font-size: 34px; font-weight: 700; letter-spacing: 1px; white-space: nowrap; }
#board-head .bh-score i { font-style: normal; color: var(--muted); padding: 0 8px; }
#board-head .bh-sub { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 13px; margin-top: -4px; }
#board .bd-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#board table { width: 100%; border-collapse: collapse; font-size: 14px; border-radius: 8px; overflow: hidden; }
#board table.bd-a { background: rgba(90, 169, 255, 0.08); border-top: 3px solid var(--a); }
#board table.bd-b { background: rgba(255, 106, 90, 0.08); border-top: 3px solid var(--b); }
#board caption { caption-side: top; font-size: 13px; font-weight: 600; text-align: left; padding: 0 2px 6px; color: var(--muted); }
#board th { color: var(--muted); font-weight: 500; text-align: right; padding: 7px 8px 5px; border-bottom: 1px solid var(--line); font-size: 12px; }
#board td { padding: 6px 8px; text-align: right; font-variant-numeric: tabular-nums; }
#board th:first-child, #board td:first-child { text-align: left; }
#board td:first-child { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#board td:first-child::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; background: currentColor; vertical-align: 1px; }
#board .bd-a td:first-child::before { color: var(--a); }
#board .bd-b td:first-child::before { color: var(--b); }
#board tr.dead td { opacity: 0.4; }
#board tr.dead td:first-child::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
#board tr.me td { color: var(--accent); font-weight: 600; }
#board tr.me { background: rgba(242, 177, 58, 0.1); }
@media (max-width: 620px) { #board .bd-teams { grid-template-columns: 1fr; } #board-head .bh-score { font-size: 26px; } }
#buy { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(620px, 94vw); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; pointer-events: auto; font-family: var(--font); }
.buy-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 10px; }
.buy-head b { font-size: 22px; }
#buy-money { color: var(--good); font-size: 20px; font-weight: 600; margin-left: auto; }
#buy-time { color: var(--muted); font-size: 14px; }
#buy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.buy-group { grid-column: 1 / -1; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 6px; }
.buy-item { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; text-align: left; }
.buy-item:hover { background: rgba(242, 177, 58, 0.15); border-color: var(--accent); }
.buy-item kbd { font-family: var(--mono); background: rgba(255, 255, 255, 0.1); border-radius: 4px; padding: 1px 7px; color: var(--accent); }
.buy-item .bi-name { flex: 1; }
.buy-item .bi-price { color: var(--good); font-family: var(--mono); }
.buy-item.poor { opacity: 0.45; }
.buy-item.poor .bi-price { color: var(--bad); }
.buy-item.have { border-color: rgba(89, 224, 143, 0.5); }
.buy-hint { color: var(--muted); font-size: 12px; margin-top: 10px; text-align: center; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; display: flex; align-items: safe center; justify-content: center; background: rgba(5, 7, 10, 0.55); z-index: 10; overflow-y: auto; padding: 10px 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 26px 30px; min-width: 300px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; backdrop-filter: blur(6px); }
.panel.wide { width: min(520px, 94vw); text-align: left; }
.panel h2 { margin: 0 0 6px; font-size: 26px; text-align: center; }
.btn { background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); border-radius: 10px; padding: 11px 22px; font-size: 16px; font-weight: 600; }
.btn:hover { background: rgba(255, 255, 255, 0.14); }
.btn.primary { background: var(--accent); color: #1b1305; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { font-size: 22px; padding: 15px 60px; border-radius: 12px; letter-spacing: 0.02em; }
.row { display: flex; gap: 10px; justify-content: center; }
#mo-title { font-size: 44px; margin: 0; }
#mo-title.good { color: var(--good); }
#mo-title.bad { color: var(--bad); }
#mo-score { font-family: var(--mono); font-size: 40px; }
#mo-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 2px 0 4px; }
#mo-stats div { background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 7px 6px 6px; display: flex; flex-direction: column; gap: 1px; }
#mo-stats b { font-family: var(--mono); font-size: 22px; color: var(--text); }
#mo-stats span { color: var(--muted); font-size: 12px; }
#mo-medals { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.medal { width: 128px; padding: 8px 6px; border-radius: 12px; background: linear-gradient(180deg, rgba(242, 177, 58, 0.22), rgba(242, 177, 58, 0.06)); border: 1px solid rgba(242, 177, 58, 0.55); display: flex; flex-direction: column; align-items: center; gap: 2px; animation: medal-in 0.45s cubic-bezier(.2, 1.4, .4, 1) both; }
.medal i { font-style: normal; font-size: 28px; line-height: 1.1; }
.medal b { font-size: 14px; color: #ffd98a; }
.medal small { color: var(--muted); font-size: 11px; line-height: 1.2; }
@keyframes medal-in { from { opacity: 0; transform: scale(0.4) rotate(-8deg); } to { opacity: 1; transform: none; } }
#mo-xp { display: flex; flex-direction: column; gap: 4px; text-align: left; margin-bottom: 4px; }
.xp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
#mo-rank { color: var(--accent); font-size: 16px; }
#mo-xpgain { font-family: var(--mono); color: var(--good); font-weight: 700; }
.xp-track { display: block; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.xp-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f2b13a, #ffe08a); border-radius: 4px; }
#mo-rankup { text-align: center; font-weight: 800; color: #ffe08a; font-size: 18px; animation: medal-in 0.5s cubic-bezier(.2, 1.4, .4, 1) both; }
#mo-xpparts, #mo-xpnext { color: var(--muted); font-size: 12px; }
.top-r { display: flex; align-items: center; gap: 12px; margin-left: auto; }
#rank-chip { display: flex; flex-direction: column; gap: 4px; min-width: 120px; padding: 6px 10px; border-radius: 10px; background: rgba(6, 8, 12, 0.6); border: 1px solid var(--line); }
#rank-chip b { font-size: 13px; color: var(--accent); white-space: nowrap; }
#rank-chip .xp-track { height: 5px; }
#match-over .panel { width: min(470px, 94vw); max-height: 96vh; overflow-y: auto; }
@media (max-height: 520px) {
  #mo-title { font-size: 30px; }
  #mo-score { font-size: 28px; }
  #mo-stats b { font-size: 17px; }
  #mo-stats div { padding: 4px; }
  .medal { width: 112px; padding: 4px; }
  .medal i { font-size: 20px; }
  .medal small { display: none; }
  .medal { flex-direction: row; width: auto; padding: 3px 10px; gap: 6px; }
  #match-over .panel { gap: 6px; }
  #mo-xpparts { display: none; }
  /* the buttons stay in view while the rest scrolls */
  #match-over .row { position: sticky; bottom: -16px; margin: 0 -18px -16px; padding: 8px 18px 12px; background: #0e1218; border-top: 1px solid var(--line); }
}
.field { display: grid; grid-template-columns: 1fr 1.3fr 48px; align-items: center; gap: 12px; font-size: 15px; }
.field.check { grid-template-columns: 22px 1fr; }
.field output { color: var(--accent); font-family: var(--mono); text-align: right; }
input[type='range'] { accent-color: var(--accent); width: 100%; }
#ctrl-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0; font-size: 15px; }
#ctrl-list dt { font-family: var(--mono); color: var(--accent); }
#ctrl-list dd { margin: 0; color: var(--text); }
#click-to-play { cursor: pointer; background: rgba(5, 7, 10, 0.35); }

/* ---------- menu ---------- */
.menu { background: none; flex-direction: column; justify-content: space-between; align-items: stretch; padding: 18px 22px; }
.menu-bg { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6, 8, 12, 0.92) 0%, rgba(6, 8, 12, 0.7) 38%, rgba(6, 8, 12, 0.05) 75%), linear-gradient(0deg, rgba(6, 8, 12, 0.7), rgba(6, 8, 12, 0) 30%); pointer-events: none; }
.menu-top, .menu-main, .menu-foot { position: relative; }
.menu-top { display: flex; justify-content: space-between; align-items: center; }
.back { color: var(--muted); text-decoration: none; font-size: 15px; }
.back:hover { color: var(--text); }
.langs { display: flex; gap: 4px; background: rgba(255, 255, 255, 0.06); border-radius: 8px; padding: 3px; }
.langs button { background: none; border: 0; padding: 5px 10px; border-radius: 6px; font-size: 13px; color: var(--muted); }
.langs button.on { background: rgba(255, 255, 255, 0.14); color: var(--text); }
.menu-main { width: min(560px, 100%); display: flex; flex-direction: column; gap: 16px; padding-left: clamp(0px, 4vw, 60px); }
.menu-main h1 { margin: 0; font-size: clamp(40px, 6vw, 68px); line-height: 0.95; letter-spacing: -0.01em; text-transform: uppercase; font-family: var(--mono); font-weight: 800; }
.menu-main h1 span { background: linear-gradient(180deg, #fff 30%, #f2c46a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { margin: -6px 0 6px; color: var(--muted); font-size: 17px; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.side { text-align: left; background: rgba(255, 255, 255, 0.05); border: 2px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.side b { font-size: 20px; }
.side span { color: var(--muted); font-size: 13px; line-height: 1.35; }
.side.on.ta { border-color: var(--a); background: rgba(90, 169, 255, 0.12); }
.side.on.tb { border-color: var(--b); background: rgba(255, 106, 90, 0.12); }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt label { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.seg button small { color: var(--muted); font-size: 12px; }
.seg.small button { text-align: center; padding: 8px; align-items: center; }
.seg button.on { border-color: var(--accent); background: rgba(242, 177, 58, 0.14); }
.play-row { justify-content: flex-start; flex-wrap: wrap; margin-top: 4px; }
/* playing with friends: a solid blue button that reads on any background */
.btn.online { font-size: 18px; padding: 15px 26px; background: linear-gradient(180deg, #3b7fd0, #2a62a8); color: #fff; border: 1px solid rgba(255, 255, 255, 0.18); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); display: inline-flex; align-items: center; gap: 10px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.btn.online:hover { background: linear-gradient(180deg, #4a8ee0, #3170ba); }
.btn.online svg { width: 22px; height: 22px; flex: none; fill: currentColor; }
.lobby { gap: 10px; }
.lobby h2 b { color: var(--accent); font-family: var(--mono); letter-spacing: 0.12em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lb-link { display: flex; gap: 8px; }
.lb-link input, .lb-name input { flex: 1; min-width: 0; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 9px 10px; font: inherit; font-size: 14px; }
.lb-name { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.lb-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lb-team { background: rgba(255, 255, 255, 0.04); border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; text-align: left; min-height: 150px; display: flex; flex-direction: column; gap: 6px; }
.lb-team:hover { border-color: currentColor; }
.lb-team ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; color: var(--text); font-size: 14px; }
.lb-team li small { color: var(--muted); margin-left: 6px; }
.lb-team li.bot { color: var(--muted); }
.lb-team li.me { color: var(--accent); }
#lb-opts { display: flex; flex-direction: column; gap: 6px; }
#lb-opts.locked { pointer-events: none; opacity: 0.6; }

#pc-only { color: var(--accent); margin: 0; }
#menu-note { margin: 0; padding: 10px 14px; border-radius: 10px; background: rgba(255, 90, 90, 0.15); border: 1px solid rgba(255, 90, 90, 0.5); color: #ffd0d0; }
.links { justify-content: flex-start; gap: 18px; }
.link { background: none; border: 0; color: var(--muted); padding: 0; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }
.menu-foot { color: var(--muted); font-size: 13px; }
.menu-foot a { color: var(--text); }

@media (max-width: 700px) {
  .menu { padding: 14px 16px; overflow-y: auto; }
  .menu-bg { background: rgba(6, 8, 12, 0.78); }
  .sides { grid-template-columns: 1fr; }
  .menu-main { padding-left: 0; }
  .btn.big { align-self: stretch; }
}

/* ---------- phone controls ---------- */
#touch { position: fixed; inset: 0; z-index: 5; pointer-events: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#touch[hidden] { display: none; }
#touch .tz { position: absolute; top: 0; bottom: 0; pointer-events: auto; touch-action: none; }
#touch .tz-move { left: 0; width: 42%; }
#touch .tz-look { left: 42%; right: 0; }
#touch .stick { position: absolute; width: 140px; height: 140px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); border: 2px solid rgba(255, 255, 255, 0.25); pointer-events: none; }
#touch .knob { position: absolute; left: 42px; top: 42px; width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); }
#touch .tb { position: absolute; pointer-events: auto; touch-action: none; width: 52px; height: 52px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.28); background: rgba(10, 13, 17, 0.38); color: rgba(255, 255, 255, 0.9); font: 700 20px/1 var(--mono); display: flex; align-items: center; justify-content: center; padding: 0; -webkit-tap-highlight-color: transparent; }
#touch .tb[hidden] { display: none; }
#touch .tb.on { background: rgba(242, 177, 58, 0.45); border-color: var(--accent); }
#touch .tb.lit { border-color: var(--accent); color: var(--accent); }
#touch .tb-fire { right: calc(24px + env(safe-area-inset-right)); bottom: 66px; width: 92px; height: 92px; background: rgba(255, 80, 70, 0.28); border-color: rgba(255, 120, 110, 0.6); }
#touch .tb-fire::after { content: ''; width: 26px; height: 26px; border: 3px solid rgba(255, 255, 255, 0.85); border-radius: 50%; box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.12); }
#touch .tb-jump { right: calc(44px + env(safe-area-inset-right)); bottom: 170px; }
#touch .tb-crouch { right: calc(130px + env(safe-area-inset-right)); bottom: 62px; }
#touch .tb-alt { right: calc(130px + env(safe-area-inset-right)); bottom: 128px; }
#touch .tb-reload { right: calc(190px + env(safe-area-inset-right)); bottom: 100px; width: 46px; height: 46px; font-size: 17px; }
#touch .tb-use { right: calc(190px + env(safe-area-inset-right)); bottom: 156px; width: 46px; height: 46px; font-size: 17px; }
#touch .tb-next { left: calc(18px + env(safe-area-inset-left)); bottom: 76px; width: 46px; height: 46px; }
#touch .tb-nade { left: calc(70px + env(safe-area-inset-left)); bottom: 76px; width: 46px; height: 46px; font-size: 16px; }
body.touch #slots { display: none; }
#touch .tb-pause { left: calc(14px + env(safe-area-inset-left)); top: 170px; width: 40px; height: 40px; font-size: 15px; }
#touch .tb-score { left: calc(60px + env(safe-area-inset-left)); top: 170px; width: 40px; height: 40px; font-size: 17px; }
#touch .tb-buy { left: calc(106px + env(safe-area-inset-left)); top: 170px; width: 40px; height: 40px; font-size: 17px; color: var(--good); }
#touch .tb-radio { left: calc(152px + env(safe-area-inset-left)); top: 170px; width: 40px; height: 40px; font-size: 16px; }
#touch .tb-ping { left: calc(198px + env(safe-area-inset-left)); top: 170px; width: 40px; height: 40px; font-size: 17px; color: #ffe14a; }
@media (min-height: 521px) { #touch .tb-pause, #touch .tb-score, #touch .tb-buy, #touch .tb-radio, #touch .tb-ping { top: 214px; } }
body.touch #view { touch-action: none; }
body.touch #prompt { top: auto; bottom: 34%; }
/* small landscape screens: a tighter HUD */
@media (max-height: 520px) {
  #radar { width: 150px !important; height: 150px !important; left: calc(10px + env(safe-area-inset-left)); top: 10px; }
  #board { padding: 10px; }
  #board table { font-size: 12px; }
  #board td { padding: 3px 6px; }
  #buy { padding: 10px; max-height: 92vh; overflow-y: auto; }
}
/* portrait phones: ask to turn the phone */
#rotate { display: none; }
@media (orientation: portrait) {
  body.touch.playing #rotate { display: flex; position: fixed; inset: 0; z-index: 50; background: #0d1014; color: var(--text); align-items: center; justify-content: center; text-align: center; font: 600 18px/1.4 var(--font); padding: 24px; }
  body.touch.playing #rotate b { display: block; font-size: 64px; margin-bottom: 12px; color: var(--accent); }
}
/* short landscape screens (phones turned sideways): a compact menu that scrolls */
@media (max-height: 520px) {
  .menu { padding: 10px 16px; overflow-y: auto; justify-content: flex-start; gap: 6px; }
  .menu-bg { background: rgba(6, 8, 12, 0.8); }
  .menu-main { width: min(780px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; padding-left: 0; align-items: start; }
  .menu-main > h1, .menu-main > .tagline, .menu-main > #menu-note, .menu-main > #pc-only { grid-column: 1 / -1; }
  .menu-main h1 { font-size: 30px; }
  .tagline { display: none; }
  .sides { grid-template-columns: 1fr; gap: 6px; }
  .side { padding: 8px 12px; }
  .side span, .seg button small { display: none; }
  .seg button { padding: 8px 10px; }
  .opts { gap: 6px; }
  .opt label { margin-bottom: 3px; }
  .play-row { grid-column: 2; margin: 0; }
  .play-row .btn { padding: 11px 18px; font-size: 16px; }
  .links { grid-column: 1; }
  .menu-foot { display: none; }
}
#buy-close { margin-left: auto; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); border-radius: 8px; width: 34px; height: 30px; color: var(--text); font-size: 15px; }

/* kill announcements */
#announce { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%); font: 900 44px/1 var(--mono); letter-spacing: 0.04em; color: #fff; text-shadow: 0 0 2px #000, 0 3px 0 rgba(0, 0, 0, 0.6), 0 0 24px rgba(255, 120, 40, 0.6); white-space: nowrap; pointer-events: none; opacity: 0; }
#announce.go { animation: ann 1.6s ease-out forwards; }
#announce.l2 { color: #ffe08a; }
#announce.l3 { color: #ffb347; font-size: 52px; }
#announce.l4 { color: #ff6a3d; font-size: 58px; }
#announce.l5 { color: #ff3b3b; font-size: 66px; }
@keyframes ann { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.2) rotate(-4deg); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(0.92) rotate(1deg); } 20% { transform: translate(-50%, -50%) scale(1.05); } 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -62%) scale(1); } }
@media (max-height: 520px) { #announce { font-size: 30px; top: 38%; } #announce.l3, #announce.l4, #announce.l5 { font-size: 38px; } }

#lowhp { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s; }
#lowhp.low { opacity: 1; animation: lowhp 1s ease-in-out infinite; }
#lowhp { background: radial-gradient(ellipse at center, rgba(170, 0, 0, 0) 55%, rgba(170, 0, 0, 0.55) 100%); will-change: opacity; }
@keyframes lowhp { 50% { opacity: 0.55; } }
#feed .feed-row.note { color: #bfe8c9; font-style: italic; }

.seg.modes { flex-wrap: wrap; }
.seg.modes button { flex: 1 1 30%; min-width: 0; }
#variant { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); padding: 3px 12px; border-radius: 8px; background: var(--hud); font: 700 15px/1.3 var(--mono); color: var(--accent); white-space: nowrap; }

/* 7 narrow screens: the kill feed goes under the score bar */
@media (max-width: 1180px) { #feed { top: 64px; max-width: 46vw; font-size: 12px; } }
/* no double-tap zoom on the buy menu and the buttons */
html { touch-action: manipulation; }
@media (max-height: 520px) { .panel { padding: 16px 18px; } .lb-team { min-height: 104px; } }

/* interface size (settings): every HUD block and the phone buttons */
:root { --ui: 1; }
#radar, #topbar, #vitals, #weapon, #feed, #prompt, #center-msg, #spec, #reloading, #variant, #touch .tb, #touch .stick { zoom: var(--ui); }
#announce { zoom: calc(0.4 + var(--ui) * 0.6); }
/* short phone screens: the round message sits under the score bar, not across the view */
@media (max-height: 420px) {
  #center-msg { top: 21%; font-size: 17px; }
  #prompt { font-size: 13px; padding: 4px 10px; }
  #touch .tz-move { width: 46%; }
}
#seg-fun { flex-wrap: wrap; } #seg-fun button { flex: 1 1 22%; }
#variant { top: auto; bottom: 18px; }
/* the menu reads on any part of the scene behind it: denser cards, a wider shade, outlined links */
.menu-bg { background: linear-gradient(90deg, rgba(6, 8, 12, 0.94) 0%, rgba(6, 8, 12, 0.82) 45%, rgba(6, 8, 12, 0.35) 70%, rgba(6, 8, 12, 0.05) 90%), linear-gradient(0deg, rgba(6, 8, 12, 0.75), rgba(6, 8, 12, 0) 35%); }
.side, .seg button { background: rgba(16, 20, 27, 0.78); }
.side.on.ta { background: rgba(30, 60, 100, 0.82); }
.side.on.tb { background: rgba(100, 34, 30, 0.82); }
.seg button.on { background: rgba(80, 60, 20, 0.85); }
.link, .menu-foot { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); }
.link { color: #c8d0d8; }
/* the shade stays put when a short window scrolls the menu */
.menu-bg { position: fixed; }
#seg-skin { flex-wrap: wrap; } #seg-skin button { flex: 1 1 18%; min-width: 70px; }
#smoke-veil { position: absolute; inset: 0; background: radial-gradient(ellipse at center, #9a9ea4 0%, #8a8e94 70%, #7c8086 100%); opacity: 0; pointer-events: none; }
#water-veil { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(40,150,190,0.55) 0%, rgba(10,70,110,0.85) 100%); opacity: 0; pointer-events: none; transition: opacity 0.15s; }
/* phones: the gun name sat under the fire button; the buy menu header stays while scrolling */
body.touch #wname { display: none; }
.buy-head { position: sticky; top: -10px; z-index: 2; background: inherit; padding-top: 6px; }
/* short screens: the buttons do not grow into each other, whatever the interface size */
@media (max-height: 420px) {
  #touch .tb, #touch .stick, #radar, #vitals, #weapon { zoom: min(var(--ui), 0.95); }
}
/* the round banner on short screens: smaller, and scaled with the interface */
#banner { zoom: var(--ui); }
@media (max-height: 520px) { #banner { top: 12%; padding: 6px 16px; } #banner b { font-size: 20px; } #banner span { font-size: 12px; } }
/* the play buttons stay in view when the menu has to scroll */
.play-row { position: sticky; bottom: -18px; z-index: 3; padding: 14px 0 28px; background: linear-gradient(to top, rgba(6, 8, 12, 0.96) 70%, rgba(6, 8, 12, 0)); }
.lobby .row { position: sticky; bottom: 0; z-index: 3; background: inherit; }
/* nine madness toggles: three to a row */
#seg-fun { display: grid; grid-template-columns: repeat(3, 1fr); }
#seg-fun button { flex: none; }
/* the language switch readable over the bright sky */
.langs { background: rgba(6, 8, 12, 0.55); }
.langs button { color: #e8ecf0; }
/* only the sensitivity that applies */
body.touch label:has(#s-sens), body:not(.touch) label:has(#s-tsens) { display: none; }

/* the narrowest phones: the header keeps the language buttons, the rank is on the screen after a match */
@media (max-width: 420px) { #rank-chip { display: none; } }

/* phones: "Гонка вооружений" and "Team deathmatch" fit their mode buttons */
@media (max-width: 760px), (max-height: 520px) { .seg.modes b { font-size: 14px; } }
@media (max-width: 420px) { .seg.modes b { font-size: 13px; } .seg.modes button { padding-left: 6px; padding-right: 6px; } }

/* a grenade landed close: an icon on a ring round the crosshair, brighter the closer it is */
#nade-warn { position: absolute; left: 50%; top: 50%; width: 230px; height: 230px; pointer-events: none; z-index: 2; }
#nade-warn b { position: absolute; left: 50%; top: 0; margin-top: -21px; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; font: 400 22px/1 system-ui, sans-serif; background: rgba(24, 14, 8, 0.78); border: 2px solid rgba(255, 112, 40, calc(0.45 + var(--k, 0) * 0.55)); box-shadow: 0 0 calc(6px + var(--k, 0) * 22px) rgba(255, 90, 30, 0.85); animation: nade-pulse 0.4s ease-in-out infinite alternate; }
@keyframes nade-pulse { to { filter: brightness(1.6); } }
@media (max-height: 520px) { #nade-warn { width: 170px; height: 170px; } #nade-warn b { width: 34px; height: 34px; margin-top: -17px; font-size: 18px; } }

/* long player names stay inside their team column */
.lb-team { min-width: 0; }
.lb-team li { overflow-wrap: anywhere; }

/* crosshair editor: a strip half light wall, half dark, to judge the colour on both */
.xh-prev { position: relative; height: 74px; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; background: linear-gradient(90deg, #c9bfa9 0 50%, #20242b 50% 100%); }
.xh-prev b { position: absolute; left: 10px; top: 6px; font-size: 13px; color: #2a2620; }
.xh-prev .xhair { --gap: 4px; }
.seg.swatch { gap: 6px; }
.seg.swatch button { flex: 1; min-width: 0; height: 30px; padding: 0; background: var(--sw) !important; border: 2px solid rgba(0, 0, 0, 0.5); }
.seg.swatch button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.field > .seg { grid-column: 2 / 4; }
.field > .seg.small button { min-width: 0; padding-left: 4px; padding-right: 4px; }

/* the freeze cam: colours washed out, a dark frame, and the killer's card */
body.freezecam #view { filter: saturate(0.3) contrast(1.15) brightness(0.92); }
body.freezecam #hud::before { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 160px 40px rgba(0, 0, 0, 0.75); animation: fc-in 0.25s ease-out; }
@keyframes fc-in { from { background: rgba(255, 255, 255, 0.55); } to { background: transparent; } }
#killcard { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); min-width: 250px; padding: 12px 22px 10px; border-radius: 12px; background: rgba(10, 12, 16, 0.82); border: 1px solid rgba(255, 255, 255, 0.12); border-top: 3px solid #e05a4a; display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; z-index: 3; animation: kc-in 0.3s cubic-bezier(0.2, 1.4, 0.4, 1); }
#killcard.ta { border-top-color: #4aa3ff; }
#killcard small { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: #aab; }
#killcard .kc-name { font-size: 26px; line-height: 1.1; }
#killcard.ta .kc-name { color: #7cc0ff; }
#killcard.tb .kc-name { color: #ff8a7a; }
#killcard .kc-gun { font-size: 14px; color: #dde; }
#killcard .kc-hp { position: relative; width: 100%; height: 16px; margin-top: 4px; border-radius: 8px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
#killcard .kc-hp i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #3fbf6a, #8fe06a); }
#killcard .kc-hp em { position: relative; display: block; text-align: center; font: 700 11px/16px var(--mono, monospace); font-style: normal; color: #fff; text-shadow: 0 1px 2px #000; }
#killcard .kc-skip { margin-top: 3px; font-size: 10px; letter-spacing: 0.06em; color: #889; text-transform: none; }
@keyframes kc-in { from { opacity: 0; transform: translate(-50%, 18px) scale(0.92); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@media (max-height: 520px) { #killcard { bottom: 92px; min-width: 200px; padding: 5px 14px 5px; gap: 1px; } #killcard small:first-child, #killcard:not(.cd) .kc-skip { display: none; } #killcard .kc-name { font-size: 18px; } #killcard .kc-gun { font-size: 12px; } #killcard .kc-hp { height: 13px; margin-top: 2px; } #killcard .kc-hp em { line-height: 13px; } }
#killcard.cd .kc-skip { color: #f2b13a; font-size: 12px; letter-spacing: 0.04em; }

/* bomb mode: the bomb in the top bar, and the planting / defusing bar */
.bomb-st { font-size: 15px; line-height: 1; filter: grayscale(0.4); opacity: 0.8; }
.bomb-st.mine { filter: none; opacity: 1; text-shadow: 0 0 8px rgba(255, 170, 40, 0.9); }
.bomb-st.planted { filter: none; opacity: 1; animation: bomb-blink 0.5s steps(2) infinite; }
.bomb-st.defused { filter: hue-rotate(90deg); opacity: 1; }
.bomb-st.exploded { opacity: 0.3; }
@keyframes bomb-blink { 50% { opacity: 0.35; } }
#bomb-bar { position: absolute; left: 50%; top: calc(50% + 46px); transform: translateX(-50%); width: 230px; text-align: center; pointer-events: none; zoom: var(--ui); }
#bomb-bar span { display: block; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: #ffd27a; text-shadow: 0 1px 3px #000; margin-bottom: 4px; }
#bomb-bar i { display: block; height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.25); overflow: hidden; }
#bomb-bar s { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f2b13a, #ff7a2a); }

/* radio calls in the feed, the team's marks on screen, the radio menu */
.feed-row.radio { background: rgba(14, 22, 16, 0.78); color: #d8f0c8; }
#pings { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ping { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.ping b { position: absolute; left: -9px; top: -22px; width: 18px; height: 18px; transform: rotate(45deg); background: #ffe14a; border: 2px solid rgba(0, 0, 0, 0.7); box-shadow: 0 0 10px rgba(255, 225, 74, 0.7); animation: ping-in 0.35s cubic-bezier(0.2, 1.6, 0.4, 1); }
.ping span { position: absolute; left: 0; top: 2px; transform: translateX(-50%); white-space: nowrap; font: 700 12px/1 var(--mono); color: #fff; text-shadow: 0 1px 3px #000, 0 0 2px #000; }
.ping.enemy b { background: #ff3b3b; box-shadow: 0 0 12px rgba(255, 59, 59, 0.8); }
.ping.enemy span { color: #ffb0a8; }
.ping.mine b { border-color: #fff; }
@keyframes ping-in { from { transform: rotate(45deg) scale(2.2); opacity: 0; } to { transform: rotate(45deg) scale(1); opacity: 1; } }
#radio { position: fixed; left: 24px; top: 50%; transform: translateY(-50%); min-width: 220px; padding: 10px; border-radius: 12px; background: rgba(10, 13, 17, 0.88); border: 1px solid rgba(255, 255, 255, 0.14); display: flex; flex-direction: column; gap: 4px; pointer-events: auto; z-index: 30; zoom: var(--ui); }
#radio b { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: #9ab; padding: 0 6px 4px; }
#radio button { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, 0.05); color: #eef; font: 600 15px/1.1 system-ui, sans-serif; text-align: left; cursor: pointer; }
#radio button:hover, #radio button:active { background: rgba(242, 177, 58, 0.22); }
#radio kbd { min-width: 18px; text-align: center; font: 700 12px/18px var(--mono); color: #f2b13a; border: 1px solid rgba(242, 177, 58, 0.5); border-radius: 4px; }
body.touch #radio kbd { display: none; }
body.touch #radio button { padding: 9px 12px; }
/* on a phone: in the middle, two columns, big enough for a thumb */
body.touch #radio { left: 50%; transform: translate(-50%, -50%); display: grid; grid-template-columns: 1fr 1fr; gap: 6px; min-width: 300px; }
body.touch #radio b { grid-column: 1 / 3; text-align: center; }
body.touch #radio button { justify-content: center; text-align: center; min-height: 40px; }
