@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono&family=Inter:wght@300;400;600&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --neon-cyan: #00f3ff;
  --neon-pink: #ff0077;
  --neon-purple: #b86cff;
  --neon-yellow: #ffd36a;
  --bg-dark: rgba(10, 11, 20, 0.75);
  --border-glow: rgba(0, 243, 255, 0.3);
  --font-title: 'Orbitron', system-ui, sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
  --font-body: 'Inter', system-ui, sans-serif;
}

html, body {
  overflow: hidden;
  /* Kill browser back/forward swipe & overscroll while playing */
  overscroll-behavior: none;
  overscroll-behavior-x: none;
  overscroll-behavior-y: none;
  -ms-touch-action: none;
  touch-action: none;
}
body {
  background: #05060b;
  font-family: var(--font-body);
  color: #e2e8f0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
/* Allow typing in inputs (chat / nickname / merchant) */
input, textarea, [contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
}
/* Canvas must own all pointer gestures for FPS controls */
canvas {
  display: block;
  touch-action: none;
  -ms-touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
body.pointer-locked,
body.pointer-locked * {
  cursor: none !important;
}

/* Low health heartbeat vignette */
body.low-health::after {
  content: ""; position: fixed; inset: 0; z-index: 99; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 0, 70, 0) 40%, rgba(255, 0, 70, 0.28) 100%);
  border: 4px solid rgba(255, 0, 70, 0.35);
  animation: dangerPulse 0.8s infinite alternate ease-in-out;
}
body.took-damage::before {
  content: ""; position: fixed; inset: 0; z-index: 98; pointer-events: none;
  background: radial-gradient(circle, transparent 45%, rgba(255, 30, 60, 0.35) 100%);
  animation: dmgFlash 0.18s ease-out;
}
@keyframes dmgFlash { from { opacity: 1; } to { opacity: 0; } }
@keyframes dangerPulse { from { opacity: 0.7; } to { opacity: 1; } }



/* CSS 2D Labels */
.world-label {
  font-family: var(--font-title);
  text-shadow: 0 0 6px rgba(0,0,0,0.95), 0 0 2px rgba(0,0,0,0.9);
  pointer-events: none;
  white-space: nowrap;
}
.player-name {
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.weapon-badge {
  color: var(--neon-cyan);
  font-size: 9px;
  background: rgba(10, 11, 20, 0.7);
  border: 1px solid var(--border-glow);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  margin-top: 2px;
}
.chat-bubble {
  max-width: 200px;
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
  background: var(--bg-dark);
  border: 1px solid var(--border-glow);
  box-shadow: 0 4px 15px rgba(0, 243, 255, 0.15);
  padding: 6px 10px;
  border-radius: 8px;
  white-space: normal;
  text-align: center;
}
.pickup-label {
  color: var(--neon-yellow);
  font-size: 11px;
  font-weight: bold;
  background: rgba(15, 12, 5, 0.82);
  border: 1px solid rgba(255, 211, 106, 0.4);
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 10px rgba(255, 211, 106, 0.15);
  /* Only equip/buff, only nearest, only very close — weapons never use this */
  white-space: nowrap;
}
/* Weapon name badges over players permanently disabled */
.weapon-badge { display: none !important; }
.merchant-label {
  color: var(--neon-purple);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-shadow: 0 0 10px rgba(184, 108, 255, 0.6);
}
.boss-label {
  color: var(--neon-pink);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(255, 0, 85, 0.8);
}
.player-hp-wrap {
  width: 44px; height: 5px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 2px;
}
.player-hp-bar { height: 100%; width: 100%; background: linear-gradient(90deg, #10b981, #059669); }

/* Login screen & launcher style */
#login-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at center, #0f1026 0%, #030408 100%);
}
#login-screen::before {
  content: ""; position: absolute; inset: 0;
  background-image: 
    linear-gradient(rgba(18, 24, 48, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 24, 48, 0.2) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 1;
}
.login-box {
  position: relative; z-index: 10;
  text-align: center; padding: 50px 60px;
  background: rgba(10, 12, 28, 0.8);
  border: 1px solid rgba(0, 243, 255, 0.25);
  box-shadow: 0 0 40px rgba(0, 243, 255, 0.15), inset 0 0 20px rgba(0, 243, 255, 0.08);
  border-radius: 20px;
  backdrop-filter: blur(15px);
  width: 100%; max-width: 460px;
}
.login-box h1 {
  font-family: var(--font-title);
  font-size: 52px; font-weight: 900; letter-spacing: 10px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.35));
  margin-bottom: 5px;
}
.login-box p.subtitle {
  font-family: var(--font-title);
  font-size: 13px; font-weight: 700;
  color: #64748b; letter-spacing: 3px;
  margin-bottom: 30px; text-transform: uppercase;
}
#nickname {
  width: 100%; padding: 14px 20px; font-size: 16px;
  background: rgba(5, 6, 12, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #fff; outline: none; text-align: center;
  font-family: var(--font-body);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 1px;
}
#nickname:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.25);
  background: rgba(5, 6, 12, 0.9);
}
#join-btn {
  display: block; width: 100%; margin-top: 20px; padding: 14px;
  font-family: var(--font-title);
  font-size: 18px; font-weight: 900; letter-spacing: 2px; cursor: pointer;
  background: linear-gradient(90deg, #1d4ed8, #6d28d9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px; color: #fff;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(109, 40, 217, 0.4);
}
#join-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(109, 40, 217, 0.6);
  background: linear-gradient(90deg, #2563eb, #7c3aed);
}
#join-btn:active { transform: translateY(0); }
.controls-hint {
  margin-top: 30px; padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px; color: #57657a;
  line-height: 1.9; font-family: var(--font-mono);
}
.controls-hint strong { color: var(--neon-cyan); }
.controls-hint .hint-tip { color: var(--neon-yellow); margin-top: 6px; }

/* Match bar top center */
#match-bar {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 110; display: flex; align-items: center; gap: 16px;
  background: var(--bg-dark); border: 1px solid var(--border-glow);
  border-radius: 12px; padding: 8px 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.12);
}
#match-timer {
  font-family: var(--font-title); font-size: 22px; font-weight: 900;
  color: #fff; letter-spacing: 2px; min-width: 70px; text-align: center;
}
#match-timer.urgent { color: var(--neon-pink); animation: pulse 0.8s infinite; }
#match-goal {
  font-family: var(--font-mono); font-size: 12px; color: #94a3b8;
}
#match-score-limit { color: var(--neon-yellow); font-weight: bold; }
#match-phase {
  font-family: var(--font-title); font-size: 11px; color: var(--neon-purple);
  letter-spacing: 1px;
}

/* Combat stats near HP */
#combat-stats {
  position: fixed; bottom: 118px; left: 30px; z-index: 100;
  display: flex; gap: 10px; flex-wrap: wrap; max-width: 280px;
}
.stat-line {
  background: var(--bg-dark); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px; padding: 4px 10px;
  font-family: var(--font-mono); font-size: 12px;
  display: flex; gap: 8px; align-items: center;
}
.stat-label { color: #64748b; font-size: 10px; letter-spacing: 1px; }
#stat-score { color: var(--neon-yellow); font-weight: bold; }
#stat-kd { color: #e2e8f0; }
#stat-streak { color: #94a3b8; font-weight: bold; }
#stat-streak.hot { color: var(--neon-pink); text-shadow: 0 0 8px rgba(255,0,119,0.5); }

/* Stamina bar */
#stamina-bar {
  height: 10px; background: rgba(5, 6, 12, 0.85);
  border-radius: 5px; margin-bottom: 0;
  position: relative; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
#stamina-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #0ea5e9, #22d3ee);
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.35);
}
#stamina-fill.low { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
#stamina-text {
  position: absolute; right: 10px; top: 0; line-height: 10px;
  font-family: var(--font-mono); font-size: 9px; color: rgba(255,255,255,0.7);
}
#stamina-bar::before {
  content: "ST"; position: absolute; left: 8px; top: 0; line-height: 10px;
  font-family: var(--font-title); font-size: 8px; font-weight: 700; color: rgba(255,255,255,0.55);
  z-index: 1;
}

/* Hit marker + floating damage */
#hit-marker {
  position: fixed; top: 46%; left: 50%; transform: translate(-50%, -50%);
  z-index: 120; pointer-events: none;
  font-family: var(--font-title); font-size: 18px; font-weight: 900;
  color: var(--neon-pink); text-shadow: 0 0 10px rgba(255,0,119,0.6);
}
#hit-marker.crit { color: var(--neon-yellow); font-size: 22px; }
#hit-marker.pop { animation: hitPop 0.45s ease-out; }
@keyframes hitPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  30% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(1); }
}
#damage-numbers {
  position: fixed; inset: 0; z-index: 115; pointer-events: none;
}
.dmg-num {
  position: absolute; font-family: var(--font-title); font-weight: 900;
  font-size: 20px; color: #fff;
  text-shadow: 0 0 8px rgba(0,243,255,0.7), 0 2px 4px #000;
  animation: dmgFloat 0.7s ease-out forwards;
}
.dmg-num.crit { color: var(--neon-yellow); font-size: 26px; }
@keyframes dmgFloat {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-48px) scale(1.2); }
}

.buff-icon.protect {
  border-color: #38bdf8; color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

/* Match end overlay */
#match-end-screen {
  position: fixed; inset: 0; z-index: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(3, 4, 10, 0.72); backdrop-filter: blur(6px);
  text-align: center;
}
#match-end-screen h2 {
  font-family: var(--font-title); font-size: 42px; letter-spacing: 4px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
}
#match-winner-text {
  font-family: var(--font-mono); font-size: 20px; color: #fff; margin-bottom: 10px;
}
#match-restart-text { color: #94a3b8; font-size: 14px; }

.hidden { display: none !important; }

/* Cyber Crosshair */
#crosshair {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 32px; height: 32px; pointer-events: none; z-index: 100;
}
#crosshair.scoped-hide { opacity: 0; }

/* ── High-power sniper scope (开镜特写) ── */
#scope-overlay {
  position: fixed; inset: 0; z-index: 95; pointer-events: none;
  background: transparent;
  opacity: 0;
  transition: opacity 0.08s linear;
}
#scope-overlay.active { opacity: 1; }
#scope-overlay.scope-in #scope-lens {
  animation: scopePunchIn 0.28s cubic-bezier(0.15, 0.85, 0.25, 1) both;
}
#scope-overlay.scope-in #scope-blackout {
  animation: scopeBlackFlash 0.32s ease-out both;
}
@keyframes scopePunchIn {
  0%   { transform: translate(-50%, -50%) scale(2.6); filter: blur(3px); opacity: 0.2; }
  55%  { transform: translate(-50%, -50%) scale(0.94); filter: blur(0); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); filter: blur(0); opacity: 1; }
}
@keyframes scopeBlackFlash {
  0%   { opacity: 0.85; }
  40%  { opacity: 0.55; }
  100% { opacity: 0; }
}
#scope-blackout {
  position: absolute; inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
}
#scope-lens {
  position: absolute; top: 50%; left: 50%;
  width: min(72vmin, 80vh);
  height: min(72vmin, 80vh);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 6px #0a0c10,
    inset 0 0 0 10px #1a2228,
    inset 0 0 40px rgba(0, 0, 0, 0.45),
    0 0 0 999vmax rgba(0, 0, 0, 0.97);
  overflow: hidden;
}
.scope-glass {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(180, 230, 210, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(100, 180, 150, 0.06) 0%, transparent 70%);
  pointer-events: none;
}
.scope-ring-mark {
  position: absolute; inset: 8%;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}
.scope-reticle {
  position: absolute; inset: 0;
  pointer-events: none;
}
.scope-cross-h, .scope-cross-v {
  position: absolute; background: rgba(8, 10, 12, 0.92);
}
.scope-cross-h {
  left: 12%; right: 12%; top: 50%; height: 1.5px; transform: translateY(-50%);
}
.scope-cross-v {
  top: 12%; bottom: 12%; left: 50%; width: 1.5px; transform: translateX(-50%);
}
.scope-dot {
  position: absolute; top: 50%; left: 50%; width: 5px; height: 5px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: #ff2244; box-shadow: 0 0 8px #ff2244, 0 0 16px rgba(255, 40, 60, 0.5);
}
.scope-tick {
  position: absolute; background: rgba(8, 10, 12, 0.85);
}
.scope-tick.t1 { left: 50%; top: 36%; width: 14px; height: 1.5px; transform: translateX(-50%); }
.scope-tick.t2 { left: 50%; top: 64%; width: 14px; height: 1.5px; transform: translateX(-50%); }
.scope-tick.t3 { top: 50%; left: 36%; width: 1.5px; height: 14px; transform: translateY(-50%); }
.scope-tick.t4 { top: 50%; left: 64%; width: 1.5px; height: 14px; transform: translateY(-50%); }
.scope-mil {
  position: absolute; background: rgba(8, 10, 12, 0.75);
}
.scope-mil.m1 { left: 50%; top: 28%; width: 8px; height: 1px; transform: translateX(-50%); }
.scope-mil.m2 { left: 50%; top: 72%; width: 8px; height: 1px; transform: translateX(-50%); }
.scope-mil.m3 { top: 50%; left: 28%; width: 1px; height: 8px; transform: translateY(-50%); }
.scope-mil.m4 { top: 50%; left: 72%; width: 1px; height: 8px; transform: translateY(-50%); }
#scope-zoom-label {
  position: absolute; bottom: 7%; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 18px; letter-spacing: 3px;
  color: rgba(0, 243, 255, 0.95);
  text-shadow: 0 0 10px rgba(0, 243, 255, 0.55);
  background: rgba(0, 0, 0, 0.6);
  padding: 5px 14px; border-radius: 4px;
  border: 1px solid rgba(0, 243, 255, 0.35);
  z-index: 2;
}
#scope-hint {
  position: absolute; bottom: 3.5%; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px;
  color: rgba(148, 163, 184, 0.75); z-index: 2;
}

/* ── Low-power red-dot / holo (手枪/机枪特写) ── */
#low-scope-overlay {
  position: fixed; inset: 0; z-index: 94; pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s linear;
}
#low-scope-overlay.active { opacity: 1; }
#low-scope-overlay.scope-in .low-scope-frame {
  animation: lowScopeIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
#low-scope-overlay.scope-in .low-scope-vignette {
  animation: lowVignetteIn 0.25s ease-out both;
}
@keyframes lowScopeIn {
  0%   { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes lowVignetteIn {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}
.low-scope-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 38%, rgba(0,0,0,0.28) 70%, rgba(0,0,0,0.62) 100%);
}
.low-scope-frame {
  position: absolute; top: 50%; left: 50%;
  width: 64px; height: 64px;
  transform: translate(-50%, -50%);
}
.low-scope-ring {
  position: absolute; inset: 0;
  border: 2px solid rgba(0, 243, 255, 0.65);
  border-radius: 50%;
  box-shadow:
    0 0 14px rgba(0, 243, 255, 0.25),
    inset 0 0 10px rgba(0, 243, 255, 0.12);
}
.low-scope-cross-h, .low-scope-cross-v {
  position: absolute; background: rgba(0, 243, 255, 0.75);
  box-shadow: 0 0 4px rgba(0, 243, 255, 0.5);
}
.low-scope-cross-h {
  left: 50%; top: 50%; width: 18px; height: 1.5px;
  transform: translate(-50%, -50%);
}
.low-scope-cross-v {
  left: 50%; top: 50%; width: 1.5px; height: 18px;
  transform: translate(-50%, -50%);
}
.low-scope-ring::after {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 4px; height: 4px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #ff3355;
  box-shadow: 0 0 6px #ff2244;
}
#low-scope-zoom-label {
  position: absolute; bottom: 16%; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 1px;
  color: rgba(0, 243, 255, 0.8);
  background: rgba(0, 0, 0, 0.45);
  padding: 3px 10px; border-radius: 3px;
  border: 1px solid rgba(0, 243, 255, 0.2);
}

/* Full-screen ADS punch flash */
#ads-flash {
  position: fixed; inset: 0; z-index: 96; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.75) 100%);
  opacity: 0;
}
#ads-flash.fire {
  animation: adsFlash 0.26s ease-out both;
}
@keyframes adsFlash {
  0%   { opacity: 0.9; }
  100% { opacity: 0; }
}

/* Local death flash */
body.player-died::before {
  content: ""; position: fixed; inset: 0; z-index: 120; pointer-events: none;
  background: radial-gradient(circle, rgba(255,40,60,0.35) 0%, rgba(0,0,0,0.55) 100%);
  animation: deathFlash 0.55s ease-out forwards;
}
@keyframes deathFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
.ch-line {
  position: absolute; background: var(--neon-cyan);
  box-shadow: 0 0 5px var(--neon-cyan);
  transition: all 0.1s ease;
}
.ch-top { width: 2px; height: 8px; left: 15px; top: 0; }
.ch-bottom { width: 2px; height: 8px; left: 15px; bottom: 0; }
.ch-left { width: 8px; height: 2px; left: 0; top: 15px; }
.ch-right { width: 8px; height: 2px; right: 0; top: 15px; }
.ch-dot {
  position: absolute; width: 4px; height: 4px; background: var(--neon-pink);
  left: 14px; top: 14px; border-radius: 50%;
  box-shadow: 0 0 6px var(--neon-pink);
}
#crosshair.hit .ch-line { background: var(--neon-pink); box-shadow: 0 0 8px var(--neon-pink); }
#crosshair.hit .ch-top { transform: translateY(-4px); }
#crosshair.hit .ch-bottom { transform: translateY(4px); }
#crosshair.hit .ch-left { transform: translateX(-4px); }
#crosshair.hit .ch-right { transform: translateX(4px); }
#crosshair.hit.crit .ch-line, #crosshair.hit.crit .ch-dot {
  background: var(--neon-yellow);
  box-shadow: 0 0 10px var(--neon-yellow);
}

/* Pickup hint overlay */
#pickup-hint {
  position: fixed; bottom: 160px; left: 50%; transform: translateX(-50%);
  z-index: 50; padding: 10px 24px; border-radius: 8px;
  background: var(--bg-dark);
  border: 1px solid var(--neon-yellow);
  box-shadow: 0 0 20px rgba(255, 211, 106, 0.25);
  color: var(--neon-yellow);
  font-family: var(--font-title);
  font-weight: 700; font-size: 13px; letter-spacing: 1px;
  animation: pulse 1.2s infinite;
  backdrop-filter: blur(10px);
}
@keyframes pulse { 0%,100% { opacity: 1; transform: translate(-50%, 0) scale(1); } 50% { opacity: 0.75; transform: translate(-50%, 0) scale(0.97); } }

/* BOSS HP BAR */
#boss-bar {
  position: fixed; top: 25px; left: 50%; transform: translateX(-50%);
  z-index: 50; width: 450px; text-align: center;
  background: var(--bg-dark);
  padding: 12px 20px; border-radius: 12px;
  border: 1px solid rgba(255, 0, 70, 0.4);
  box-shadow: 0 0 25px rgba(255, 0, 70, 0.25);
  backdrop-filter: blur(10px);
}
#boss-name {
  font-family: var(--font-title);
  color: var(--neon-pink);
  font-weight: 900; font-size: 15px; letter-spacing: 3px;
  text-shadow: 0 0 8px rgba(255, 0, 70, 0.5);
}
.boss-hp-track {
  height: 12px; background: rgba(0, 0, 0, 0.5); border-radius: 6px;
  margin-top: 8px; overflow: hidden; border: 1px solid rgba(255, 0, 70, 0.2);
}
#boss-hp-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #b91c1c, #ef4444, #f43f5e);
  transition: width 0.15s ease-out;
  box-shadow: 0 0 8px rgba(255, 0, 70, 0.5);
}

/* Local Player HUD Stats */
#top-bar {
  position: fixed; bottom: 30px; left: 30px; z-index: 100; width: 260px;
}
#death-killer {
  font-family: var(--font-title); color: var(--neon-pink);
  font-size: 16px; letter-spacing: 1px; margin: 8px 0;
}
#death-countdown {
  font-family: var(--font-mono); color: var(--neon-yellow);
  font-size: 14px; margin-bottom: 12px;
}
#hp-bar, #armor-bar {
  height: 24px; background: rgba(5, 6, 12, 0.85);
  border-radius: 6px; margin-bottom: 8px;
  position: relative; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
#hp-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #dc2626, #f87171);
  transition: width 0.15s ease-out;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.3);
}
#armor-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  transition: width 0.15s ease-out;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}
#hp-text, #armor-text {
  position: absolute; right: 12px; top: 0; line-height: 22px;
  font-family: var(--font-mono);
  font-size: 13px; font-weight: bold; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
#hp-bar::before {
  content: "HP"; position: absolute; left: 10px; top: 0; line-height: 22px;
  font-family: var(--font-title); font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.7);
}
#armor-bar::before {
  content: "AP"; position: absolute; left: 10px; top: 0; line-height: 22px;
  font-family: var(--font-title); font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.7);
}

/* Weapon View HUD */
#weapon-info {
  position: fixed; bottom: 30px; right: 30px; z-index: 100;
  text-align: right;
  background: var(--bg-dark);
  border: 1px solid var(--border-glow);
  box-shadow: 0 0 25px rgba(0, 243, 255, 0.1);
  border-radius: 12px; padding: 12px 20px;
  min-width: 180px;
  backdrop-filter: blur(10px);
}
#weapon-name {
  font-family: var(--font-title);
  font-size: 24px; font-weight: 900; color: #fff;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(0, 243, 255, 0.4);
}
#cooldown-bar {
  width: 100%; height: 6px; background: rgba(0, 0, 0, 0.5);
  border-radius: 3px; margin-top: 8px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
#cooldown-fill {
  height: 100%; width: 0%;
  background: var(--neon-yellow);
  box-shadow: 0 0 6px var(--neon-yellow);
  transition: width 0.1s linear;
}

/* Buffs List */
#buffs {
  position: fixed; bottom: 100px; left: 30px; z-index: 100;
  display: flex; gap: 8px; flex-wrap: wrap; max-width: 320px;
}
.buff-icon {
  padding: 6px 12px; border-radius: 6px;
  font-family: var(--font-title); font-size: 10px; font-weight: 900;
  background: rgba(15, 12, 5, 0.85);
  border: 1px solid var(--neon-yellow);
  color: var(--neon-yellow);
  box-shadow: 0 0 10px rgba(255, 211, 106, 0.2);
  letter-spacing: 1px;
  animation: buffFloat 1.5s infinite alternate ease-in-out;
}
@keyframes buffFloat { from { transform: translateY(0); } to { transform: translateY(-2px); } }

/* Kill feed top right */
#kill-feed {
  position: fixed; top: 30px; right: 30px; z-index: 100;
  max-width: 320px;
}
.kill-entry {
  padding: 8px 16px; margin-bottom: 6px;
  background: var(--bg-dark);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13px; color: #cbd5e1;
  animation: slideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  backdrop-filter: blur(5px);
}
.kill-entry.assassin {
  border-left: 4px solid var(--neon-pink);
  color: #fca5a5;
  box-shadow: 0 0 15px rgba(255, 0, 85, 0.15);
}
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

/* Announcement overlay center */
#announcement {
  position: fixed; top: 25%; left: 50%; transform: translate(-50%, -50%);
  z-index: 200; font-family: var(--font-title);
  font-size: 28px; font-weight: 900; letter-spacing: 4px;
  color: #fff;
  text-shadow: 0 0 15px rgba(0, 243, 255, 0.8), 0 0 30px rgba(0, 243, 255, 0.4);
  pointer-events: none; opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  text-transform: uppercase;
}
#announcement.show { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }

/* Chat Logs bottom left */
#chat-log {
  position: fixed; bottom: 100px; left: 320px; z-index: 100;
  width: 320px; max-height: 180px; overflow-y: auto;
  pointer-events: none;
}
#chat-log::-webkit-scrollbar { display: none; }
.chat-entry {
  padding: 4px 8px; margin-bottom: 4px;
  background: rgba(10, 11, 20, 0.4);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 12px; color: #94a3b8;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.chat-entry .name { color: var(--neon-cyan); font-weight: bold; }

/* Chat inputs */
#chat-input-wrap {
  position: fixed; bottom: 70px; left: 320px; z-index: 1000;
}
#chat-input {
  width: 320px; padding: 10px 16px; font-size: 14px;
  background: rgba(5, 6, 12, 0.95);
  border: 1px solid var(--border-glow);
  border-radius: 8px; color: #fff; outline: none;
  font-family: var(--font-body);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.15);
}

/* Leaderboard top left */
#leaderboard {
  position: fixed; top: 30px; left: 30px; z-index: 100;
  background: var(--bg-dark);
  border: 1px solid var(--border-glow);
  border-radius: 12px; padding: 16px 20px;
  min-width: 240px;
  box-shadow: 0 0 30px rgba(0, 243, 255, 0.1);
  backdrop-filter: blur(10px);
}
#leaderboard h3 {
  font-family: var(--font-title);
  font-size: 14px; font-weight: 900; letter-spacing: 2px;
  margin-bottom: 12px; text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: center;
}
.lb-tab {
  cursor: pointer; padding: 3px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 700; color: #64748b;
  transition: all 0.2s ease;
  font-family: var(--font-title);
}
.lb-tab:hover { color: #fff; }
.lb-tab.active { background: rgba(0, 243, 255, 0.15); color: var(--neon-cyan); border: 1px solid rgba(0, 243, 255, 0.3); }

#lb-list { list-style: none; counter-reset: lb; }
#lb-list li {
  padding: 6px 0; display: flex; justify-content: space-between; align-items: center;
  counter-increment: lb;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px; font-family: var(--font-mono);
}
#lb-list li:last-child { border-bottom: none; }
#lb-list li::before {
  content: counter(lb) "."; color: #475569; margin-right: 8px; width: 15px; font-weight: bold;
}
.lb-assassin { color: var(--neon-pink); }

/* Circular high-tech Radar Minimap */
#minimap {
  position: fixed; bottom: 30px; left: 320px; z-index: 100;
  border: 2px solid var(--neon-cyan);
  border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.3), inset 0 0 15px rgba(0, 243, 255, 0.2);
  width: 154px; height: 154px;
  backdrop-filter: blur(3px);
}
#minimap::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.08) 0%, transparent 50%, rgba(0, 243, 255, 0.08) 100%);
  border-radius: 50%; pointer-events: none;
}
#minimap-canvas {
  width: 150px; height: 150px;
  border-radius: 50%;
}

/* Cyber Merchant Panel */
#merchant-panel {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  z-index: 1000; background: rgba(8, 7, 18, 0.95);
  border: 2px solid var(--neon-purple);
  box-shadow: 0 0 45px rgba(184, 108, 255, 0.35), inset 0 0 20px rgba(184, 108, 255, 0.1);
  border-radius: 16px; padding: 30px; min-width: 400px;
  backdrop-filter: blur(20px);
  animation: panelGlow 4s infinite alternate;
}
@keyframes panelGlow {
  0% { box-shadow: 0 0 35px rgba(184, 108, 255, 0.2); }
  100% { box-shadow: 0 0 50px rgba(184, 108, 255, 0.45); }
}
#merchant-panel h3 {
  font-family: var(--font-title);
  font-size: 22px; font-weight: 900; color: var(--neon-purple);
  letter-spacing: 3px; margin-bottom: 5px; text-transform: uppercase;
  text-shadow: 0 0 8px rgba(184, 108, 255, 0.4);
}
.merchant-score {
  font-family: var(--font-mono);
  font-size: 15px; color: #fff; margin-bottom: 20px;
  display: flex; gap: 8px; align-items: center;
}
#merchant-score { color: var(--neon-yellow); font-weight: bold; }
.merchant-distance {
  color: #64748b; font-size: 12px; margin: -15px 0 15px;
  font-family: var(--font-mono);
}
#merchant-items {
  display: grid; gap: 8px; max-height: 280px; overflow-y: auto;
  padding-right: 4px;
}
#merchant-items::-webkit-scrollbar { width: 4px; }
#merchant-items::-webkit-scrollbar-thumb { background: var(--neon-purple); border-radius: 2px; }
.merchant-section-title {
  margin: 8px 0 2px;
  color: #94a3b8;
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.5px;
}
.merchant-item {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  gap: 14px;
  padding: 12px 18px; background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 8px; cursor: pointer;
  color: #cbd5e1; font-family: var(--font-body); font-size: 14px;
  transition: all 0.2s ease;
  text-align: left;
}
.merchant-good { border-color: rgba(255, 211, 106, 0.18); }
.merchant-item:hover:not(.disabled) {
  background: rgba(184, 108, 255, 0.12);
  border-color: rgba(184, 108, 255, 0.4);
  color: #fff;
  transform: translateX(2px);
}
.merchant-item.owned .item-status { color: #34d399; font-weight: 600; }
.merchant-item.equipped {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(52, 211, 153, 0.12);
}
.merchant-item.disabled {
  cursor: not-allowed; opacity: 0.35;
}
.item-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.merchant-good .item-main {
  display: grid;
  gap: 2px;
}
.item-name {
  font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item-desc {
  min-width: 0;
  color: #64748b;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-swatch {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 8px rgba(255,255,255,0.12);
}
.item-status {
  font-family: var(--font-mono);
  color: var(--neon-yellow); white-space: nowrap;
  flex: 0 0 auto;
}
#merchant-close {
  margin-top: 20px; width: 100%; padding: 12px; cursor: pointer;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px; color: #94a3b8; font-family: var(--font-title);
  font-weight: 700; font-size: 13px; letter-spacing: 1px;
  transition: all 0.2s ease;
}
#merchant-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Death Overlay Screen — must receive clicks (button was blocked by pointer-events:none) */
#death-screen {
  position: fixed; inset: 0; z-index: 4000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(15, 5, 5, 0.75) 0%, rgba(3, 1, 1, 0.95) 100%);
  pointer-events: auto;
  cursor: default;
}
#death-screen.hidden {
  pointer-events: none !important;
}
#death-screen h2 {
  font-family: var(--font-title);
  font-size: 48px; font-weight: 900; color: var(--neon-pink);
  letter-spacing: 8px;
  text-shadow: 0 0 25px rgba(255, 0, 70, 0.75), 0 0 5px rgba(0, 0, 0, 0.8);
  animation: glitchText 3s infinite;
  pointer-events: none;
}
#death-screen p {
  margin-top: 15px; color: #94a3b8;
  font-family: var(--font-body); font-size: 15px;
  pointer-events: none;
}
#death-screen .respawn-btn {
  pointer-events: auto;
  position: relative;
  z-index: 4001;
  cursor: pointer;
  margin-top: 20px;
}
.spectate-hint {
  font-size: 12px; color: #475569; margin-top: 10px;
  font-family: var(--font-mono);
}
kbd {
  background: rgba(255, 255, 255, 0.08); padding: 3px 8px;
  border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.15);
  font-family: var(--font-mono); color: #fff; font-size: 13px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Global loading overlay */
#loading {
  position: fixed; inset: 0; z-index: 5000;
  display: flex; align-items: center; justify-content: center;
  background: #05060b; font-family: var(--font-title);
  font-size: 22px; font-weight: 900; color: var(--neon-cyan);
  letter-spacing: 4px;
}
#loading::after {
  content: ""; width: 24px; height: 24px; margin-left: 15px;
  border: 3px solid rgba(0, 243, 255, 0.15);
  border-top-color: var(--neon-cyan);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dangerPulse { 0% { opacity: 0.6; } 100% { opacity: 1.0; } }
@keyframes glitchText {
  0%, 100% { transform: none; }
  92% { transform: skewX(-5deg) scaleY(0.95); }
  94% { transform: skewX(5deg) scaleY(1.05); }
  96% { transform: skewX(-3deg) scaleY(0.98); }
}

@media (max-width: 720px) {
  #leaderboard { min-width: 160px; max-width: 42vw; padding: 10px; }
  #minimap { left: auto; right: 20px; bottom: 100px; width: 104px; height: 104px; }
  #minimap-canvas { width: 100px; height: 100px; }
  #top-bar { width: 200px; bottom: 20px; left: 20px; }
  #weapon-info { bottom: 20px; right: 20px; padding: 8px 12px; min-width: 130px; }
  #chat-log, #chat-input-wrap { left: 20px; width: 260px; }
  #chat-input { width: 260px; }
  #merchant-panel { min-width: min(400px, calc(100vw - 32px)); padding: 20px; }
  .login-box { padding: 30px; }
  .login-box h1 { font-size: 36px; }
}

/* Loadout bar */
#loadout-bar {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 100; display: flex; gap: 8px; pointer-events: auto;
}
.loadout-slot {
  min-width: 78px; padding: 6px 10px; border-radius: 8px;
  background: rgba(10, 12, 20, 0.82); border: 1px solid rgba(0, 243, 255, 0.22);
  color: #cbd5e1; font-family: var(--font-mono); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.loadout-slot .ls-label { font-size: 10px; color: #64748b; letter-spacing: 1px; }
.loadout-slot .ls-name { font-size: 12px; color: #e2e8f0; font-weight: 700; }
.loadout-slot.active {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.25);
  background: rgba(0, 40, 50, 0.85);
}
.loadout-slot.empty .ls-name { color: #475569; }
.view-mode-tag {
  margin-left: 8px; font-size: 10px; color: #94a3b8;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 4px; padding: 1px 6px;
}

/* Flashbang whiteout */
body.flashed::after {
  content: ""; position: fixed; inset: 0; z-index: 200; pointer-events: none;
  background: #fff;
  animation: flashFade 1.8s ease-out forwards;
}
@keyframes flashFade {
  0% { opacity: 1; }
  30% { opacity: 0.85; }
  100% { opacity: 0; }
}

/* Mobile virtual controls */
#mobile-controls {
  position: fixed; inset: 0; z-index: 150; pointer-events: none;
  touch-action: none;
}
#mc-stick-zone {
  position: absolute; left: 0; bottom: 0; width: 46%; height: 48%;
  pointer-events: auto; touch-action: none;
}
#mc-stick-base {
  position: absolute; left: 28px; bottom: 36px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.28); border: 2px solid rgba(0, 243, 255, 0.35);
}
#mc-stick-knob {
  position: absolute; left: 50%; top: 50%;
  width: 52px; height: 52px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 243, 255, 0.45); border: 2px solid rgba(255,255,255,0.5);
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.35);
}
#mc-look-zone {
  position: absolute; right: 0; top: 0; width: 54%; height: 100%;
  pointer-events: auto; touch-action: none;
}
#mc-buttons {
  position: absolute; right: 12px; bottom: 20px;
  width: 210px; height: 250px; pointer-events: none;
}
.mc-btn {
  position: absolute; pointer-events: auto; touch-action: none;
  border: 1px solid rgba(0, 243, 255, 0.4);
  background: rgba(8, 12, 22, 0.55);
  color: #e2e8f0; font-family: var(--font-title); font-size: 12px;
  border-radius: 50%; width: 58px; height: 58px;
  backdrop-filter: blur(4px);
}
.mc-btn.active { background: rgba(0, 243, 255, 0.35); transform: scale(0.95); }
.mc-fire { right: 8px; bottom: 70px; width: 72px; height: 72px; background: rgba(255, 40, 80, 0.35); border-color: rgba(255,80,100,0.6); }
.mc-aim { right: 88px; bottom: 100px; }
.mc-jump { right: 88px; bottom: 28px; }
.mc-sprint { right: 8px; bottom: 8px; width: 52px; height: 52px; font-size: 11px; }
.mc-interact { right: 150px; bottom: 28px; width: 48px; height: 48px; font-size: 11px; }
.mc-slot { width: 44px; height: 44px; font-size: 10px; bottom: 190px; }
.mc-slot[data-btn="slot1"] { right: 150px; }
.mc-slot[data-btn="slot2"] { right: 100px; }
.mc-slot[data-btn="slot3"] { right: 50px; }
.mc-view { right: 8px; bottom: 200px; width: 48px; height: 48px; font-size: 11px; }

body.mobile-mode #leaderboard { transform: scale(0.85); transform-origin: top right; }
body.mobile-mode #loadout-bar { bottom: 300px; }
body.mobile-mode #weapon-info { bottom: 250px; }
body.mobile-mode #chat-log { display: none; }

.respawn-btn {
  margin: 14px auto 10px;
  display: inline-block;
  padding: 12px 36px;
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #041018;
  background: linear-gradient(135deg, #00f3ff, #38bdf8);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(0, 243, 255, 0.45);
}
.respawn-btn:hover { filter: brightness(1.08); transform: scale(1.03); }
.respawn-btn:active { transform: scale(0.98); }
