/* ==========================================================================
   NEON BRAWL — tactical / outdoor theme
   Stencil headings (Black Ops One) + condensed body (Barlow Condensed),
   olive, sand and amber palette over the live arena backdrop.
   ========================================================================== */
:root {
  --ink: #12140d;
  --panel: rgba(24, 28, 18, 0.82);
  --panel-2: rgba(40, 46, 30, 0.9);
  --line: rgba(217, 198, 144, 0.22);
  --line-2: rgba(217, 198, 144, 0.4);
  --sand: #d9c690;
  --text: #f1ead6;
  --muted: #aaa68f;
  --amber: #e3a72f;
  --amber-2: #c98a1c;
  --olive: #5b6b2f;
  --olive-2: #7a8c3e;
  --steel: #4b5257;
  --red: #c0392b;
  --green: #6fcf4a;
  --head: 'Black Ops One', Impact, 'Arial Black', sans-serif;
  --body: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #7fb3e0; color: var(--text);
  font-family: var(--body); font-weight: 600; letter-spacing: .3px; user-select: none; -webkit-user-select: none; touch-action: none; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button, input, select { font-family: inherit; }
em { font-style: normal; color: var(--muted); font-weight: 500; }

.screen { position: fixed; inset: 0; display: none; z-index: 5; }
.screen.active { display: block; }
#menu, #room { overflow-y: auto; touch-action: pan-y; padding: 14px 16px 18px; }
#menu.active, #room.active { display: flex; flex-direction: column; align-items: center; }

/* readability veil over the live arena backdrop */
.menu-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 55%, rgba(10, 14, 8, 0) 30%, rgba(10, 14, 8, 0.45) 100%),
    linear-gradient(180deg, rgba(12, 16, 10, 0.55) 0%, rgba(12, 16, 10, 0.08) 26%, rgba(12, 16, 10, 0.1) 70%, rgba(12, 16, 10, 0.6) 100%); }

/* ---------- top bar ---------- */
.topbar { width: 100%; max-width: 1040px; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; }
.badge svg { width: clamp(44px, 6vw, 62px); height: auto; display: block; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.logo { font-family: var(--head); font-weight: 400; margin: 0; font-size: clamp(30px, 5.4vw, 56px); line-height: .95; letter-spacing: 1px;
  color: #f3ead2; text-shadow: 0 3px 0 #2b2f1c, 0 6px 18px rgba(0, 0, 0, .55); }
.logo.small { font-size: clamp(30px, 6vw, 50px); text-align: center; }
.tag { font-weight: 700; letter-spacing: 4px; color: var(--amber); font-size: clamp(11px, 1.6vw, 14px); margin-top: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8); }
.tag.center { text-align: center; }
.topbar-right { display: flex; gap: 8px; align-items: center; }
.pill { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 4px; background: var(--panel);
  border: 1px solid var(--line); font-size: 14px; letter-spacing: 1px; text-transform: uppercase; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: #888; }
.pill.on .dot { background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 1.6s infinite; }
.pill.off .dot { background: var(--red); }
@keyframes blink { 50% { opacity: .35; } }
.iconbtn { width: 40px; height: 40px; border-radius: 4px; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font-size: 17px; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: border-color .2s; }
.iconbtn:hover { border-color: var(--amber); }

/* ---------- cards with corner brackets ---------- */
.menu-grid { display: grid; grid-template-columns: minmax(280px, 400px) minmax(300px, 460px); gap: 16px; width: 100%; justify-content: center; align-items: start; }
.card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px 18px;
  backdrop-filter: blur(12px) saturate(1.1); -webkit-backdrop-filter: blur(12px) saturate(1.1); box-shadow: 0 18px 50px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06); }
.card::before, .card::after { content: ''; position: absolute; width: 18px; height: 18px; border: 3px solid var(--amber); pointer-events: none; }
.card::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.card::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.card-head .num { font-family: var(--head); font-size: 13px; color: var(--ink); background: var(--amber); padding: 2px 6px; border-radius: 2px; }
.card h2 { font-family: var(--head); font-weight: 400; margin: 0; font-size: 20px; letter-spacing: 2px; color: var(--sand); }

.preview-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 0 10px; border-radius: 4px;
  background: linear-gradient(180deg, rgba(150, 195, 225, .28), rgba(210, 225, 200, .12) 60%, rgba(0, 0, 0, 0) 100%); border: 1px solid rgba(217, 198, 144, .12); }
#preview { width: 200px; height: 200px; }
.face-btns { display: flex; gap: 8px; }
.field { display: block; margin: 12px 0 8px; }
.field span, .swatch-row > span, .row-lbl span { font-size: 13px; letter-spacing: 3px; color: var(--muted); font-weight: 700; }
input#nameInput, #codeInput, #chatInput { width: 100%; padding: 10px 12px; border-radius: 4px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .45);
  color: var(--text); font-size: 20px; font-weight: 700; letter-spacing: 1px; outline: none; transition: border-color .2s, box-shadow .2s; }
input#nameInput:focus, #codeInput:focus, #chatInput:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(227, 167, 47, .2); }
.seg { display: flex; background: rgba(0, 0, 0, .4); border: 1px solid var(--line); border-radius: 4px; padding: 3px; gap: 3px; margin: 8px 0; }
.seg button { flex: 1; border: 0; padding: 9px; border-radius: 3px; background: transparent; color: var(--muted); font-weight: 700; font-size: 16px; letter-spacing: 1.5px; cursor: pointer; transition: background .15s, color .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: linear-gradient(180deg, var(--olive-2), var(--olive)); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); }
.seg.small button { padding: 7px; font-size: 14px; }
.swatch-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.swatch-row > span { width: 72px; flex: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { width: 26px; height: 26px; border-radius: 3px; border: 2px solid rgba(0, 0, 0, .5); cursor: pointer; transition: transform .15s;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .25); }
.sw:hover { transform: translateY(-2px); }
.sw.on { border-color: var(--amber); transform: scale(1.12); box-shadow: 0 0 0 2px rgba(0, 0, 0, .6), inset 0 -4px 0 rgba(0, 0, 0, .2); }
.toggle { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 15px; color: var(--text); cursor: pointer; letter-spacing: 1px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--amber); }

/* ---------- buttons ---------- */
.btn { position: relative; border: 0; cursor: pointer; padding: 11px 16px; border-radius: 4px; font-weight: 700; font-size: 17px; letter-spacing: 1.5px;
  color: var(--text); background: rgba(255, 255, 255, .06); border: 1px solid var(--line); transition: transform .12s, filter .2s, box-shadow .2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-transform: uppercase; }
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { border-color: var(--amber); color: var(--amber); }
.amber { background: linear-gradient(180deg, #f3bf47, var(--amber) 45%, var(--amber-2)); color: #1d1809; border: 1px solid #8a5f12;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 4px 0 #7a5410, 0 10px 22px rgba(0, 0, 0, .35); }
.olive { background: linear-gradient(180deg, #8a9d47, var(--olive-2) 40%, var(--olive)); color: #f6f1dc; border: 1px solid #36401a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 0 #2e3716, 0 10px 22px rgba(0, 0, 0, .35); }
.steel { background: linear-gradient(180deg, #6c757b, #545c61 45%, #3f464a); color: #f1f1ec; border: 1px solid #2a2f32;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 3px 0 #23272a; }
.btn.big { width: 100%; padding: 12px 16px; margin: 8px 0 6px; clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  justify-content: flex-start; gap: 12px; text-align: left; }
.btn.big .ico { font-size: 24px; width: 36px; text-align: center; flex: none; }
.btn.big .lbl { font-family: var(--head); font-weight: 400; font-size: 23px; letter-spacing: 1.5px; line-height: 1.05; flex: 1; display: flex; flex-direction: column; }
.btn.big .lbl small { font-family: var(--body); font-weight: 700; font-size: 12px; letter-spacing: 2.5px; opacity: .75; margin-top: 2px; }
.btn.big .arrow { font-size: 34px; line-height: 1; opacity: .7; transition: transform .2s; }
.btn.big:hover .arrow { transform: translateX(4px); }
#againBtn, #endMenu { justify-content: center; }
.row2 { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.row2 > * { flex: 1; }
.join { display: flex; gap: 6px; }
#codeInput { text-transform: uppercase; letter-spacing: 5px; font-size: 18px; padding: 9px 10px; min-width: 0; font-family: var(--head); }
.divider { text-align: center; position: relative; margin: 18px 0 10px; color: var(--sand); font-size: 13px; letter-spacing: 3px; font-weight: 700; }
.divider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--line-2); }
.divider span { position: relative; background: #1f2418; padding: 0 10px; }
.bots-box { background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: 4px; padding: 12px; }
.row-lbl { display: flex; justify-content: space-between; align-items: baseline; }
.row-lbl b { font-family: var(--head); font-weight: 400; color: var(--amber); font-size: 24px; }
input[type=range] { width: 100%; accent-color: var(--amber); }

.controls-help { width: 100%; max-width: 940px; margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px;
  padding: 8px 12px; font-size: 14px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
kbd { display: inline-block; min-width: 20px; text-align: center; background: #2c3122; border: 1px solid #555b45; border-bottom-width: 3px; border-radius: 3px;
  padding: 0 5px; margin-right: 2px; font-family: inherit; color: var(--text); font-size: 12px; font-weight: 700; }

/* ---------- credit + about ---------- */
.credit { margin-top: 10px; font-size: 14px; letter-spacing: 1.5px; color: var(--text); text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
.credit b { color: var(--amber); }
.credit a, .facts a { color: var(--amber); text-decoration: none; border-bottom: 1px dashed currentColor; }
.about { position: fixed; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; padding: 16px;
  background: rgba(10, 12, 8, .6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); touch-action: pan-y; }
.about.show { display: flex; }
.about-card { width: min(520px, 100%); max-height: 92vh; overflow: auto; animation: pop .25s; }
.dossier { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.avatar-badge { width: 72px; height: 72px; flex: none; display: grid; place-items: center; font-family: var(--head); font-size: 40px; color: var(--ink);
  background: linear-gradient(180deg, #f3bf47, var(--amber-2)); border-radius: 4px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), 0 4px 0 #7a5410;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.dev-name { font-family: var(--head); font-size: 36px; line-height: 1; color: #f3ead2; letter-spacing: 2px; }
.dev-role { color: var(--amber); letter-spacing: 3px; font-size: 14px; font-weight: 800; margin-top: 2px; }
.bio { font-size: 17px; font-weight: 500; line-height: 1.4; color: var(--text); margin: 6px 0 12px; }
.facts { margin: 0 0 12px; border-top: 1px dashed var(--line); }
.facts div { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.facts dt { width: 96px; flex: none; color: var(--muted); font-size: 13px; letter-spacing: 2px; padding-top: 2px; }
.facts dd { margin: 0; font-size: 16px; word-break: break-word; }
a.btn { text-decoration: none; }
@media (max-width: 760px) { #aboutBtn { order: 3; } }

/* ---------- room ---------- */
.room-card { width: min(680px, 100%); margin-top: 4vh; display: flex; flex-direction: column; gap: 12px; }
.room-head { display: flex; justify-content: space-between; align-items: center; }
.muted { color: var(--muted); font-size: 14px; letter-spacing: 2px; }
.center { text-align: center; }
.code { font-family: var(--head); font-size: 44px; color: var(--amber); letter-spacing: 8px; text-shadow: 0 3px 0 #3d2b08; }
.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pcard { background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-left: 3px solid var(--olive-2); border-radius: 4px; padding: 8px 10px;
  display: flex; gap: 8px; align-items: center; animation: pop .3s; }
.pcard canvas { width: 44px; height: 44px; border-radius: 4px; flex: none; border: 1px solid rgba(0, 0, 0, .5); }
.pcard .n { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .b { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.pcard.host { border-left-color: var(--amber); }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } }
select { background: rgba(0, 0, 0, .45); color: var(--text); border: 1px solid var(--line-2); border-radius: 4px; padding: 8px; font-weight: 700; font-size: 15px; }

/* ---------- HUD ---------- */
#hud { pointer-events: none; }
#hud button, #hud input, #hud .stick, #hud .board, #hud .pause { pointer-events: auto; }
.hud-top { position: absolute; top: 10px; left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); display: flex; justify-content: space-between; align-items: flex-start; }
.hud-score, .hud-timer, .hp-box, .ammo-box, .kf, .chatlog div, #minimap {
  background: rgba(20, 24, 15, .72); border: 1px solid var(--line); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.hud-score, .hud-timer { border-radius: 4px; padding: 3px 14px; font-family: var(--head); font-size: 24px; }
.hud-score small { font-family: var(--body); font-size: 13px; color: var(--muted); letter-spacing: 2px; }
.hud-timer { color: var(--amber); position: absolute; left: 50%; transform: translateX(-50%); }
.hud-timer.low { color: #ff5a45; animation: blink .6s infinite; }
.hud-btns { display: flex; gap: 6px; }
.hud-btns .iconbtn { background: rgba(20, 24, 15, .72); }
.killfeed { position: absolute; top: 60px; right: calc(10px + var(--safe-r)); display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.kf { border-radius: 3px; padding: 3px 10px; font-size: 15px; animation: slidein .25s; border-left: 3px solid var(--red); white-space: nowrap; }
.kf.me { border-left-color: var(--amber); background: rgba(80, 60, 10, .8); }
.kf b { font-weight: 800; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.chatlog { position: absolute; left: calc(10px + var(--safe-l)); top: 160px; display: flex; flex-direction: column; gap: 3px; max-width: 45vw; }
.chatlog div { padding: 2px 8px; border-radius: 3px; font-size: 15px; animation: slidein .2s; }
#chatInput { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); width: min(420px, 80vw); display: none; pointer-events: auto; }
#minimap { position: absolute; top: 58px; left: calc(10px + var(--safe-l)); width: 180px; height: 90px; border-radius: 4px; }
.hud-bottom { position: absolute; bottom: calc(10px + var(--safe-b)); left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); display: flex; justify-content: space-between; align-items: flex-end; }
.hp-box { display: flex; gap: 10px; align-items: center; border-radius: 4px; padding: 8px 12px; border-left: 3px solid var(--amber); }
.hp-face canvas { width: 46px; height: 46px; border-radius: 4px; border: 2px solid var(--sand); }
.bars { width: 190px; display: flex; flex-direction: column; gap: 5px; }
.bar { position: relative; height: 16px; background: rgba(0, 0, 0, .5); border-radius: 2px; overflow: hidden; }
.bar.jet { height: 8px; }
.bar i { position: absolute; inset: 0; width: 100%; transition: width .15s; }
.bar.hp i { background: linear-gradient(90deg, #b8321f, #d9a12a 45%, #6fcf4a); }
.bar.jet i { background: linear-gradient(90deg, #c4561b, #f0a43a); }
.bar span { position: absolute; right: 6px; top: -1px; font-size: 14px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.bar.jet span { display: none; }
.ammo-box { text-align: right; border-radius: 4px; padding: 8px 14px; min-width: 140px; border-right: 3px solid var(--amber); }
.wname { font-family: var(--head); font-size: 15px; color: var(--sand); letter-spacing: 1px; }
.ammo { font-family: var(--head); font-size: 32px; line-height: 1; }
.ammo small { font-family: var(--body); font-size: 16px; color: var(--muted); }
.reload { color: var(--amber); font-size: 14px; height: 16px; letter-spacing: 1px; }
.center-msg { position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%); text-align: center; font-family: var(--head); font-size: clamp(24px, 5vw, 48px);
  color: #f3ead2; text-shadow: 0 3px 0 #2b2f1c, 0 0 24px rgba(0, 0, 0, .6); white-space: pre-line; letter-spacing: 2px; }
.center-msg small { display: block; font-family: var(--body); font-size: 19px; color: var(--sand); letter-spacing: 1px; }
.hitmarker { position: absolute; left: 50%; top: 50%; font-size: 28px; color: #fff; opacity: 0; transform: translate(-50%, -50%); text-shadow: 0 0 4px #000; }
.dmg-vignette { position: absolute; inset: 0; box-shadow: inset 0 0 160px 40px #9b0000; opacity: 0; transition: opacity .25s; }
.board { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, 92vw); max-height: 80vh; overflow: auto; display: none;
  background: var(--panel-2); backdrop-filter: blur(10px); border: 1px solid var(--line-2); border-radius: 6px; padding: 16px; }
.board.show { display: block; }
.board h2 { font-family: var(--head); font-weight: 400; margin: 0 0 10px; color: var(--sand); text-align: center; letter-spacing: 2px; }
.board table { width: 100%; border-collapse: collapse; font-size: 17px; }
.board td, .board th { padding: 6px; text-align: left; border-bottom: 1px solid rgba(217, 198, 144, .12); }
.board th { color: var(--muted); font-size: 13px; letter-spacing: 2px; }
.board tr.me td { color: var(--amber); }
.pause { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(10, 12, 8, .55); }
.pause.show { display: flex; }
.pause .card { display: flex; flex-direction: column; gap: 8px; width: min(320px, 90vw); }
.pause .btn.big { justify-content: center; }

/* ---------- touch controls ---------- */
#touch { display: none; position: absolute; inset: 0; pointer-events: none; }
body.touch #touch { display: block; }
body.touch .controls-help { display: none; }
.stick { position: absolute; bottom: calc(18px + var(--safe-b)); width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(rgba(20, 24, 15, .25), rgba(20, 24, 15, .55)); border: 2px solid rgba(217, 198, 144, .45); pointer-events: auto; touch-action: none; }
.stick.left { left: calc(22px + var(--safe-l)); }
.stick.right { right: calc(22px + var(--safe-r)); border-color: rgba(192, 57, 43, .7); }
.stick span { position: absolute; bottom: -18px; width: 100%; text-align: center; font-size: 11px; color: rgba(255, 255, 255, .8); letter-spacing: 2px; text-shadow: 0 1px 2px #000; }
.knob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f3ead2, #b9a46c); box-shadow: 0 4px 10px rgba(0, 0, 0, .5); opacity: .9; }
.stick.right .knob { background: radial-gradient(circle at 35% 35%, #f6b8a8, #c0392b); }
.tbtns { position: absolute; right: calc(176px + var(--safe-r)); bottom: calc(16px + var(--safe-b)); display: grid; grid-template-columns: repeat(3, auto); gap: 8px; align-items: center; justify-items: center; }
.tb { pointer-events: auto; width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(217, 198, 144, .55); background: rgba(20, 24, 15, .6); color: #fff; font-size: 26px; touch-action: none; }
.tb.small { width: 46px; height: 46px; font-size: 17px; font-weight: 800; }
.tb.jump { background: rgba(91, 107, 47, .7); border-color: #a9bb68; }
.tb.jet { background: rgba(201, 138, 28, .6); border-color: var(--amber); }
.tb.down { transform: scale(.9); filter: brightness(1.4); }
body.touch .hud-bottom { bottom: auto; top: 6px; left: calc(150px + var(--safe-l)); right: calc(150px + var(--safe-r)); pointer-events: none; }
body.touch .hud-top { left: calc(6px + var(--safe-l)); right: calc(6px + var(--safe-r)); top: 6px; }
body.touch .hud-timer { top: 52px; font-size: 17px; padding: 2px 10px; }
body.touch .hud-score { font-size: 19px; }
body.touch .hp-box { padding: 4px 8px; gap: 6px; }
body.touch .hp-face canvas { width: 30px; height: 30px; }
body.touch .bars { width: 110px; }
body.touch .bar { height: 12px; } body.touch .bar span { font-size: 11px; }
body.touch .ammo-box { padding: 3px 10px; min-width: 0; }
body.touch .ammo { font-size: 21px; } body.touch .wname { font-size: 12px; } body.touch .reload { height: 12px; font-size: 12px; }
body.touch .killfeed { top: 92px; right: calc(6px + var(--safe-r)); }
body.touch .kf { font-size: 12px; padding: 2px 7px; }
body.touch .kf:nth-child(n+4) { display: none; }
body.touch .chatlog { top: 92px; max-width: 40vw; }
body.touch .chatlog div { font-size: 12px; }
body.touch #minimap { display: none; }
body.touch .center-msg { top: 30%; }

/* ---------- end screen ---------- */
#end { background: rgba(14, 17, 10, .6); backdrop-filter: blur(3px); }
#end.active { display: flex; align-items: center; justify-content: center; }
.end-card { width: min(640px, 94vw); max-height: 94vh; overflow: auto; text-align: center; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin: 18px 0 10px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pod canvas { width: 70px; height: 70px; border-radius: 4px; border: 2px solid var(--sand); }
.pod .blk { width: 96px; border-radius: 3px 3px 0 0; font-family: var(--head); font-size: 28px; padding-top: 6px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35); }
.pod.p1 .blk { height: 110px; background: linear-gradient(#f3c24c, #b98316); color: #3a2a05; }
.pod.p2 .blk { height: 80px; background: linear-gradient(#d6d8d4, #8b8f8a); color: #222; }
.pod.p3 .blk { height: 60px; background: linear-gradient(#c98a5a, #7b4a28); color: #2a1406; }
.pod .n { font-size: 16px; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.standings { text-align: left; margin: 8px 0; font-size: 17px; }
.standings div { display: flex; justify-content: space-between; padding: 5px 10px; border-bottom: 1px solid rgba(217, 198, 144, .12); }
.standings div.me { color: var(--amber); }

#rotateHint { position: fixed; inset: auto 10px 10px 10px; z-index: 50; background: var(--panel-2); border: 1px solid var(--amber); border-radius: 4px; padding: 10px; text-align: center; display: none; }
#rotateHint button { margin-left: 8px; background: var(--amber); color: #1d1809; border: 0; border-radius: 3px; padding: 4px 12px; font-weight: 800; }
#toast { position: fixed; left: 50%; top: 18px; transform: translate(-50%, -300%); z-index: 60; background: var(--panel-2); border: 1px solid var(--amber);
  padding: 10px 18px; border-radius: 4px; transition: transform .3s; font-size: 17px; letter-spacing: .5px; }
#toast.show { transform: translate(-50%, 0); }

@media (max-width: 760px) {
  .menu-grid { grid-template-columns: 1fr; max-width: 460px; }
  .card.play { order: -1; }
  .play .row2 > * { flex-basis: 100%; }
  .swatch-row > span { width: 62px; letter-spacing: 2px; }
  .sw { width: 24px; height: 24px; }
  .topbar { flex-wrap: wrap; justify-content: center; }
  .tag { letter-spacing: 2.5px; }
}
@media (max-height: 500px) {
  .bars { width: 130px; }
  #minimap { display: none; }
  .stick { width: 120px; height: 120px; }
  .tb { width: 54px; height: 54px; font-size: 22px; }
  .tb.small { width: 40px; height: 40px; }
  .tbtns { right: calc(156px + var(--safe-r)); }
}
@media (orientation: portrait) {
  body.touch .hud-bottom { top: 50px; left: calc(6px + var(--safe-l)); right: calc(6px + var(--safe-r)); }
  body.touch .hud-timer { top: 6px; }
  body.touch .killfeed, body.touch .chatlog { top: 110px; }
}
