:root {
  color-scheme: light dark;
  --navy: #08263a;
  --night: #041621;
  --cream: #fff8e7;
  --paper: #fffdf6;
  --yellow: #f9c74f;
  --coral: #ef6548;
  --teal: #16a8a3;
  --violet: #7651b5;
  --ink: #0a2534;
  --muted: #4f6873;
  --surface: #ffffff;
  --line: #ccdade;
  --shadow: 0 24px 80px rgb(4 22 33 / 15%);
  font-family: "Aptos", "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --paper: #041621;
  --ink: #fff8e7;
  --muted: #c5d5db;
  --surface: #0b3044;
  --line: #365c6c;
  --shadow: 0 24px 80px rgb(0 0 0 / 35%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #041621;
    --ink: #fff8e7;
    --muted: #c5d5db;
    --surface: #0b3044;
    --line: #365c6c;
    --shadow: 0 24px 80px rgb(0 0 0 / 35%);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); min-width: 280px; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-underline-offset: 0.22em; }
:focus-visible { outline: 4px solid var(--yellow); outline-offset: 4px; border-radius: 4px; }
.hidden { display: none !important; }
.skip-link { position: fixed; z-index: 10; left: 1rem; top: -5rem; background: var(--yellow); color: var(--night); padding: 0.8rem 1rem; font-weight: 800; }
.skip-link:focus { top: 1rem; }

.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 0.8rem; text-decoration: none; font-size: 1.15rem; letter-spacing: 0.08em; }
.brand img { border-radius: 14px; }
.brand b { color: var(--coral); }
nav { display: flex; align-items: center; gap: 1rem; }

main { overflow: clip; }
.hero {
  position: relative;
  min-height: calc(100svh - 78px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 7rem);
  padding: clamp(3rem, 8vw, 8rem) clamp(1rem, 7vw, 8rem);
  background: var(--navy);
  color: var(--cream);
}
.route-line { position: absolute; inset: auto -6vw 8% 25%; height: 22%; transform: rotate(-5deg); opacity: 0.9; pointer-events: none; }
.route-line::before, .route-line::after { content: ""; position: absolute; inset: 42% 0 auto; height: 18%; border-radius: 50%; background: var(--yellow); }
.route-line::after { inset: 58% 0 auto; background: var(--teal); }
.route-line span { position: absolute; z-index: 1; width: 11px; height: 11px; border-radius: 50%; background: var(--cream); }
.route-line span:nth-child(1) { left: 18%; top: 42%; }
.route-line span:nth-child(2) { left: 51%; top: 55%; }
.route-line span:nth-child(3) { right: 12%; top: 47%; }
.hero-copy, .command-card { position: relative; z-index: 2; }
.eyebrow { color: var(--yellow); font: 800 0.78rem/1.2 "Cascadia Mono", monospace; letter-spacing: 0.16em; }
h1, h2, p { margin-top: 0; }
h1 { font-family: "Arial Narrow", "Aptos Display", sans-serif; font-size: clamp(3.6rem, 9vw, 8.5rem); line-height: 0.84; letter-spacing: -0.055em; margin-bottom: 1.5rem; }
h2 { font-family: "Arial Narrow", "Aptos Display", sans-serif; font-size: clamp(2rem, 4vw, 3.8rem); line-height: 0.95; }
.lede { max-width: 45rem; color: #d6e4e9; font-size: clamp(1.05rem, 2vw, 1.35rem); line-height: 1.55; }
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.primary-button, .secondary-button, .quiet-button, .link-button {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
}
.primary-button { background: var(--yellow); color: var(--night); padding: 1rem 1.4rem; box-shadow: 0 9px 0 #b88719; }
.primary-button:active { transform: translateY(4px); box-shadow: 0 5px 0 #b88719; }
.secondary-button { background: transparent; color: inherit; border: 2px solid currentColor; padding: 0.8rem 1.2rem; }
.quiet-button { background: color-mix(in srgb, var(--surface) 82%, transparent); color: var(--ink); border: 1px solid var(--line); padding: 0.7rem 1rem; }
.link-button { background: none; color: inherit; text-decoration: underline; text-underline-offset: 0.22em; padding: 0; min-height: 44px; text-align: left; }
.wide { width: 100%; margin-top: 1rem; }
.command-card { background: rgb(255 255 255 / 9%); border: 1px solid rgb(255 255 255 / 20%); border-radius: 28px; padding: clamp(1.5rem, 4vw, 2.8rem); backdrop-filter: blur(12px); box-shadow: var(--shadow); }
.command-card h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
.command-card dl { margin: 2rem 0; }
.command-card dl div { padding: 1rem 0; border-top: 1px solid rgb(255 255 255 / 18%); }
.command-card dt { font-weight: 800; }
.command-card dd { margin: 0.25rem 0 0; color: #bfd1d8; }
.live-dot { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 8px rgb(239 101 72 / 18%); margin-bottom: 2rem; }
.fine-print { color: #bfd1d8; font-size: 0.9rem; }

.panel { min-height: 75svh; max-width: 1180px; margin: 0 auto; padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem); }
.panel h1 { font-size: clamp(3rem, 7vw, 6rem); color: var(--ink); }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 2rem; }
.panel-heading p:not(.eyebrow), .help p { color: var(--muted); font-size: 1.05rem; }
.player-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 1rem; }
.player-card { display: grid; gap: 0.65rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 10px 30px rgb(4 22 33 / 6%); }
.player-card label { font-weight: 800; font-size: 0.85rem; }
.player-card input[type="text"], .player-card input[type="number"] { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); padding: 0.7rem; }
.check-line { display: flex; align-items: center; gap: 0.6rem; min-height: 48px; }
.check-line input { width: 22px; height: 22px; }
.form-error { min-height: 1.5rem; color: #b3261e; font-weight: 800; margin-top: 1rem; }
.score-strip { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 3rem; font-weight: 800; }
#question-heading { font-size: clamp(2.8rem, 6vw, 6rem); line-height: 0.98; max-width: 1000px; }
.answer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.answer-button { min-height: 76px; padding: 1rem; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); font-weight: 800; text-align: left; cursor: pointer; }
.answer-button:hover { border-color: var(--teal); }
.result { min-height: 2rem; margin: 1.5rem 0 0; font-weight: 800; color: var(--teal); }
.help { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; padding: clamp(3rem, 7vw, 7rem) clamp(1rem, 7vw, 8rem); background: var(--surface); border-block: 1px solid var(--line); }
.help-links { display: grid; align-content: start; gap: 0.8rem; }
.update-panel {
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden;
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 14px 40px rgb(4 22 33 / 7%);
}
.update-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: linear-gradient(var(--coral) 0 33%, var(--yellow) 33% 66%, var(--teal) 66%);
}
.update-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.update-heading h3 { margin: 0; font: 800 clamp(1.5rem, 3vw, 2.3rem)/1 "Arial Narrow", "Aptos Display", sans-serif; }
.version-marker {
  flex: none;
  padding: 0.55rem 0.7rem;
  border: 2px solid var(--ink);
  border-radius: 10px;
  color: var(--ink);
  font: 800 0.8rem/1 "Cascadia Mono", monospace;
  transform: rotate(2deg);
}
#update-status { margin: 1rem 0; color: var(--ink); font-weight: 800; }
.release-notes { max-width: 62rem; color: var(--muted); }
.release-notes ul { margin: 0.6rem 0 0; padding-left: 1.3rem; }
.release-notes li + li { margin-top: 0.35rem; }
.update-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.4rem; }
.update-actions .secondary-button { color: var(--ink); }
.update-actions button:disabled { cursor: wait; opacity: 0.65; }
footer { display: flex; justify-content: space-between; gap: 2rem; padding: 2rem clamp(1rem, 4vw, 4rem); }
.policy-links { display: flex; flex-wrap: wrap; gap: 1rem; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .route-line { left: -20%; }
  .player-grid { grid-template-columns: repeat(2, 1fr); }
  .help { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .site-header { align-items: flex-start; }
  .site-header nav { flex-direction: column-reverse; align-items: flex-end; gap: 0.3rem; }
  .hero { padding-top: 4rem; }
  .hero h1 { font-size: clamp(3.8rem, 20vw, 6rem); }
  .player-grid, .answer-grid { grid-template-columns: 1fr; }
  .panel-heading, footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
