/* The Scoreboard: shared theme for every game in the collection (sport-neutral) */
:root {
  --night: #0b1a2e;
  --night-2: #12263f;
  --panel: #15304f;
  --panel-2: #1c3c61;
  --grass: #3f9139;
  --grass-dark: #2c6d28;
  --chalk: #f4f7fb;
  --muted: #9fb3cc;
  --gold: #ffd23f;
  --good: #22c55e;
  --bad: #ef4444;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --display: 'Impact', 'Haettenschweiler', 'Arial Narrow Bold', 'Franklin Gothic Bold', sans-serif;
  --led: 'Courier New', 'Lucida Console', ui-monospace, monospace;
  --led-amber: #ffb000;
  /* each game can override --page-tint to colour the bottom of the page */
  --page-tint: #10233a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--chalk);
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 50% -120px, rgba(255, 255, 255, .14), transparent 70%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 55%, var(--page-tint) 140%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.answer:focus-visible, .btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.hidden { display: none !important; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; gap: 12px;
  background: rgba(0, 0, 0, .25);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(6px);
}
.brand { text-decoration: none; font-weight: 700; letter-spacing: .3px; display: inline-flex; align-items: center; gap: 8px; }
.brand-mark { /* mini LED scoreboard */
  font-family: var(--led); font-weight: 700; font-size: .8rem; color: var(--led-amber); background: #050608;
  border: 2px solid #2a2f38; border-radius: 4px; padding: 1px 5px; text-shadow: 0 0 5px rgba(255, 176, 0, .8);
}
.topbar-title { font-family: var(--display); letter-spacing: 1px; font-size: 1.1rem; text-transform: uppercase; color: var(--gold); }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4); background: transparent; color: var(--chalk);
  font-weight: 700; font-size: 1rem; cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { border-color: var(--gold); color: var(--gold); } }

.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  padding: 12px 20px; border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, .25);
  background: var(--panel-2); color: var(--chalk);
  transition: transform .1s, background .2s, border-color .2s;
}
@media (hover: hover) and (pointer: fine) { .btn:hover { border-color: var(--gold); } }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--gold); color: #1a1a1a; border-color: var(--gold); }
@media (hover: hover) and (pointer: fine) { .btn.primary:hover { background: #ffe066; } }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 14px; font-size: .9rem; }

.modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(3, 10, 20, .75);
  display: flex; align-items: flex-start; justify-content: center; padding: 16px;
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
/* margin:auto centres the card when it fits, and lets it scroll from the top when it doesn't */
.modal > .modal-card { margin: auto 0; }
.modal-card {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  max-width: 520px; width: 100%; padding: 24px; border: 1px solid rgba(255, 255, 255, .1);
}
.modal-card h2 { margin-top: 0; font-family: var(--display); letter-spacing: 1px; text-transform: uppercase; color: var(--gold); }
.modal-card li { margin-bottom: 8px; line-height: 1.45; }

.fine-print { color: var(--muted); font-size: .85rem; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--chalk); color: #111; padding: 10px 18px; border-radius: 999px;
  font-weight: 600; box-shadow: var(--shadow); z-index: 80;
}

.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 70; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
