/* ==========================================================================
   POLYSHATTER — Retro-Futuristic Arcade Stylesheet
   Theme: Geometry Wars / Synthwave Cyberpunk
   ========================================================================== */

:root {
  /* Color Palette Tokens */
  --bg-deep: #060613;
  --bg-dark: #09081d;
  --bg-surface: rgba(14, 13, 34, 0.85);
  --bg-surface-elevated: rgba(22, 20, 52, 0.92);
  --border-subtle: rgba(100, 80, 200, 0.25);
  --border-glow: rgba(0, 240, 255, 0.5);

  /* Neon Accents */
  --neon-cyan: #00f0ff;
  --neon-pink: #ff007f;
  --neon-green: #39ff14;
  --neon-gold: #ffe600;
  --neon-violet: #a855f7;
  --neon-crimson: #ff3366;
  --neon-orange: #ff6600;

  /* Typography */
  --font-display: 'Orbitron', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ui: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* UI Spacing Scale */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;

  /* Glow Filters */
  --glow-cyan: 0 0 12px rgba(0, 240, 255, 0.6), 0 0 24px rgba(0, 240, 255, 0.3);
  --glow-pink: 0 0 12px rgba(255, 0, 127, 0.6), 0 0 24px rgba(255, 0, 127, 0.3);
  --glow-gold: 0 0 12px rgba(255, 230, 0, 0.6), 0 0 24px rgba(255, 230, 0, 0.3);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: #f1f5f9;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.4;
  touch-action: none;
}

/* CRT Scanlines & Vignette Filter */
.crt-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: 
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    radial-gradient(circle at center, transparent 65%, rgba(0, 0, 0, 0.7) 100%);
  background-size: 100% 3px, 100% 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.crt-overlay.active {
  opacity: 1;
}

/* Screen Flash on heavy damage */
.screen-flash {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(255, 0, 85, 0.4);
  opacity: 0;
  transition: opacity 0.1s ease-out;
}

.hidden {
  display: none !important;
}

/* Root App Shell */
.app-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Canvas Wrapper */
.canvas-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: var(--bg-deep);
}

canvas#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

/* ==========================================================================
   IN-GAME HUD
   ========================================================================== */
.ingame-hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--sp-md);
  transition: opacity 0.25s ease;
}

.ingame-hud.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Top Bar */
.hud-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: var(--sp-md);
}

.hud-group {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  pointer-events: auto;
}

.hud-metric {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 4px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.hud-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: #94a3b8;
  text-transform: uppercase;
}

.hud-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #ffffff;
}

.hud-glow-cyan {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.7);
}

.hud-glow-gold {
  color: var(--neon-gold);
  text-shadow: 0 0 10px rgba(255, 230, 0, 0.7);
}

.hud-glow-pink {
  color: var(--neon-pink);
  text-shadow: 0 0 10px rgba(255, 0, 127, 0.7);
}

.hud-mode-badge {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 1px;
}

/* Combo Container */
.hud-combo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 230, 0, 0.3);
  border-radius: 4px;
  padding: 4px 16px;
  min-width: 140px;
}

.combo-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.combo-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #e2e8f0;
}

.combo-multiplier {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
}

.combo-bar-bg {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 3px;
}

.combo-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-gold), var(--neon-pink));
  box-shadow: 0 0 8px var(--neon-gold);
  transition: width 0.05s linear;
}

/* Time Attack Timer */
.hud-timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 0, 127, 0.4);
  border-radius: 4px;
  padding: 4px 16px;
}

.hud-timer-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
}

/* Shield Icons */
.hud-lives-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 4px 12px;
}

.hud-lives-icons {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.life-shield {
  width: 16px;
  height: 18px;
  background: rgba(255, 255, 255, 0.15);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  transition: all 0.3s ease;
}

.life-shield.active {
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
}

/* HUD Buttons */
.btn-hud-icon {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: #e2e8f0;
  width: 38px;
  height: 38px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-hud-icon:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

.btn-hud-icon .hud-icon {
  font-size: 16px;
}

.btn-hud-icon .hud-icon-text {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
}

/* Wave Announcement Banner */
.wave-banner {
  position: absolute;
  top: 28%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  animation: bannerPop 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.wave-banner-title {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 6px;
  color: #ffffff;
  text-shadow: 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-pink);
}

.wave-banner-sub {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--neon-gold);
  margin-top: 6px;
}

@keyframes bannerPop {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.8); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  35% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(0.95); }
}

/* Practice Mode Hint Toast */
.practice-hint-toast {
  position: absolute;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 12, 35, 0.95);
  border: 1px solid var(--neon-gold);
  border-radius: 6px;
  padding: 12px 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(255, 230, 0, 0.3);
  pointer-events: auto;
  max-width: 480px;
  width: 90%;
  z-index: 20;
}

.hint-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.hint-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--neon-gold);
  letter-spacing: 1px;
}

.btn-close-toast {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
}

.hint-text {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #f8fafc;
  line-height: 1.4;
}

.hint-rule {
  font-size: 12px;
  color: #cbd5e1;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 4px;
}

/* ==========================================================================
   BOTTOM WEAPON DOCK
   ========================================================================== */
.hud-bottom-dock {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: var(--sp-md);
  width: 100%;
  pointer-events: auto;
}

.weapon-deck {
  display: flex;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.weapon-card {
  position: relative;
  background: rgba(18, 16, 40, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  width: 62px;
  height: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  overflow: hidden;
}

.weapon-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.4);
}

.weapon-card:active {
  transform: translateY(0);
}

.weapon-card.active {
  transform: translateY(-5px);
  box-shadow: 0 0 16px var(--border-glow);
}

.weapon-key {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #94a3b8;
}

.weapon-prime {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  margin: 2px 0;
}

.weapon-name {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.5px;
  color: #cbd5e1;
}

/* Specific Prime Colors */
.prime-2 { color: var(--neon-cyan); text-shadow: 0 0 10px var(--neon-cyan); }
.weapon-card[data-prime="2"].active { border-color: var(--neon-cyan); box-shadow: 0 0 15px rgba(0, 240, 255, 0.6); }

.prime-3 { color: var(--neon-green); text-shadow: 0 0 10px var(--neon-green); }
.weapon-card[data-prime="3"].active { border-color: var(--neon-green); box-shadow: 0 0 15px rgba(57, 255, 20, 0.6); }

.prime-5 { color: var(--neon-gold); text-shadow: 0 0 10px var(--neon-gold); }
.weapon-card[data-prime="5"].active { border-color: var(--neon-gold); box-shadow: 0 0 15px rgba(255, 230, 0, 0.6); }

.prime-7 { color: var(--neon-violet); text-shadow: 0 0 10px var(--neon-violet); }
.weapon-card[data-prime="7"].active { border-color: var(--neon-violet); box-shadow: 0 0 15px rgba(168, 85, 247, 0.6); }

.prime-11 { color: var(--neon-pink); text-shadow: 0 0 10px var(--neon-pink); }
.weapon-card[data-prime="11"].active { border-color: var(--neon-pink); box-shadow: 0 0 15px rgba(255, 0, 127, 0.6); }

.prime-13 { color: var(--neon-crimson); text-shadow: 0 0 10px var(--neon-crimson); }
.weapon-card[data-prime="13"].active { border-color: var(--neon-crimson); box-shadow: 0 0 15px rgba(255, 51, 102, 0.6); }

.weapon-cooldown-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
}

/* Mobile Fire Button */
.btn-mobile-fire {
  display: none;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-crimson));
  border: 2px solid #ffffff;
  border-radius: 50%;
  width: 72px;
  height: 72px;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1px;
  box-shadow: 0 0 20px rgba(255, 0, 127, 0.6);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease;
}

.btn-mobile-fire:active {
  transform: scale(0.92);
}

/* ==========================================================================
   SCREENS & MODALS (Awesome Design Standards)
   ========================================================================== */
.screen-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-md);
  background: radial-gradient(circle at center, rgba(14, 12, 36, 0.85) 0%, rgba(6, 6, 19, 0.95) 100%);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.screen-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.menu-content-card {
  max-width: 680px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-lg);
  text-align: center;
}

/* Logo */
.logo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--sp-sm);
}

.logo-poly-icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--sp-sm);
  position: relative;
}

.poly-wireframe {
  width: 100%;
  height: 100%;
  border: 2px solid var(--neon-cyan);
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  animation: polySpin 12s linear infinite;
  box-shadow: 0 0 20px var(--neon-cyan);
  background: radial-gradient(circle at center, rgba(0, 240, 255, 0.2), transparent);
}

@keyframes polySpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.game-title {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 5px;
  color: #ffffff;
  line-height: 1.1;
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
}

.title-highlight {
  color: var(--neon-pink);
  text-shadow: 0 0 20px rgba(255, 0, 127, 0.7);
}

.game-tagline {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--neon-gold);
  margin-top: 6px;
}

/* Game Mode Selection Grid */
.mode-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-md);
  width: 100%;
}

.btn-mode-card {
  position: relative;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-subtle);
  border-radius: 8px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  overflow: hidden;
}

.btn-mode-card:hover {
  transform: translateY(-4px);
  border-color: var(--neon-cyan);
  box-shadow: 0 8px 24px rgba(0, 240, 255, 0.25);
}

.btn-mode-card:active {
  transform: translateY(-1px);
}

.btn-mode-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-icon {
  font-size: 20px;
}

.mode-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
}

.mode-desc {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.35;
  flex-grow: 1;
}

.mode-badge-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.1);
  padding: 3px 6px;
  border-radius: 3px;
}

.btn-mode-card:nth-child(2) .mode-badge-tag {
  color: var(--neon-pink);
  background: rgba(255, 0, 127, 0.1);
}

.btn-mode-card:nth-child(3) .mode-badge-tag {
  color: var(--neon-green);
  background: rgba(57, 255, 20, 0.1);
}

/* Secondary Action Row */
.menu-action-row {
  display: flex;
  gap: var(--sp-md);
  width: 100%;
  justify-content: center;
}

.btn-cyber-primary {
  background: linear-gradient(135deg, var(--neon-cyan), #0077ff);
  border: 1px solid #ffffff;
  color: #060613;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 12px 28px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.btn-cyber-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.8);
  background: linear-gradient(135deg, #4df6ff, #1a8cff);
}

.btn-cyber-outline {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: #e2e8f0;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cyber-outline:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.3);
  transform: translateY(-2px);
}

.btn-cyber-danger {
  background: rgba(255, 0, 85, 0.15);
  border: 1px solid var(--neon-pink);
  color: #ff99bb;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cyber-danger:hover {
  background: rgba(255, 0, 85, 0.35);
  color: #ffffff;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.5);
}

.menu-footer-credits {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #64748b;
  letter-spacing: 1px;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-md);
  background: rgba(6, 6, 19, 0.85);
  backdrop-filter: blur(6px);
  transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-glow);
  border-radius: 8px;
  padding: var(--sp-xl);
  max-width: 480px;
  width: 100%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 240, 255, 0.25);
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.modal-large {
  max-width: 720px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.modal-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--sp-sm);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffffff;
}

.btn-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s ease;
}

.btn-modal-close:hover {
  color: var(--neon-pink);
}

.modal-btn-stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.modal-action-row {
  display: flex;
  gap: var(--sp-md);
  justify-content: center;
  margin-top: var(--sp-sm);
}

.modal-footer-bar {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--sp-md);
  margin-top: var(--sp-sm);
}

/* ==========================================================================
   GAME OVER MODAL
   ========================================================================== */
.modal-game-over {
  text-align: center;
  align-items: center;
}

.gameover-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--neon-pink);
}

.gameover-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 4px;
  color: #ffffff;
}

.new-high-badge {
  display: inline-block;
  background: linear-gradient(90deg, var(--neon-gold), #ff8800);
  color: #000000;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
  margin-top: 6px;
  animation: pulseBadge 1s infinite alternate;
}

@keyframes pulseBadge {
  0% { transform: scale(0.96); box-shadow: 0 0 5px var(--neon-gold); }
  100% { transform: scale(1.04); box-shadow: 0 0 15px var(--neon-gold); }
}

.gameover-score-hero {
  display: flex;
  flex-direction: column;
  margin: var(--sp-sm) 0;
}

.score-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #94a3b8;
}

.score-number {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 2px;
}

.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}

.stat-box {
  background: rgba(14, 12, 34, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-val {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}

.stat-lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ==========================================================================
   FIELD MANUAL / HOW TO PLAY
   ========================================================================== */
.manual-scrollable-content {
  overflow-y: auto;
  padding-right: var(--sp-sm);
  max-height: 58vh;
  display: flex;
  flex-direction: column;
  gap: var(--sp-lg);
  text-align: left;
}

.manual-scrollable-content::-webkit-scrollbar {
  width: 6px;
}

.manual-scrollable-content::-webkit-scrollbar-thumb {
  background: var(--border-glow);
  border-radius: 3px;
}

.manual-section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.manual-heading {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--neon-cyan);
  border-left: 3px solid var(--neon-cyan);
  padding-left: 8px;
}

.factor-demo-box {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(10, 10, 24, 0.7);
  border: 1px dashed var(--border-subtle);
  border-radius: 6px;
  padding: 12px;
  margin: var(--sp-xs) 0;
}

.demo-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.demo-shape {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
}

.shape-hex {
  border: 2px solid var(--neon-cyan);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: rgba(0, 240, 255, 0.15);
}

.shape-tri {
  border: 2px solid var(--neon-green);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  background: rgba(57, 255, 20, 0.15);
}

.shape-orb {
  border-radius: 50%;
  border: 2px solid var(--neon-gold);
  background: rgba(255, 230, 0, 0.3);
  box-shadow: 0 0 12px var(--neon-gold);
}

.demo-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  color: #94a3b8;
}

.demo-arrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--neon-pink);
}

.divisibility-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.div-rule-card {
  background: rgba(15, 13, 35, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 10px;
  position: relative;
}

.div-rule-card .prime-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
}

.rule-2 .prime-badge { color: var(--neon-cyan); }
.rule-3 .prime-badge { color: var(--neon-green); }
.rule-5 .prime-badge { color: var(--neon-gold); }
.rule-7 .prime-badge { color: var(--neon-violet); }
.rule-11 .prime-badge { color: var(--neon-pink); }
.rule-13 .prime-badge { color: var(--neon-crimson); }

.div-rule-card h4 {
  font-family: var(--font-display);
  font-size: 12px;
  color: #ffffff;
  margin-bottom: 4px;
}

.div-rule-card p {
  font-size: 12px;
  color: #cbd5e1;
}

.manual-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.manual-table th, .manual-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.manual-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
}

kbd {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--neon-cyan);
}

/* ==========================================================================
   SETTINGS & FORM CONTROLS
   ========================================================================== */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  text-align: left;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setting-label {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.range-wrapper {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

input[type="range"] {
  flex-grow: 1;
  accent-color: var(--neon-cyan);
  cursor: pointer;
}

.range-val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--neon-cyan);
  min-width: 40px;
}

.setting-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Cyber Toggle Switch */
.cyber-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.cyber-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cyber-switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: 0.2s;
  border-radius: 12px;
}

.cyber-switch .slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.2s;
  border-radius: 50%;
}

.cyber-switch input:checked + .slider {
  background-color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.cyber-switch input:checked + .slider::before {
  transform: translateX(20px);
  background-color: #060613;
}

.cyber-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: #ffffff;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
}

.cyber-select:focus {
  outline: none;
  border-color: var(--neon-cyan);
}

/* High Scores Box */
.high-score-record-box {
  background: rgba(15, 12, 35, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
  margin-bottom: var(--sp-md);
}

.record-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: #94a3b8;
}

.record-val {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  margin: 4px 0;
}

.record-details {
  display: flex;
  justify-content: center;
  gap: var(--sp-md);
  font-size: 12px;
  color: #cbd5e1;
}

.lifetime-stats-box h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--neon-gold);
  margin-bottom: 8px;
  text-align: center;
}

/* ==========================================================================
   RESPONSIVE LAYOUTS (Tablet & Mobile)
   ========================================================================== */
@media (max-width: 768px) {
  .game-title {
    font-size: 36px;
    letter-spacing: 3px;
  }

  .mode-select-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .btn-mode-card {
    padding: 12px 14px;
  }

  .hud-top-bar {
    gap: 8px;
  }

  .hud-metric {
    padding: 3px 8px;
  }

  .hud-value {
    font-size: 15px;
  }

  .weapon-deck {
    gap: 4px;
    padding: 4px 6px;
  }

  .weapon-card {
    width: 46px;
    height: 56px;
  }

  .weapon-prime {
    font-size: 17px;
  }

  .weapon-name {
    display: none;
  }

  .btn-mobile-fire {
    display: flex;
  }

  .divisibility-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hud-top-bar {
    flex-wrap: wrap;
  }

  .hud-group.hud-center {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .game-title {
    font-size: 28px;
  }

  .modal-card {
    padding: var(--sp-md);
  }

  .stats-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
