:root {
  --ice: #7fd4ff;
  --ice-2: #4fb6ff;
  --ember: #ff7a36;
  --text: #e9f2fb;
  --muted: #93a7bc;
  --panel: rgba(9, 14, 21, 0.78);
  --panel-2: rgba(18, 27, 38, 0.85);
  --line: rgba(140, 200, 255, 0.22);
  --danger: #ff4b3e;
  --gold: #ffd166;
  --display: 'Black Ops One', Impact, 'Arial Black', sans-serif;
  --ui: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  --sl: env(safe-area-inset-left, 0px);
  --sr: env(safe-area-inset-right, 0px);
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0a0f16; color: var(--text); font-family: var(--ui); }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; touch-action: none; }
input, select { -webkit-user-select: text; user-select: text; font-family: var(--ui); }
button { font-family: var(--ui); color: inherit; cursor: pointer; }
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; }
.hidden { display: none !important; }
.dim { color: var(--muted); }

/* ---------------------------------------------------------------- panels & buttons */
.panel {
  background: linear-gradient(160deg, rgba(20, 31, 44, 0.86), rgba(8, 12, 18, 0.88));
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}
.k { font-size: 12px; letter-spacing: 0.22em; color: var(--muted); font-weight: 700; }
.btn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1px solid rgba(127, 212, 255, 0.35); background: rgba(127, 212, 255, 0.08);
  color: var(--text); font-weight: 700; font-size: 18px; letter-spacing: 0.12em; padding: 12px 18px; min-height: 48px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  transition: background 0.15s, transform 0.08s, border-color 0.15s;
}
.btn small { font-size: 12px; letter-spacing: 0.04em; font-weight: 600; color: var(--muted); text-transform: none; }
.btn:hover { background: rgba(127, 212, 255, 0.16); border-color: rgba(127, 212, 255, 0.6); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: linear-gradient(180deg, #8ddcff, #3fa6ef); color: #06121d; border-color: transparent; }
.btn.primary small { color: rgba(6, 18, 29, 0.7); }
.btn.primary:hover { background: linear-gradient(180deg, #a6e5ff, #56b4f4); }
.btn.ghost { background: transparent; border-color: rgba(255, 255, 255, 0.16); }
.btn.sm { font-size: 14px; min-height: 40px; padding: 8px 14px; }
.btn.xs { font-size: 11px; min-height: 28px; padding: 4px 10px; letter-spacing: 0.1em; }
.btn.big { font-size: 22px; min-height: 58px; }
.lnk { background: none; border: none; color: var(--muted); font-size: 15px; font-weight: 600; padding: 6px 4px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(147, 167, 188, 0.4); }
.lnk:hover { color: var(--text); }
select, input[type=text], input:not([type]) {
  background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(127, 212, 255, 0.28); color: var(--text); font-size: 17px; font-weight: 600; padding: 10px 12px; outline: none; border-radius: 0;
}
input:focus, select:focus { border-color: var(--ice); box-shadow: 0 0 0 3px rgba(127, 212, 255, 0.15); }

/* ---------------------------------------------------------------- loading */
#loading { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #16263a, #070b11 70%); transition: opacity 0.6s; }
#loading.done { opacity: 0; pointer-events: none; }
.load-inner { text-align: center; width: min(420px, 80vw); }
.brandmark { width: 72px; height: 72px; margin: 0 auto 16px; color: var(--ice); filter: drop-shadow(0 0 18px rgba(127, 212, 255, 0.6)); animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.load-title { font-family: var(--display); font-size: clamp(20px, 4vw, 30px); letter-spacing: 0.06em; }
.load-bar { height: 4px; background: rgba(255, 255, 255, 0.1); margin: 18px 0 10px; overflow: hidden; }
.load-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ice-2), #d6f3ff); transition: width 0.3s; box-shadow: 0 0 12px var(--ice); }
.load-msg { color: var(--muted); font-weight: 600; letter-spacing: 0.06em; }

/* ---------------------------------------------------------------- screens */
.screen { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: calc(16px + var(--st)) calc(16px + var(--sr)) calc(16px + var(--sb)) calc(16px + var(--sl)); overflow: auto; touch-action: pan-y; }
#menu { background: linear-gradient(90deg, rgba(5, 9, 14, 0.82) 0%, rgba(5, 9, 14, 0.45) 55%, rgba(5, 9, 14, 0.15) 100%); }
.menu-wrap { width: min(1100px, 100%); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.85fr); gap: 40px; align-items: center; }
.menu-wrap > * { min-width: 0; }
.brand-kicker { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: 0.2em; font-size: 13px; color: var(--ice); background: rgba(127, 212, 255, 0.1); border: 1px solid rgba(127, 212, 255, 0.25); padding: 5px 10px; }
.dotlive { width: 8px; height: 8px; border-radius: 50%; background: #56ff9a; box-shadow: 0 0 10px #56ff9a; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.brand h1 { margin: 16px 0 10px; font-family: var(--display); font-weight: 400; line-height: 0.92; letter-spacing: 0.02em; text-shadow: 0 6px 30px rgba(0, 0, 0, 0.6); }
.brand .l1 { display: block; font-size: clamp(24px, 3.4vw, 52px); color: #cfeeff; }
.brand .l2 { display: block; font-size: clamp(34px, 5.3vw, 100px); white-space: nowrap; background: linear-gradient(180deg, #ffffff 10%, #9fdcff 60%, #4fb6ff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 24px rgba(79, 182, 255, 0.35)); }
.brand-sub { max-width: 520px; color: #c3d3e3; font-size: 18px; font-weight: 500; line-height: 1.4; margin: 0; }
.brand-sub b { color: #fff; }
.menu-panel { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld span { font-size: 12px; letter-spacing: 0.22em; color: var(--muted); font-weight: 700; }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.join-row input { min-width: 0; width: 100%; font-family: var(--display); font-size: 24px; letter-spacing: 0.35em; text-align: center; text-transform: uppercase; }
.join-row .btn { min-width: 110px; }
.menu-foot { display: flex; justify-content: space-between; margin-top: 4px; }
.menu-msg { min-height: 20px; margin: 0; color: var(--ice); font-weight: 600; font-size: 15px; }
.menu-msg.warn { color: #ffb199; }
body.busy .menu-panel .btn { pointer-events: none; opacity: 0.6; }
@media (max-height: 520px) { .ver { display: none; } }
.ver { position: fixed; right: calc(14px + var(--sr)); bottom: calc(10px + var(--sb)); color: rgba(233, 242, 251, 0.45); font-size: 13px; letter-spacing: 0.08em; }

/* lobby */
#lobby { background: rgba(5, 9, 14, 0.55); }
.lobby-panel { width: min(1000px, 100%); padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.lobby-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.code { font-family: var(--display); font-size: clamp(40px, 6vw, 64px); letter-spacing: 0.22em; color: #fff; text-shadow: 0 0 24px rgba(127, 212, 255, 0.5); line-height: 1; margin-top: 4px; }
.lobby-actions { display: flex; gap: 8px; }
.teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.vs { font-family: var(--display); align-self: center; color: var(--muted); font-size: 22px; }
.team { border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 14%, transparent), transparent); padding: 12px; min-height: 150px; }
.th { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tn { font-family: var(--display); font-size: 24px; color: var(--tc); letter-spacing: 0.08em; }
.th b { font-size: 18px; color: var(--muted); margin-right: auto; }
.team ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.team li { display: flex; justify-content: space-between; align-items: center; background: rgba(0, 0, 0, 0.3); padding: 8px 10px; font-size: 18px; font-weight: 700; border-left: 3px solid var(--tc); }
.team li.me { background: rgba(255, 255, 255, 0.1); }
.team li em { font-style: normal; font-size: 11px; letter-spacing: 0.15em; color: var(--gold); border: 1px solid rgba(255, 209, 102, 0.5); padding: 1px 6px; }
.team li.empty { color: var(--muted); font-weight: 500; border-left-color: transparent; background: transparent; }
.lobby-mid { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.lobby-settings { display: flex; flex-direction: column; gap: 10px; }
.lobby-settings label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; letter-spacing: 0.2em; color: var(--muted); font-weight: 700; }
.lobby-settings.readonly select { opacity: 0.7; }
.lobby-foot { display: flex; align-items: center; gap: 12px; }
.lobby-info { flex: 1; text-align: center; color: var(--muted); font-weight: 600; }
#btnStart { min-width: 200px; }

/* loadout cards */
.loadout { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.lo { text-align: left; padding: 10px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.1); display: flex; flex-direction: column; gap: 4px; transition: border-color 0.15s, background 0.15s; }
.lo:hover { border-color: rgba(127, 212, 255, 0.45); }
.lo.sel { border-color: var(--ice); background: rgba(127, 212, 255, 0.14); box-shadow: inset 0 0 0 1px var(--ice); }
.lo-cls { font-size: 11px; letter-spacing: 0.2em; color: var(--muted); font-weight: 700; }
.lo-name { font-family: var(--display); font-size: 17px; letter-spacing: 0.03em; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 6px; font-size: 10px; letter-spacing: 0.12em; color: var(--muted); font-weight: 700; }
.st i { height: 4px; background: rgba(255, 255, 255, 0.1); display: block; }
.st b { display: block; height: 100%; background: linear-gradient(90deg, var(--ice-2), #d6f3ff); }
.lo-desc { margin-top: 8px; color: #c3d3e3; font-weight: 600; min-height: 20px; }

/* deploy */
#deploy { flex-direction: column; gap: 18px; background: radial-gradient(ellipse at center, rgba(60, 0, 0, 0.25), rgba(5, 8, 12, 0.7)); animation: fadein 0.5s 0.9s both; }
#deploy.instant { animation-delay: 0s; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.deploy-top { text-align: center; }
.kb-t { letter-spacing: 0.3em; font-weight: 700; color: #ffb199; }
.kb-n { font-family: var(--display); font-size: clamp(30px, 5vw, 48px); line-height: 1.1; }
.kb-w { color: var(--muted); font-weight: 700; letter-spacing: 0.12em; }
.deploy-panel { width: min(860px, 100%); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
#btnRespawn { margin-top: 8px; }

/* pause / modals */
#pause { background: rgba(5, 8, 12, 0.6); }
.pause-panel { width: min(380px, 100%); padding: 24px; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.pause-panel h2, .modal-panel h2 { font-family: var(--display); font-weight: 400; margin: 0; font-size: 34px; letter-spacing: 0.06em; }
.modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(4, 7, 11, 0.7); padding: calc(12px + var(--st)) calc(12px + var(--sr)) calc(12px + var(--sb)) calc(12px + var(--sl)); overflow: auto; touch-action: pan-y; }
.modal-panel { width: min(620px, 100%); padding: 22px; display: flex; flex-direction: column; gap: 14px; max-height: 100%; overflow: auto; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.set-grid label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 15px; }
.set-grid label.chk { flex-direction: row; align-items: center; gap: 10px; }
.set-grid output { color: var(--ice); font-weight: 700; }
input[type=range] { accent-color: var(--ice); width: 100%; }
input[type=checkbox] { accent-color: var(--ice); width: 20px; height: 20px; }
.help p { margin: 0; line-height: 1.45; font-size: 16px; }
.help h3 { margin: 0 0 6px; font-size: 14px; letter-spacing: 0.2em; color: var(--ice); }
.help ul { margin: 0; padding-left: 18px; line-height: 1.5; font-size: 15px; }
.help-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* end */
#end { background: rgba(5, 8, 12, 0.6); }
.end-wrap { width: min(900px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.result { font-family: var(--display); font-size: clamp(56px, 11vw, 120px); line-height: 1; letter-spacing: 0.04em; animation: slam 0.6s cubic-bezier(.2, 1.4, .4, 1) both; }
.result.win { color: #9fe3ff; text-shadow: 0 0 40px rgba(127, 212, 255, 0.6); }
.result.lose { color: #ff8a70; text-shadow: 0 0 40px rgba(255, 90, 60, 0.5); }
.result.draw { color: #e9f2fb; }
@keyframes slam { from { transform: scale(1.8); opacity: 0; } }
.end-score { font-family: var(--display); font-size: 26px; display: flex; gap: 16px; align-items: center; }
.end-score i { color: var(--muted); font-style: normal; }
.end-mvp { color: var(--muted); font-weight: 700; letter-spacing: 0.1em; min-height: 20px; }
.end-board { width: 100%; padding: 14px; }
.end-foot { display: flex; gap: 12px; align-items: center; width: 100%; justify-content: space-between; }

/* scoreboard */
#scoreboard { position: fixed; z-index: 15; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(860px, 94vw); padding: 14px; background: rgba(8, 12, 18, 0.86); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); pointer-events: auto; }
.sbgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sbhead { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--tc); padding: 2px 4px 6px; margin-bottom: 4px; }
.sbhead span { font-family: var(--display); color: var(--tc); font-size: 20px; letter-spacing: 0.08em; }
.sbhead b { font-family: var(--display); font-size: 26px; }
.sbcol table { width: 100%; border-collapse: collapse; font-weight: 700; font-size: 15px; }
.sbcol th { text-align: right; font-size: 11px; letter-spacing: 0.15em; color: var(--muted); padding: 4px 6px; }
.sbcol th:first-child { text-align: left; }
.sbcol td { text-align: right; padding: 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.sbcol td.nm { text-align: left; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbcol td.pg { color: var(--muted); font-size: 13px; }
.sbcol tr.me td { background: rgba(127, 212, 255, 0.12); }
.sbcol tr.dead td.nm { opacity: 0.55; }

/* ---------------------------------------------------------------- HUD */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#vignette { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(170, 0, 0, 0.55) 85%, rgba(120, 0, 0, 0.85)); transition: opacity 0.3s; }
#flash { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 50%, rgba(255, 40, 30, 0.5)); opacity: 0; }
#flash.on { animation: hitflash 0.45s ease-out; }
@keyframes hitflash { from { opacity: 1; } to { opacity: 0; } }
#scope { position: absolute; inset: 0; display: none; background: radial-gradient(circle at center, transparent 0, transparent 38vmin, rgba(0, 0, 0, 0.6) 38.4vmin, #000 39vmin); }
#scope::before { content: ''; position: absolute; left: 50%; top: 50%; width: 78vmin; height: 78vmin; transform: translate(-50%, -50%); border-radius: 50%; box-shadow: inset 0 0 40px 10px rgba(0, 0, 0, 0.8); }
#scope .sh { position: absolute; left: calc(50% - 38vmin); right: calc(50% - 38vmin); top: 50%; height: 1.5px; background: rgba(0, 0, 0, 0.9); }
#scope .sv { position: absolute; top: calc(50% - 38vmin); bottom: calc(50% - 38vmin); left: 50%; width: 1.5px; background: rgba(0, 0, 0, 0.9); }
#scope::after { content: ''; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: #ff3b30; box-shadow: 0 0 6px #ff3b30; }

#scorebar { position: absolute; top: calc(10px + var(--st)); left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; gap: 4px; font-weight: 700; }
.sb-side { position: relative; display: flex; align-items: center; gap: 10px; min-width: 150px; padding: 6px 12px 10px; background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 30%, rgba(8, 12, 18, 0.8)), rgba(8, 12, 18, 0.75)); border-top: 3px solid var(--tc); justify-content: space-between; }
.sb-side .sb-name { font-family: var(--display); font-size: 15px; letter-spacing: 0.1em; color: var(--tc); }
.sb-side b { font-family: var(--display); font-size: 30px; line-height: 1; font-weight: 400; }
.sb-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.08); }
.sb-bar em { display: block; height: 100%; width: 0; background: var(--tc); transition: width 0.4s; }
.sb-side.r .sb-bar em { margin-left: auto; }
.sb-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 14px; background: rgba(8, 12, 18, 0.8); min-width: 96px; }
#timer { font-family: var(--display); font-size: 26px; line-height: 1; }
#timer.low { color: var(--danger); animation: pulse 1s infinite; }
#limit { font-size: 10px; letter-spacing: 0.18em; color: var(--muted); margin-top: 3px; }

#minimap { position: absolute; left: calc(14px + var(--sl)); top: calc(12px + var(--st)); width: 170px; height: 170px; border-radius: 50%; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); }
#healthBar { position: absolute; left: calc(20px + var(--sl)); bottom: calc(22px + var(--sb)); display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; letter-spacing: 0.15em; }
#healthBar i { width: 220px; height: 8px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.15); display: block; }
#hpFill { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #e9f6ff, #9fdcff); transition: width 0.2s; }
#hpFill.low { background: linear-gradient(90deg, #ff4b3e, #ff8a70); }
#netinfo { position: absolute; left: calc(20px + var(--sl)); bottom: calc(6px + var(--sb)); font-size: 11px; letter-spacing: 0.1em; color: rgba(233, 242, 251, 0.5); font-weight: 600; }
#killfeed { position: absolute; right: calc(14px + var(--sr)); top: calc(14px + var(--st)); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.kf { display: flex; align-items: center; gap: 8px; background: rgba(8, 12, 18, 0.65); padding: 4px 10px; font-weight: 700; font-size: 15px; animation: kfin 0.25s ease-out; transition: opacity 0.4s; }
.kf em { font-style: normal; font-size: 11px; letter-spacing: 0.1em; color: var(--muted); border: 1px solid rgba(255, 255, 255, 0.18); padding: 0 5px; }
.kf em b { color: var(--gold); }
.kf.out { opacity: 0; }
@keyframes kfin { from { transform: translateX(30px); opacity: 0; } }

#crosshair { --gap: 10px; position: absolute; left: 50%; top: 50%; width: 0; height: 0; transition: opacity 0.12s; }
#crosshair i { position: absolute; background: #fff; box-shadow: 0 0 2px rgba(0, 0, 0, 0.9); }
#crosshair .l, #crosshair .r { width: 10px; height: 2px; top: -1px; }
#crosshair .t, #crosshair .b { width: 2px; height: 10px; left: -1px; }
#crosshair .l { right: var(--gap); }
#crosshair .r { left: var(--gap); }
#crosshair .t { bottom: var(--gap); }
#crosshair .b { top: var(--gap); }
#crosshair s { position: absolute; width: 3px; height: 3px; left: -1.5px; top: -1.5px; background: #fff; border-radius: 50%; box-shadow: 0 0 2px #000; }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; }
#hitmarker i { position: absolute; width: 11px; height: 2.5px; background: #fff; box-shadow: 0 0 3px rgba(0, 0, 0, 0.8); }
#hitmarker i:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg) translate(-12px); }
#hitmarker i:nth-child(2) { transform: translate(-50%, -50%) rotate(135deg) translate(-12px); }
#hitmarker i:nth-child(3) { transform: translate(-50%, -50%) rotate(225deg) translate(-12px); }
#hitmarker i:nth-child(4) { transform: translate(-50%, -50%) rotate(315deg) translate(-12px); }
#hitmarker.on { animation: hm 0.28s ease-out; }
#hitmarker.head i { background: var(--gold); }
#hitmarker.kill i { background: var(--danger); width: 16px; }
@keyframes hm { from { opacity: 1; transform: scale(1.35); } 60% { opacity: 1; } to { opacity: 0; transform: scale(1); } }
#dmgRing { position: absolute; left: 50%; top: 50%; }
.dmgArc { position: absolute; left: 0; top: 0; width: 34vmin; height: 34vmin; border-radius: 50%; border: 6px solid transparent; border-top-color: rgba(255, 50, 40, 0.9); filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.8)); animation: dmgfade 1.3s ease-out forwards; }
@keyframes dmgfade { from { opacity: 1; } to { opacity: 0; } }
#enemyName { position: absolute; left: 50%; top: calc(50% - 64px); transform: translateX(-50%); color: #ff6b5b; font-weight: 700; font-size: 16px; letter-spacing: 0.08em; text-shadow: 0 1px 3px #000; }
#reloadHint { display: none; position: absolute; left: 50%; top: calc(50% + 44px); transform: translateX(-50%); font-weight: 700; letter-spacing: 0.25em; font-size: 14px; color: #ffd9a0; text-shadow: 0 1px 3px #000; animation: pulse 1s infinite; }
#popups { position: absolute; left: 50%; top: calc(50% + 70px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pop { font-family: var(--display); font-size: 22px; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8); animation: popup 1.6s ease-out forwards; white-space: nowrap; }
.pop.gold { color: var(--gold); }
.pop.streak { color: var(--ice); font-size: 28px; }
@keyframes popup { 0% { transform: scale(1.5); opacity: 0; } 12% { transform: scale(1); opacity: 1; } 75% { opacity: 1; } 100% { transform: translateY(-24px); opacity: 0; } }
#clickHint { display: none; position: absolute; left: 50%; top: 58%; transform: translateX(-50%); padding: 10px 18px; background: rgba(8, 12, 18, 0.75); border: 1px solid var(--line); font-weight: 700; letter-spacing: 0.2em; font-size: 14px; }
#clickHint.on { display: block; }
#centerMsg { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); font-family: var(--display); font-size: clamp(26px, 5vw, 52px); letter-spacing: 0.08em; opacity: 0; transition: opacity 0.4s; text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7); white-space: nowrap; }
#centerMsg.on { opacity: 1; }
#weaponBox { position: absolute; right: calc(22px + var(--sr)); bottom: calc(18px + var(--sb)); text-align: right; font-weight: 700; }
#wName { font-size: 13px; letter-spacing: 0.2em; color: var(--muted); }
.ammo { font-family: var(--display); line-height: 1; }
#ammoMag { font-size: 44px; font-weight: 400; }
#ammoMag.low { color: #ff8a70; }
#ammoRes { font-size: 20px; color: var(--muted); margin-left: 4px; }
#nades { display: flex; gap: 6px; justify-content: flex-end; margin-top: 4px; }
.nd { display: block; width: 11px; height: 14px; border-radius: 45% 45% 40% 40%; background: #a9c46a; box-shadow: 0 0 4px rgba(0, 0, 0, 0.6); }
.nd.off { background: rgba(255, 255, 255, 0.15); }
.hud-btn { position: absolute; top: calc(14px + var(--st)); width: 42px; height: 42px; display: none; align-items: center; justify-content: center; background: rgba(8, 12, 18, 0.6); border: 1px solid rgba(255, 255, 255, 0.18); pointer-events: auto; padding: 9px; }
.hud-btn svg { width: 100%; height: 100%; }
#btnPause { right: calc(14px + var(--sr)); }
#btnScore { right: calc(62px + var(--sr)); }

/* ---------------------------------------------------------------- toasts / rotate */
#toasts { position: fixed; z-index: 60; top: calc(70px + var(--st)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: rgba(8, 12, 18, 0.85); border: 1px solid var(--line); padding: 8px 16px; font-weight: 700; letter-spacing: 0.04em; animation: kfin 0.25s ease-out; transition: opacity 0.4s; }
.toast.out { opacity: 0; }
#rotate { display: none; position: fixed; inset: 0; z-index: 70; background: #070b11; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--ice); font-weight: 700; letter-spacing: 0.1em; text-align: center; }
#rotate svg { width: 90px; height: 90px; animation: tilt 2s ease-in-out infinite; }
@keyframes tilt { 50% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (pointer: coarse) { body.ingame #rotate { display: flex; } }

/* ---------------------------------------------------------------- touch controls */
#touch { display: none; position: fixed; inset: 0; z-index: 12; pointer-events: none; }
body.touch.ingame #touch { display: block; }
body.dead #touch { display: none !important; }
body.dead #hud > *:not(#vignette):not(#killfeed):not(#toasts) { opacity: 0; }
body.touch .hud-btn { display: flex; }
#joyZone { position: absolute; left: 0; bottom: 0; width: 42vw; height: 72vh; pointer-events: auto; touch-action: none; }
#lookZone { position: absolute; right: 0; top: calc(64px + var(--st)); bottom: 0; width: 58vw; pointer-events: auto; touch-action: none; }
#joy { position: absolute; left: 0; top: 0; width: 26vh; height: 26vh; min-width: 110px; min-height: 110px; opacity: 0; transition: opacity 0.15s; pointer-events: none; }
#joy.on { opacity: 1; }
#joyRing { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); background: radial-gradient(circle, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.12)); }
#joyKnob { position: absolute; left: 50%; top: 50%; width: 42%; height: 42%; border-radius: 50%; background: rgba(233, 242, 251, 0.75); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5); transform: translate(-50%, -50%); }
#sprintLock { position: absolute; left: calc(12vw + var(--sl)); bottom: 70vh; padding: 3px 10px; font-weight: 700; letter-spacing: 0.25em; font-size: 12px; background: rgba(8, 12, 18, 0.6); border: 1px solid rgba(255, 255, 255, 0.2); color: var(--muted); opacity: 0; transition: opacity 0.15s; }
#sprintLock.on { opacity: 1; color: #fff; border-color: var(--ice); }
.tb { position: absolute; pointer-events: auto; touch-action: none; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); background: rgba(10, 16, 24, 0.38); color: rgba(255, 255, 255, 0.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; width: 12vh; height: 12vh; min-width: 48px; min-height: 48px; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); transition: transform 0.06s, background 0.1s; }
.tb svg { width: 52%; height: 52%; pointer-events: none; }
.tb em { pointer-events: none; }
.tb em { font-style: normal; font-size: 9px; letter-spacing: 0.15em; font-weight: 700; margin-top: -2px; }
.tb.down { transform: scale(0.92); background: rgba(127, 212, 255, 0.35); }
.tb.fire { width: 20vh; height: 20vh; min-width: 76px; min-height: 76px; right: calc(15vh + var(--sr)); bottom: 20vh; border-color: rgba(255, 120, 90, 0.7); background: rgba(80, 20, 10, 0.3); }
.tb.fire svg { width: 46%; height: 46%; }
.tb.fire.down { background: rgba(255, 90, 60, 0.45); }
#fireL { left: calc(14px + max(25vh, 96px) + 5vh + var(--sl)); top: 14vh; width: 14vh; height: 14vh; border-color: rgba(255, 120, 90, 0.6); background: rgba(80, 20, 10, 0.25); }
.tb.ads { right: calc(3vh + var(--sr)); bottom: 42vh; width: 13vh; height: 13vh; }
.tb.ads svg { width: 46%; height: 46%; }
.tb.ads.on { background: rgba(127, 212, 255, 0.4); border-color: var(--ice); }
.tb.jump { right: calc(3vh + var(--sr)); bottom: 6vh; width: 13vh; height: 13vh; }
.tb.crouch { right: calc(38vh + var(--sr)); bottom: 4vh; }
.tb.reload { right: calc(38vh + var(--sr)); bottom: 36vh; width: 11vh; height: 11vh; }
.tb.nade { right: calc(23vh + var(--sr)); bottom: 48vh; width: 11vh; height: 11vh; }
.tb.melee { right: calc(3vh + var(--sr)); bottom: 62vh; width: 11vh; height: 11vh; }
.tb.swap { right: calc(52vh + var(--sr)); bottom: 3vh; width: auto; height: 9vh; min-height: 40px; border-radius: 6px; flex-direction: row; gap: 6px; padding: 0 14px; }
.tb.swap svg { width: 5vh; height: 5vh; min-width: 20px; min-height: 20px; }
.tb.swap em { font-size: 13px; margin: 0; }

/* touch HUD layout */
body.touch #minimap { width: 25vh; height: 25vh; min-width: 96px; min-height: 96px; }
body.touch #healthBar { left: calc(14px + var(--sl)); top: calc(12px + max(25vh, 96px) + 18px + var(--st)); bottom: auto; }
body.touch #healthBar i { width: max(25vh, 96px); height: 6px; }
body.touch #healthBar span { display: none; }
body.touch #netinfo { left: calc(14px + var(--sl)); top: calc(12px + max(25vh, 96px) + 32px + var(--st)); bottom: auto; }
body.touch #killfeed { top: calc(64px + var(--st)); }
body.touch .kf { font-size: 13px; padding: 3px 8px; }
body.touch #weaponBox { right: auto; left: 50%; transform: translateX(-50%); bottom: calc(4px + var(--sb)); display: flex; align-items: baseline; gap: 10px; }
body.touch #wName { display: none; }
body.touch #ammoMag { font-size: 30px; }
body.touch #ammoRes { font-size: 15px; }
body.touch #nades { margin: 0; }
body.touch .sb-side { min-width: 104px; padding: 4px 8px 7px; }
body.touch .sb-side b { font-size: 22px; }
body.touch .sb-side .sb-name { font-size: 12px; }
body.touch #timer { font-size: 20px; }
body.touch #popups { top: calc(50% + 46px); }
body.touch .pop { font-size: 17px; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 860px), (max-height: 520px) {
  .menu-wrap { grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr); gap: 20px; }
  .brand-sub { font-size: 15px; }
  .brand h1 { margin: 10px 0 6px; }
  .menu-panel { padding: 16px; gap: 8px; }
  .btn { font-size: 16px; min-height: 44px; padding: 8px 14px; }
  .btn small { font-size: 11px; }
  .lobby-panel { padding: 14px; gap: 10px; }
  .team { min-height: 0; padding: 8px; }
  .team li { font-size: 15px; padding: 5px 8px; }
  .tn { font-size: 18px; }
  .lobby-mid { grid-template-columns: 170px 1fr; gap: 10px; }
  .lo { padding: 7px; }
  .lo-name { font-size: 14px; }
  .st { grid-template-columns: 52px 1fr; font-size: 9px; }
  .code { font-size: 36px; }
  .deploy-panel { padding: 12px; }
  .set-grid { gap: 10px 14px; }
}
@media (max-height: 520px) {
  .lobby-panel { padding: 10px 14px; gap: 7px; }
  .lobby-head .k { font-size: 10px; }
  .code { font-size: 30px; margin: 0; }
  .lobby-actions .btn { min-height: 34px; padding: 4px 12px; font-size: 13px; }
  .th { margin-bottom: 4px; }
  .team { padding: 6px 8px; }
  .team li { font-size: 14px; padding: 3px 8px; }
  .team ul { gap: 3px; }
  .lobby-mid { grid-template-columns: 150px 1fr; }
  .lobby-settings label:last-child { display: none; }
  .lobby-settings label { letter-spacing: 0.12em; font-size: 10px; }
  .lo-wrap > .k { display: none; }
  .loadout { margin-top: 0; }
  .st { font-size: 8px; grid-template-columns: 48px 1fr; }
  .lo { gap: 2px; }
  .lobby-foot .btn { min-height: 38px; }
  #btnStart { min-width: 160px; }
  .lobby-info { font-size: 13px; }
  .brand-kicker { font-size: 11px; }
  .brand .l2 { font-size: clamp(30px, 5vw, 64px); }
  .brand .l1 { font-size: clamp(20px, 3.2vw, 34px); }
  .lobby-settings { gap: 6px; }
  .lobby-settings select { padding: 6px 8px; font-size: 15px; }
  .lo-desc { display: none; }
  .result { font-size: clamp(44px, 9vw, 80px); }
  .end-board { padding: 8px; }
  .sbcol td { padding: 3px 6px; }
  .modal-panel { padding: 14px; gap: 10px; }
  .help p, .help ul { font-size: 13px; }
}
@media (max-width: 640px) and (orientation: portrait) {
  .menu-wrap { grid-template-columns: 1fr; }
  .brand { text-align: center; }
  .brand-sub { margin: 0 auto; }
  .teams { grid-template-columns: 1fr; }
  .vs { display: none; }
  .lobby-mid { grid-template-columns: 1fr; }
  .loadout { grid-template-columns: repeat(2, 1fr); }
  .set-grid, .help-cols, .sbgrid { grid-template-columns: 1fr; }
  .lobby-foot { flex-wrap: wrap; }
}

/* promo mode (?promo) — used to capture the link-preview image */
body.promo .menu-panel, body.promo .ver, body.promo #toasts { display: none !important; }
body.promo #menu { background: radial-gradient(ellipse at 50% 55%, rgba(6, 12, 20, 0.45), rgba(4, 8, 13, 0.88) 75%); }
body.promo .brand h1 { filter: drop-shadow(0 6px 30px rgba(0, 0, 0, 0.7)); }
body.promo .menu-wrap { grid-template-columns: 1fr; text-align: center; }
body.promo .brand-sub { margin: 0 auto; font-size: 22px; }
body.promo .brand .l2 { font-size: 118px; }
body.promo .brand .l1 { font-size: 56px; }