/* Neon Siege — Protocol Drop — FPS HUD + neon menu */
:root {
  --bg: #05080f;
  --panel: rgba(8, 14, 28, 0.92);
  --panel-border: rgba(0, 240, 255, 0.35);
  --neon-cyan: #00f0ff;
  --neon-pink: #ff2d95;
  --neon-violet: #7b61ff;
  --neon-lime: #b8ff3c;
  --neon-amber: #ffb020;
  --danger: #ff3355;
  --text: #e8f4ff;
  --muted: #7a8fa8;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "Consolas", "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  user-select: none;
  -webkit-user-select: none;
}

body { background: transparent; }

#aps-space-war-bg { z-index: 0 !important; }
#game-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 1;
  background: transparent;
}

#game-viewport {
  position: absolute;
  inset: 0;
  z-index: 1;
}
#game-viewport canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

body.ns-menu #game-viewport { opacity: 0; pointer-events: none; }
body.ns-playing #aps-space-war-bg { opacity: 0.18; }
body.ns-menu #aps-space-war-bg { opacity: 1; }
body.ns-menu .screen {
  background: rgba(3, 6, 14, 0.48);
  backdrop-filter: blur(6px);
}
body.ns-menu .panel {
  background: rgba(8, 14, 28, 0.78);
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 0 40px rgba(109, 40, 217, 0.25);
}
body.ns-playing .screen:not(.hidden) {
  background: rgba(3, 6, 14, 0.72);
}

/* Screens */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 40;
  background: rgba(3, 6, 14, 0.88);
  backdrop-filter: blur(8px);
  padding: 24px;
  overflow-y: auto;
}
.screen.hidden { display: none !important; }

.logo-wrap { text-align: center; margin-bottom: 28px; }
.logo-wrap h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink), var(--neon-violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.4));
}
.logo-wrap .tagline {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: 0.35em;
  color: var(--neon-cyan);
  opacity: 0.85;
  text-transform: uppercase;
}
.fps-badge {
  margin-top: 10px;
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid rgba(255, 45, 149, 0.5);
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--neon-pink);
  background: rgba(255, 45, 149, 0.12);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.08), inset 0 0 60px rgba(0, 240, 255, 0.03);
  max-width: 920px;
  width: 100%;
}
.panel h2 {
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  padding-bottom: 8px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 12px 0;
}

button, .btn {
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid var(--neon-cyan);
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.18), rgba(0, 240, 255, 0.05));
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
button:hover, .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.35);
}
button.primary {
  border-color: var(--neon-pink);
  background: linear-gradient(180deg, rgba(255, 45, 149, 0.35), rgba(255, 45, 149, 0.1));
}
button.danger {
  border-color: var(--danger);
  background: linear-gradient(180deg, rgba(255, 51, 85, 0.3), rgba(255, 51, 85, 0.08));
}
button.ghost {
  border-color: rgba(122, 143, 168, 0.5);
  background: rgba(255, 255, 255, 0.04);
}
button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 12px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

select, input[type="text"] {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.9rem;
}
.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 240, 255, 0.4);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--neon-cyan);
}

.map-card, .shop-card, .pass-card {
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 10px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.map-card:hover, .shop-card:hover, .pass-card:hover {
  border-color: var(--neon-pink);
  box-shadow: 0 0 16px rgba(255, 45, 149, 0.25);
}
.map-card h3, .shop-card h3 { font-size: 0.95rem; margin-bottom: 6px; color: var(--neon-cyan); }
.paywall-prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
@media (max-width: 640px) { .paywall-prices { grid-template-columns: 1fr; } }

.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.inv-item {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  font-size: 0.8rem;
}
.inv-item:hover { border-color: var(--neon-lime); }

.overlay-panel {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}
.overlay-panel.hidden { display: none !important; }

/* Crosshair */
.crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  z-index: 25;
  pointer-events: none;
}
.crosshair .ch-h, .crosshair .ch-v {
  position: absolute;
  background: rgba(232, 244, 255, 0.9);
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.6);
}
.crosshair .ch-h { left: 4px; right: 4px; top: 50%; height: 2px; margin-top: -1px; }
.crosshair .ch-v { top: 4px; bottom: 4px; left: 50%; width: 2px; margin-left: -1px; }
.crosshair .ch-dot {
  position: absolute;
  left: 50%; top: 50%;
  width: 3px; height: 3px;
  margin: -1.5px 0 0 -1.5px;
  border-radius: 50%;
  background: var(--neon-cyan);
}
.crosshair.ads { width: 18px; height: 18px; }
.crosshair.ads .ch-h, .crosshair.ads .ch-v { opacity: 0.55; }

#hitmarker {
  position: absolute;
  left: 50%; top: 50%;
  width: 22px; height: 22px;
  margin: -11px 0 0 -11px;
  z-index: 26;
  pointer-events: none;
  border: 2px solid var(--neon-lime);
  transform: rotate(45deg) scale(0.6);
  opacity: 0;
  transition: opacity 0.05s;
}
#hitmarker.show { opacity: 1; }

#muzzle-flash {
  position: absolute;
  left: 50%; top: 50%;
  width: 120px; height: 80px;
  margin: -20px 0 0 -20px;
  z-index: 24;
  pointer-events: none;
  background: radial-gradient(ellipse at 30% 60%, rgba(255, 220, 120, 0.55), transparent 70%);
  opacity: 0;
}
#muzzle-flash.show { opacity: 1; }

#dmg-vignette {
  position: absolute;
  inset: 0;
  z-index: 22;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(180, 0, 40, 0.55) 100%);
  opacity: 0;
  transition: opacity 0.15s;
}

#ads-scope {
  position: absolute;
  inset: 0;
  z-index: 23;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 18%, rgba(0,0,0,0.72) 42%, rgba(0,0,0,0.88) 100%);
  opacity: 0;
  transition: opacity 0.12s;
}
#ads-scope.show { opacity: 1; }

#interact-prompt {
  position: absolute;
  left: 50%;
  bottom: 28%;
  transform: translateX(-50%);
  z-index: 28;
  padding: 8px 16px;
  border: 1px solid var(--neon-cyan);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--neon-cyan);
  pointer-events: none;
}

#cam-mode {
  position: absolute;
  top: 72px;
  right: 18px;
  z-index: 28;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: rgba(0, 240, 255, 0.7);
  pointer-events: none;
}

/* HUD */
#hud {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}
#hud .interactive { pointer-events: auto; }

.hud-top {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}
.hud-top b { color: var(--neon-cyan); }

.bars {
  position: absolute;
  left: 18px;
  bottom: 22px;
  width: 220px;
}
.bar-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin: 6px 0 2px;
}
.bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.bar i {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transition: transform 0.1s;
}
.bar.hp i { background: linear-gradient(90deg, #ff3355, #ff2d95); }
.bar.armor i { background: linear-gradient(90deg, #4cc9f0, #00f0ff); }

#ammo-display {
  position: absolute;
  right: 22px;
  bottom: 28px;
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}
#ammo-display small {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 500;
}
#weapon-name {
  position: absolute;
  right: 22px;
  bottom: 72px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--neon-cyan);
  text-transform: uppercase;
}

.hotbar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}
.hotbar .slot {
  width: 56px;
  height: 56px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--muted);
  cursor: pointer;
}
.hotbar .slot.active {
  border-color: var(--neon-pink);
  box-shadow: 0 0 14px rgba(255, 45, 149, 0.35);
  color: var(--text);
}
.hotbar .slot .key {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--neon-cyan);
  margin-bottom: 2px;
}

#killfeed {
  position: absolute;
  top: 60px;
  right: 16px;
  width: 280px;
  text-align: right;
  font-size: 0.78rem;
  font-family: var(--mono);
}
#killfeed .kf {
  margin-bottom: 4px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  color: var(--muted);
  animation: kf-in 0.2s ease;
}
#killfeed .kf b { color: var(--neon-pink); }
@keyframes kf-in { from { opacity: 0; transform: translateX(12px); } }

#xp-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
}
#xp-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-violet), var(--neon-cyan));
}

#controls-hint {
  position: absolute;
  left: 50%;
  top: 52px;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: rgba(122, 143, 168, 0.55);
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 3s;
}
body.ns-playing.hint-fade #controls-hint { opacity: 0; }

/* Minimap */
#minimap {
  position: absolute;
  right: 16px;
  top: 100px;
  z-index: 21;
  width: 140px;
  height: 140px;
  border-radius: 8px;
  border: 1px solid rgba(0, 240, 255, 0.4);
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
body.ns-menu #minimap { display: none; }
body.ns-playing #hud[hidden] ~ #minimap,
#hud[hidden] ~ #minimap { display: none; }
#minimap.hidden { display: none !important; }

#bigmap-canvas {
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  background: #060a12;
}

.panel.victory h1 {
  font-size: 2.4rem;
  letter-spacing: 0.2em;
  color: var(--neon-lime);
  text-shadow: 0 0 24px rgba(184, 255, 60, 0.5);
}
.panel.defeat h1 {
  color: var(--danger);
  text-shadow: 0 0 24px rgba(255, 51, 85, 0.45);
}

/* Touch (mobile fallback) */
#touch-controls {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}
.touch-stick {
  position: absolute;
  left: 24px;
  bottom: 24px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 2px solid rgba(0, 240, 255, 0.35);
  background: rgba(0, 0, 0, 0.25);
  pointer-events: auto;
}
.touch-btn {
  position: absolute;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  pointer-events: auto;
  font-size: 0.75rem;
}
#touch-fire { bottom: 24px; }
#touch-reload { bottom: 100px; right: 28px; width: 52px; height: 52px; }
#touch-interact { bottom: 160px; right: 36px; width: 48px; height: 48px; }
@media (pointer: coarse) {
  #touch-controls { display: block; }
  #controls-hint { display: none; }
}
