/* Retro CRT / Arcade theme — design tokens, resets, and global background layers. */
:root {
  /* Colors */
  --neon: #00ff88;
  --cyan: #00d4ff;
  --amber: #ffaa00;
  --purple: #9966ff;
  --danger: #ff4466;

  --bg: #06060e;
  --surface: #0b0b18;
  --surface2: #111124;

  --border: rgba(0, 255, 136, 0.10);
  --border-hi: rgba(0, 255, 136, 0.32);

  --text: #bcc8e0;
  --text-primary: #bcc8e0;
  --text-secondary: #8692b0;
  --text-muted: #48506a;
  --muted: #48506a;

  /* Fonts */
  --font-px: 'Press Start 2P', monospace;
  --font-mo: 'Share Tech Mono', monospace;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 14px;
  --spacing-lg: 20px;
  --spacing-xl: 28px;
  --spacing-2xl: 44px;

  /* Radius — intentionally sharp */
  --radius-sm: 2px;
  --radius-md: 2px;
  --radius-lg: 2px;
  --radius-xl: 2px;

  /* Shadows */
  --shadow-sm: 0 0 4px rgba(0, 255, 136, 0.15);
  --shadow-md: 0 0 10px rgba(0, 255, 136, 0.18);
  --shadow-lg: 0 0 22px rgba(0, 255, 136, 0.22);
  --shadow-glow: 0 0 12px rgba(0, 255, 136, 0.45);
}

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

html, body {
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mo);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Ensure app content renders above the fixed background layers. */
body > header,
body > main,
body > .app-main {
  position: relative;
  z-index: 2;
}

/* ── Global background layers ─────────────────────────── */

#grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(0, 255, 136, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 136, 0.024) 1px, transparent 1px);
  background-size: 48px 48px;
  transition: opacity 0.4s;
}

#aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
#aurora::before,
#aurora::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.18;
}
#aurora::before {
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, var(--neon) 0%, transparent 65%);
  top: -150px;
  left: -200px;
  animation: drift1 14s ease-in-out infinite alternate;
}
#aurora::after {
  width: 700px;
  height: 550px;
  background: radial-gradient(ellipse, var(--cyan) 0%, transparent 65%);
  bottom: -120px;
  right: -150px;
  animation: drift2 18s ease-in-out infinite alternate;
}
@keyframes drift1 {
  0%   { transform: translate(0px, 0px) scale(1); }
  33%  { transform: translate(180px, 120px) scale(1.1); }
  66%  { transform: translate(80px, 260px) scale(0.95); }
  100% { transform: translate(300px, 80px) scale(1.05); }
}
@keyframes drift2 {
  0%   { transform: translate(0px, 0px) scale(1); }
  33%  { transform: translate(-140px, -100px) scale(1.08); }
  66%  { transform: translate(-60px, -220px) scale(0.92); }
  100% { transform: translate(-250px, -60px) scale(1.1); }
}

#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at 50% 50%, transparent 45%, rgba(0, 0, 6, 0.75) 100%);
}

#crt {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.09) 3px,
    rgba(0, 0, 0, 0.09) 4px
  );
  animation: flicker 9s infinite;
}
@keyframes flicker {
  0%, 93%, 96.5%, 100% { opacity: 1; }
  95% { opacity: 0.92; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon); }
