/* ============================================================
   richolson-missile-command — hand-written scoped overrides
   ------------------------------------------------------------
   Atomic prepends the compiled Tailwind v4 bundle ABOVE this block.
   This file holds only scoped, hand-authored rules:
     1. the palette tokens (flip under a .dark ancestor — class-based
        dark mode owned by the site shell). The <canvas> game reads
        these at runtime so it re-themes with the site;
     2. the canvas presentation + a subtle CRT scanline overlay;
     3. small keyframes for the HUD glow / banner.
   Scoped under .custom-section-richolson-missile-command so nothing leaks.
   ============================================================ */

.custom-section-richolson-missile-command.ro-arcade-site {
  --bg: oklch(0.985 0.008 160);
  --surface: oklch(0.965 0.012 175);
  --surface-2: oklch(0.93 0.016 180);
  --text: oklch(0.24 0.022 165);
  --muted: oklch(0.47 0.024 200);
  --line: oklch(0.88 0.015 175);
  --accent: oklch(0.55 0.14 158);
  --accent-ghost: oklch(0.55 0.14 158 / 0.4);
  --accent2: oklch(0.55 0.13 245);
  --on-accent: oklch(0.99 0.01 160);
  --code-bg: oklch(0.95 0.012 178);
  --danger: oklch(0.55 0.2 25);

  --font-sans: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: block;
  min-height: 100vh;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .4s ease, color .4s ease;
}

.dark .custom-section-richolson-missile-command.ro-arcade-site {
  --bg: oklch(0.16 0.012 160);
  --surface: oklch(0.205 0.016 162);
  --surface-2: oklch(0.245 0.02 162);
  --text: oklch(0.945 0.015 150);
  --muted: oklch(0.72 0.02 150);
  --line: oklch(0.31 0.02 160);
  --accent: oklch(0.82 0.16 150);
  --accent-ghost: oklch(0.82 0.16 150 / 0.5);
  --accent2: oklch(0.87 0.15 96);
  --on-accent: oklch(0.17 0.02 160);
  --code-bg: oklch(0.125 0.012 160);
  --danger: oklch(0.66 0.18 25);
}

.custom-section-richolson-missile-command.ro-arcade-site ::selection { background: var(--accent); color: var(--on-accent); }

@keyframes ro-arcade-glow { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
.custom-section-richolson-missile-command.ro-arcade-site .ro-glow { animation: ro-arcade-glow 1.6s ease-in-out infinite; }

/* the playfield: fixed 16:9, scales to container width */
.custom-section-richolson-missile-command.ro-arcade-site [data-stage] {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: var(--code-bg);
  border: 1px solid var(--line);
}
.custom-section-richolson-missile-command.ro-arcade-site [data-canvas] {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;           /* let taps/swipes fire instead of scrolling */
  cursor: crosshair;
}

/* CRT scanline + vignette, purely cosmetic, never blocks pointer */
.custom-section-richolson-missile-command.ro-arcade-site [data-crt] {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, transparent 0, transparent 2px, color-mix(in oklab, var(--bg) 22%, transparent) 3px, transparent 4px),
    radial-gradient(120% 120% at 50% 50%, transparent 62%, color-mix(in oklab, var(--bg) 55%, transparent) 100%);
  mix-blend-mode: multiply;
  opacity: .5;
}
.dark .custom-section-richolson-missile-command.ro-arcade-site [data-crt] { mix-blend-mode: screen; opacity: .35; }

/* overlays (start / game over) */
.custom-section-richolson-missile-command.ro-arcade-site [data-overlay] {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(3px);
}
.custom-section-richolson-missile-command.ro-arcade-site [data-overlay][hidden] { display: none; }

/* mobile fit: section.js adapts the logical canvas width, so taps stay accurate. */
@media (max-width: 640px) {
  .custom-section-richolson-missile-command.ro-arcade-site [data-stage] {
    aspect-ratio: 10 / 9;
    border-radius: 10px;
    margin: -8px;
    width: calc(100% + 16px);
  }
}
