/* ---------- Tokens ---------- */
:root {
  --gc-indigo: #4c3c75;
  --gc-indigo-2: #5d4a8e;
  --gc-indigo-3: #7a66b3;
  --gc-orange: #ff6f00;
  --gc-silver: #cccccc;

  --bg: #07050f;
  --bg-2: #130d24;
  --text: #eeebf8;
  --muted: #a89fc8;
  --line: rgba(204, 204, 204, 0.16);
  --panel: rgba(28, 20, 54, 0.72);
  --panel-strong: rgba(44, 32, 82, 0.9);

  /* Main highlight color; the Spice easter egg swaps it. */
  --primary: var(--gc-indigo-2);
  --primary-bright: #9d86e6;
  --accent: var(--gc-orange);
  --glow: rgba(157, 134, 230, 0.55);

  --region-JP: #ff5a6e;
  --region-NA: #4c9bff;
  --region-EU: #f6c945;

  --font: 'Exo 2', 'Segoe UI', system-ui, sans-serif;
  /* Small labels, badges and numbers: clean and technical (was a pixel font). */
  --font-pixel: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --radius: 14px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 0.9, 0.3);
}

:root[data-spice='on'] {
  --primary: #b44c00;
  --primary-bright: #ffa04d;
  --glow: rgba(255, 140, 40, 0.55);
  --bg-2: #22100a;
  --panel: rgba(52, 24, 12, 0.72);
  --panel-strong: rgba(80, 36, 14, 0.9);
  --muted: #d6b49c;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(ellipse at 50% 30%, var(--bg-2), var(--bg) 70%) fixed, var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.8s ease;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, h3, p {
  margin: 0;
}

.pixel {
  font-family: var(--font-pixel);
  font-weight: 600;
  font-size: 0.9em;
  letter-spacing: 0.04em;
}

.eyebrow {
  font-family: var(--font-pixel);
  font-weight: 600;
  font-size: 0.87rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Background ---------- */
.starfield {
  position: fixed;
  inset: 0;
  z-index: -2;
}

.starfield canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.65));
}

.screen {
  position: relative;
  min-height: 100vh;
}

/* ---------- Shared controls ---------- */
.audio-controls {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 20;
  display: flex;
  gap: 8px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.icon-btn:hover,
.icon-btn.is-on {
  color: var(--text);
  border-color: var(--primary-bright);
}

.icon-btn.is-on {
  box-shadow: 0 0 14px var(--glow);
}

.return-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(6px);
  cursor: pointer;
  font-weight: 600;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease-out);
}

.return-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(255, 111, 0, 0.35);
  transform: translateX(-3px);
}

.return-btn kbd {
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

@media (max-width: 560px) {
  .return-btn kbd {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
