/* Google font "Chakra Petch", aliased to the family name Pr1sonCS */
@font-face { font-family: 'Pr1sonCS'; font-style: normal; font-weight: 500; font-display: swap; src: url(https://fonts.gstatic.com/s/chakrapetch/v13/cIflMapbsEk7TDLdtEz1BwkebIl1R5_F.woff2) format('woff2'); }
@font-face { font-family: 'Pr1sonCS'; font-style: normal; font-weight: 600; font-display: swap; src: url(https://fonts.gstatic.com/s/chakrapetch/v13/cIflMapbsEk7TDLdtEz1BwkeQI51R5_F.woff2) format('woff2'); }
@font-face { font-family: 'Pr1sonCS'; font-style: normal; font-weight: 700; font-display: swap; src: url(https://fonts.gstatic.com/s/chakrapetch/v13/cIflMapbsEk7TDLdtEz1BwkeJI91R5_F.woff2) format('woff2'); }
/* Studio wordmark font (boot splash) */
@font-face { font-family: 'GoogleSans'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/GoogleSans-400.woff2) format('woff2'); }
@font-face { font-family: 'GoogleSans'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/GoogleSans-500.woff2) format('woff2'); }

:root {
  --sand: #e4f5ff;                 /* white-cyan primary text */
  --ink: #04121b;                  /* dark ink on accent */
  --accent: #35d6ff;               /* cyan */
  --red: #ff5a6a;
  --panel: rgba(8, 20, 28, 0.86);
  --line: rgba(170, 226, 255, 0.22);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #030a10; color: var(--sand);
  font: 15px/1.4 'Pr1sonCS', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; }
.hidden { display: none !important; }

/* ------------------------------------------------------------ boot splash */
#splash { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #05070a; cursor: pointer; transition: opacity .45s ease; }
#splash.gone { opacity: 0; pointer-events: none; }
#splash .sp-inner { display: flex; align-items: center; gap: .5em; animation: spIn .9s ease both; }
#splash .sp-mark { width: 1.35em; height: 1.35em; flex: none; color: #F3EFEA; }
#splash .sp-studio { font-family: 'GoogleSans', 'Google Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-weight: 400; letter-spacing: .06em; font-size: clamp(17px, 2.6vw, 26px); color: #F3EFEA; }
#splash .sp-presents { font-family: 'GoogleSans', system-ui, sans-serif; font-weight: 400; letter-spacing: .5em; text-indent: .5em; text-transform: uppercase; font-size: clamp(9px, 1.1vw, 11px); color: rgba(243, 239, 234, .45); opacity: 0; animation: spPre .9s ease .5s both; }
@keyframes spIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes spPre { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------ first-run setup */
#setup { position: fixed; inset: 0; z-index: 190; display: grid; place-items: center; padding: 22px; background: rgba(3, 9, 14, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
body.setup-active #menu { visibility: hidden; }   /* reveal the live scene behind so brightness is visible */
#setup .st-card { width: min(900px, 95vw); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px 24px 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
#setup .st-step h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: .02em; }
#setup .st-step p { margin: 0 0 14px; color: rgba(228, 245, 255, .72); font-size: 14.5px; line-height: 1.5; }
#setup b { color: var(--sand); }
#setup .st-bright { display: flex; gap: 20px; align-items: stretch; }
#setup .st-info { flex: 0 0 44%; display: flex; flex-direction: column; }
#setup .st-info p { flex: 1; }
#setup .st-ref { flex: 1; min-height: min(40vh, 280px); border-radius: 12px; border: 1px solid var(--line); background: #070c11; display: grid; place-items: center; overflow: hidden; }
#setup .st-mark { font-weight: 900; letter-spacing: .26em; text-transform: uppercase; text-align: center; line-height: 1.5; font-size: clamp(16px, 3vw, 30px); color: #e4f5ff; opacity: calc(var(--exp, 1) - 0.6); transition: opacity .05s linear; }
#setup .st-range { width: 100%; height: 26px; accent-color: var(--accent); }
#setup .st-val { margin-top: 4px; font-size: 12px; letter-spacing: .12em; color: var(--accent); font-variant-numeric: tabular-nums; }
#setup .st-bar { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
#setup .st-compiling { margin-right: auto; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); opacity: .9; transition: opacity .4s ease; }
#setup .st-compiling.done { opacity: 0; }
@media (max-width: 640px) { #setup .st-bright { flex-direction: column; } #setup .st-ref { min-height: 32vh; } }
button {
  font: inherit; font-weight: 600; letter-spacing: .04em; color: var(--sand); cursor: pointer;
  background: rgba(226, 246, 255, 0.08); border: 1px solid var(--line); border-radius: 8px; padding: 11px 16px;
  transition: background .15s, border-color .15s, transform .05s;
}
button:hover { background: rgba(226, 246, 255, 0.16); border-color: rgba(120, 225, 255, 0.5); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); color: var(--ink); border-color: var(--accent); }
button.primary:hover { background: #63e0ff; }
button.ghost { background: transparent; }
button.danger { color: #ff8a95; }
input {
  font: inherit; color: var(--sand); background: rgba(0,0,0,.35); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; outline: none; user-select: text; -webkit-user-select: text;
}
input:focus { border-color: var(--accent); }

/* ---------------- screens ---------------- */
.screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 20;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.25), rgba(0,0,0,.7));
  padding: calc(12px + var(--safe-t)) calc(12px + var(--safe-r)) calc(12px + var(--safe-b)) calc(12px + var(--safe-l));
  overflow-y: auto;
}
#menu { background: linear-gradient(180deg, rgba(10,8,5,.15), rgba(10,8,5,.75)); }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px;
  width: min(380px, 100%); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 20px 60px rgba(0,0,0,.5); max-height: 100%; overflow-y: auto; margin: auto;
}
.panel.wide { width: min(720px, 100%); }
h1 { margin: 0; font-size: 44px; letter-spacing: .12em; font-weight: 900; line-height: 1; }
h1 span { color: var(--accent); }
h2 { margin: 0 0 12px; letter-spacing: .1em; font-size: 22px; }
h3 { margin: 14px 0 6px; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.tag { margin: 6px 0 18px; opacity: .75; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .9; margin-bottom: 14px; }
.btns { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.join-row { display: flex; gap: 8px; }
.join-row input { flex: 1; text-transform: uppercase; letter-spacing: .3em; text-align: center; font-weight: 700; min-width: 0; }
.row2 { display: flex; gap: 8px; }
.row2 button { flex: 1; }
.muted { opacity: .65; }
.small { font-size: 12px; }
.error { color: var(--red); min-height: 1.2em; margin: 10px 0 0; }
.tip { font-size: 13px; opacity: .8; margin: 8px 0 0; }
#load { margin-top: 14px; height: 18px; position: relative; background: rgba(0,0,0,.35); border-radius: 9px; overflow: hidden; font-size: 11px; }
#load-bar { position: absolute; inset: 0 auto 0 0; width: 0;   background: rgba(53,214,255,.5); transition: width .2s; }
#load-text { position: relative; display: block; text-align: center; line-height: 18px; opacity: .85; }
#room-code { font-size: 54px; font-weight: 900; letter-spacing: .25em; text-align: center; color: var(--accent); margin: 4px 0 10px; }
.share { display: flex; gap: 8px; margin-bottom: 10px; }
.share input { flex: 1; min-width: 0; font-size: 13px; }
#btn-share { width: 100%; margin-bottom: 8px; }
.waiting { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 14px 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .2; transform: scale(.7); } }
#lobby .panel > button.ghost { width: 100%; }
#over-title { font-size: 40px; text-align: center; letter-spacing: .15em; }
#over-title.win { color: var(--accent); }
#over-title.lose { color: var(--red); }
#over-score { text-align: center; font-size: 28px; font-weight: 800; margin-bottom: 10px; }
#over-stats { width: 100%; border-collapse: collapse; margin-bottom: 8px; font-size: 14px; }
#over-stats td { padding: 5px 4px; border-bottom: 1px solid var(--line); }
#over-stats td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
#over-stats th { text-align: right; font-size: 12px; opacity: .7; padding: 4px; }
#over-stats th:first-child { text-align: left; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .cols { grid-template-columns: 1fr; } }
table.keys { border-collapse: collapse; width: 100%; font-size: 14px; }
table.keys td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.keys td:first-child { font-weight: 700; white-space: nowrap; color: var(--accent); width: 1%; }
ul.tips { margin: 0; padding-left: 18px; font-size: 14px; }
ul.tips li { margin: 4px 0; }

/* settings */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; margin-bottom: 8px; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }
.set { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.set .lbl { display: flex; justify-content: space-between; opacity: .9; }
.set .lbl b { color: var(--accent); font-variant-numeric: tabular-nums; }
.set input[type=range] { width: 100%; accent-color: var(--accent); padding: 0; background: none; border: none; height: 28px; }
.set select {
  font: inherit; color: var(--sand); background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 8px; padding: 8px;
}
.set.check { flex-direction: row; align-items: center; justify-content: space-between; min-height: 36px; }
.set.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.set .hint { font-size: 11px; opacity: .55; }
.grid h3 { grid-column: 1 / -1; margin: 8px 0 0; }

#rotate {
  position: fixed; inset: 0; z-index: 100; background: #0d0a07; display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 64px; color: var(--accent);
}
#rotate p { font-size: 16px; color: var(--sand); }

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
/* map download gate: above the HUD, below the menu screens (z-index 20) */
#map-loading { position: fixed; inset: 0; z-index: 15; display: none; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 38%, rgba(8, 20, 28, .82), rgba(3, 10, 16, .96)); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
#map-loading.show { display: flex; }
#map-loading .ml-card { width: min(320px, 78vw); text-align: center; }
#map-loading .ml-title { font-size: 12px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; color: var(--accent); opacity: .9; }
#map-loading .ml-name { margin: 8px 0 14px; font-size: 22px; font-weight: 800; color: var(--sand); letter-spacing: .04em; }
#map-loading .ml-bar { height: 6px; border-radius: 4px; background: rgba(170, 226, 255, .16); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(170, 226, 255, .14); }
#map-loading .ml-fill { width: 0%; height: 100%; background: linear-gradient(90deg, var(--accent), #9becff); box-shadow: 0 0 12px var(--accent); transition: width .18s ease-out; }
#map-loading .ml-bar.indet .ml-fill { width: 40%; animation: mlIndet 1.1s ease-in-out infinite; }
#map-loading .ml-pct { margin-top: 10px; font-size: 12px; font-variant-numeric: tabular-nums; color: rgba(228, 245, 255, .8); letter-spacing: .06em; }
@keyframes mlIndet { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; --gap: 8px; transition: opacity .1s; transform: scale(var(--xhair-scale, 1)); }
#crosshair i { position: absolute; background: var(--xhair, rgba(255,255,255,.9)); box-shadow: 0 0 2px rgba(0,0,0,.9); }
#crosshair i:nth-child(1) { width: 2px; height: 8px; left: -1px; top: calc(-8px - var(--gap)); }
#crosshair i:nth-child(2) { width: 2px; height: 8px; left: -1px; top: var(--gap); }
#crosshair i:nth-child(3) { width: 8px; height: 2px; top: -1px; left: calc(-8px - var(--gap)); }
#crosshair i:nth-child(4) { width: 8px; height: 2px; top: -1px; left: var(--gap); }
#crosshair b { position: absolute; width: 3px; height: 3px; left: -1.5px; top: -1.5px; background: var(--xhair, #fff); border-radius: 50%; box-shadow: 0 0 2px #000; }
#crosshair.nodot b { display: none; }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; z-index: 3; }
#hitmarker i { position: absolute; width: 2.5px; height: 11px; background: #fff; box-shadow: 0 0 3px rgba(0,0,0,.8); left: -1.25px; top: -5.5px; }
#hitmarker i:nth-child(1) { transform: rotate(45deg) translateY(-12px); }
#hitmarker i:nth-child(2) { transform: rotate(135deg) translateY(-12px); }
#hitmarker i:nth-child(3) { transform: rotate(225deg) translateY(-12px); }
#hitmarker i:nth-child(4) { transform: rotate(315deg) translateY(-12px); }
#hitmarker.kill i { background: var(--red); }
#hitmarker.show { animation: hm .45s ease-out forwards; }
#hitmarker.head i { height: 15px; }
@keyframes hm { 0% { opacity: 1; transform: scale(1.5); } 20% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1); } }

#scope { position: absolute; inset: 0; z-index: 1; }
/* The scope frame + peripheral glass are drawn by the render pipeline's scope
   lens pass (see public/js/render/post.js), so the DOM overlay no longer blacks
   out the surroundings. Only the reticle/breath/zoom live here now. */
#scope::before, #scope::after { content: none; }
#reticle { position: absolute; left: 50%; top: 50%; width: calc(var(--r, 40vmin) * 2); height: calc(var(--r, 40vmin) * 2); transform: translate(-50%, -50%); overflow: visible; }
/* live shot-cone indicator: a ring sized to the current spread (set from JS) */
#spread { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: translate(-50%, -50%); border: 1px solid rgba(200, 44, 28, .75); border-radius: 50%; box-shadow: 0 0 1px rgba(0, 0, 0, .5); pointer-events: none; }
#breath { position: absolute; left: 50%; bottom: calc(50% - var(--r, 40vmin) - 26px); width: 120px; height: 4px; margin-left: -60px; background: rgba(255,255,255,.15); border-radius: 2px; overflow: hidden; z-index: 2; }
#breath-fill { height: 100%; width: 100%; background: rgba(255,255,255,.75); }
#breath.low #breath-fill { background: var(--red); }
#zoom-label { position: absolute; left: calc(50% + var(--r, 40vmin) * .72); top: calc(50% + var(--r, 40vmin) * .72); font-weight: 800; color: rgba(255,255,255,.7); z-index: 2; font-size: 14px; }

#dmg-flash { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(170, 20, 10, .55)); transition: opacity .6s; }
#dmg-dirs { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.dmg-dir {
  position: absolute; width: 140px; height: 140px; left: -70px; top: -70px; border-radius: 50%;
  border-top: 6px solid rgba(229, 72, 60, .9); filter: drop-shadow(0 0 4px rgba(229,72,60,.8));
  animation: dd 1.6s ease-out forwards;
}
@keyframes dd { 0% { opacity: 1; } 100% { opacity: 0; } }

#score {
  position: absolute; z-index: 2; top: calc(10px + var(--safe-t)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; font-weight: 800; text-shadow: 0 1px 3px #000;
}
#score .side { display: flex; align-items: center; gap: 8px; }
#score .num { font-size: 30px; min-width: 38px; text-align: center; padding: 0 6px; background: rgba(0,0,0,.45); border-radius: 6px; }
#score .me .num { color: #9fd5ff; }
#score .opp .num { color: #ff9f8f; }
#score .name { font-size: 13px; opacity: .85; max-width: 22vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#score .mid { font-size: 11px; opacity: .7; letter-spacing: .08em; text-transform: uppercase; }
#killfeed { position: absolute; z-index: 2; top: calc(12px + var(--safe-t)); right: calc(14px + var(--safe-r)); display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
#killfeed div { background: rgba(0,0,0,.5); padding: 4px 10px; border-radius: 4px; font-size: 13px; animation: kf 6s forwards; }
#killfeed .hs { color: var(--accent); font-weight: 700; }
@keyframes kf { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
/* Delta-Force-style kill broadcast: lower half of the screen, own kills only */
#killcast { position: absolute; z-index: 3; left: 0; right: 0; bottom: calc(24% + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 7px; pointer-events: none; }
/* Icon drops in LARGE over the card centre, shrinks + slides left, and the text
   is drawn out to its right (clip-path reveal). --lead is set per-instance from
   JS so the icon starts precisely over the card's centre. */
#killcast .kc {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 2px;
  animation: kcast 3.6s cubic-bezier(.16, .84, .24, 1) forwards;
  will-change: transform, opacity;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 0 9px rgba(0, 0, 0, .65);
}
#killcast .kc .ico { font-size: 24px; line-height: 1; color: #fff; opacity: 0; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); transform-origin: center; animation: kcastIco .6s cubic-bezier(.22, .9, .24, 1) forwards; }
#killcast .kc .txt { display: flex; flex-direction: column; line-height: 1.12; opacity: 0; clip-path: inset(0 100% 0 0); animation: kcastTxt .46s cubic-bezier(.2, .9, .2, 1) .34s forwards; }
#killcast .kc .t1 { font-size: 11px; font-weight: 800; letter-spacing: .2em; color: #ffd9d3; }
#killcast .kc .t2 { font-size: 18px; font-weight: 800; color: #fff; }
#killcast .kc .t3 { font-size: 11px; letter-spacing: .06em; color: rgba(255, 255, 255, .85); }
#killcast .kc.hs .t1 { color: #ffe6b8; }
#killcast .kc.hs .ico { color: var(--accent); }
@keyframes kcast { 0% { opacity: 0; } 5% { opacity: 1; } 86% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes kcastIco {
  0%   { opacity: 0; transform: translateX(var(--lead, 46px)) scale(2.7); }
  16%  { opacity: 1; transform: translateX(var(--lead, 46px)) scale(2.7); }
  58%  { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes kcastTxt { 0% { opacity: 0; clip-path: inset(0 100% 0 0); transform: translateX(10px); } 100% { opacity: 1; clip-path: inset(0 0 0 0); transform: translateX(0); } }
#banner {
  position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); text-align: center; font-weight: 900;
  font-size: 28px; letter-spacing: .12em; text-shadow: 0 2px 8px #000; opacity: 0; white-space: nowrap; z-index: 4;
}
#banner small { display: block; font-size: 14px; font-weight: 600; letter-spacing: .1em; opacity: .85; }
#banner.show { animation: banner 2.2s ease-out forwards; }
#banner.hs { color: var(--accent); }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); } 10% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
#center-msg { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); font-size: 18px; font-weight: 700; text-shadow: 0 1px 4px #000; text-align: center; white-space: nowrap; z-index: 4; }
#center-msg.big { top: 38%; font-size: 72px; font-weight: 900; }
#netinfo { position: absolute; z-index: 2; top: calc(8px + var(--safe-t)); left: calc(10px + var(--safe-l)); font-size: 11px; opacity: .6; text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
#vitals { position: absolute; z-index: 2; left: calc(20px + var(--safe-l)); bottom: calc(18px + var(--safe-b)); display: flex; align-items: center; gap: 10px; text-shadow: 0 1px 3px #000; }
#hp-bar { width: 180px; height: 8px; background: rgba(0,0,0,.5); border-radius: 4px; overflow: hidden; border: 1px solid rgba(255,255,255,.15); }
#hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #d9cba4, #fff3d4); transition: width .2s; }
#hp-fill.low { background: var(--red); }
#hp-num { font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
#ammo { position: absolute; z-index: 2; right: calc(24px + var(--safe-r)); bottom: calc(18px + var(--safe-b)); text-align: right; text-shadow: 0 1px 3px #000; }
#ammo-pips { display: flex; gap: 5px; justify-content: flex-end; }
#ammo-pips i { width: 7px; height: 26px; border-radius: 3px 3px 1px 1px; background: linear-gradient(180deg, #eafcff 0 30%, #35d6ff 30%); box-shadow: 0 0 2px #000; }
#ammo-pips i.spent { opacity: .2; }
#ammo-state { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--accent); min-height: 16px; margin-top: 2px; }
/* reloading: a progress bar above the bullets */
#ammo-reload-bar { width: 72px; height: 4px; margin: 0 0 6px auto; background: rgba(255,255,255,.2); border-radius: 3px; overflow: hidden; box-shadow: 0 0 2px #000; }
#ammo-reload-fill { width: 0%; height: 100%; background: var(--accent); transition: width .05s linear; }
/* chambering: a progress bar under the bullets */
#ammo-chamber { width: 72px; height: 4px; margin: 6px 0 2px auto; background: rgba(255,255,255,.2); border-radius: 3px; overflow: hidden; box-shadow: 0 0 2px #000; }
#ammo-chamber-fill { width: 0%; height: 100%; background: var(--accent); transition: width .03s linear; }

#killcam { position: absolute; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); text-align: center; background: rgba(0,0,0,.55); padding: 12px 22px; border-radius: 10px; border: 1px solid rgba(229,72,60,.4); }
.kc-title { font-size: 20px; letter-spacing: .1em; }
.kc-title b { color: #ff9f8f; }
.kc-detail { font-size: 14px; opacity: .85; margin: 4px 0; }
.kc-respawn { font-size: 13px; opacity: .7; }

/* ---------------- touch controls ---------------- */
#touch { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
#touch > * { pointer-events: auto; }
#stick-zone { position: absolute; left: 0; top: 25%; bottom: 0; width: 40%; touch-action: none; }
#stick-base {
  position: absolute; width: 130px; height: 130px; margin: -65px 0 0 -65px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.25); background: rgba(0,0,0,.18); left: calc(110px + var(--safe-l)); top: calc(100% - 110px - var(--safe-b));
  transition: opacity .2s; opacity: .55;
}
#stick-base.active { opacity: 1; transition: none; }
#stick-base.sprint { border-color: var(--accent); }
#stick-knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px; border-radius: 50%; background: rgba(255,255,255,.35); }
#look-zone { position: absolute; right: 0; top: 0; bottom: 0; width: 60%; touch-action: none; }
.tbtn {
  position: absolute; border-radius: 50%; width: 64px; height: 64px; padding: 0; font-size: 11px; font-weight: 800; letter-spacing: .05em;
  background: rgba(0,0,0,.35); border: 2px solid rgba(255,255,255,.3); color: rgba(255,255,255,.9); touch-action: none;
}
.tbtn.big { width: 84px; height: 84px; font-size: 14px; }
.tbtn.small { width: 46px; height: 46px; font-size: 13px; }
.tbtn.on { background: rgba(53,214,255,.45); border-color: var(--accent); }
.tbtn.pressed { background: rgba(255,255,255,.3); }
#t-fire { right: calc(26px + var(--safe-r)); bottom: calc(60px + var(--safe-b)); border-color: rgba(229,72,60,.7); }
#t-scope { right: calc(124px + var(--safe-r)); bottom: calc(34px + var(--safe-b)); width: 76px; height: 76px; }
#t-jump { right: calc(30px + var(--safe-r)); bottom: calc(162px + var(--safe-b)); }
#t-crouch { right: calc(112px + var(--safe-r)); bottom: calc(124px + var(--safe-b)); }
#t-reload { right: calc(190px + var(--safe-r)); bottom: calc(120px + var(--safe-b)); }
#t-zoom { right: calc(214px + var(--safe-r)); bottom: calc(46px + var(--safe-b)); }
#t-leanl { right: calc(176px + var(--safe-r)); top: calc(70px + var(--safe-t)); }
#t-leanr { right: calc(118px + var(--safe-r)); top: calc(70px + var(--safe-t)); }
#t-pause { left: calc(14px + var(--safe-l)); top: calc(30px + var(--safe-t)); width: 40px; height: 40px; font-size: 12px; }
#t-hint { position: absolute; left: 50%; bottom: calc(8px + var(--safe-b)); transform: translateX(-50%); font-size: 12px; opacity: .7; pointer-events: none; text-shadow: 0 1px 2px #000; }
.touch-mode #vitals { bottom: auto; top: calc(56px + var(--safe-t)); left: calc(14px + var(--safe-l)); }
.touch-mode #hp-bar { width: 120px; }
.touch-mode #ammo { bottom: auto; top: calc(56px + var(--safe-t)); right: calc(14px + var(--safe-r)); }
.touch-mode #killfeed { top: calc(110px + var(--safe-t)); }
.touch-mode #netinfo { left: calc(64px + var(--safe-l)); top: calc(36px + var(--safe-t)); }
@media (max-height: 500px) {
  #score .num { font-size: 22px; }
  .panel { padding: 12px 16px; }
  h1 { font-size: 28px; }
  h2 { font-size: 18px; margin-bottom: 6px; }
  .tag { margin: 2px 0 8px; font-size: 13px; }
  .field { margin-bottom: 8px; flex-direction: row; align-items: center; gap: 10px; }
  .field input { flex: 1; padding: 7px 10px; }
  button { padding: 8px 14px; }
  .btns { gap: 7px; margin-top: 4px; }
  .join-row input { padding: 7px 10px; }
  #room-code { font-size: 38px; margin: 0 0 4px; }
  #center-msg.big { font-size: 56px; }
  #load { margin-top: 8px; }
}
.touch-mode #zoom-label { display: none; }

/* ---------------- customize controls editor ---------------- */
body:not(.touch-mode) .touch-only { display: none; }
body.customizing #touch { display: none !important; }
#customize { display: block; padding: 0; background: rgba(8, 6, 4, 0.6); }
.cz-bar {
  position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) 10px calc(12px + var(--safe-l));
  background: linear-gradient(180deg, rgba(10, 8, 5, 0.92), rgba(10, 8, 5, 0));
}
.cz-bar b { letter-spacing: .1em; white-space: nowrap; }
.cz-bar .cz-tip { font-size: 12px; opacity: .7; }
.cz-bar .sp { flex: 1; }
.cz-bar button { padding: 9px 14px; }
#cz-stage { position: absolute; inset: 0; touch-action: none; }
.cz-btn {
  position: absolute; border-radius: 50%; padding: 0; font-size: 11px; font-weight: 800; letter-spacing: .05em;
  background: rgba(0, 0, 0, .35); border: 2px solid rgba(255, 255, 255, .35); color: rgba(255, 255, 255, .92);
  display: flex; align-items: center; justify-content: center; touch-action: none; cursor: move;
}
.cz-btn.big { font-size: 14px; }
.cz-btn.sel { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(53, 214, 255, .35); }
#cz-handle {
  position: absolute; width: 26px; height: 26px; margin: -13px; border-radius: 50%; z-index: 3;
  background: var(--accent); border: 3px solid var(--ink); box-shadow: 0 0 0 2px rgba(255, 255, 255, .6);
  touch-action: none; cursor: nwse-resize;
}
#cz-server {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px calc(12px + var(--safe-r)) calc(10px + var(--safe-b)) calc(12px + var(--safe-l));
  background: linear-gradient(0deg, rgba(10, 8, 5, 0.92), rgba(10, 8, 5, 0));
}
#cz-server input, #cz-server select, #cz-server button { font-size: 13px; padding: 8px 10px; }
#cz-server input { width: 110px; }
#cz-server select { max-width: 170px; }
#cz-code { font-size: 12px; opacity: .85; }

/* prone touch button + create-room "allow prone" checkbox (added after the theme) */
#t-prone { right: calc(112px + var(--safe-r)); bottom: calc(192px + var(--safe-b)); }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 0 0 14px; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--accent); }

/* settings additions: video / accessibility */
.field select { font: inherit; color: var(--sand); background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-top: 4px; opacity: .75; }
.screen { zoom: var(--ui-scale, 1); }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
