@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');
/* ==========================================================================
   The Quiz! — shared styles (mobile-first responsive)
   ========================================================================== */

/* ==========================================================================
   Variables
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: oklch(11% 0.02 265);
  --bg-2: oklch(16% 0.025 265);
  --panel: oklch(100% 0 0 / 0.06);
  --panel-strong: oklch(100% 0 0 / 0.1);
  --line: oklch(100% 0 0 / 0.13);
  --line-strong: oklch(100% 0 0 / 0.24);
  --ink: oklch(97% 0.01 260);
  --muted: oklch(82% 0.02 260);
  --faint: oklch(67% 0.025 260);

  --violet: oklch(58% 0.21 292);
  --violet-2: oklch(78% 0.13 292);
  --cyan: oklch(82% 0.13 205);
  --lime: oklch(84% 0.16 155);
  --amber: oklch(85% 0.14 82);
  --teal: oklch(83% 0.12 185);
  --gold: oklch(85% 0.14 82);
  --red: oklch(73% 0.18 15);

  --font-display: 'Bricolage Grotesque', 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 12px 40px -10px rgba(0, 0, 0, 0.6);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   Stats! theme — warm amber + teal, distinct from True or False
   ========================================================================== */

body.theme-stats {
  --violet: #d97706;
  --violet-2: #fbbf24;
  --cyan: #fbbf24;
  --lime: #2dd4bf;
  --amber: #f59e0b;
  --teal: #2dd4bf;
}

body.theme-stats .bg-decor {
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(245, 158, 11, 0.22), transparent 60%),
    radial-gradient(900px 700px at 0% 110%, rgba(45, 212, 191, 0.18), transparent 60%),
    var(--bg);
}

body.theme-stats .blob--violet { background: #b45309; }
body.theme-stats .blob--cyan { background: #0f766e; }
body.theme-stats .blob--lime { background: #92400e; }

body.theme-stats .btn {
  background: linear-gradient(135deg, #f59e0b, #b45309);
  box-shadow: 0 8px 24px -10px rgba(245, 158, 11, 0.7);
}

body.theme-stats .btn-next {
  color: #08080f;
  background: linear-gradient(100deg, #fbbf24, #2dd4bf);
  box-shadow: 0 14px 34px -12px rgba(251, 191, 36, 0.7);
}

body.theme-stats .q-chip {
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(245, 158, 11, 0.12);
}

body.theme-stats .hud-score {
  background: linear-gradient(90deg, #fbbf24, #2dd4bf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.theme-stats .card-icon {
  background: linear-gradient(150deg, rgba(245, 158, 11, 0.28), rgba(45, 212, 191, 0.18));
}

/* ==========================================================================
   Clue Ladder theme — sky blue + pink
   ========================================================================== */

body.theme-clues {
  --violet: #0ea5e9;
  --violet-2: #7dd3fc;
  --cyan: #f472b6;
  --lime: #4ade80;
  --amber: #fbbf24;
  --teal: #2dd4bf;
}

body.theme-clues .bg-decor {
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(14, 165, 233, 0.24), transparent 60%),
    radial-gradient(900px 700px at 0% 110%, rgba(244, 114, 182, 0.16), transparent 60%),
    var(--bg);
}

body.theme-clues .blob--violet { background: #0369a1; }
body.theme-clues .blob--cyan { background: #9d174d; }
body.theme-clues .blob--lime { background: #15803d; }

body.theme-clues .btn {
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  box-shadow: 0 8px 24px -10px rgba(14, 165, 233, 0.7);
}

body.theme-clues .btn-next {
  color: #08080f;
  background: linear-gradient(100deg, #7dd3fc, #4ade80);
  box-shadow: 0 14px 34px -12px rgba(125, 211, 252, 0.7);
}

body.theme-clues .q-chip {
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, 0.3);
  background: rgba(14, 165, 233, 0.12);
}

body.theme-clues .hud-score {
  background: linear-gradient(90deg, #7dd3fc, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.theme-clues .card-icon {
  background: linear-gradient(150deg, rgba(14, 165, 233, 0.32), rgba(244, 114, 182, 0.2));
}

/* ==========================================================================
   Which Came First? theme — corkboard + sticky notes
   ========================================================================== */

body.theme-board {
  --violet: #b45309;
  --violet-2: #fcd34d;
  --cyan: #fbbf24;
  --lime: #22c55e;
  --amber: #f59e0b;
  --teal: #2dd4bf;
  --red: #ef4444;
}

body.theme-board .bg-decor {
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(180, 83, 9, 0.3), transparent 60%),
    radial-gradient(900px 700px at 0% 110%, rgba(250, 204, 21, 0.14), transparent 60%),
    #120d08;
}

body.theme-board .blob--violet { background: #92400e; }
body.theme-board .blob--cyan { background: #a16207; }
body.theme-board .blob--lime { background: #4d7c0f; }

body.theme-board .btn {
  background: linear-gradient(135deg, #d97706, #92400e);
  box-shadow: 0 8px 24px -10px rgba(217, 119, 6, 0.7);
}

body.theme-board .btn-next {
  color: #08080f;
  background: linear-gradient(100deg, #fde047, #22c55e);
  box-shadow: 0 14px 34px -12px rgba(250, 204, 21, 0.7);
}

body.theme-board .q-chip {
  color: #7c2d12;
  border-color: rgba(124, 45, 18, 0.28);
  background: rgba(255, 255, 255, 0.4);
}

body.theme-board .hud-score {
  background: linear-gradient(90deg, #fde047, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.theme-board .card-icon {
  background: linear-gradient(150deg, rgba(217, 119, 6, 0.34), rgba(250, 204, 21, 0.22));
}

/* The sticky note itself */

.q-card.note-card {
  display: block;
  text-align: center;
  border-radius: 8px;
  background: linear-gradient(160deg, #fef3c7, #fde68a);
  border: 1px solid rgba(120, 53, 15, 0.18);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.75), inset 0 -18px 30px -24px rgba(120, 53, 15, 0.4);
  transform: rotate(-1.1deg);
  overflow: visible;
}

.q-card.note-card::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  width: 96px;
  height: 26px;
  transform: translateX(-50%) rotate(-2deg);
  background: rgba(255, 255, 255, 0.42);
  border-left: 1px dashed rgba(120, 53, 15, 0.18);
  border-right: 1px dashed rgba(120, 53, 15, 0.18);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.q-card.note-card .q-text {
  color: #1c1917;
  font-family: 'Caveat', var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 6.5vw, 3rem);
  line-height: 1.15;
  margin-top: 0.9rem;
}

.q-card.note-card:has(.feedback.active) { transform: none; }

.note-cutoff {
  margin: 1.1rem auto 0;
  padding-top: 0.55rem;
  max-width: 320px;
  border-top: 1px dashed rgba(120, 53, 15, 0.35);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #92400e;
}

.theme-board .answer--a { --a: #38bdf8; }
.theme-board .answer--b { --a: #fb7185; }

.theme-board .answers {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.theme-board .answer {
  flex-direction: column;
  gap: 0.5rem;
  min-height: 130px;
  padding: 1rem 0.7rem;
  color: #1c1917;
  background: linear-gradient(160deg, #fffbeb, #fde68a);
  border: 1px solid rgba(120, 53, 15, 0.28);
  border-radius: 8px;
  box-shadow: 0 14px 26px -14px rgba(0, 0, 0, 0.8);
  font-size: clamp(1.15rem, 4vw, 1.6rem);
  line-height: 1.15;
  transform: rotate(-1deg);
}

.theme-board .answer--b {
  background: linear-gradient(160deg, #fffbeb, #fcd34d);
  transform: rotate(1deg);
}

.theme-board .answer .label {
  display: block;
  text-wrap: balance;
}

body.theme-board .game-shell:has(.feedback.active) .answers { opacity: 0.85; }

.card--paper .card-icon {
  background: linear-gradient(150deg, rgba(217, 119, 6, 0.36), rgba(250, 204, 21, 0.24));
}

/* ==========================================================================
   Outline theme — animal shadows
   ========================================================================== */

body.theme-outline {
  --violet: #0f766e;
  --violet-2: #5eead4;
  --cyan: #2dd4bf;
  --lime: #4ade80;
  --amber: #fbbf24;
}

body.theme-outline .bg-decor {
  background:
    radial-gradient(1100px 760px at 15% -10%, rgba(15, 118, 110, 0.32), transparent 60%),
    radial-gradient(900px 700px at 95% 105%, rgba(74, 222, 128, 0.16), transparent 60%),
    #04100f;
}

body.theme-outline .blob--violet { background: #0f766e; }
body.theme-outline .blob--cyan { background: #14b8a6; }
body.theme-outline .blob--lime { background: #4d7c0f; }

body.theme-outline .btn {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  box-shadow: 0 8px 24px -10px rgba(20, 184, 166, 0.7);
}

body.theme-outline .btn-next {
  color: #04120f;
  background: linear-gradient(100deg, #5eead4, #4ade80);
}

body.theme-outline .q-chip { color: #5eead4; }
body.theme-outline .hud-score { color: #5eead4; }
body.theme-outline .card-icon {
  background: linear-gradient(150deg, rgba(20, 184, 166, 0.36), rgba(74, 222, 128, 0.24));
}

.card--jungle .card-icon {
  background: linear-gradient(150deg, rgba(20, 184, 166, 0.36), rgba(74, 222, 128, 0.24));
}

/* The silhouette: a locally stored PhyloPic species silhouette. */
.silhouette {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(150px, 34vw, 250px);
  margin: 0.6rem auto 0.9rem;
  border: 1px dashed color-mix(in oklch, var(--teal) 40%, transparent);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 45%, color-mix(in oklch, var(--teal) 16%, transparent), transparent 68%),
    color-mix(in oklch, var(--ink) 4%, transparent);
  overflow: hidden;
}

.silhouette::before {
  content: '?';
  position: absolute;
  font-family: var(--font-display);
  font-size: clamp(10rem, 30vw, 18rem);
  font-weight: 800;
  color: var(--ink);
  opacity: 0.04;
  pointer-events: none;
}

.silhouette-img {
  position: relative;
  display: block;
  max-inline-size: 100%;
  max-block-size: clamp(150px, 34vw, 250px);
  inline-size: auto;
  block-size: auto;
  object-fit: contain;
  animation: q-in 0.35s var(--ease) both;
}

.silhouette-glyph {
  position: relative;
  font-size: clamp(5.5rem, 22vw, 10rem);
  line-height: 1;
  filter: grayscale(1) brightness(0);
  animation: q-in 0.35s var(--ease) both;
}

.silhouette-img[hidden], .silhouette-glyph[hidden] { display: none; }

.theme-outline .answers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }

.theme-outline .answer {
  min-height: 78px;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem 0.45rem;
  font-size: clamp(0.95rem, 3.4vw, 1.4rem);
  line-height: 1.15;
  text-align: center;
}

.theme-outline .answer--a { --a: #34d399; }
.theme-outline .answer--b { --a: #60a5fa; }
.theme-outline .answer--c { --a: #fbbf24; }
.theme-outline .answer--d { --a: #f472b6; }

.theme-outline .answer .key {
  padding: 0.1rem 0.4rem;
  color: #5eead4;
  border-color: rgba(94, 234, 212, 0.4);
}

.theme-outline .answer .name { overflow-wrap: break-word; }
.theme-outline .feedback-answer { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }

/* ==========================================================================
   Mastermind theme — generated questions
   ========================================================================== */

body.theme-subject {
  --violet: #6d28d9;
  --violet-2: #c4b5fd;
  --cyan: #22d3ee;
  --lime: #a3e635;
  --amber: #fbbf24;
}

body.theme-subject .bg-decor {
  background:
    radial-gradient(1000px 720px at 12% -8%, rgba(109, 40, 217, 0.34), transparent 60%),
    radial-gradient(900px 700px at 95% 105%, rgba(34, 211, 238, 0.16), transparent 60%),
    #090717;
}

body.theme-subject .blob--violet { background: #6d28d9; }
body.theme-subject .blob--cyan { background: #0e7490; }
body.theme-subject .blob--lime { background: #4d7c0f; }

body.theme-subject .btn {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  box-shadow: 0 8px 24px -10px rgba(124, 58, 237, 0.8);
}

body.theme-subject .btn-next { color: #160b2e; background: linear-gradient(100deg, #c4b5fd, #67e8f9); }
body.theme-subject .q-chip { color: #c4b5fd; }
body.theme-subject .hud-score { color: #c4b5fd; }
body.theme-subject .card-icon { background: linear-gradient(150deg, rgba(124, 58, 237, 0.38), rgba(34, 211, 238, 0.24)); }
.card--spark .card-icon { background: linear-gradient(150deg, rgba(124, 58, 237, 0.38), rgba(34, 211, 238, 0.24)); }

.subject-form { margin: 1.1rem auto 0; max-inline-size: 520px; }
.subject-form input { font-size: 1rem; }
.gen-note { margin: 0.8rem auto 0; max-inline-size: 44ch; font-size: 0.78rem; line-height: 1.5; color: var(--muted); text-align: center; }

.gen-progress { margin: 1rem auto 0; max-inline-size: 420px; text-align: center; }
.gen-progress[hidden], .gen-error[hidden] { display: none; }
.gen-bar { height: 8px; border-radius: 99px; overflow: hidden; background: color-mix(in srgb, var(--ink) 12%, transparent); }
.gen-bar span {
  display: block;
  inline-size: 38%;
  block-size: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c3aed, #22d3ee, #a3e635, #7c3aed);
  background-size: 260% 100%;
  animation: gen-slide 1.4s linear infinite;
}
@keyframes gen-slide {
  from { transform: translateX(-100%); background-position: 0% 0; }
  to { transform: translateX(360%); background-position: 100% 0; }
}
.gen-progress p { margin: 0.5rem 0 0; font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.gen-error {
  margin: 0.8rem auto 0;
  max-inline-size: 44ch;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(251, 113, 133, 0.5);
  border-radius: var(--radius);
  background: rgba(251, 113, 133, 0.1);
  color: #fecdd3;
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: center;
}

.theme-subject .q-text { font-size: clamp(1.5rem, 4.8vw, 2.4rem); }
.theme-subject .answers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.theme-subject .answer {
  min-height: 78px;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem 0.45rem;
  font-size: clamp(0.9rem, 3.2vw, 1.3rem);
  line-height: 1.15;
  text-align: center;
}
.theme-subject .answer .name { overflow-wrap: break-word; }
.theme-subject .answer--a { --a: #a78bfa; }
.theme-subject .answer--b { --a: #22d3ee; }
.theme-subject .answer--c { --a: #fbbf24; }
.theme-subject .answer--d { --a: #fb7185; }
.theme-subject .answer .key { padding: 0.1rem 0.4rem; color: #c4b5fd; border-color: rgba(196, 181, 253, 0.4); }
.theme-subject .feedback-answer { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }

/* ==========================================================================
   Reset & Base
   ========================================================================== */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; }

body {
  margin: 0;
  min-height: 100dvh;
  max-width: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Animated backdrop
   ========================================================================== */

.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(124, 58, 237, 0.22), transparent 60%),
    radial-gradient(900px 700px at 0% 110%, rgba(34, 211, 238, 0.16), transparent 60%),
    var(--bg);
}

.bg-decor::before {
  content: '';
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 25%, transparent 75%);
  animation: grid-drift 20s linear infinite;
}

.bg-decor::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3'/%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  opacity: 0.025;
  mix-blend-mode: overlay;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.45;
  animation: blob-float 20s var(--ease) infinite alternate;
}

.blob--violet { width: 40vw; height: 40vw; left: -10vw; top: -16vh; background: #6d28d9; }
.blob--cyan { width: 36vw; height: 36vw; right: -8vw; top: 20vh; background: #0e7490; animation-delay: -8s; }
.blob--lime { width: 30vw; height: 30vw; left: 24vw; bottom: -24vh; background: #3f6212; animation-delay: -16s; opacity: 0.3; }

@keyframes blob-float {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(3vw, -8vh, 0) scale(1.1); }
}

@keyframes grid-drift {
  to { transform: translate3d(48px, 48px, 0); }
}

/* ==========================================================================
   Layout
   ========================================================================== */

.wrap {
  width: min(1000px, 100% - 2rem);
  margin-inline: auto;
}

.section { padding: clamp(2rem, 5vw, 4rem) 0; }

/* ==========================================================================
   Nav
   ========================================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(6, 6, 15, 0.58);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand img { width: 28px; height: 28px; }

.brand span em {
  font-style: normal;
  background: linear-gradient(90deg, var(--violet-2), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links { display: flex; align-items: center; gap: 0.3rem; }

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover { color: var(--ink); background: var(--panel-strong); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  padding: 0.7rem 1.4rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), #5b21b6);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: center;
  transition: transform 0.15s var(--ease), box-shadow 0.2s, filter 0.2s;
  box-shadow: 0 8px 24px -10px rgba(124, 58, 237, 0.7);
}

.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.btn--ghost {
  background: var(--panel);
  border-color: var(--line-strong);
  box-shadow: none;
  color: var(--ink);
}

.btn--ghost:hover { background: var(--panel-strong); }

.btn--big { padding: 0.9rem 2rem; font-size: 1rem; }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  text-align: center;
  padding: clamp(2.5rem, 8vw, 5rem) 0 clamp(1.5rem, 4vw, 2.5rem);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 10vw, 6rem);
  line-height: 0.88;
  letter-spacing: -0.04em;
  margin: 0.8rem 0 0.5rem;
  font-weight: 700;
}

.grad,
.hero h1 .grad {
  background: linear-gradient(90deg, var(--violet-2) 0%, var(--cyan) 50%, var(--lime) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: grad-pan 6s ease-in-out infinite alternate;
  background-size: 200% 100%;
}

@keyframes grad-pan {
  from { background-position: 0% 0; }
  to { background-position: 100% 0; }
}

.hero p {
  max-width: 560px;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
}

.player-form {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 0.5rem; margin: 1.25rem auto 0; max-width: 30rem;
}

.player-form label { color: var(--muted); font-size: 0.9rem; }

.player-form input {
  flex: 1 1 12rem; min-inline-size: 0;
  padding: 0.65rem 0.85rem; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--panel-strong);
  color: var(--ink); font: inherit; font-size: 1rem;
}

/* ==========================================================================
   Game Cards
   ========================================================================== */

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(150deg, var(--panel-strong), var(--panel));
  padding: 1.2rem;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}

.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.card--playable { cursor: pointer; }
.card-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 0.9rem;
  background: linear-gradient(150deg, rgba(124, 58, 237, 0.3), rgba(34, 211, 238, 0.18));
}

.card--amber .card-icon {
  background: linear-gradient(150deg, rgba(245, 158, 11, 0.32), rgba(45, 212, 191, 0.2));
}

.card--blue .card-icon {
  background: linear-gradient(150deg, rgba(14, 165, 233, 0.34), rgba(244, 114, 182, 0.2));
}
.card h3 {
  font-family: var(--font-display); font-size: 1.25rem; margin: 0 0 0.3rem; letter-spacing: -0.02em;
}
.card p { margin: 0 0 0.8rem; color: var(--muted); font-size: 0.9rem; }

.card-meta {
  display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.8rem;
}

.chip {
  font-size: 0.68rem; font-weight: 550; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.25rem 0.5rem; border-radius: 999px;
}

/* ==========================================================================
   Section Headings
   ========================================================================== */

.section-head {
  display: flex; align-items: end; justify-content: space-between; gap: 0.7rem; margin-bottom: 1rem;
}

.section-head h2 {
  font-family: var(--font-display); font-size: clamp(1.4rem, 4vw, 2rem); margin: 0; letter-spacing: -0.02em;
}

.section-head p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* ==========================================================================
   Leaderboard
   ========================================================================== */

.board {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.board-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--line);
  animation: row-in 0.3s var(--ease) both;
}

.board-row:last-child { border-bottom: 0; }

.board-row .rank {
  font-family: var(--font-display); font-weight: 700; color: var(--faint); font-size: 0.9rem;
}

.board-row:nth-child(1) .rank { color: var(--gold); }
.board-row:nth-child(2) .rank { color: #e5e7eb; }
.board-row:nth-child(3) .rank { color: #d97706; }

.board-row .name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.board--picks .board-row .name {
  cursor: pointer;
  text-decoration: underline dotted transparent;
  text-underline-offset: 3px;
}

.board--picks .board-row .name:hover { color: var(--cyan); text-decoration-color: currentColor; }

.board-row .score {
  font-family: var(--font-display); font-weight: 600; color: var(--cyan); font-variant-numeric: tabular-nums;
}

.board-empty {
  padding: 1.5rem 1rem; text-align: center; color: var(--faint); font-size: 0.9rem;
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  border-top: 1px solid var(--line);
  margin-top: 1.5rem; padding: 1.5rem 0 2rem;
  color: var(--faint); font-size: 0.85rem; text-align: center;
}

.footer a { color: var(--muted); }

/* ==========================================================================
   Game Page
   ========================================================================== */

.game-shell {
  min-height: calc(100dvh - 56px);
  display: grid; justify-items: center; align-content: start; padding: 0.75rem 0.75rem 2rem; position: relative;
  container: game / inline-size;
}

.screen { display: none; width: min(900px, 100%); min-width: 0; }
.screen.active { display: block; animation: screen-in 0.35s var(--ease); }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.panel {
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, var(--panel-strong), var(--panel));
  padding: clamp(1rem, 4vw, 2rem);
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}

.panel::after {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(400px 180px at 50% -8%, rgba(124, 58, 237, 0.14), transparent 68%);
}

/* ==========================================================================
   Start Screen
   ========================================================================== */

.start-panel { text-align: center; }

.start-panel .game-icon {
  width: 72px; height: 72px; margin: 0 auto 0.8rem;
  border-radius: 22px;
  display: grid; place-items: center; font-size: 2.2rem;
  background: linear-gradient(130deg, rgba(124, 58, 237, 0.3), rgba(34, 211, 238, 0.2));
  border: 1px solid var(--line-strong);
  box-shadow: 0 16px 40px -16px rgba(124, 58, 237, 0.8);
}

.start-panel h1 {
  font-family: var(--font-display); font-size: clamp(2rem, 6.5vw, 3.5rem); margin: 0 0 0.4rem; letter-spacing: -0.03em; line-height: 0.95;
}

.start-panel .sub { color: var(--muted); margin: 0 auto 1rem; font-size: 0.95rem; max-width: 480px; }

.rules {
  display: grid; gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 0 auto 1.2rem; max-width: 560px; text-align: left;
}

.rule {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 0.7rem 0.6rem; background: rgba(255, 255, 255, 0.02);
  font-size: 0.85rem; color: var(--muted);
}

.rule b { display: block; color: var(--ink); margin-bottom: 0.1rem; font-size: 0.88rem; }

.difficulty-row { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin: 0.9rem 0; }
.diff-btn { font: inherit; font-weight: 700; font-size: 0.85rem; color: var(--muted); background: rgba(255,255,255,0.04); border: 2px solid var(--line-strong); border-radius: 999px; padding: 0.45rem 0.9rem; cursor: pointer; transition: all 0.15s; }
.diff-btn span { display: block; font-size: 0.65rem; font-weight: 600; opacity: 0.7; }
.diff-btn:hover { border-color: var(--violet-2); color: var(--ink); }
.diff-btn.active { color: #fff; background: linear-gradient(135deg, var(--violet), #6d28d9); border-color: transparent; box-shadow: 0 6px 18px -8px var(--violet); }
.diff-btn[data-difficulty="medium"].active { background: linear-gradient(135deg, #d97706, #b45309); box-shadow: 0 6px 18px -8px #d97706; }
.diff-btn[data-difficulty="hard"].active { background: linear-gradient(135deg, #dc2626, #991b1b); box-shadow: 0 6px 18px -8px #dc2626; }

.start-actions { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }

.best-badge {
  display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.8rem;
  color: var(--gold); font-weight: 550; font-size: 0.85rem;
}

.start-board { max-width: 100%; width: min(420px, 100%); margin: 1.2rem auto 0; text-align: left; font-size: 0.85rem; }

.start-board h4 {
  margin: 0 0 0.4rem; font-size: 0.7rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); font-weight: 600;
}

/* ==========================================================================
   Countdown
   ========================================================================== */

.countdown {
  position: fixed; inset: 0; z-index: 80;
  display: none; place-items: center;
  background: rgba(6, 6, 15, 0.18); backdrop-filter: none;
  pointer-events: none;
}

.countdown.active { display: grid; }

.countdown span {
  font-family: var(--font-display); font-size: clamp(5rem, 20vw, 11rem); font-weight: 700;
  background: linear-gradient(110deg, var(--violet-2), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: count-pop 0.7s var(--ease);
}

.countdown span.go {
  background: linear-gradient(110deg, var(--lime), var(--cyan));
  -webkit-background-clip: text; background-clip: text;
}

@keyframes count-pop {
  0% { opacity: 0; transform: scale(0.5); }
  30% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0.95; transform: scale(1); }
}

/* ==========================================================================
   Game Hud
   ========================================================================== */

.hud {
  display: flex; align-items: center; justify-content: space-between; gap: 0.7rem; margin-bottom: 0.8rem; flex-wrap: wrap;
}

.hud .hud-left { display: flex; align-items: center; gap: 0.5rem; }

.hud-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: -0.01em;
}

.hud-progress { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }

.hud-score {
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.hud-score small {
  font-size: 0.65rem; color: var(--faint);
  -webkit-text-fill-color: var(--faint);
  display: block; text-align: right; letter-spacing: 0.1em; text-transform: uppercase;
}

/* ==========================================================================
   Timer — fuse to dynamite
   ========================================================================== */

.timer { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.6rem; position: relative; z-index: 2; }

.timer-value {
  font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; line-height: 1;
  font-variant-numeric: tabular-nums; min-width: 2.8rem; text-align: right;
}
.timer-value small { font-size: 0.55rem; color: var(--faint); margin-left: 0.1rem; }

.fuse-wrap { flex: 1; display: flex; align-items: center; gap: 0.25rem; min-width: 0; }
.fuse-track { flex: 1; height: 10px; background: rgba(255,255,255,0.08); border-radius: 99px; overflow: visible; position: relative; display: flex; justify-content: flex-end; }
.fuse-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #fbbf24, #f59e0b, #a16207); border-radius: 99px; position: relative; transition: width 0.25s linear; }
.fuse-spark { position: absolute; left: -4px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: radial-gradient(circle, #fff 0%, #fde047 35%, #f97316 70%, transparent 100%); box-shadow: 0 0 8px 4px rgba(251,191,36,0.8); animation: spark-flicker 0.15s infinite alternate; }
.fuse-bomb { font-size: 1.4rem; line-height: 1; position: relative; flex-shrink: 0; }

.timer.is-warn .fuse-fill { background: linear-gradient(90deg, #fb923c, #f59e0b, #b45309); }
.timer.is-warn .timer-value { color: var(--amber); }
.timer.is-danger .fuse-fill { background: linear-gradient(90deg, #f87171, #ef4444, #991b1b); }
.timer.is-danger .fuse-spark { background: radial-gradient(circle, #fff 0%, #fca5a5 35%, #ef4444 70%, transparent 100%); box-shadow: 0 0 10px 5px rgba(239,68,68,0.9); }
.timer.is-danger .timer-value { color: var(--red); animation: pulse 0.8s ease-in-out infinite; }
.timer.is-boom .fuse-bomb { animation: bomb-shake 0.12s linear 4; }
.timer.is-boom .fuse-spark { opacity: 0; }
.game-shell:has(.timer.is-boom) { animation: screen-shake 0.8s linear; }

@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes spark-flicker { from { transform: scale(0.8); opacity: 0.7; } to { transform: scale(1.3); opacity: 1; } }
@keyframes bomb-shake { 0%,100% { transform: translate(0,0) rotate(0); } 20% { transform: translate(-3px,2px) rotate(-12deg); } 40% { transform: translate(3px,-2px) rotate(12deg); } 60% { transform: translate(-3px,-1px) rotate(-10deg); } 80% { transform: translate(3px,1px) rotate(10deg); } }
@keyframes screen-shake { 0%,100% { transform: translate(0,0); } 8% { transform: translate(-14px,-8px) rotate(-2deg); } 16% { transform: translate(14px,8px) rotate(2deg); } 24% { transform: translate(-16px,4px) rotate(-2.5deg); } 32% { transform: translate(16px,-4px) rotate(2.5deg); } 40% { transform: translate(-12px,6px) rotate(-2deg); } 48% { transform: translate(12px,-6px) rotate(2deg); } 56% { transform: translate(-8px,4px) rotate(-1deg); } 64% { transform: translate(8px,-4px) rotate(1deg); } 72% { transform: translate(-4px,2px); } 80% { transform: translate(4px,-2px); } 90% { transform: translate(-2px,1px); } }

/* ==========================================================================
   Question
   ========================================================================== */

.q-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(150deg, color-mix(in srgb, var(--panel-strong) 72%, transparent), color-mix(in srgb, var(--panel) 72%, transparent));
  padding: clamp(1.25rem, 4vw, 2.2rem);
  text-align: center;
  min-height: clamp(180px, 28vh, 280px);
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.q-chip {
  position: absolute; top: 0.7rem; left: 0.8rem;
  font-size: 0.6rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--violet-2);
  border: 1px solid rgba(167, 139, 250, 0.25);
  background: rgba(124, 58, 237, 0.1); padding: 0.2rem 0.5rem; border-radius: 8px;
}

.q-text {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5.5vw, 2.8rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 700;
  text-wrap: balance;
}

@keyframes q-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
   Answers
   ========================================================================== */

.answers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-top: 1rem;
}

.answer {
  --a: var(--lime);
  position: relative;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--ink);
  padding: clamp(1.1rem, 4vw, 1.6rem) 1rem;
  min-height: 88px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  transition: transform 0.12s var(--ease), border-color 0.18s, background 0.2s, box-shadow 0.2s;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.answer::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--a) 24%, transparent), transparent 60%);
  opacity: 0; transition: opacity 0.2s;
}

.answer:hover { transform: translateY(-2px); border-color: var(--a); box-shadow: 0 12px 32px -12px var(--a); }
.answer:hover::before { opacity: 1; }
.answer:active { transform: translateY(0) scale(0.97); }
.answer:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; }

.answer--true { --a: var(--lime); }
.answer--false { --a: var(--red); }
.answer--a { --a: var(--amber); }
.answer--b { --a: var(--teal); }

.answer .key {
  font-size: 0.65rem; font-family: var(--font-body); font-weight: 600;
  letter-spacing: 0.08em; color: var(--faint);
  border: 1px solid var(--line); border-radius: 5px; padding: 0.15rem 0.35rem;
}

.answer .mark { font-size: 1.1rem; }

.answer.is-picked {
  border-color: var(--a);
  box-shadow: 0 0 0 3px var(--a), 0 14px 36px -10px var(--a);
}

.answer.is-picked::before { opacity: 1; }
.answer.is-dim { opacity: 0.3; }

.answer.is-answer {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px var(--lime), 0 14px 36px -10px var(--lime);
  opacity: 1;
}

.answer.is-answer::before { opacity: 1; }

.answer.is-bad {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red), 0 14px 36px -10px var(--red);
  opacity: 1;
}

.answer.is-bad::before { opacity: 1; }

/* Stats! answer labels can be long country names */
.answer .name { display: block; text-wrap: balance; }
.theme-stats .answer { font-size: clamp(1.6rem, 4.5vw, 2.3rem); line-height: 1.15; }
.theme-stats .answer .key { color: var(--amber); border-color: rgba(251, 191, 36, 0.4); }

/* ==========================================================================
   Clue Ladder
   ========================================================================== */

.clue-card { display: block; text-align: left; }

.clue-worth {
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  margin: 1.1rem 0 0.6rem;
}

.clue-worth b {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--cyan);
  letter-spacing: -0.01em;
  margin-left: 0.15rem;
}

.clue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.clue {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.95rem;
  line-height: 1.4;
  animation: clue-in 0.3s var(--ease);
}

.clue.is-new {
  border-color: rgba(125, 211, 252, 0.5);
  background: rgba(14, 165, 233, 0.12);
  box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.18);
}

.clue-num {
  flex: 0 0 auto;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.clue.is-new .clue-num { background: var(--violet); color: #fff; }

@keyframes clue-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.guess-row { display: flex; gap: 0.6rem; margin-top: 1rem; }

.guess-input {
  flex: 1;
  min-width: 0;
  border: 2px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
  font-family: var(--font-body);
  font-size: 1.1rem;
}

.guess-input::placeholder { color: var(--faint); }
.guess-input:focus {
  outline: none;
  border-color: var(--violet-2);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.25);
}
.guess-input:disabled { opacity: 0.6; }
.guess-input.is-shake { border-color: var(--red); animation: shake 0.3s; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.clue-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  align-items: center;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.btn--link {
  background: none;
  border: 1px solid transparent;
  box-shadow: none;
  color: var(--faint);
  padding: 0.5rem 0.8rem;
  font-weight: 500;
}

.btn--link:hover { color: var(--ink); background: var(--panel); filter: none; }

.feedback-answer {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 4vw, 1.9rem);
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.4rem;
}

.game-shell:has(.feedback.active) .guess-row,
.game-shell:has(.feedback.active) .clue-actions {
  opacity: 0.35;
  pointer-events: none;
}

@media (max-width: 600px) {
  .clue { font-size: 0.95rem; padding: 0.55rem 0.65rem; }
  .guess-input { font-size: 1rem; padding: 0.8rem 0.85rem; }
}

/* ==========================================================================
   Feedback
   ========================================================================== */

.feedback {
  position: absolute; inset: 0; z-index: 5;
  display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1rem;
  background: rgba(6, 6, 15, 0.9); backdrop-filter: blur(4px);
  animation: screen-in 0.25s var(--ease);
  overflow-y: auto;
}

.q-card:has(.feedback.active) {
  min-height: min(78vh, 540px);
  place-items: stretch;
}

.game-shell:has(.feedback.active) .answers {
  opacity: 0.4;
  pointer-events: none;
}

.feedback.active { display: flex; }

.feedback-badge {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.2rem, 3.5vw, 1.7rem);
  letter-spacing: -0.02em; margin-bottom: 0.2rem;
}

.feedback.is-correct .feedback-badge { color: var(--lime); text-shadow: 0 0 20px rgba(52, 211, 153, 0.4); }
.feedback.is-wrong .feedback-badge { color: var(--red); text-shadow: 0 0 20px rgba(251, 113, 133, 0.35); }
.feedback.is-timeout .feedback-badge { color: var(--amber); text-shadow: 0 0 20px rgba(251, 191, 36, 0.3); }

.sad-face { display: none; font-size: clamp(2.5rem, 8vw, 4rem); line-height: 1; margin-bottom: 0.25rem; }
.feedback.is-wrong .sad-face, .feedback.is-timeout .sad-face { display: block; animation: sad-wobble 0.6s ease-in-out; }
@keyframes sad-wobble { 0%{transform:scale(0.5) rotate(0);opacity:0} 30%{transform:scale(1.2) rotate(-8deg);opacity:1} 50%{transform:scale(0.95) rotate(6deg)} 70%{transform:scale(1.05) rotate(-3deg)} 100%{transform:scale(1) rotate(0)} }

.feedback-fact { margin: 0 0 0.2rem; color: var(--ink); font-size: 0.9rem; max-width: 500px; }
.feedback-source { margin: 0 0 0.5rem; color: var(--faint); font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase; }

.feedback-points {
  font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; color: var(--cyan);
  margin-bottom: 0.5rem; font-variant-numeric: tabular-nums;
}

.feedback-points.is-zero { color: var(--faint); }

.btn-next {
  appearance: none;
  border: 0;
  cursor: pointer;
  width: min(340px, 92%);
  min-height: 64px;
  margin-top: 0.4rem;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.4vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #08080f;
  background: linear-gradient(100deg, var(--cyan), var(--lime));
  box-shadow: 0 14px 34px -12px rgba(34, 211, 238, 0.7);
  transition: transform 0.12s var(--ease), box-shadow 0.2s, filter 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-next:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 18px 40px -12px rgba(34, 211, 238, 0.8); }
.btn-next:active { transform: translateY(0) scale(0.97); }
.btn-next:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ==========================================================================
   Progress Dots
   ========================================================================== */

.dots { display: flex; justify-content: center; gap: 0.3rem; margin-top: 0.8rem; flex-wrap: wrap; }

.dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transition: transform 0.2s, background 0.2s;
}

.dot.is-correct { background: var(--lime); box-shadow: 0 0 10px rgba(52, 211, 153, 0.5); }
.dot.is-wrong { background: var(--red); }
.dot.is-current { transform: scale(1.3); background: var(--cyan); box-shadow: 0 0 12px rgba(34, 211, 238, 0.6); }

/* ==========================================================================
   Streak
   ========================================================================== */

.streak {
  position: absolute; top: 0.6rem; right: 0.7rem;
  font-size: 0.7rem; font-weight: 600; color: var(--amber);
  opacity: 0; transform: translateY(-2px);
  transition: opacity 0.2s, transform 0.2s;
}

.streak.show { opacity: 1; transform: none; }

/* ==========================================================================
   Results
   ========================================================================== */

.results-panel { text-align: center; }

.results-kicker {
  font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--faint); font-weight: 550;
}

.results-score {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.5rem, 10vw, 4.5rem); line-height: 1;
  letter-spacing: -0.03em; margin: 0.2rem 0 0.1rem;
  background: linear-gradient(90deg, var(--violet-2), var(--cyan) 50%, var(--lime));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}

.results-verdict { color: var(--muted); margin: 0 0 0.8rem; }

.results-stats {
  display: grid; grid-template-columns: 1fr; gap: 0.5rem; max-width: 440px; margin: 0 auto 1rem;
}

.rstat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.4rem; background: rgba(255, 255, 255, 0.02);
}

.rstat b { display: block; font-family: var(--font-display); font-size: 1.2rem; letter-spacing: -0.02em; }
.rstat span { color: var(--faint); font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 550; }

.new-best {
  display: none; margin: 0 auto 0.6rem; width: fit-content;
  padding: 0.3rem 0.6rem; border-radius: var(--radius);
  background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--gold); font-weight: 550; font-size: 0.75rem;
}

.new-best.show { display: block; animation: pop 0.3s var(--ease); }

@keyframes pop {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.score-form {
  display: flex; flex-direction: column; gap: 0.5rem; max-width: 400px; margin: 0 auto 0.8rem;
}

.score-form input {
  flex: 1; min-width: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  padding: 0.7rem 0.6rem; color: var(--ink);
  font-family: var(--font-body); font-size: 0.95rem;
}

.score-form input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.1); }

.results-board { max-width: 400px; margin: 0 auto 0.8rem; text-align: left; font-size: 0.8rem; }

.results-board h4 {
  margin: 0 0 0.4rem; font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); font-weight: 550;
}

.results-actions { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }

/* ==========================================================================
   Confetti
   ========================================================================== */

#confetti {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
}

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed; left: 50%; bottom: 1rem; transform: translate(-50%, 140%);
  z-index: 100;
  background: rgba(12, 12, 27, 0.95); border: 1px solid var(--line-strong);
  color: var(--ink); padding: 0.5rem 0.8rem; border-radius: var(--radius);
  font-size: 0.8rem; font-weight: 550; backdrop-filter: blur(8px);
}

.toast.show { transform: translate(-50%, 0); }

/* ==========================================================================
   Responsive — Mobile First
   ========================================================================== */

@media (min-width: 640px) {
  .answers { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .answer { min-height: 116px; font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
  .answer .mark { font-size: 1.6rem; }
  .answer .key { font-size: 0.8rem; padding: 0.2rem 0.45rem; }
  .q-text { font-size: clamp(2rem, 4.2vw, 3rem); }
}

@media (max-width: 600px) {
  body { font-size: 15px; }
  .nav-inner { flex-wrap: wrap; }
  .nav-links { flex-wrap: wrap; justify-content: flex-end; gap: 0.2rem; }
  .nav-links a { font-size: 0.8rem; padding: 0.35rem 0.5rem; }
  .rules { grid-template-columns: 1fr; }

  .hero { padding: clamp(2rem, 6vw, 4rem) 0 clamp(1rem, 3vw, 2rem); }
  .hero h1 { font-size: clamp(2rem, 9vw, 4.5rem); }
  .hero p { font-size: clamp(0.9rem, 2vw, 1rem); }
  .grid { gap: 0.5rem; }
  .card { padding: 0.8rem; }
  .card-icon { width: 40px; height: 40px; margin-bottom: 0.5rem; font-size: 1.2rem; }
  .card h3 { font-size: 1.1rem; }
  .card p { font-size: 0.85rem; margin-bottom: 0.5rem; }

  .section-head h2 { font-size: clamp(1.2rem, 4vw, 1.8rem); }

  .answers { gap: 0.75rem; }
  .theme-board .answers, .theme-outline .answers, .theme-subject .answers { grid-template-columns: 1fr; }
  .answer { min-height: 96px; font-size: clamp(1.75rem, 8vw, 2.4rem); padding: 1.2rem 0.75rem; }
  .answer .key { font-size: 0.75rem; padding: 0.2rem 0.42rem; }
  .answer .mark { font-size: 1.4rem; }

  .hud { gap: 0.4rem; }
  .hud-title { font-size: 0.9rem; }
  .hud-progress { font-size: 0.75rem; }
  .hud-score { font-size: 1.1rem; }
  .hud-score small { font-size: 0.55rem; letter-spacing: 0.05em; }

  .timer { margin-bottom: 0.5rem; gap: 0.4rem; }
  .timer-value { font-size: 1rem; min-width: 2.4rem; }
  .fuse-bomb { font-size: 1.2rem; }

  .q-card { padding: 1.25rem 1rem; min-height: 190px; }
  .q-chip { top: 0.5rem; left: 0.6rem; font-size: 0.58rem; }
  .q-text { font-size: clamp(1.75rem, 7vw, 2.4rem); line-height: 1.22; }
  .feedback { padding: 0.6rem; }
  .feedback-badge { font-size: clamp(1rem, 3vw, 1.3rem); }
  .feedback-fact { font-size: 0.85rem; max-width: 400px; }
  .feedback-source { font-size: 0.65rem; }
  .feedback-points { font-size: 1.2rem; }
  .btn-next { min-height: 68px; width: 94%; font-size: 1.25rem; }

  .dots { gap: 0.2rem; }
  .dot { width: 6px; height: 6px; }

  .streak { display: none; }

  .results-stats { grid-template-columns: 1fr; max-width: 360px; margin: 0 auto 0.5rem; }
  .rstat { padding: 0.5rem 0.3rem; }
  .rstat b { font-size: 1.1rem; }
  .rstat span { font-size: 0.55rem; }

  .new-best { margin: 0.4rem auto 0.2rem; padding: 0.2rem 0.4rem; font-size: 0.7rem; }

  .score-form { gap: 0.3rem; max-width: 320px; }
  .score-form input { padding: 0.5rem 0.4rem; font-size: 0.85rem; }

  .results-board { font-size: 0.75rem; max-width: 320px; }
  .results-board h4 { font-size: 0.55rem; }

  .results-actions { gap: 0.3rem; }
}

/* ==========================================================================
   Readability polish — modern CSS, one override pass
   ========================================================================== */

body { font-size: 1.0625rem; line-height: 1.65; }

h1, h2, h3 { text-wrap: balance; }

::selection { background: color-mix(in oklch, var(--cyan) 45%, transparent); color: var(--ink); }

.nav-links a {
  display: inline-flex; align-items: center;
  min-block-size: 44px; font-size: 0.9rem;
}

.brand { font-size: 1.1rem; }

.hero p,
.start-panel .sub,
.card p,
.rule,
.board-empty,
.feedback-fact,
.results-verdict { text-wrap: pretty; }

.hero p { font-size: clamp(1rem, 2.2vw, 1.2rem); }
.start-panel .sub { font-size: 1.05rem; max-inline-size: 34rem; }
.card p { font-size: 1rem; }
.chip { font-size: 0.72rem; }
.rule { font-size: 0.95rem; }
.rule b { font-size: 1rem; }
.hud-progress { font-size: 0.95rem; }
.q-text { font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.18; }
.answer { font-size: clamp(1.7rem, 5.2vw, 2.6rem); line-height: 1.15; }
.feedback-fact { font-size: 1rem; }
.feedback-source { font-size: 0.75rem; }
.results-kicker,
.start-board h4,
.results-board h4 { font-size: 0.75rem; }
.rstat span { font-size: 0.7rem; }
.score-form input { font-size: 1rem; }
.footer { font-size: 0.9rem; }

.card, .q-card, .answer { min-inline-size: 0; }
.answer .name,
.answer .label { overflow-wrap: break-word; }

/* Brighter surfaces without changing each game's accent colours */
.panel,
.board,
.card {
  border-color: color-mix(in oklch, var(--ink) 16%, transparent);
  background: linear-gradient(
    155deg,
    color-mix(in oklch, var(--ink) 9%, transparent),
    color-mix(in oklch, var(--ink) 4%, transparent)
  );
}

.q-card {
  border-color: color-mix(in oklch, var(--ink) 18%, transparent);
  background: linear-gradient(
    150deg,
    color-mix(in oklch, var(--ink) 10%, transparent),
    color-mix(in oklch, var(--ink) 5%, transparent)
  );
}

.feedback {
  background: color-mix(in oklch, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px) saturate(1.2);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

input { accent-color: var(--violet); }

/* Layout follows the game card's width, not just the viewport */
@container game (min-width: 34rem) {
  .rules { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .answers { grid-template-columns: 1fr 1fr; }
  .results-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .score-form { flex-direction: row; align-items: center; }
}

@media (max-width: 600px) {
  body { font-size: 1rem; }
  .hero p { font-size: 1rem; }
  .card p { font-size: 0.98rem; }
  .chip { font-size: 0.7rem; }
  .answer { font-size: clamp(1.7rem, 7.5vw, 2.3rem); }
  .q-text { font-size: clamp(1.9rem, 7.2vw, 2.6rem); }
  .feedback-fact { font-size: 0.95rem; }
  .feedback-source { font-size: 0.72rem; }
  .rstat span { font-size: 0.68rem; }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

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

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  :root { color-scheme: light; }
  .bg-decor, .blob, .countdown, .toast, .sound-toggle { display: none !important; }
  * { -webkit-text-size-adjust: 100%; }
  body { background: white; color: black; }
  .card, .board, .panel { box-shadow: none !important; border-color: #000 !important; }
}

/* ==========================================================================
   Pint-Sized Artillery
   ========================================================================== */

.arena-wrap {
  position: relative;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #07131c;
  margin-top: 0.8rem;
}

#canvas { display: block; width: 100%; height: auto; touch-action: none; }

.hud--arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
}

.hud-side { display: flex; flex-direction: column; gap: 0.2rem; }
.hud-side.right { text-align: right; }
.hud-side-name { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 600; }
.hud-side-score { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.hud-side-turn { font-size: 0.72rem; color: var(--muted); font-weight: 600; }

.hud-mid { text-align: center; min-width: 400px; }
.hud-wind, .hud-status { font-size: 0.75rem; color: var(--muted); font-weight: 600; }

.weapon-row { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-top: 0.9rem; }
.weapon { padding: 0.55rem 1rem; font-size: 1rem; }

.join-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; max-width: 100%; }
.join-form input {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  border: 2px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  flex: 1 1 6rem;
  min-width: 0;
  max-width: 100%;
}

.code-display { text-align: center; margin-top: 1rem; }
.code-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 600; }
.code-big {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 10vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--ink);
  line-height: 1.1;
}
.code-hint { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }

@media (max-width: 640px) {
  .hud--arena { grid-template-columns: 1fr; gap: 0.5rem; text-align: center; }
  .hud-side { flex-direction: row; justify-content: center; align-items: center; gap: 0.6rem; text-align: center; }
  .hud-side.right { text-align: center; }
  .hud-mid { order: 2; }
  .hud-wind, .hud-status { text-align: center; }
}

/* ==========================================================================
   Liar's Crown — pub bluffing
   ========================================================================== */

body.theme-ruby {
  --violet: #e11d48;
  --violet-2: #fda4af;
  --cyan: #fb7185;
  --lime: #f43f5e;
  --amber: #fb923c;
  --teal: #f472b6;
}

body.theme-ruby .bg-decor {
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(225, 29, 72, 0.24), transparent 60%),
    radial-gradient(900px 700px at 0% 110%, rgba(251, 113, 133, 0.18), transparent 60%),
    var(--bg);
}

body.theme-ruby .blob--violet { background: #9f1239; }
body.theme-ruby .blob--cyan { background: #be185d; }
body.theme-ruby .blob--lime { background: #7f1d1d; }

body.theme-ruby .btn {
  background: linear-gradient(135deg, #e11d48, #9f1239);
  box-shadow: 0 8px 24px -10px rgba(225, 29, 72, 0.7);
}

body.theme-ruby .q-chip { color: #fda4af; border-color: rgba(253, 164, 175, 0.3); background: rgba(225, 29, 72, 0.12); }

body.theme-ruby .hud-score { background: linear-gradient(90deg, #fb7185, #fbbf24); -webkit-background-clip: text; background-clip: text; color: transparent; }

body.theme-ruby .card-icon { background: linear-gradient(150deg, rgba(225, 29, 72, 0.38), rgba(251, 113, 133, 0.2)); }

.card--ruby .card-icon { background: linear-gradient(150deg, rgba(225, 29, 72, 0.38), rgba(251, 113, 133, 0.2)); }

.bluff-round {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 700;
}

.bluff-teller { font-size: 0.85rem; color: var(--muted); margin-top: 0.2rem; }

.bluff-card {
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 0.8rem;
  margin-top: 0.6rem;
}

.bluff-topic {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #fda4af;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.bluff-tale {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 6vw, 2.1rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.bluff-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-top: 0.8rem; }

@media (max-width: 640px) {
  .bluff-actions { flex-direction: column; }
  .bluff-actions .btn { width: 100%; }
}

/* ==========================================================================
   Artillery v25 — mobile-first, Scorched Earth style
   ========================================================================== */

.hud-side-turns {
  font-size: 0.7rem;
  color: var(--faint);
  margin-top: 0.2rem;
}

.hud-wind {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: var(--panel);
  border-radius: 999px;
  border: 1px solid var(--line);
}

.wind-flag {
  font-size: 1.3rem;
  display: inline-block;
  transition: transform 0.2s ease-out;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.wind-value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #67e8f9;
  min-width: 2.5ch;
  text-align: right;
}

.wind-unit {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.weapon-row {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.8rem;
  padding: 0 0.5rem;
}

.weapon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.7rem 1rem;
  min-width: 72px;
  font-weight: 600;
  transition: all 0.15s;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: var(--radius);
}

.weapon:not(:disabled):active { transform: scale(0.96); }

.weapon.active {
  border-color: var(--violet);
  background: linear-gradient(135deg, var(--violet), var(--violet-2));
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.weapon:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.weapon-icon { font-size: 1.4rem; line-height: 1; }
.weapon-name { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.weapon-points {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.2);
  color: var(--ink);
}

.weapon.active .weapon-points { background: rgba(255,255,255,0.3); color: #fff; }

.weapon-info {
  text-align: center;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--panel);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--muted);
  min-height: 1.4em;
  transition: all 0.2s;
}

@media (max-width: 600px) {
  .weapon { padding: 0.6rem 0.8rem; min-width: 64px; }
  .weapon-name { font-size: 0.65rem; }
  .weapon-points { font-size: 0.6rem; padding: 0.08rem 0.35rem; }
  .hud-side-score { font-size: 1.4rem; }
  .hud-side-turn { font-size: 0.65rem; }
  .hud-side-turns { font-size: 0.6rem; }
  .hud-wind { padding: 0.3rem 0.6rem; gap: 0.3rem; }
  .wind-value { font-size: 1rem; min-width: 2ch; }
}

@media (max-width: 400px) {
  .weapon { padding: 0.5rem 0.6rem; min-width: 56px; }
  .weapon-icon { font-size: 1.2rem; }
  .weapon-name { display: none; }
}

/* ==========================================================================
   8-BIT THEME — pixel type, hard edges, NES palette
   Loaded after every game theme, so it wins the cascade.
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #0b0b1a;
  --bg-2: #12122a;
  --panel: #1a1a38;
  --panel-strong: #25254a;
  --line: #3c3c72;
  --line-strong: #6464b0;
  --ink: #ffffff;
  --muted: #bfbfe6;
  --faint: #8585b8;

  --violet: #7a4dff;
  --violet-2: #b69cff;
  --cyan: #3fe6ff;
  --lime: #8cff6b;
  --green: #5cff9d;
  --teal: #45e0d0;
  --amber: #ffd93d;
  --gold: #ffe066;
  --red: #ff5c7a;

  --font-display: 'Press Start 2P', 'Courier New', monospace;
  --font-body: 'VT323', 'Courier New', monospace;

  --radius: 0px;
  --radius-lg: 0px;
  --shadow: 8px 8px 0 #000;
  --ease: steps(3, end);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 21px;
  line-height: 1.4;
}

h1, h2, h3, h4, p, a, button, input, label, b, span, div {
  font-family: inherit;
}

h1, h2, h3, .hero h1, .start-panel h1, .q-text,
.results-score, .hud-score, .hud-title, .card h3,
.section-head h2, .feedback-badge, .countdown span,
.timer-value, .code-big, .brand {
  letter-spacing: 0;
  text-shadow: 3px 3px 0 #000;
}

::selection { background: var(--cyan); color: #000; }

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

/* ---------- backdrop: flat wall + scanlines + pixel dust ---------- */

.bg-decor,
body[class] .bg-decor {
  background: var(--bg);
}

.bg-decor::before {
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.3) 0,
    rgba(0, 0, 0, 0.3) 2px,
    transparent 2px,
    transparent 4px
  );
  mask-image: none;
  animation: none;
}

.bg-decor::after {
  inset: 0;
  background-image: radial-gradient(rgba(63, 230, 255, 0.16) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 1;
  mix-blend-mode: normal;
}

.blob { display: none; }

/* ---------- nav ---------- */

.nav {
  background: var(--bg);
  border-bottom: 4px solid var(--line);
  backdrop-filter: none;
}

.nav-inner { padding-block: 0.65rem; }

.brand { font-family: var(--font-display); font-size: 0.8rem; }
.brand img { width: 26px; height: 26px; }

.brand span em {
  background: none;
  color: var(--amber);
  -webkit-text-fill-color: var(--amber);
}

.nav-links a {
  border-radius: 0;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 1.1rem;
  padding: 0.35rem 0.6rem;
}

.nav-links a:hover { background: var(--panel-strong); color: var(--cyan); }

/* ---------- buttons ---------- */

.btn,
body[class] .btn {
  --btn-bg: var(--violet);
  background: var(--btn-bg);
  border: 3px solid #000;
  border-radius: 0;
  box-shadow: 4px 4px 0 #000;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.62rem;
  line-height: 1.7;
  padding: 0.8rem 1.1rem;
  text-transform: uppercase;
  transition: transform 0.08s steps(1, end), box-shadow 0.08s steps(1, end), background 0.08s;
}

.btn:hover,
body[class] .btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 #000;
  filter: none;
}

.btn:active,
body[class] .btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #000;
}

.btn--big { font-size: 0.72rem; padding: 1rem 1.4rem; }

.btn--ghost,
body[class] .btn--ghost {
  background: var(--bg-2);
  border-color: var(--line-strong);
  color: var(--ink);
  box-shadow: 4px 4px 0 #000;
}

.btn--ghost:hover { background: var(--panel-strong); }

.btn[disabled],
body[class] .btn[disabled] { opacity: 0.45; transform: none; box-shadow: 2px 2px 0 #000; }

.btn-next,
body[class] .btn-next {
  background: var(--lime);
  border: 3px solid #000;
  border-radius: 0;
  box-shadow: 5px 5px 0 #000;
  color: #000;
  font-family: var(--font-display);
  font-size: 0.8rem;
  line-height: 1.7;
  letter-spacing: 0;
  text-transform: uppercase;
}

.btn-next:hover,
body[class] .btn-next:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 #000;
  filter: none;
}

.btn-next:active,
body[class] .btn-next:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #000;
}

/* ---------- hero / home ---------- */

.hero { padding: clamp(2rem, 6vw, 4rem) 0 clamp(1.5rem, 4vw, 2.5rem); }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 3.8rem);
  line-height: 1.15;
  margin: 1.4rem 0 1rem;
}

.grad,
.hero h1 .grad {
  background: none;
  color: var(--amber);
  -webkit-text-fill-color: var(--amber);
  animation: none;
}

.hero p { max-width: 34rem; font-size: 1.3rem; color: var(--muted); }

.hero-kicker {
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  font-family: var(--font-body);
  font-size: 1rem;
  letter-spacing: 0.1em;
}

.hero-stats .stat b { font-family: var(--font-display); font-size: clamp(1.1rem, 3vw, 1.6rem); }
.hero-stats .stat span { font-family: var(--font-body); font-size: 0.95rem; }

.player-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem auto 0;
  max-width: 34rem;
}

.player-form label { color: var(--muted); font-size: 1.15rem; }

.player-form input {
  flex: 1 1 13rem;
  min-inline-size: 0;
  border: 3px solid var(--line-strong);
  border-radius: 0;
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.2rem;
  padding: 0.55rem 0.75rem;
}

/* ---------- inputs ---------- */

.score-form input,
.guess-input,
.join-form input {
  border: 3px solid var(--line-strong);
  border-radius: 0;
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--font-body);
}

.score-form input:focus,
.guess-input:focus,
.join-form input:focus,
.player-form input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 4px 4px 0 #000;
}

.score-form input { font-size: 1.2rem; }

::placeholder { color: var(--faint); opacity: 1; }

/* ---------- cards / boards ---------- */

.grid { gap: 1.25rem; }

.card,
.card:visited {
  border: 3px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  box-shadow: 5px 5px 0 #000;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.08s steps(1, end), box-shadow 0.08s steps(1, end), border-color 0.08s;
}

.card::before { display: none; }

.card:hover {
  transform: translate(-2px, -2px);
  border-color: var(--cyan);
  box-shadow: 7px 7px 0 #000;
}

.card .card-icon,
body[class] .card-icon {
  border: 3px solid var(--line-strong);
  border-radius: 0;
  background: var(--panel-strong);
  box-shadow: 3px 3px 0 #000;
}

.card h3 { color: var(--ink); font-family: var(--font-display); font-size: 0.9rem; line-height: 1.6; }
.card p { font-size: 1.1rem; }

.chip {
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--bg-2);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.card-cta { color: var(--amber); font-family: var(--font-body); font-size: 1.1rem; }

.section-head h2 { font-family: var(--font-display); font-size: clamp(1rem, 2.6vw, 1.5rem); line-height: 1.5; }
.section-head p { font-family: var(--font-body); font-size: 1.05rem; }

.board {
  border: 3px solid var(--line);
  border-radius: 0;
  background: var(--bg-2);
}

.board-row { border-bottom: 2px solid var(--line); padding: 0.55rem 0.8rem; }
.board-row:last-child { border-bottom: 0; }
.board-row .rank { font-family: var(--font-display); font-size: 0.72rem; }
.board-row .name { font-family: var(--font-body); font-size: 1.15rem; }
.board-row .score { font-family: var(--font-display); font-size: 0.78rem; color: var(--gold); }
.board-empty { font-size: 1.1rem; }

.footer { border-top: 3px solid var(--line); font-size: 1rem; }
.footer a { color: var(--cyan); }

/* ---------- game panel ---------- */

.panel {
  border: 3px solid var(--line-strong);
  border-radius: 0;
  background: var(--panel);
  box-shadow: 8px 8px 0 #000;
}

.panel::after { display: none; }

.start-panel .game-icon {
  border: 3px solid var(--line-strong);
  border-radius: 0;
  background: var(--panel-strong);
  box-shadow: 4px 4px 0 #000;
}

.start-panel h1 { font-family: var(--font-display); font-size: clamp(1.4rem, 4.5vw, 2.4rem); line-height: 1.3; }
.start-panel .sub { font-size: 1.2rem; max-width: 34rem; }

.rules { gap: 0.75rem; }

.rule {
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--bg-2);
  font-size: 1.05rem;
}

.rule b { font-family: var(--font-display); font-size: 0.6rem; line-height: 1.7; }

.best-badge { color: var(--gold); font-family: var(--font-body); font-size: 1.1rem; }

.start-board h4,
.results-board h4 { font-family: var(--font-display); font-size: 0.6rem; line-height: 1.7; }

/* ---------- difficulty picker ---------- */

.diff-btn {
  border: 3px solid var(--line-strong);
  border-radius: 0;
  background: var(--bg-2);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 1.05rem;
  padding: 0.45rem 0.9rem;
  transition: none;
}

.diff-btn span { font-size: 0.85rem; }
.diff-btn:hover { border-color: var(--amber); color: var(--ink); }

.diff-btn.active,
.diff-btn[data-difficulty="medium"].active,
.diff-btn[data-difficulty="hard"].active {
  background: var(--violet);
  border-color: #000;
  color: #fff;
  box-shadow: 3px 3px 0 #000;
}

.diff-btn[data-difficulty="medium"].active { background: var(--amber); color: #000; }
.diff-btn[data-difficulty="hard"].active { background: var(--red); color: #000; }

/* ---------- countdown ---------- */

.countdown { background: rgba(0, 0, 0, 0.88); backdrop-filter: none; }

.countdown span,
.countdown span.go {
  background: none;
  color: var(--amber);
  -webkit-text-fill-color: var(--amber);
  font-family: var(--font-display);
  text-shadow: 6px 6px 0 #000;
}

.countdown span.go { color: var(--lime); -webkit-text-fill-color: var(--lime); }

/* ---------- hud ---------- */

.hud-title { font-family: var(--font-display); font-size: 0.72rem; line-height: 1.7; }
.hud-progress { font-family: var(--font-body); font-size: 1.1rem; }

.hud-score,
body[class] .hud-score {
  background: none;
  color: var(--gold);
  -webkit-text-fill-color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.6;
}

.hud-score small {
  color: var(--faint);
  -webkit-text-fill-color: var(--faint);
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}

/* ---------- timer ---------- */

.timer-track { stroke: #2a2a52; stroke-width: 8; }
.timer-bar { stroke-width: 8; stroke-linecap: butt; }

.timer-value { font-family: var(--font-display); font-size: clamp(1.3rem, 4vw, 1.8rem); }
.timer-value small { font-family: var(--font-body); font-size: 0.95rem; }

/* ---------- question ---------- */

.q-card {
  border: 3px solid var(--line-strong);
  border-radius: 0;
  background: var(--panel);
  box-shadow: 6px 6px 0 #000;
}

.q-chip,
body[class] .q-chip {
  border: 2px solid var(--line-strong);
  border-radius: 0;
  background: var(--bg-2);
  color: var(--cyan);
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.q-text {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  line-height: 1.7;
}

/* ---------- answers ---------- */

.answers { gap: 1rem; }

.answer {
  border: 3px solid var(--line-strong);
  border-radius: 0;
  background: var(--bg-2);
  box-shadow: 5px 5px 0 #000;
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 2.2vw, 1.25rem);
  line-height: 1.5;
  letter-spacing: 0;
  padding: 1rem 0.8rem;
  text-shadow: 2px 2px 0 #000;
  transition: transform 0.08s steps(1, end), box-shadow 0.08s steps(1, end), border-color 0.08s;
}

.answer::before { background: var(--a); opacity: 0; }

.answer:hover {
  transform: translate(-2px, -2px);
  border-color: var(--a);
  box-shadow: 7px 7px 0 var(--a);
}

.answer:hover::before { opacity: 0.12; }
.answer:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #000; }
.answer.is-dim { opacity: 0.35; }

.answer.is-picked {
  border-color: var(--a);
  box-shadow: 0 0 0 3px var(--a), 5px 5px 0 #000;
}

.answer.is-answer {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green), 5px 5px 0 #000;
}

.answer.is-bad,
.answer.is-wrong {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red), 5px 5px 0 #000;
}

.answer .key {
  border: 2px solid var(--line-strong);
  border-radius: 0;
  color: var(--muted);
  font-family: var(--font-body);
}

.answer .mark { font-family: var(--font-body); font-size: 1.2rem; }

/* ---------- feedback ---------- */

.feedback {
  background: rgba(11, 11, 26, 0.96);
  backdrop-filter: none;
}

.feedback-badge { font-family: var(--font-display); font-size: clamp(0.85rem, 2.4vw, 1.2rem); line-height: 1.7; }

.feedback.is-correct .feedback-badge,
.feedback.is-wrong .feedback-badge,
.feedback.is-timeout .feedback-badge { text-shadow: 2px 2px 0 #000; }

.feedback-fact { font-size: 1.1rem; }
.feedback-source { font-family: var(--font-body); font-size: 0.95rem; }

.feedback-points { font-family: var(--font-display); font-size: 1.1rem; color: var(--gold); }
.feedback-next .fb-label { font-family: var(--font-body); font-size: 1rem; }

.feedback-bar {
  height: 12px;
  border: 2px solid var(--line-strong);
  border-radius: 0;
  background: var(--bg-2);
}

.feedback-bar i { background: var(--lime); }

/* ---------- dots / streak ---------- */

.dot {
  width: 12px;
  height: 12px;
  border-radius: 0;
  background: #2a2a52;
  transition: none;
}

.dot.is-correct { background: var(--lime); box-shadow: none; }
.dot.is-wrong { background: var(--red); box-shadow: none; }
.dot.is-current { background: var(--cyan); box-shadow: none; outline: 2px solid var(--ink); outline-offset: 1px; }

.streak { font-family: var(--font-body); font-size: 1.05rem; color: var(--amber); }

/* ---------- results ---------- */

.results-kicker { font-family: var(--font-body); font-size: 1rem; letter-spacing: 0.12em; }

.results-score {
  background: none;
  color: var(--gold);
  -webkit-text-fill-color: var(--gold);
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 3.5rem);
  line-height: 1.3;
}

.results-verdict { font-size: 1.2rem; }

.rstat {
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--bg-2);
}

.rstat b { font-family: var(--font-display); font-size: 0.95rem; line-height: 1.6; }
.rstat span { font-family: var(--font-body); font-size: 0.9rem; }

.new-best {
  border: 2px solid var(--amber);
  border-radius: 0;
  background: var(--bg-2);
  color: var(--gold);
  box-shadow: 3px 3px 0 #000;
  font-family: var(--font-body);
  font-size: 1rem;
}

/* ---------- toast / sound ---------- */

.toast {
  background: var(--bg-2);
  border: 3px solid var(--line-strong);
  border-radius: 0;
  box-shadow: 4px 4px 0 #000;
  backdrop-filter: none;
  font-family: var(--font-body);
  font-size: 1.1rem;
}

.sound-toggle {
  border: 3px solid var(--line-strong);
  border-radius: 0;
  background: var(--bg-2);
  box-shadow: 4px 4px 0 #000;
  backdrop-filter: none;
}

.sound-toggle:hover { transform: none; border-color: var(--amber); }

/* ---------- clue ladder ---------- */

.clue {
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--bg-2);
  font-size: 1.1rem;
}

.clue.is-new {
  border-color: var(--cyan);
  background: var(--panel-strong);
  box-shadow: none;
}

.clue-num {
  border-radius: 0;
  background: var(--panel-strong);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.5rem;
}

.clue.is-new .clue-num { background: var(--cyan); color: #000; }

.clue-worth { font-family: var(--font-body); font-size: 0.9rem; }
.clue-worth b { font-family: var(--font-display); font-size: 0.8rem; color: var(--gold); }

.guess-input { font-size: 1.2rem; }
.feedback-answer { font-family: var(--font-display); font-size: clamp(0.9rem, 2.5vw, 1.2rem); line-height: 1.6; }
.btn--link { font-family: var(--font-body); font-size: 1.05rem; }

/* ---------- which came first / sticky notes ---------- */

.q-card.note-card {
  border: 3px solid var(--line-strong);
  border-radius: 0;
  background: var(--panel);
  box-shadow: 6px 6px 0 #000;
  transform: none;
}

.q-card.note-card::before { display: none; }

.q-card.note-card .q-text {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1rem, 4vw, 1.6rem);
  line-height: 1.7;
  margin-top: 0;
}

.note-cutoff {
  border-top: 2px dashed var(--line-strong);
  color: var(--faint);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.theme-board .answer,
.theme-board .answer--b {
  background: var(--bg-2);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: 5px 5px 0 #000;
  transform: none;
}

/* Keep the A/B/C/D key badges readable on every game theme. */
.answer .key {
  min-width: 2rem;
  min-height: 2rem;
  display: inline-grid;
  place-items: center;
  padding: 0 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  background: var(--panel-strong);
  border: 2px solid var(--line-strong);
  border-radius: 0;
  text-shadow: none;
}

/* ---------- outline / animal silhouettes ---------- */

.silhouette {
  border: 3px dashed var(--line-strong);
  border-radius: 0;
  background: var(--bg-2);
}

.silhouette::before { display: none; }

.silhouette-img { filter: invert(1) contrast(1.05); }
.silhouette-glyph { filter: invert(1) grayscale(1); }


/* ---------- generated questions ---------- */

.subject-form input { font-size: 1.2rem; }

.gen-bar {
  height: 12px;
  border: 2px solid var(--line-strong);
  border-radius: 0;
  background: var(--bg-2);
}

.gen-bar span { border-radius: 0; background: var(--amber); animation: none; }
.gen-progress p { font-family: var(--font-body); font-size: 1rem; }

.gen-error {
  border: 2px solid var(--red);
  border-radius: 0;
  background: var(--bg-2);
  color: var(--red);
  font-family: var(--font-body);
  font-size: 1rem;
}

/* ---------- liar's crown ---------- */

.bluff-card {
  border: 3px solid var(--line-strong);
  border-radius: 0;
  background: var(--bg-2);
}

.bluff-topic { font-family: var(--font-body); font-size: 0.9rem; }
.bluff-tale { font-family: var(--font-display); font-size: clamp(0.9rem, 3vw, 1.4rem); line-height: 1.7; }

/* ---------- artillery ---------- */

.arena-wrap {
  border: 3px solid var(--line-strong);
  border-radius: 0;
  background: #051019;
  box-shadow: 5px 5px 0 #000;
}

.hud-side-name,
.hud-side-turn,
.hud-side-turns,
.hud-status,
.wind-unit { font-family: var(--font-body); }

.hud-side-score { font-family: var(--font-display); font-size: 1.1rem; line-height: 1.6; }

.hud-wind {
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--bg-2);
}

.wind-value { font-family: var(--font-display); font-size: 0.8rem; color: var(--cyan); }

.weapon-row { gap: 0.6rem; }

.weapon,
body[class] .weapon {
  border: 3px solid var(--line-strong);
  border-radius: 0;
  background: var(--bg-2);
  box-shadow: 4px 4px 0 #000;
  color: var(--ink);
}

.weapon.active,
body[class] .weapon.active {
  border-color: #000;
  background: var(--violet);
  color: #fff;
  box-shadow: 4px 4px 0 #000;
}

.weapon-name { font-family: var(--font-display); font-size: 0.5rem; line-height: 1.7; }

.weapon-points {
  border-radius: 0;
  background: #000;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.weapon.active .weapon-points { background: #000; color: var(--gold); }

.weapon-info {
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--bg-2);
  font-family: var(--font-body);
  font-size: 1.05rem;
}

.join-form input { letter-spacing: 0.15em; }
.code-big { font-family: var(--font-display); font-size: clamp(1.6rem, 7vw, 2.6rem); letter-spacing: 0.08em; }
.code-label, .code-hint { font-family: var(--font-body); font-size: 0.95rem; }

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  body { font-size: 19px; }
  .hero h1 { font-size: clamp(1.5rem, 8vw, 2.4rem); }
  .start-panel h1 { font-size: clamp(1.25rem, 6vw, 1.9rem); }
  .q-text { font-size: clamp(0.95rem, 4.5vw, 1.25rem); }
  .answer { font-size: clamp(0.85rem, 4.2vw, 1.1rem); }
  .btn { font-size: 0.58rem; }
  .btn--big { font-size: 0.64rem; }
  .brand { font-size: 0.68rem; }
}
