/* =========================================================
   Dom's Mom's Minivan Grand Prix — styles
   No external dependencies. No build step.
   ========================================================= */

:root {
  --bg: #0d0820;
  --bg-2: #150d33;
  --panel: #1b1340;
  --panel-2: #241752;
  --ink: #f4f1ff;
  --muted: #b7add9;
  --accent: #ffd54a;
  --accent-2: #ff5ea8;
  --good: #4ad7a3;
  --bad: #ff6b6b;
  --road: #2a2446;
  --line: rgba(255, 255, 255, 0.14);
  --ring: #7cf0ff;
  --radius: 16px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --maxw: 1040px;
  --font: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 15% -10%, #2a1a5e 0%, transparent 55%),
    radial-gradient(1000px 700px at 110% 10%, #3a1150 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  line-height: 1.6;
  min-height: 100vh;
}

img, svg { max-width: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Accessibility helpers ---- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 50%; top: -60px;
  transform: translateX(-50%);
  background: var(--accent); color: #1a1030;
  padding: 10px 18px; border-radius: 0 0 12px 12px;
  font-weight: 700; z-index: 100; transition: top .18s ease;
}
.skip-link:focus { top: 0; }

:where(a, button, summary, [tabindex], canvas):focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
  border-radius: 10px;
}

/* ---- Layout containers ---- */
main { display: block; }
section { max-width: var(--maxw); margin: 0 auto; padding: clamp(2.2rem, 6vw, 4.5rem) 1.2rem; }

.section-title {
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  margin: 0 0 .4rem;
  letter-spacing: -0.5px;
}
.section-lead { color: var(--muted); max-width: 60ch; margin: 0 0 1.6rem; }

/* ---- Header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(13, 8, 32, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1.2rem; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); font-weight: 800; }
.brand:hover { text-decoration: none; }
.brand-badge { font-size: 1.6rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; font-size: 1rem; }
.brand-sub { font-size: .72rem; color: var(--accent); letter-spacing: 1px; text-transform: uppercase; }
.nav-links { list-style: none; display: flex; gap: 1.1rem; margin: 0; padding: 0; }
.nav-links a { color: var(--muted); font-weight: 600; }
.nav-links a:hover { color: var(--ink); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; cursor: pointer; border: 0;
  font: inherit; font-weight: 700;
  padding: .8rem 1.3rem; border-radius: 999px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  color: #1a1030;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #ffb02e); box-shadow: 0 8px 22px rgba(255, 176, 46, .35); }
.btn-primary:hover { box-shadow: 0 10px 28px rgba(255, 176, 46, .5); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); text-decoration: none; }

/* ---- Hero ---- */
.hero { position: relative; text-align: center; padding-top: clamp(2.5rem, 7vw, 5rem); }
.hero-glow {
  position: absolute; inset: -10% -20% auto -20%; height: 60%;
  background: radial-gradient(600px 300px at 50% 0, rgba(255, 94, 168, .35), transparent 70%);
  filter: blur(10px); z-index: -1; pointer-events: none;
}
.hero-kicker { color: var(--accent-2); font-weight: 700; letter-spacing: 2px; font-size: .78rem; margin: 0 0 .6rem; }
.hero h1 { font-size: clamp(2.2rem, 8vw, 4.6rem); line-height: 1.02; margin: 0 0 1rem; letter-spacing: -1.5px; }
.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-tagline { max-width: 60ch; margin: 0 auto 1.6rem; color: var(--muted); font-size: clamp(1rem, 2.4vw, 1.2rem); }
.hero-tagline strong { color: var(--ink); }
.hero-cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  list-style: none; display: flex; gap: clamp(1rem, 5vw, 3rem);
  justify-content: center; margin: 2.4rem 0 0; padding: 0; flex-wrap: wrap;
}
.hero-stats li { display: flex; flex-direction: column; }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--accent); }
.stat-label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

/* ---- Game ---- */
.game-section { text-align: center; }
.game-shell {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 1.6rem);
  max-width: 480px; margin: 0 auto;
}
.game-hud {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: .5rem; margin-bottom: 1rem;
}
.hud-item {
  background: rgba(0, 0, 0, .25); border-radius: 12px;
  padding: .5rem .3rem; display: flex; flex-direction: column; gap: .2rem;
}
.hud-label { font-size: .62rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.hud-value { font-size: 1.15rem; font-weight: 800; }
.turbo-track { display: block; height: 10px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: .35rem; }
.turbo-fill { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .18s ease; }

.canvas-wrap {
  position: relative; width: 100%;
  aspect-ratio: 360 / 560;
  border-radius: 14px; overflow: hidden;
  background: var(--road);
}
#gameCanvas { display: block; width: 100%; height: 100%; touch-action: none; }

.overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(8, 5, 20, .82); backdrop-filter: blur(3px);
  padding: 1rem; text-align: center;
}
.overlay.hidden { display: none; }
.overlay-card { max-width: 320px; }
.overlay-card h3 { font-size: 1.6rem; margin: 0 0 .6rem; }
.overlay-card p { color: var(--muted); margin: 0 0 1.1rem; }
.overlay-hint { font-size: .78rem; margin-top: .8rem; }
.overlay-score { font-size: 1rem; color: var(--ink); }
.overlay-score strong { color: var(--accent); font-size: 1.6rem; display: inline-block; margin-left: .3rem; }

.game-controls {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: .5rem; margin-top: 1rem;
}
.btn-ctrl {
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); padding: .7rem .4rem; border-radius: 12px;
  font-weight: 700;
}
.btn-ctrl:hover { border-color: var(--accent); }
.btn-ctrl[aria-pressed="true"] { background: var(--accent); color: #1a1030; }

.legend {
  list-style: none; display: grid; grid-template-columns: repeat(2, 1fr);
  gap: .4rem .8rem; margin: 1.2rem 0 0; padding: 0;
  font-size: .82rem; color: var(--muted); text-align: left;
}
.legend li { display: flex; align-items: center; gap: .5rem; }
.chip {
  display: inline-grid; place-items: center;
  width: 1.8rem; height: 1.8rem; border-radius: 8px; font-size: 1rem;
  background: rgba(255,255,255,.08);
}
.chip-good { box-shadow: inset 0 0 0 2px var(--good); }
.chip-bad { box-shadow: inset 0 0 0 2px var(--bad); }

/* ---- Lore ---- */
.lore-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.lore-card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow);
}
.lore-card h3 { margin: 0 0 .5rem; color: var(--accent); }
.lore-card p { margin: 0; color: var(--muted); }

/* ---- Leaderboard ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.leaderboard { width: 100%; border-collapse: collapse; min-width: 420px; background: rgba(0,0,0,.2); }
.leaderboard th, .leaderboard td { padding: .85rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
.leaderboard th { background: rgba(0,0,0,.3); font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); }
.leaderboard tbody tr:last-child td { border-bottom: 0; }
.you-row { background: rgba(255, 213, 74, .1); font-weight: 700; }
.you-row td { color: var(--ink); }

/* ---- FAQ ---- */
.faq-list { display: grid; gap: .7rem; }
.faq-list details {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: 12px; padding: 0 1.1rem;
  box-shadow: var(--shadow);
}
.faq-list summary {
  cursor: pointer; font-weight: 700; padding: 1rem 0;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; }
.faq-list details[open] summary::after { content: "–"; }
.faq-list p { margin: 0 0 1rem; color: var(--muted); }

/* ---- Footer ---- */
.site-footer {
  max-width: var(--maxw); margin: 0 auto; padding: 2.5rem 1.2rem 3rem;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem;
}
.disclaimer { max-width: 72ch; }
.disclaimer strong { color: var(--ink); }
.copyright { margin-top: 1rem; color: var(--muted); }

/* ---- Responsive ---- */
@media (max-width: 620px) {
  .nav-links { gap: .7rem; font-size: .85rem; }
  .brand-text { font-size: .9rem; }
  .legend { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .nav-links { display: none; }
  .hud-value { font-size: .95rem; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * , *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
