/* NEON STRIKE — HUD + menu styling. Neon-noir on dark. */
:root {
  --cyan: #4de3ff;
  --magenta: #ff5cc8;
  --amber: #ffb454;
  --green: #53f5a0;
  --red: #ff4d5e;
  --ink: #eaf6ff;
  --font: 'Bahnschrift', 'DIN Alternate', 'Arial Narrow', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #05060a; font-family: var(--font); color: var(--ink); user-select: none; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#overlay { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
#overlay.active { pointer-events: auto; }
.hidden { display: none !important; }

/* ---------------- Crosshair ---------------- */
.xhair { position: absolute; left: 50%; top: 50%; z-index: 12; }
.x-dot { position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; border-radius: 50%;
  background: var(--cyan); transform: translate(-50%, -50%); box-shadow: 0 0 6px var(--cyan); }
.x-bar { position: absolute; left: 50%; top: 50%; background: #eafcff; box-shadow: 0 0 5px rgba(120,240,255,0.9); }
.x-bar.b0, .x-bar.b1 { width: 2px; height: 9px; transform: translate(-50%, -50%); }
.x-bar.b2, .x-bar.b3 { width: 9px; height: 2px; transform: translate(-50%, -50%); }

/* ---------------- Hitmarker ---------------- */
.hitmark { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; display: none;
  transform: translate(-50%, -50%); }
.hitmark span { position: absolute; left: 50%; top: 50%; width: 14px; height: 2px; background: #fff;
  box-shadow: 0 0 5px #fff; }
.hitmark span:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
.hitmark span:nth-child(2) { transform: translate(-50%, -50%) rotate(-45deg); }
.hitmark.head span { background: var(--amber); box-shadow: 0 0 8px var(--amber); height: 3px; }

/* ---------------- Damage direction ---------------- */
.dmg-canvas { position: absolute; left: 50%; top: 50%; width: 480px; height: 480px;
  transform: translate(-50%, -50%); z-index: 11; }

/* ---------------- Scope ---------------- */
.scope { position: absolute; inset: 0; z-index: 13; }
.scope::before, .scope::after { content: ''; position: absolute; background: #000; }
.scope::before { inset: 0; background: radial-gradient(circle at 50% 50%, transparent 0, transparent 30%, rgba(0,0,0,0.55) 32%, #000 42%); }
.scope-ring { position: absolute; left: 50%; top: 50%; width: 62vh; height: 62vh; transform: translate(-50%, -50%);
  border: 2px solid rgba(80,220,255,0.5); border-radius: 50%; box-shadow: 0 0 40px rgba(80,220,255,0.25) inset; }
.scope-h, .scope-v { position: absolute; left: 50%; top: 50%; background: rgba(120,240,255,0.65); }
.scope-h { width: 62vh; height: 1px; transform: translate(-50%, -50%); }
.scope-v { width: 1px; height: 62vh; transform: translate(-50%, -50%); }
.scope-dot { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; background: var(--red);
  border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 6px var(--red); }

/* ---------------- Health ---------------- */
.health-wrap { position: absolute; left: 26px; bottom: 26px; display: flex; align-items: center; gap: 10px; }
.hp-icon { color: var(--green); font-size: 24px; text-shadow: 0 0 10px var(--green); }
.hp-barbg { width: 240px; height: 16px; background: rgba(6,10,16,0.7); border: 1px solid rgba(120,200,255,0.25);
  border-radius: 3px; overflow: hidden; box-shadow: 0 0 10px rgba(0,0,0,0.4); }
.hp-fill { height: 100%; width: 100%; background: var(--green); transition: width 0.12s linear, background 0.2s; box-shadow: 0 0 12px currentColor; }
.hp-num { font-size: 30px; font-weight: 700; min-width: 54px; text-shadow: 0 0 12px rgba(120,240,255,0.5); }

/* ---------------- Ammo ---------------- */
.ammo-wrap { position: absolute; right: 26px; bottom: 26px; text-align: right; }
.wpn-name { font-size: 15px; letter-spacing: 3px; color: var(--cyan); opacity: 0.85; text-shadow: 0 0 8px rgba(80,220,255,0.5); }
.ammo-line { font-size: 42px; font-weight: 700; line-height: 1; text-shadow: 0 0 14px rgba(120,240,255,0.35); }
.ammo-line .mag { color: #fff; }
.ammo-line .mag.low { color: var(--red); animation: blink 0.5s steps(2) infinite; }
.ammo-line .sep { opacity: 0.4; margin: 0 6px; font-size: 28px; }
.ammo-line .reserve { font-size: 26px; opacity: 0.7; }
.reload-bar { width: 160px; height: 5px; margin: 6px 0 0 auto; background: rgba(6,10,16,0.7);
  border-radius: 3px; overflow: hidden; opacity: 0; transition: opacity 0.15s; }
.reload-fill { height: 100%; width: 0; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
@keyframes blink { 50% { opacity: 0.25; } }

/* ---------------- Round info ---------------- */
.round-info { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); white-space: nowrap;
  font-size: 16px; letter-spacing: 1.5px; background: rgba(6,10,16,0.5); padding: 7px 18px; border-radius: 20px;
  border: 1px solid rgba(120,200,255,0.15); display: flex; gap: 10px; align-items: center; }
.round-info b { color: var(--cyan); font-size: 19px; }
.ri-sep { opacity: 0.3; }
.ri-lead { color: #ffd9a0; }
.ri-goal { opacity: 0.6; }
.respawn { color: var(--red); font-weight: 700; text-shadow: 0 0 8px var(--red); }

/* ---------------- Kill feed ---------------- */
.kill-feed { position: absolute; right: 26px; top: 240px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.kf-row { background: rgba(6,10,16,0.55); padding: 4px 10px; border-radius: 4px; font-size: 15px;
  display: flex; gap: 8px; align-items: center; border-right: 3px solid rgba(255,255,255,0.2); }
.kf-row.me { border-right-color: var(--cyan); }
.kf-row.victim-me { border-right-color: var(--red); }
.kf-a { color: #fff; font-weight: 700; }
.kf-w { color: var(--amber); }
.kf-v { color: #ffb0b8; }
.kf-row.me .kf-a { color: var(--cyan); }
.hs { color: var(--red); margin-left: 3px; }

/* ---------------- Kill popup ---------------- */
.kill-popup { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%) scale(0.8);
  font-size: 34px; font-weight: 700; letter-spacing: 3px; color: #fff; opacity: 0; pointer-events: none;
  text-shadow: 0 0 18px var(--red), 0 0 6px #fff; }
.kill-popup.show { animation: pop-in 0.35s ease-out forwards; opacity: 1; }
@keyframes pop-in { 0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; } 60% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }

/* ---------------- Low HP vignette ---------------- */
.lowhp-vig { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.25s;
  box-shadow: inset 0 0 200px 40px rgba(255,20,40,0.65); }

/* ---------------- Minimap ---------------- */
.map-wrap { position: absolute; right: 22px; top: 20px; width: 200px; height: 200px; border-radius: 8px;
  overflow: hidden; border: 1px solid rgba(120,200,255,0.25); box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.map-canvas { width: 200px; height: 200px; display: block; }

/* ---------------- Scoreboard ---------------- */
.scoreboard { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 14;
  background: rgba(8,12,20,0.9); padding: 24px 30px; border-radius: 12px; min-width: 460px;
  border: 1px solid rgba(120,200,255,0.25); box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.sb-title { font-size: 22px; letter-spacing: 6px; color: var(--cyan); text-align: center; margin-bottom: 14px; text-shadow: 0 0 12px rgba(80,220,255,0.5); }
.scoreboard table { width: 100%; border-collapse: collapse; font-size: 17px; }
.scoreboard th { text-align: left; opacity: 0.5; font-weight: 400; font-size: 13px; letter-spacing: 2px; padding: 4px 10px; }
.scoreboard td { padding: 5px 10px; border-top: 1px solid rgba(255,255,255,0.06); }
.scoreboard tr.me td { background: rgba(80,220,255,0.12); color: var(--cyan); }
.scoreboard .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; }

/* ---------------- Menus ---------------- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(20,16,40,0.35), rgba(4,5,10,0.82)); text-align: center; }
.title-logo { font-weight: 800; line-height: 0.9; display: flex; flex-direction: column; }
.title-logo .l1 { font-size: 96px; letter-spacing: 10px; color: #fff; text-shadow: 0 0 24px var(--cyan), 0 0 60px var(--cyan); }
.title-logo .l2 { font-size: 118px; letter-spacing: 12px; color: var(--magenta);
  text-shadow: 0 0 24px var(--magenta), 0 0 70px rgba(255,92,200,0.8); margin-top: -8px; }
.title-sub { margin-top: 12px; font-size: 18px; letter-spacing: 8px; color: var(--amber); opacity: 0.85; }

.big-btn { margin-top: 34px; padding: 15px 46px; font-family: var(--font); font-size: 22px; letter-spacing: 4px;
  font-weight: 700; color: #04121a; background: linear-gradient(180deg, #7fefff, var(--cyan)); border: none; border-radius: 8px;
  cursor: pointer; box-shadow: 0 0 26px rgba(80,220,255,0.6); transition: transform 0.1s, box-shadow 0.2s; }
.big-btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 0 40px rgba(80,220,255,0.9); }
.big-btn:active { transform: translateY(0) scale(0.99); }

.settings { margin-top: 30px; display: flex; gap: 26px; flex-wrap: wrap; justify-content: center; }
.settings label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; letter-spacing: 2px; opacity: 0.85; }
.settings input[type=range] { width: 170px; accent-color: var(--cyan); cursor: pointer; }
.settings select { padding: 6px 10px; background: #10151f; color: var(--ink); border: 1px solid rgba(120,200,255,0.3);
  border-radius: 5px; font-family: var(--font); cursor: pointer; }
.settings span { color: var(--cyan); }

.controls { margin-top: 34px; display: flex; gap: 50px; font-size: 15px; opacity: 0.8; }
.ctrl-col { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.ctrl-col .alt { opacity: 0.5; font-size: 12px; }
kbd { display: inline-block; min-width: 20px; padding: 2px 7px; background: #161c28; border: 1px solid rgba(120,200,255,0.3);
  border-bottom-width: 2px; border-radius: 4px; font-family: var(--font); font-size: 13px; color: var(--cyan); margin-right: 4px; }

/* countdown */
.count-num { font-size: 180px; font-weight: 800; color: #fff; text-shadow: 0 0 40px var(--cyan); }
.count-num.pop { animation: count-pop 0.75s ease-out; }
.count-num.go { color: var(--green); text-shadow: 0 0 50px var(--green); }
@keyframes count-pop { 0% { transform: scale(2.2); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 100% { transform: scale(0.8); opacity: 0; } }

/* pause + result */
.pause-box, .result-box { background: rgba(8,12,20,0.85); padding: 40px 60px; border-radius: 16px;
  border: 1px solid rgba(120,200,255,0.2); box-shadow: 0 20px 70px rgba(0,0,0,0.6); }
.pause-box h2 { font-size: 44px; letter-spacing: 8px; margin-bottom: 20px; color: var(--cyan); text-shadow: 0 0 20px var(--cyan); }
.result-box h1 { font-size: 78px; letter-spacing: 8px; margin-bottom: 24px; }
.result-box h1.win { color: var(--green); text-shadow: 0 0 30px var(--green); }
.result-box h1.lose { color: var(--red); text-shadow: 0 0 30px var(--red); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 40px; margin-bottom: 10px; }
.stat .sv { font-size: 40px; font-weight: 700; color: #fff; text-shadow: 0 0 14px rgba(120,240,255,0.4); }
.stat .sl { font-size: 13px; letter-spacing: 3px; opacity: 0.55; margin-top: 2px; }

/* fatal */
#fatal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center;
  background: #05060a; }
.fatal-box { text-align: center; max-width: 560px; padding: 40px; }
.fatal-box h1 { font-size: 56px; letter-spacing: 8px; color: var(--magenta); text-shadow: 0 0 24px var(--magenta); margin-bottom: 16px; }
.fatal-msg { color: var(--red); margin: 12px 0; font-family: monospace; }
.fatal-hint { opacity: 0.7; font-size: 14px; line-height: 1.6; }
.fatal-hint code { background: #161c28; padding: 2px 8px; border-radius: 4px; color: var(--cyan); }

@media (max-width: 720px) {
  .title-logo .l1 { font-size: 56px; } .title-logo .l2 { font-size: 68px; }
  .controls { flex-direction: column; gap: 16px; } .map-wrap { width: 130px; height: 130px; }
  .map-canvas { width: 130px; height: 130px; } .hp-barbg { width: 150px; }
}

/* ---------------- Touch controls ---------------- */
body.touch { overscroll-behavior: none; touch-action: none; }
body.touch #gl { touch-action: none; }
#touch { position: fixed; inset: 0; z-index: 20; pointer-events: none; display: none; touch-action: none;
  -webkit-user-select: none; user-select: none; }
.t-surface { position: absolute; inset: 0; pointer-events: auto; touch-action: none; }
.t-stick { position: absolute; width: 124px; height: 124px; margin-left: -62px; margin-top: -62px;
  border-radius: 50%; border: 2px solid rgba(120,220,255,0.4); background: rgba(10,16,24,0.22);
  pointer-events: none; }
.t-knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; border-radius: 50%;
  background: rgba(120,220,255,0.5); box-shadow: 0 0 14px rgba(80,220,255,0.5); transform: translate(-50%,-50%); }

.t-btn { position: absolute; pointer-events: auto; touch-action: none; display: flex; align-items: center;
  justify-content: center; border-radius: 50%; background: rgba(10,16,24,0.4);
  border: 2px solid rgba(120,220,255,0.5); color: #dff; font-weight: 700; letter-spacing: 1px;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); text-shadow: 0 0 6px rgba(120,240,255,0.5); }
.t-btn span { pointer-events: none; }
.t-btn.press { background: rgba(120,220,255,0.35); transform: scale(0.93); }
/* right-thumb arc: Fire + Aim + Jump only (keeps the top-right clear for HUD) */
.t-fire { right: 30px; bottom: 96px; width: 98px; height: 98px; font-size: 17px;
  border-color: rgba(255,90,110,0.7); color: #ffd7dd; background: rgba(60,12,18,0.4); }
.t-fire.press { background: rgba(255,90,110,0.5); }
.t-ads { right: 142px; bottom: 74px; width: 64px; height: 64px; font-size: 15px; }
.t-ads.on { background: rgba(120,220,255,0.4); border-color: #7fe0ff; }
.t-jump { right: 150px; bottom: 152px; width: 60px; height: 60px; font-size: 14px; }
/* bottom-centre row: weapons + reload */
.t-reload { left: 50%; margin-left: 44px; bottom: 20px; width: 52px; height: 52px; font-size: 20px; }
.t-w { width: 48px; height: 48px; font-size: 17px; bottom: 22px; }
.t-w1 { left: 50%; margin-left: -116px; } .t-w2 { left: 50%; margin-left: -60px; } .t-w3 { left: 50%; margin-left: -4px; }
/* left side: Duck above the health bar */
.t-duck { left: 20px; bottom: 92px; width: 58px; height: 58px; font-size: 14px; }
.t-pause { top: 14px; left: 14px; width: 46px; height: 46px; font-size: 15px; }
.t-rotate { position: absolute; inset: 0; z-index: 45; background: #05060a; color: var(--cyan);
  display: none; align-items: center; justify-content: center; text-align: center; font-size: 26px;
  letter-spacing: 2px; line-height: 1.6; pointer-events: auto; text-shadow: 0 0 16px var(--cyan); }

/* HUD repositioned so it doesn't collide with the on-screen controls */
body.touch .ammo-wrap { top: 124px; right: 16px; bottom: auto; }
body.touch .wpn-name { font-size: 13px; } body.touch .ammo-line { font-size: 30px; }
body.touch .map-wrap { width: 104px; height: 104px; top: 12px; right: 12px; }
body.touch .map-canvas { width: 104px; height: 104px; }
body.touch .round-info { font-size: 12px; top: 10px; padding: 5px 12px; }
body.touch .kill-feed { top: 68px; left: 14px; right: auto; align-items: flex-start; }
body.touch .health-wrap { bottom: 20px; left: 20px; }
body.touch .hp-barbg { width: 150px; }
