/* PRESERVE: Do NOT replace this file with write_file. Use edit_file to ADD your styles below the CUSTOM STYLES marker. */
/* This file contains essential arcade-shell classes: hud, hud-pill, overlay, overlay-card, overlay-stat, overlay-hint, */
/* primary-btn, the paused-screen state rules, and the shared --color-* / --gradient-* neon token palette. */
/* Overwriting these will break your game's HUD/overlay foundation. Add new styles at the bottom. */

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

:root {
  /* Neon-arcade palette on the shared --color-* / --gradient-* vocabulary. */
  --color-bg: #07070d;
  --color-surface: #0f0f1a;
  --color-primary: #4af;
  --color-accent-2: #a78bfa;
  --color-accent-3: #f472b6;
  --color-danger: #f87171;
  --color-text: #e2e8f0;
  --color-muted: rgba(255, 255, 255, 0.55);
  --color-faint: rgba(255, 255, 255, 0.3);
  --color-panel: rgba(10, 12, 24, 0.55);
  --color-border: rgba(255, 255, 255, 0.08);
  /* Gradient tokens — the title/hero neon gradient. */
  --gradient-from: #4af;
  --gradient-via: #a78bfa;
  --gradient-to: #f472b6;
  /* Motion tokens. */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 450ms;
}

html, body {
  background: radial-gradient(ellipse at top, #14142a 0%, var(--color-bg) 60%);
  color: var(--color-text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

canvas {
  display: block;
  background: var(--color-surface);
  image-rendering: pixelated;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow:
    0 0 60px rgba(74, 175, 255, 0.08),
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* ============================================================
   HUD — top-row pills overlaid on canvas
   ============================================================ */
#hud {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 5;
  pointer-events: none;
}
#hud.hidden { display: none; }

.hud-pill {
  background: var(--color-panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.hud-pill span {
  color: #fff;
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Overlay — menu / pause / game-over screens
   ============================================================ */
#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background: radial-gradient(ellipse at center, rgba(10, 10, 30, 0.78) 0%, rgba(0, 0, 0, 0.92) 100%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.25s ease;
}
#overlay.hidden { opacity: 0; pointer-events: none; }

.overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 56px;
  text-align: center;
  animation: overlay-rise 0.4s var(--ease-out);
}

@keyframes overlay-rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

#overlay h1 {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--gradient-from) 0%, var(--gradient-via) 50%, var(--gradient-to) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 24px rgba(167, 139, 250, 0.35));
}

#overlay[data-screen="gameover"] h1 {
  background: linear-gradient(135deg, var(--color-danger) 0%, var(--color-accent-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 24px rgba(248, 113, 113, 0.4));
}

#overlay p {
  font-size: 16px;
  color: var(--color-muted);
  letter-spacing: 0.04em;
}

.overlay-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  margin: 8px 0;
}
.overlay-stat span {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-faint);
}
.overlay-stat strong {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

#overlay-highscore {
  font-size: 13px;
  color: var(--color-faint);
  letter-spacing: 0.08em;
}

#primary-btn {
  margin-top: 8px;
  padding: 14px 44px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent-2));
  color: #fff;
  cursor: pointer;
  box-shadow:
    0 0 30px rgba(74, 175, 255, 0.35),
    0 6px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
#primary-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 40px rgba(74, 175, 255, 0.55),
    0 10px 30px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  filter: brightness(1.08);
}
#primary-btn:active { transform: translateY(0) scale(0.98); }

.overlay-hint {
  margin-top: 16px;
  font-size: 12px;
  color: var(--color-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#overlay[data-screen="paused"] .overlay-card { animation: none; }
#overlay[data-screen="paused"] #overlay-stat,
#overlay[data-screen="paused"] #overlay-highscore { display: none !important; }

/* === CUSTOM STYLES: Add your game-specific styles below this line === */
