/* Fonts are loaded with a <link> in each page (Press Start 2P, VT323, and
   Caveat on Which Came First?). The old @import blocked CSS parsing until
   Google answered, so it is gone. */
/* ==========================================================================
   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;
  /* --font-pixel was referenced ~20 times but never defined, so every one of
     those rules was invalid at computed-value time and silently inherited.
     It resolves to the body pixel face, which is what the site has rendered
     so far — now legitimately, and with no visual change. */
  --font-pixel: var(--font-body);

  /* Type scale. Nothing that carries information goes below --fs-2xs (12px). */
  --fs-2xs: 0.75rem;    /* 12px — absolute floor for real text */
  --fs-xs: 0.8125rem;   /* 13px */
  --fs-sm: 0.9375rem;   /* 15px */
  --fs-md: 1.0625rem;   /* 17px */
  --fs-lg: 1.25rem;     /* 20px */

  /* Single set of breakpoints, mobile-first: 480 / 640 / 900 / 1200 */
  --bp-sm: 30rem;
  --bp-md: 40rem;
  --bp-lg: 56.25rem;
  --bp-xl: 75rem;

  --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-prompt {
  display: block;
  margin: 1.1rem auto 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1rem, 3.5vw, 1.35rem);
  font-weight: 700;
  color: var(--ink);
}

.subject-form { margin: 0.35rem 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(var(--wrap-max, 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; }
.difficulty-row[hidden] { display: none; }

.difficulty-prompt {
  margin: 0.65rem auto 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 2.8vw, 1.05rem);
  color: var(--amber);
  text-align: center;
  letter-spacing: 0.02em;
}
.difficulty-prompt[hidden] { display: none; }

.difficulty-row.is-awaiting {
  padding: 0.55rem 0.6rem;
  border: 2px dashed rgba(251, 191, 36, 0.7);
  border-radius: var(--radius);
  background: rgba(251, 191, 36, 0.08);
  animation: difficulty-glow 1.2s ease-in-out infinite;
}

@keyframes difficulty-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
  50% { box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.16); }
}
.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: 640px) {
  .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: 640px) {
  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: 640px) {
  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: 0; }
.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: 640px) {
  .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: 480px) {
  .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; }
}

/* ==========================================================================
   Mobile: keep a whole round on one screen
   ========================================================================== */

@media (max-width: 640px) {
  .game-shell {
    min-height: 0;
    display: block;
    padding: 0.35rem 0.6rem calc(0.6rem + env(safe-area-inset-bottom));
  }
  .screen { width: 100%; }

  /* keep the nav on one line on small phones */
  .nav-inner { padding-block: 0.55rem; gap: 0.5rem; }
  .brand { font-size: 0.95rem; gap: 0.45rem; }
  .brand img { width: 28px; height: 28px; }
  .nav-links { gap: 0.2rem; }
  .nav-links a { padding: 0.35rem 0.5rem; font-size: 0.72rem; }

  .hud { margin-bottom: 0.35rem; gap: 0.35rem; flex-wrap: nowrap; align-items: center; }
  .hud .hud-left { gap: 0.4rem; min-width: 0; }
  .hud-title { font-size: 0.62rem; line-height: 1.5; }
  .hud-progress { font-size: 0.85rem; padding: 0 0.3rem; }
  .hud-score, body[class] .hud-score { font-size: 0.95rem; line-height: 1.3; }
  .hud-score small { font-size: 0.6rem; }

  .timer { gap: 0.45rem; margin-bottom: 0.5rem; }
  .timer-value { font-size: 1rem; min-width: 2.2rem; }
  .timer-value small { font-size: 0.7rem; }
  .fuse-track { height: 14px; }
  .fuse-spark { width: 11px; height: 11px; margin-top: -5.5px; left: -4px; }
  .fuse-bomb { font-size: 1.25rem; }

  .q-card { min-height: 0; padding: 2.05rem 0.7rem 0.8rem; box-shadow: 5px 5px 0 #000; }
  .q-chip, body[class] .q-chip { top: 0.5rem; left: 0.5rem; font-size: 0.68rem; padding: 0.12rem 0.4rem; }
  .q-text,
  .theme-subject .q-text,
  .theme-outline .q-text,
  .theme-board .q-text { font-size: clamp(0.95rem, 4vw, 1.15rem); line-height: 1.35; }
  .q-card.note-card .q-text { font-size: clamp(1.1rem, 5vw, 1.4rem); }
  .note-cutoff { margin-top: 0.5rem; padding-top: 0.3rem; font-size: 0.6rem; }

  .answers,
  .theme-outline .answers,
  .theme-subject .answers,
  .theme-board .answers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.55rem; }
  .answer { padding: 0.6rem 0.45rem; font-size: clamp(0.78rem, 3.4vw, 0.98rem); line-height: 1.25; gap: 0.3rem; box-shadow: 4px 4px 0 #000; }
  .theme-outline .answer, .theme-subject .answer, .theme-board .answer {
    min-height: 0; padding: 0.55rem 0.4rem; font-size: clamp(0.74rem, 3.2vw, 0.92rem);
  }
  .answer .key { font-size: 0.7rem; padding: 0 0.3rem; }
  .answer .mark { font-size: 0.95rem; }

  .clue-list { gap: 0.35rem; margin-top: 0.35rem; }
  .clue-list li, .clue-list li.clue { padding: 0.45rem 0.55rem; font-size: 0.83rem; box-shadow: 2px 2px 0 #000; }
  .clue-worth { margin: 0.5rem 0 0.3rem; font-size: 0.6rem; }
  .guess-row { margin-top: 0.5rem; gap: 0.4rem; }
  .guess-input { padding: 0.6rem 0.7rem; font-size: 1rem; }

  .dots { margin-top: 0.5rem; gap: 0.3rem; }
  .dot { width: 9px; height: 9px; }

  .feedback { padding: 0.9rem 0.7rem; }
  .feedback-badge { font-size: clamp(0.9rem, 4vw, 1.15rem); }
  .feedback-fact { font-size: 0.9rem; }
  .feedback-source { font-size: 0.72rem; margin-bottom: 0.5rem; }
  .feedback-points { font-size: 1.1rem; margin-bottom: 0.55rem; }
  .feedback-answer { font-size: 0.95rem; }
  .feedback-next .fb-label { font-size: 0.6rem; }

  /* Name That Tune: one compact row instead of a stack */
  .tune-panel { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin: 0 0 0.45rem; }
  .tune-wave { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; }
  .tune-wave span { width: 4px; height: 30%; background: var(--amber, #fbbf24); }
  .tune-wave span:nth-child(2) { height: 65%; }
  .tune-wave span:nth-child(3) { height: 100%; }
  .tune-wave span:nth-child(4) { height: 55%; }
  .tune-wave span:nth-child(5) { height: 40%; }
  .tune-wave.is-playing span { animation: tune-bounce 0.55s steps(4) infinite alternate; }
  .tune-wave.is-playing span:nth-child(2) { animation-delay: 0.08s; }
  .tune-wave.is-playing span:nth-child(3) { animation-delay: 0.16s; }
  .tune-wave.is-playing span:nth-child(4) { animation-delay: 0.24s; }
  .tune-wave.is-playing span:nth-child(5) { animation-delay: 0.32s; }
  .tune-status { font-size: 0.9rem; font-weight: 700; }
  .tune-sub { font-size: 0.62rem; color: var(--faint); letter-spacing: 0.08em; text-transform: uppercase; }
  .tune-replay { padding: 0.35rem 0.55rem; font-size: 0.82rem; }
  .play-loud { display: inline-block; margin: 0.1rem 0 0.5rem; font-size: 0.7rem; letter-spacing: 0.16em; color: var(--amber, #fbbf24); }

  /* start screens: less dead space */
  .panel { padding: 1rem; }
  .start-panel .game-icon { width: 64px; height: 64px; font-size: 1.9rem; margin-bottom: 0.8rem; }
  .rules { gap: 0.5rem; margin-bottom: 1rem; }
  .rule { padding: 0.6rem 0.7rem; font-size: 0.8rem; }
}

@media (max-width: 640px) and (max-height: 730px) {
  .dots { display: none; }
  .hud-title { display: none; }
  .hud { margin-bottom: 0.25rem; }
  .q-card { padding: 1.6rem 0.55rem 0.6rem; }
  .answers { gap: 0.4rem; margin-top: 0.45rem; }
  .answer { line-height: 1.2; }
  .q-text { line-height: 1.3; }
  .q-text,
  .theme-subject .q-text,
  .theme-outline .q-text,
  .theme-board .q-text { font-size: clamp(0.86rem, 3.6vw, 1rem); }
  .answer { padding: 0.5rem 0.4rem; }
  .timer { margin-bottom: 0.35rem; }
}

@media (max-width: 360px) {
  .answers,
  .theme-outline .answers,
  .theme-subject .answers,
  .theme-board .answers { grid-template-columns: 1fr; }
}

@keyframes tune-bounce {
  from { transform: scaleY(0.35); }
  to { transform: scaleY(1); }
}

@media (max-width: 480px) {
  .nav-inner > span:not(.version-badge) { display: none; }
  .nav-inner > .version-badge { display: none; }
}

@media (max-width: 640px) and (max-height: 700px) {
  /* very short phones: the HUD already names the game, so drop the card chip */
  .q-chip { display: none; }
  .q-card { padding-top: 0.8rem; }
}

/* ==========================================================================
   Name the Game — screenshot frame
   ========================================================================== */

.shot-frame {
  position: relative;
  display: grid;
  place-items: center;
  max-width: 560px;
  margin: 0.2rem auto 0.8rem;
  padding: 6px;
  background: #000;
  border: 3px solid var(--line-strong);
  box-shadow: 6px 6px 0 #000;
  line-height: 0;
  overflow: hidden;
}

.shot-img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 52vh;
  object-fit: contain;
  image-rendering: pixelated;
}

@media (max-width: 640px) {
  .shot-frame { margin: 0.1rem auto 0.5rem; padding: 4px; }
  .shot-img { max-height: 34vh; }
}

@media (max-width: 640px) and (max-height: 730px) {
  .shot-img { max-height: 29vh; }
}
/* ==========================================================================
   Arcade initials & the top 20
   ========================================================================== */

/* names are entered as initials on the results screen */
#scoreForm { display: none !important; }

.results-board .board,
.start-board .board {
  max-height: min(46vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

#hubBoard {
  max-height: 64vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.board-row.is-you {
  background: var(--gold);
  color: #0b0b0b;
  box-shadow: inset 0 0 0 3px #0b0b0b;
  animation: hs-row-pop 0.7s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.board-row.is-you .rank,
.board-row.is-you .name,
.board-row.is-you .score { color: #0b0b0b; }

.board-row.is-you .name::after { content: ' \2605'; }

@keyframes hs-row-pop {
  0% { transform: scale(0.82); opacity: 0; }
  55% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

html.hs-open { overflow: hidden; }

/* the initials screen — deliberately a black arcade cabinet display */
.hs-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: clamp(0.5rem, 2vw, 1.5rem);
  background: #04060f;
  overflow: auto;
}

.hs-panel {
  width: min(780px, 100%);
  padding: clamp(0.6rem, 2vw, 1.4rem);
  font-family: var(--font-pixel);
  text-transform: uppercase;
  text-align: center;
}

.hs-topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: clamp(0.46rem, 1.7vw, 0.7rem);
  color: #59e6ff;
  letter-spacing: 0.04em;
  margin-bottom: clamp(0.8rem, 3vw, 1.5rem);
}

.hs-topline b { color: #fff; font-weight: 400; }

.hs-player {
  font-size: clamp(0.46rem, 1.8vw, 0.66rem);
  color: #59e6ff;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.hs-title {
  font-size: clamp(0.66rem, 2.8vw, 1.05rem);
  color: #59e6ff;
  margin-bottom: clamp(0.7rem, 2.6vw, 1.2rem);
}

.hs-entry {
  display: flex;
  justify-content: center;
  gap: clamp(0.6rem, 2.4vw, 1.2rem);
  margin: 0 0 clamp(0.8rem, 3vw, 1.4rem);
}

.hs-char {
  position: relative;
  min-width: clamp(1.5rem, 6vw, 2.4rem);
  font-size: clamp(1.5rem, 6.5vw, 2.6rem);
  line-height: 1.2;
  color: #00e24a;
}

.hs-char.is-empty { color: transparent; }

.hs-char.is-active::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -0.45em;
  transform: translateX(-50%);
  width: 0.6em;
  height: 0.35em;
  background: #ff2b2b;
  animation: hs-blink 0.6s steps(2) infinite;
}

@keyframes hs-blink { 50% { opacity: 0; } }

.hs-keys {
  display: grid;
  gap: clamp(0.35rem, 1.5vw, 0.75rem);
  margin-bottom: clamp(0.9rem, 3vw, 1.4rem);
}

.hs-keyrow {
  display: flex;
  justify-content: center;
  gap: clamp(0.55rem, 2.4vw, 1.2rem);
}

.hs-key {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: clamp(0.52rem, 2.1vw, 0.9rem);
  line-height: 1.5;
  color: #00e24a;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.hs-key:hover,
.hs-key:focus-visible {
  color: #fff;
  outline: none;
  text-shadow: 0 0 10px rgba(0, 226, 74, 0.9);
}

.hs-key--end { color: #ffe600; }
.hs-key[disabled] { opacity: 0.3; cursor: default; }

.hs-table {
  margin: 0 auto clamp(0.8rem, 2.6vw, 1.2rem);
  max-width: 430px;
  font-size: clamp(0.48rem, 1.8vw, 0.68rem);
}

.hs-row {
  display: grid;
  grid-template-columns: 5ch 1fr auto;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.16rem 0;
  color: #fff;
}

.hs-pos { text-align: left; color: #dfe6ff; }
.hs-name { text-align: center; letter-spacing: 0.08em; }
.hs-score { text-align: right; font-variant-numeric: tabular-nums; }
.hs-pts { color: #8fa0c8; }

.hs-row.is-you,
.hs-row.is-you .hs-pos,
.hs-row.is-you .hs-pts { color: #ff5ad9; }

.hs-hint {
  font-size: clamp(0.4rem, 1.6vw, 0.55rem);
  line-height: 2.1;
  color: #ffe600;
}

.hs-skip {
  margin-top: 0.7rem;
  font-family: inherit;
  font-size: 0.4rem;
  letter-spacing: 0.1em;
  color: #6b7aa8;
  background: none;
  border: 0;
  cursor: pointer;
}

.hs-skip:hover { color: #fff; }
/* ==========================================================================
   INTRO — synthwave arcade entrance
   ========================================================================== */

html.intro-off .intro { display: none; }
html.intro-open { overflow: hidden; }

.intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow: hidden;
  background: #050011;
  cursor: pointer;
  isolation: isolate;
}

.intro.is-out {
  animation: intro-off 0.5s cubic-bezier(0.6, 0, 0.3, 1) forwards;
}

@keyframes intro-off {
  0% { transform: scaleY(1) scaleX(1); filter: brightness(1); opacity: 1; }
  45% { transform: scaleY(0.02) scaleX(1.3); filter: brightness(3); opacity: 1; }
  75% { transform: scaleY(0.02) scaleX(0.02); filter: brightness(8); opacity: 1; }
  100% { transform: scaleY(0.02) scaleX(0.02); filter: brightness(8); opacity: 0; }
}

/* ------------------------------- backdrop ------------------------------- */

.syn { position: absolute; inset: -4%; }

.syn__sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 55%, rgba(255, 45, 154, 0.35), transparent 65%),
    linear-gradient(180deg, #04000d 0%, #0d0126 32%, #2a0746 52%, #12002a 66%, #04000c 100%);
}

.syn__stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.6px 1.6px at 18% 14%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 72% 9%, rgba(255, 255, 255, 0.9) 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 41% 24%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 88% 28%, rgba(255, 255, 255, 0.85) 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 8% 38%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 59% 34%, rgba(255, 255, 255, 0.8) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 31% 45%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 93% 44%, rgba(255, 255, 255, 0.7) 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 66% 47%, rgba(255, 255, 255, 0.9) 50%, transparent 51%);
  animation: syn-twinkle 2.6s steps(3) infinite;
}

@keyframes syn-twinkle { 0%, 100% { opacity: 0.95; } 50% { opacity: 0.55; } }

.syn__sun {
  position: absolute;
  left: 50%;
  top: 60%;
  width: min(40vw, 330px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: linear-gradient(180deg, #fff3a0 0%, #ffcf4d 22%, #ff8a3c 44%, #ff2d7d 68%, #9c0d63 100%);
  filter: drop-shadow(0 0 26px rgba(255, 45, 125, 0.75)) drop-shadow(0 0 90px rgba(255, 45, 125, 0.35));
  -webkit-mask-image: repeating-linear-gradient(180deg, #000 0 12px, transparent 12px 15px);
  mask-image: repeating-linear-gradient(180deg, #000 0 12px, transparent 12px 15px);
  opacity: 0.8;
  animation: syn-sun-glow 6s ease-in-out infinite alternate;
}

@keyframes syn-sun-glow {
  from { filter: drop-shadow(0 0 22px rgba(255, 45, 125, 0.65)) drop-shadow(0 0 70px rgba(255, 45, 125, 0.3)); }
  to { filter: drop-shadow(0 0 34px rgba(255, 45, 125, 0.9)) drop-shadow(0 0 120px rgba(255, 45, 125, 0.45)); }
}

.syn__horizon {
  position: absolute;
  left: 0;
  right: 0;
  top: 54%;
  height: 3px;
  background: #9ffcff;
  box-shadow:
    0 0 12px 2px rgba(0, 240, 255, 0.9),
    0 0 48px 12px rgba(255, 45, 154, 0.55),
    0 0 120px 30px rgba(255, 45, 154, 0.25);
}

.syn__plane {
  position: absolute;
  left: -60%;
  width: 220%;
  height: 58%;
  background-image:
    linear-gradient(rgba(255, 45, 154, 0.55) 2px, transparent 2px),
    linear-gradient(90deg, rgba(0, 236, 255, 0.42) 2px, transparent 2px);
  background-size: 84px 84px;
  will-change: background-position;
}

.syn__plane--floor {
  top: 54%;
  transform: perspective(340px) rotateX(66deg);
  transform-origin: top center;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.65) 45%, transparent 92%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.65) 45%, transparent 92%);
  animation: syn-run 1.5s linear infinite;
}

.syn__plane--ceiling {
  bottom: 46%;
  transform: perspective(340px) rotateX(-66deg);
  transform-origin: bottom center;
  -webkit-mask-image: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.5) 40%, transparent 85%);
  mask-image: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.5) 40%, transparent 85%);
  animation: syn-run-up 1.5s linear infinite;
}

@keyframes syn-run { from { background-position: 0 0; } to { background-position: 0 84px; } }
@keyframes syn-run-up { from { background-position: 0 0; } to { background-position: 0 -84px; } }

.syn__scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
  opacity: 0.75;
  pointer-events: none;
}

.syn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 45%, transparent 35%, rgba(0, 0, 0, 0.75) 100%);
  pointer-events: none;
}

/* -------------------------------- content ------------------------------- */

.intro-inner {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1.5rem;
  text-align: center;
  transition: opacity 0.35s linear, transform 0.35s var(--ease);
}

.intro-inner::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 145%;
  height: 125%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(4, 0, 13, 0.88) 0%, rgba(4, 0, 13, 0.55) 38%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.intro-inner.is-gone {
  opacity: 0;
  transform: scale(1.08);
}

.syn-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.7rem, 2.4vw, 1.4rem);
  margin-bottom: 0.4rem;
}

.syn-kicker {
  margin: 0 0 0.9rem;
  font-family: var(--font-pixel);
  font-size: clamp(0.45rem, 1.8vw, 0.62rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #7ff9ff;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.9);
  animation: syn-blink 1.1s steps(2) infinite;
}

@keyframes syn-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.25; } }

.syn-logo {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: clamp(1.45rem, 6.2vw, 2.9rem);
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-transform: uppercase;
  text-shadow:
    0 0 6px #aefcff,
    0 0 18px #00f0ff,
    0 0 42px #ff2d9a,
    0 0 80px rgba(255, 45, 154, 0.6),
    5px 5px 0 rgba(0, 0, 0, 0.55);
  animation: syn-flicker 7s steps(24) infinite;
}

.syn-logo em {
  font-style: normal;
  color: #ff2d9a;
  text-shadow:
    0 0 6px #ff8ac4,
    0 0 20px #ff2d9a,
    0 0 48px #ff2d9a,
    0 0 90px rgba(255, 45, 154, 0.7),
    5px 5px 0 rgba(0, 0, 0, 0.55);
}

@keyframes syn-flicker {
  0%, 76%, 100% { opacity: 1; }
  77% { opacity: 0.45; }
  78% { opacity: 1; }
  92% { opacity: 0.72; }
  93% { opacity: 1; }
}

.syn-face {
  width: clamp(64px, 11vw, 100px);
  aspect-ratio: 1;
  margin: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #08001a;
  border: 3px solid rgba(0, 236, 255, 0.85);
  box-shadow:
    0 0 18px rgba(0, 236, 255, 0.7),
    0 0 50px rgba(255, 45, 154, 0.45),
    inset 0 0 22px rgba(255, 45, 154, 0.35);
}

.syn-face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
  image-rendering: pixelated;
}

.syn-tag {
  margin: 0.2rem 0 1.3rem;
  font-family: var(--font-pixel);
  font-size: clamp(0.4rem, 1.6vw, 0.55rem);
  line-height: 2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffd6f4;
  text-shadow: 0 0 8px rgba(255, 45, 154, 0.8);
}

.syn-start {
  appearance: none;
  font-family: var(--font-pixel);
  font-size: clamp(0.6rem, 2.2vw, 0.85rem);
  line-height: 1.6;
  text-transform: uppercase;
  color: #b8fdff;
  background: rgba(0, 20, 30, 0.35);
  border: 3px solid #19f2ff;
  padding: 0.95rem 1.7rem;
  box-shadow:
    0 0 16px rgba(0, 240, 255, 0.6),
    inset 0 0 18px rgba(0, 240, 255, 0.22);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.9);
  cursor: pointer;
  animation: syn-pulse 1.4s steps(2) infinite;
}

@keyframes syn-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.62; }
}

.syn-start:hover,
.syn-start:focus-visible {
  color: #ffffff;
  border-color: #ff2d9a;
  box-shadow: 0 0 22px rgba(255, 45, 154, 0.8), inset 0 0 22px rgba(255, 45, 154, 0.35);
  outline: none;
}

.syn-hint {
  margin: 1rem 0 0;
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 214, 244, 0.5);
}

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

.syn-count {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  place-items: center;
  font-family: var(--font-pixel);
  font-size: clamp(4.5rem, 22vw, 11rem);
  line-height: 1;
  color: #ffffff;
  -webkit-text-stroke: clamp(4px, 1.1vw, 8px) rgba(8, 0, 18, 0.92);
  paint-order: stroke fill;
  text-shadow:
    8px 8px 0 rgba(255, 45, 154, 0.6),
    14px 14px 0 rgba(0, 0, 0, 0.4),
    0 0 26px #00f0ff,
    0 0 70px #ff2d9a;
  pointer-events: none;
}

.syn-count.is-on { display: grid; }

.syn-count.tick { animation: syn-count-pop 0.72s cubic-bezier(0.2, 1.4, 0.4, 1) both; }

@keyframes syn-count-pop {
  0% { transform: scale(2.2); opacity: 0; filter: blur(6px); }
  35% { transform: scale(1); opacity: 1; filter: blur(0); }
  100% { transform: scale(1); opacity: 1; filter: blur(0); }
}

.syn-count.is-go {
  color: #ffe94d;
  text-shadow:
    8px 8px 0 rgba(255, 45, 154, 0.7),
    14px 14px 0 rgba(0, 0, 0, 0.4),
    0 0 26px #fff6b0,
    0 0 70px #ffd400,
    0 0 120px #ff2d9a;
}



/* ==========================================================================
   Front screen: bigger marquee + arcade emblem
   ========================================================================== */

.syn-head { gap: clamp(1rem, 3vw, 1.8rem); }

.syn-face {
  width: clamp(120px, 21vw, 190px);
  aspect-ratio: 1;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
  filter:
    drop-shadow(0 0 16px rgba(0, 240, 255, 0.55))
    drop-shadow(0 0 46px rgba(255, 45, 154, 0.45));
}

.syn-face img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
}

.syn-kicker { font-size: clamp(0.6rem, 2.2vw, 0.85rem); }

.syn-logo { font-size: clamp(1.9rem, 8.2vw, 4rem); }

.syn-tag {
  font-size: clamp(0.5rem, 1.9vw, 0.7rem);
  margin-top: 0.5rem;
}

.syn-start {
  font-size: clamp(0.72rem, 2.7vw, 1rem);
  padding: 1.15rem 2.1rem;
}

.syn-hint { font-size: 0.46rem; }

/* ==========================================================================
   Initials: much bigger characters
   ========================================================================== */

.hs-entry { gap: clamp(1rem, 4vw, 2.2rem); margin-bottom: clamp(1rem, 4vw, 1.8rem); }

.hs-char {
  min-width: clamp(2.4rem, 10vw, 4.4rem);
  font-size: clamp(3rem, 12vw, 5.6rem);
  line-height: 1.05;
}

.hs-char.is-active::before {
  width: 0.5em;
  height: 0.26em;
  top: -0.3em;
}

.hs-keys { gap: clamp(0.45rem, 1.8vw, 0.9rem); }
.hs-keyrow { gap: clamp(0.5rem, 2vw, 1rem); }
.hs-key { font-size: clamp(0.66rem, 2.6vw, 1.05rem); }
.hs-table { font-size: clamp(0.5rem, 1.9vw, 0.72rem); }

/* ==========================================================================
   Game countdown — the synthwave 3-2-1-GO, on every start
   ========================================================================== */

.countdown {
  padding-bottom: clamp(2rem, 13vh, 10rem);
  background:
    radial-gradient(120% 80% at 50% 55%, rgba(255, 45, 154, 0.35), transparent 65%),
    linear-gradient(180deg, #04000d 0%, #0d0126 32%, #2a0746 52%, #12002a 66%, #04000c 100%);
  overflow: hidden;
}

.countdown::before {
  content: '';
  position: absolute;
  left: -60%;
  right: -60%;
  top: 54%;
  height: 62%;
  background-image:
    linear-gradient(rgba(255, 45, 154, 0.5) 2px, transparent 2px),
    linear-gradient(90deg, rgba(0, 236, 255, 0.38) 2px, transparent 2px);
  background-size: 84px 84px;
  transform: perspective(340px) rotateX(66deg);
  transform-origin: top center;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.6) 45%, transparent 92%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.6) 45%, transparent 92%);
  animation: syn-run 1.5s linear infinite;
  pointer-events: none;
}

.countdown::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 54%;
  height: 3px;
  background: #9ffcff;
  box-shadow:
    0 0 12px 2px rgba(0, 240, 255, 0.9),
    0 0 48px 12px rgba(255, 45, 154, 0.55),
    0 0 120px 30px rgba(255, 45, 154, 0.25);
  pointer-events: none;
}

.countdown span,
.countdown span.go {
  position: relative;
  z-index: 2;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: clamp(5rem, 24vw, 11rem);
  line-height: 1;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: #ffffff;
  -webkit-text-fill-color: currentColor;
  -webkit-text-stroke: clamp(4px, 1.1vw, 9px) rgba(8, 0, 18, 0.92);
  paint-order: stroke fill;
  text-shadow:
    9px 9px 0 rgba(255, 45, 154, 0.6),
    16px 16px 0 rgba(0, 0, 0, 0.4),
    0 0 26px #00f0ff,
    0 0 70px #ff2d9a;
  animation: syn-count-loop 0.75s cubic-bezier(0.2, 1.4, 0.4, 1) infinite both;
}

.countdown span.go {
  color: #ffe94d;
  text-shadow:
    9px 9px 0 rgba(255, 45, 154, 0.7),
    16px 16px 0 rgba(0, 0, 0, 0.4),
    0 0 26px #fff6b0,
    0 0 70px #ffd400,
    0 0 130px #ff2d9a;
}

@keyframes syn-count-loop {
  0% { transform: scale(1.14); opacity: 0.8; }
  18% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* front screen: sun sits low behind the grid, text gets more air */
.syn__sun { top: 68%; opacity: 0.55; width: min(44vw, 360px); }
.syn-kicker { font-size: clamp(0.66rem, 2.4vw, 1rem); }
.syn-tag { font-size: clamp(0.56rem, 2.1vw, 0.82rem); }
.syn-hint { font-size: 0.52rem; }

/* front screen: no sun disc — the horizon glow carries it */
.syn__sun { display: none; }
.syn-logo { font-size: clamp(2.1rem, 9.2vw, 4.8rem); }
.syn-face { width: clamp(140px, 24vw, 220px); }
.syn-start { font-size: clamp(0.78rem, 3vw, 1.1rem); padding: 1.25rem 2.4rem; }

/* ==========================================================================
   HUB — arcade hall
   ========================================================================== */

.hall {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: #05040f;
}

.hall__aurora {
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(38% 32% at 24% 28%, rgba(124, 58, 237, 0.55), transparent 70%),
    radial-gradient(32% 28% at 80% 20%, rgba(0, 210, 255, 0.32), transparent 70%),
    radial-gradient(44% 38% at 62% 82%, rgba(255, 45, 154, 0.28), transparent 70%);
  filter: blur(55px);
  animation: hall-drift 26s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes hall-drift {
  0% { transform: translate3d(-2%, -1%, 0) scale(1); }
  50% { transform: translate3d(2%, 2%, 0) scale(1.08); }
  100% { transform: translate3d(4%, -2%, 0) scale(1.03); }
}

.hall__beam {
  position: absolute;
  top: -35%;
  left: -15%;
  width: 44vw;
  height: 170vh;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.1), transparent);
  filter: blur(10px);
  transform: rotate(15deg);
  animation: hall-beam 24s ease-in-out infinite alternate;
  will-change: transform;
}

.hall__beam--b {
  left: 55%;
  background: linear-gradient(90deg, transparent, rgba(255, 45, 154, 0.1), transparent);
  transform: rotate(-13deg);
  animation-duration: 31s;
  animation-direction: alternate-reverse;
}

@keyframes hall-beam {
  from { transform: translate3d(-18%, 0, 0) rotate(15deg); }
  to { transform: translate3d(18%, 0, 0) rotate(9deg); }
}

.hall__grid {
  position: absolute;
  inset: -25%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.45;
  -webkit-mask-image: radial-gradient(ellipse at 50% 38%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse at 50% 38%, #000 25%, transparent 78%);
  animation: hall-grid 70s linear infinite;
}

@keyframes hall-grid {
  from { background-position: 0 0; }
  to { background-position: 300px 300px; }
}

.hall__dust {
  position: absolute;
  inset: -10%;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 72%, rgba(0, 240, 255, 0.9) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 28% 34%, rgba(255, 214, 244, 0.75) 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 44% 84%, rgba(255, 45, 154, 0.8) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 61% 22%, rgba(0, 240, 255, 0.6) 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 74% 66%, rgba(255, 255, 255, 0.55) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 88% 38%, rgba(255, 45, 154, 0.6) 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 6% 18%, rgba(255, 255, 255, 0.5) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 52% 12%, rgba(0, 240, 255, 0.5) 50%, transparent 51%);
  opacity: 0.5;
  animation: hall-dust 44s linear infinite;
}

@keyframes hall-dust {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-40px, -180px, 0); }
}

.hall__scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0 1px, transparent 1px 3px);
  opacity: 0.7;
}

.hall::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 35%, transparent 30%, rgba(0, 0, 0, 0.7) 100%);
  pointer-events: none;
}

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

.nav {
  background: rgba(5, 4, 15, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 240, 255, 0.18);
}

.nav-links a {
  color: #b9b6e6;
  border: 1px solid transparent;
  border-radius: 8px;
}

.nav-links a:hover {
  color: #eafdff;
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.35);
}

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

.hero {
  text-align: center;
  padding: clamp(3rem, 9vh, 6.5rem) 0 clamp(2rem, 5vh, 3.5rem);
}

.hero-kicker {
  display: inline-block;
  margin: 0 0 1.1rem;
  padding: 0.45rem 0.9rem;
  font-family: var(--font-pixel);
  font-size: clamp(0.44rem, 1.5vw, 0.62rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8ffcff;
  border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.07);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.18);
}

.hero h1 {
  margin: 0 0 1rem;
  font-family: var(--font-pixel);
  font-size: clamp(2.1rem, 7.4vw, 4.6rem);
  line-height: 1.25;
  color: #ffffff;
  text-shadow:
    0 0 6px #aefcff,
    0 0 22px #00f0ff,
    0 0 60px rgba(255, 45, 154, 0.55);
}

.hero h1 .grad {
  color: #ff2d9a;
  background: none;
  -webkit-text-fill-color: currentColor;
  text-shadow:
    0 0 6px #ff8ac4,
    0 0 22px #ff2d9a,
    0 0 60px rgba(255, 45, 154, 0.65);
}

.hero-copy {
  max-width: 620px;
  margin: 0 auto;
  color: #b9b6e6;
  font-size: clamp(1rem, 1.9vw, 1.12rem);
  line-height: 1.6;
}

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

.btn--neon {
  background: rgba(0, 240, 255, 0.12);
  border: 2px solid #19f2ff;
  color: #b8fdff;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4), inset 0 0 16px rgba(0, 240, 255, 0.12);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
}

.btn--neon:hover {
  background: rgba(0, 240, 255, 0.2);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.6), inset 0 0 20px rgba(0, 240, 255, 0.2);
}

.btn--ghost {
  background: transparent;
  border: 2px solid rgba(255, 214, 244, 0.35);
  color: #ffd6f4;
  box-shadow: none;
}

.btn--ghost:hover {
  border-color: rgba(255, 45, 154, 0.7);
  background: rgba(255, 45, 154, 0.08);
}

/* ------------------------------- marquee -------------------------------- */

.hall-marquee {
  overflow: hidden;
  border-block: 1px solid rgba(0, 240, 255, 0.22);
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.06), rgba(255, 45, 154, 0.06));
}

.hall-marquee__track {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  width: max-content;
  padding-block: 0.7rem;
  animation: hall-marquee 36s linear infinite;
}

.hall-marquee span {
  font-family: var(--font-pixel);
  font-size: clamp(0.44rem, 1.4vw, 0.58rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8ffcff;
  white-space: nowrap;
}

.hall-marquee b {
  color: #ff2d9a;
  font-size: 0.7rem;
  line-height: 1;
}

@keyframes hall-marquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

/* ------------------------------- sections ------------------------------- */

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }

.section-head { margin-bottom: 1.6rem; align-items: end; }

.section-head h2 {
  font-family: var(--font-pixel);
  font-size: clamp(1rem, 2.6vw, 1.5rem);
  line-height: 1.5;
  color: #ffffff;
  text-shadow: 0 0 16px rgba(0, 240, 255, 0.45);
}

.section-head p { color: #8f8bbf; font-size: 0.95rem; }

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

.grid { gap: 1.3rem; }

.card {
  --accent: #8b5cf6;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.6rem 1.5rem 1.45rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(22, 22, 48, 0.92), rgba(9, 9, 24, 0.92));
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.25s;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(65% 55% at 18% 0%, var(--accent), transparent 72%);
  opacity: 0.16;
  transition: opacity 0.3s;
  pointer-events: none;
}

.card::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 26px 60px -26px color-mix(in srgb, var(--accent) 65%, transparent);
  outline: none;
}

.card:hover::before { opacity: 0.26; }

.card--violet { --accent: #8b5cf6; }
.card--amber { --accent: #fbbf24; }
.card--blue { --accent: #22d3ee; }
.card--paper { --accent: #e9e6ff; }
.card--jungle { --accent: #34d399; }
.card--spark { --accent: #ff2d9a; }
.card--soon { opacity: 0.55; }

.card-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  font-size: 1.7rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: inset 0 0 22px color-mix(in srgb, var(--accent) 18%, transparent);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-pixel);
  font-size: clamp(0.62rem, 1.6vw, 0.78rem);
  line-height: 1.7;
  color: #ffffff;
  text-transform: uppercase;
}

.card p { margin: 0 0 1rem; color: #a9a6d0; font-size: 0.94rem; flex: 1; }

.card-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.1rem; }

.chip {
  padding: 0.3rem 0.55rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c9f7ff;
  background: rgba(0, 240, 255, 0.07);
  border: 1px solid rgba(0, 240, 255, 0.22);
  border-radius: 999px;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-pixel);
  font-size: 0.56rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.card-cta::after { content: '\25B8'; font-size: 0.9em; }

.card:hover .card-cta { text-shadow: 0 0 12px var(--accent); }

/* ------------------------------- top 20 --------------------------------- */

.board {
  background: rgba(10, 9, 26, 0.72);
  border: 1px solid rgba(0, 240, 255, 0.16);
  border-radius: 14px;
  backdrop-filter: blur(8px);
}

.board-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.board-row:nth-child(odd) { background: rgba(255, 255, 255, 0.02); }
.board-row:hover { background: rgba(0, 240, 255, 0.06); }

.board-row .rank {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: #6f6b9c;
}

.board-row:nth-child(1) .rank { color: #ffd400; }
.board-row:nth-child(2) .rank { color: #d7d9f5; }
.board-row:nth-child(3) .rank { color: #ff9a3c; }

.board-row .name { color: #e9e6ff; }
.board-row .score { color: #19f2ff; font-family: var(--font-pixel); font-size: 0.62rem; }

/* -------------------------------- footer -------------------------------- */

.footer {
  margin-top: 2.5rem;
  padding: 2rem 0 2.4rem;
  border-top: 1px solid rgba(0, 240, 255, 0.14);
  background: rgba(5, 4, 15, 0.7);
  color: #8f8bbf;
}

.footer a { color: #8ffcff; }

/* ------------------------------ responsive ------------------------------ */

@media (max-width: 640px) {
  .hero { padding-top: 2.4rem; }
  .section-head { align-items: flex-start; }
  .hero-actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .hall__aurora,
  .hall__beam,
  .hall__grid,
  .hall__dust,
  .hall-marquee__track { animation: none !important; }
}

/* ==========================================================================
   Countdown: huge numeral + arcade message of the day
   ========================================================================== */

.countdown {
  align-content: center;
  justify-items: center;
  padding: 1rem 1rem clamp(1rem, 6vh, 3rem);
}

#countNum {
  display: block;
  font-size: clamp(7rem, 40vw, 17rem);
  line-height: 1;
}

.countdown__msg {
  position: absolute;
  left: 50%;
  bottom: clamp(1rem, 4vh, 2.5rem);
  transform: translateX(-50%);
  z-index: 2;
  width: min(36ch, 92vw);
  padding: 0.75rem 1rem;
  text-align: center;
  background: rgba(4, 0, 13, 0.66);
  border: 1px solid rgba(0, 240, 255, 0.18);
  border-radius: 12px;
  backdrop-filter: blur(6px);
}

.countdown__msg b {
  display: block;
  margin-bottom: 0.7em;
  font-family: var(--font-pixel);
  font-size: clamp(0.46rem, 1.8vw, 0.6rem);
  line-height: 1.8;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8ffcff;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}

/* beat the base .countdown span styles for the quote */
.countdown .countdown__msg span {
  display: block;
  font-family: var(--font-pixel);
  font-size: clamp(0.56rem, 2.4vw, 0.78rem);
  line-height: 2.1;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: #ffd6f4;
  -webkit-text-fill-color: currentColor;
  -webkit-text-stroke: 0;
  text-shadow: 0 0 16px rgba(255, 45, 154, 0.5);
  animation: none;
}

.countdown .countdown__msg i {
  display: block;
  margin-top: 0.9em;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: #8f8bbf;
}

/* ==========================================================================
   CRT overlay
   --------------------------------------------------------------------------
   The heavy version ran at z-index 9998 — on top of all content — with 30%
   black scanlines, an RGB subpixel mask and a 50% vignette on multiply. It
   measured ~3.2:1 effective contrast for --faint text and made 1px-stroke
   pixel fonts fuzzy. The scanlines behind the content (.bg-decor::before)
   already carry the look, so this layer is now a light, opt-in overlay.
   ========================================================================== */

.crt-fx {
  position: fixed;
  inset: 0;
  z-index: -1;             /* behind content, above the backdrop */
  display: none;
  pointer-events: none;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.35);
}

/* Off by default. Add .crt to <html> to turn it back on. */
html.crt .crt-fx { display: block; }

.crt-fx::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.07) 0 1px,
    transparent 1px 4px
  );
}

/* The RGB mask and vignette are gone: they multiplied over text. */
.crt-fx::after { content: none; }


/* ==========================================================================
   Mobile-first reading sizes on the hub
   ========================================================================== */

@media (max-width: 640px) {
  body { font-size: 17px; }

  .hero { padding-top: 2.2rem; }
  .hero-kicker { font-size: 0.6rem; padding: 0.55rem 0.9rem; }
  .hero h1 { font-size: clamp(2rem, 9vw, 2.6rem); }
  .hero-copy { font-size: 1.05rem; line-height: 1.65; }

  .hero-actions .btn { font-size: 0.78rem; padding: 0.95rem 1.2rem; }

  .section-head h2 { font-size: 1.05rem; }
  .section-head p { font-size: 0.95rem; }

  .card { padding: 1.4rem 1.2rem 1.3rem; }
  .card h3 { font-size: 0.8rem; line-height: 1.8; }
  .card p { font-size: 1rem; line-height: 1.55; }
  .chip { font-size: 0.68rem; padding: 0.35rem 0.6rem; }
  .card-cta { font-size: 0.64rem; }

  .board-row { padding: 0.85rem 0.9rem; }
  .board-row .name { font-size: 1rem; }
  .board-row .score { font-size: 0.78rem; }
  .board-row .rank { font-size: 0.78rem; }

  .nav-links a { font-size: 0.82rem; }

  .hall-marquee span { font-size: 0.52rem; }
}

/* ==========================================================================
   Countdown v2 — cross-browser (iPhone / Android / desktop)
   No paint-order or text-stroke: outline is drawn with shadows so Safari
   renders the numeral exactly like Chrome.
   ========================================================================== */

.countdown {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.8rem, 3.5vh, 1.6rem);
  padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(1rem + env(safe-area-inset-bottom));
  overflow: hidden;
}

.countdown.active { display: flex; }

#countNum {
  position: relative;
  z-index: 2;
  display: block;
  margin: 0;
  font-family: var(--font-pixel);
  font-weight: 400;
  font-size: clamp(7rem, 44vw, 16rem);
  line-height: 1;
  color: #ffffff;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: currentColor;
  -webkit-text-stroke: 0;
  animation: cd-pop 0.75s cubic-bezier(0.2, 1.4, 0.4, 1) infinite both;
  text-shadow:
    -3px -3px 0 #080012, 3px -3px 0 #080012, -3px 3px 0 #080012, 3px 3px 0 #080012,
    -4px 0 0 #080012, 4px 0 0 #080012, 0 -4px 0 #080012, 0 4px 0 #080012,
    8px 8px 0 rgba(255, 45, 154, 0.62),
    0 0 28px #00f0ff,
    0 0 72px rgba(255, 45, 154, 0.8);
}

#countNum.go {
  color: #ffe94d;
  text-shadow:
    -3px -3px 0 #080012, 3px -3px 0 #080012, -3px 3px 0 #080012, 3px 3px 0 #080012,
    -4px 0 0 #080012, 4px 0 0 #080012, 0 -4px 0 #080012, 0 4px 0 #080012,
    8px 8px 0 rgba(255, 45, 154, 0.7),
    0 0 28px #fff6b0,
    0 0 72px #ffd400;
}

@keyframes cd-pop {
  0% { transform: scale(1.12); opacity: 0.85; }
  18% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* message sits in normal flow so it can never overlap on iOS */
.countdown__msg {
  position: static;
  transform: none;
  margin: 0;
  width: min(36ch, 92vw);
  padding: 0.7rem 0.9rem;
  text-align: center;
  background: rgba(4, 0, 13, 0.66);
  border: 1px solid rgba(0, 240, 255, 0.18);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

@media (max-height: 680px) {
  #countNum { font-size: clamp(4.5rem, 26vw, 8rem); }
  .countdown__msg { padding: 0.55rem 0.7rem; }
  .countdown .countdown__msg span { font-size: 0.5rem; }
}

/* ==========================================================================
   Game screens — readable, roomy, mobile first
   ========================================================================== */

@media (max-width: 640px) {
  .game-shell {
    min-height: 0;
    display: block;
    padding:
      calc(0.9rem + env(safe-area-inset-top))
      0.85rem
      calc(1rem + env(safe-area-inset-bottom));
  }

  .hud { gap: 0.5rem; margin-bottom: 0.6rem; flex-wrap: nowrap; align-items: center; }
  .hud .hud-left { gap: 0.45rem; min-width: 0; }
  .hud-title { display: block; font-size: 0.62rem; line-height: 1.5; }
  .hud-progress { font-size: 0.78rem; padding: 0.1rem 0.4rem; }
  .hud-score { font-size: 0.95rem; padding: 0.25rem 0.55rem 0.3rem; }
  .hud-score small { font-size: 0.62rem; }

  .timer:has(.fuse-wrap) { margin-bottom: 0.75rem; gap: 0.5rem; }
  .timer:has(.fuse-wrap) .timer-value { font-size: 1.1rem; min-width: 2.2rem; }
  .fuse-track { height: 18px; }
  .fuse-bomb { font-size: 1.35rem; }

  .q-card { min-height: 0; padding: 0.95rem 0.8rem 0.9rem; }
  .q-chip { display: inline-block; top: 0.5rem; left: 0.5rem; font-size: 0.42rem; padding: 0.22rem 0.4rem; }
  .q-text { font-size: clamp(1rem, 4.4vw, 1.22rem); line-height: 1.4; }
  .q-card.note-card .q-text { font-size: clamp(1.15rem, 5.4vw, 1.4rem); }

  .answers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; margin-top: 0.7rem; }
  .answer {
    min-height: 0;
    padding: 0.8rem 0.55rem;
    font-size: clamp(0.85rem, 3.9vw, 1.05rem);
    line-height: 1.3;
    gap: 0.35rem;
  }
  .theme-subject .answer,
  .theme-outline .answer,
  .theme-board .answer {
    min-height: 0;
    padding: 0.7rem 0.5rem;
    font-size: clamp(0.8rem, 3.6vw, 1rem);
  }

  .dots { display: flex; margin-top: 0.7rem; gap: 0.35rem; }
  .dot { width: 10px; height: 10px; }

  .feedback { padding: 1.1rem 0.9rem; }
  .feedback-badge { font-size: clamp(0.9rem, 4vw, 1.15rem); }
  .feedback-fact { font-size: 0.92rem; line-height: 1.5; }
  .feedback-source { font-size: 0.7rem; }
  .feedback-points { font-size: 1.05rem; }

  .start-panel h1 { font-size: clamp(1.2rem, 5.2vw, 1.7rem); }
  .rules { gap: 0.6rem; }
  .rule { padding: 0.7rem 0.8rem; font-size: 0.86rem; }

  .guess-input { font-size: 1rem; padding: 0.75rem 0.85rem; }
  .clue-list li.clue { font-size: 0.88rem; padding: 0.55rem 0.65rem; }
}

/* ==========================================================================
   Readability pass — hub picker and arcade messages
   ========================================================================== */

.section-head h2 { font-size: clamp(1.15rem, 2.8vw, 1.7rem); }
.section-head p { font-size: 1rem; }

.card-icon { width: 62px; height: 62px; font-size: 1.9rem; }
.card h3 { font-size: clamp(0.8rem, 1.9vw, 1rem); line-height: 1.7; }
.card p { font-size: 1rem; line-height: 1.55; }
.chip { font-size: 0.76rem; padding: 0.34rem 0.62rem; }
.card-cta { font-size: 0.68rem; }

.hero-copy { font-size: clamp(1.05rem, 2vw, 1.2rem); }
.hero-kicker { font-size: clamp(0.52rem, 1.7vw, 0.72rem); }

.board-row .name { font-size: 1.02rem; }
.board-row .score { font-size: 0.74rem; }
.board-row .rank { font-size: 0.8rem; }

.countdown__msg {
  width: min(42ch, 94vw);
  padding: 0.9rem 1.1rem;
}

.countdown__msg b { font-size: clamp(0.58rem, 2.1vw, 0.75rem); }

.countdown .countdown__msg span {
  font-size: clamp(0.76rem, 3.1vw, 1.05rem);
  line-height: 1.95;
}

.countdown .countdown__msg i { font-size: 0.95rem; }

@media (max-width: 640px) {
  .section-head h2 { font-size: 1.15rem; }
  .card h3 { font-size: 1rem; }
  .card p { font-size: 1.05rem; }
  .chip { font-size: 0.78rem; }
  .card-cta { font-size: 0.72rem; }

  .countdown__msg b { font-size: 0.6rem; }
  .countdown .countdown__msg span { font-size: 0.88rem; line-height: 1.9; }
  .countdown .countdown__msg i { font-size: 0.86rem; }
}

@media (max-width: 640px) and (max-height: 720px) {
  .countdown__msg { padding: 0.7rem 0.8rem; }
  .countdown .countdown__msg span { font-size: 0.76rem; line-height: 1.8; }
  .countdown .countdown__msg i { font-size: 0.78rem; }
}

/* ==========================================================================
   Nav music toggle (replaces the old menu)
   ========================================================================== */

.music-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-pixel);
  font-size: 0.46rem;
  line-height: 1.6;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8ffcff;
  background: rgba(0, 240, 255, 0.07);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.music-toggle__icon {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1;
}

.music-toggle:hover {
  color: #fff;
  border-color: #19f2ff;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
}

.music-toggle[aria-pressed='false'] {
  color: #8f8bbf;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.16);
}

.music-toggle[aria-pressed='false']:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: none;
}

@media (max-width: 640px) {
  .music-toggle { font-size: 0.42rem; padding: 0.42rem 0.62rem; }
  .music-toggle__icon { font-size: 0.85rem; }
}

/* ==========================================================================
   Mobile legibility pass — play screens, initials, quotes
   The play screen now fills the phone; the arcade keypad is thumb-sized.
   ========================================================================== */

/* ---- initials: a full-screen arcade keypad at every width --------------- */

.hs-panel { width: min(820px, 100%); }

.hs-topline { font-size: clamp(0.7rem, 1.5vw, 0.9rem); }
.hs-player { font-size: clamp(0.7rem, 1.5vw, 0.85rem); }
.hs-title { font-size: clamp(1rem, 2.4vw, 1.5rem); }

.hs-char { border-bottom: 3px solid rgba(0, 226, 74, 0.45); }
.hs-char.is-active { border-bottom-color: #ff2b2b; animation: hs-blink 0.7s steps(2) infinite; }
.hs-char.is-active::before { content: none; }

.hs-keys { max-width: 780px; margin-inline: auto; }
.hs-keyrow { gap: 0.25rem; }

.hs-key {
  flex: 1 1 0;
  min-width: 0;
  min-height: 54px;
  padding: 0;
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  line-height: 1;
  border: 1px solid rgba(0, 226, 74, 0.28);
  border-radius: 3px;
  background: rgba(0, 226, 74, 0.05);
  -webkit-tap-highlight-color: transparent;
}

.hs-key:active { background: rgba(0, 226, 74, 0.24); color: #fff; }
.hs-key--fn { font-size: clamp(0.72rem, 1.2vw, 0.9rem); }
.hs-key--end { border-color: rgba(255, 230, 0, 0.5); background: rgba(255, 230, 0, 0.07); }

.hs-table { font-size: clamp(0.75rem, 1.4vw, 0.95rem); }
.hs-hint { font-size: clamp(0.72rem, 1.4vw, 0.88rem); }
.hs-skip { font-size: clamp(0.7rem, 1.3vw, 0.85rem); }

@media (max-width: 640px) {

  /* measured nav height: 26px logo + 2×0.65rem padding + 4px border */
  :root { --nav-h: 57px; }

  /* ---- the play screen owns the rest of the viewport ------------------ */
  .game-shell:has(> #screen-game.active) {
    min-height: calc(100dvh - var(--nav-h));
    display: flex;
    flex-direction: column;
    padding-bottom: calc(1.6rem + env(safe-area-inset-bottom));
  }

  #screen-game.active {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 0.7rem;
    justify-content: center;
  }

  #screen-game .hud { margin-bottom: 0; }

  .hud-title { font-size: 0.78rem; line-height: 1.5; }
  .hud-progress { font-size: 0.92rem; }
  .hud-score { font-size: 1.25rem; line-height: 1.4; }
  .hud-score small { font-size: 0.64rem; letter-spacing: 0.08em; }

  .timer:has(.fuse-wrap) { margin-bottom: 0; }
  .timer:has(.fuse-wrap) .timer-value { font-size: 1.4rem; min-width: 2.6rem; }
  .timer-value small { font-size: 0.8rem; }
  .fuse-track { height: 16px; }

  /* ---- question card sits at its natural size ------------------------- */
  #screen-game .q-card:not(.clue-card):not(.note-card) {
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 132px;
    padding: 1rem 0.85rem;
  }

  /* the clue card is a list — keep it natural and push the input down */
  #screen-game .q-card.clue-card { flex: 0 0 auto; overflow: visible; }
  #screen-game .guess-row { margin-top: auto; }
  #screen-game .guess-row .btn,
  #screen-game .clue-actions .btn { min-height: 54px; font-size: 0.95rem; }
  #screen-game .clue-actions .btn { flex: 1 1 0; }
  #screen-game .guess-input { font-size: 1.05rem; }

  /* feedback fills the card, so the answers stay visible underneath */
  #screen-game .q-card:has(.feedback.active):not(.clue-card):not(.note-card) {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
  }

  .q-chip {
    position: static;
    font-size: 0.62rem;
    padding: 0.28rem 0.5rem;
  }

  .streak { top: 0.45rem; right: 0.5rem; font-size: 0.72rem; }

  .q-text {
    font-size: clamp(1.05rem, 4.9vw, 1.35rem);
    line-height: 1.55;
    letter-spacing: 0;
  }

  .shot-frame,
  .silhouette {
    flex: 0 1 auto;
    min-height: 0;
    max-height: 100%;
  }

  .shot-img,
  .silhouette-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
  }

  /* keep the whole silhouette inside the card on phones */
  .silhouette {
    flex: 0 0 auto;
    width: 100%;
  }

  .silhouette-img {
    max-height: min(30vw, 15vh);
  }

  #screen-game .q-card:not(.clue-card):not(.note-card) { max-height: 52vh; }

  /* picture games: the frame flexes so the answers always fit */
  #screen-game .q-card:has(.shot-frame):not(.clue-card),
  #screen-game .q-card:has(.silhouette):not(.clue-card) { max-height: 33vh; }

  /* ---- answers: comfy rows, never stretched to fill the screen -------- */
  .answers {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(64px, auto);
    flex: 0 0 auto;
    min-height: 0;
    align-content: start;
    gap: 0.6rem;
    margin-top: 0;
  }

  /* four long labels need a touch less padding and type to fit in one screen */
  #screen-game .answers:has(.answer:nth-child(4)) .answer {
    min-height: 0;
    padding: 0.65rem 0.7rem;
    font-size: clamp(0.85rem, 3.6vw, 1.05rem);
    line-height: 1.35;
  }

  /* while the result is up, the dimmed answers are just clutter on a phone */
  .game-shell:has(.feedback.active) .answers { display: none; }

  .answer,
  .theme-subject .answer,
  .theme-outline .answer,
  .theme-board .answer {
    min-height: 64px;
    height: auto;
    max-height: 112px;
    padding: 0.8rem 0.75rem;
    font-size: clamp(0.95rem, 4.3vw, 1.25rem);
    line-height: 1.4;
  }

  .answer .key { font-size: 0.75rem; padding: 0.2rem 0.45rem; }

  .dots { margin-top: 0; gap: 0.4rem; }
  .dot { width: 12px; height: 12px; }

  /* ---- feedback ------------------------------------------------------- */
  .feedback { padding: 1.2rem 1rem; }
  .feedback-badge { font-size: 1.05rem; }
  .feedback-fact { font-size: 1rem; line-height: 1.55; }
  .feedback-source { font-size: 0.8rem; }
  .feedback-points { font-size: 1.2rem; }
  .btn-next { min-height: 58px; font-size: 0.98rem; }

  /* ---- the countdown quote -------------------------------------------- */
  .countdown__msg b { font-size: 0.7rem; }
  .countdown .countdown__msg span { font-size: 1rem; line-height: 1.8; }
  .countdown .countdown__msg i { font-size: 0.92rem; }

  /* ---- music toggle --------------------------------------------------- */
  .music-toggle { font-size: 0.5rem; min-height: 38px; padding: 0.4rem 0.7rem; }
  .music-toggle__icon { font-size: 0.95rem; }

  /* ---- initials: a real arcade keypad you can hit with a thumb -------- */
  .hs-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding:
      0.75rem
      calc(0.75rem + env(safe-area-inset-left))
      calc(0.75rem + env(safe-area-inset-bottom))
      calc(0.75rem + env(safe-area-inset-right));
  }

  .hs-panel {
    width: 100%;
    max-height: calc(100dvh - 1.5rem);
    overflow-y: auto;
    padding: 0.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .hs-topline { font-size: 0.78rem; margin-bottom: 1rem; }
  .hs-player { font-size: 0.78rem; letter-spacing: 0.12em; margin-bottom: 0.35rem; }
  .hs-title { font-size: 1.1rem; line-height: 1.6; margin-bottom: 1.1rem; }

  .hs-entry { gap: 1rem; margin-bottom: 1.2rem; }

  .hs-char {
    width: 3.2rem;
    height: 3.2rem;
    min-width: 0;
    display: grid;
    place-items: center;
    font-size: 2.7rem;
    line-height: 1;
    border-bottom: 3px solid rgba(0, 226, 74, 0.45);
  }

  /* the red cursor is the blinking underline, not a block floating overhead */
  .hs-char.is-active { border-bottom-color: #ff2b2b; animation: hs-blink 0.7s steps(2) infinite; }
  .hs-char.is-active::before { content: none; }

  .hs-keys { gap: 0.45rem; margin-bottom: 1.1rem; width: 100%; margin-inline: 0; }
  .hs-keyrow { gap: 0.22rem; }

  .hs-key {
    flex: 1 1 0;
    min-width: 0;
    min-height: 46px;
    font-size: 0.95rem;
    line-height: 1;
    border: 1px solid rgba(0, 226, 74, 0.28);
    border-radius: 3px;
    background: rgba(0, 226, 74, 0.05);
    -webkit-tap-highlight-color: transparent;
  }

  .hs-key:active { background: rgba(0, 226, 74, 0.24); color: #fff; }
  .hs-key--fn { font-size: 0.72rem; }
  .hs-key--end { border-color: rgba(255, 230, 0, 0.5); background: rgba(255, 230, 0, 0.07); }

  .hs-table { font-size: 0.82rem; max-width: none; margin-bottom: 1rem; }
  .hs-row { grid-template-columns: 4ch 1fr auto; gap: 0.4rem; padding: 0.3rem 0; }

  .hs-hint { font-size: 0.82rem; line-height: 1.9; }
  .hs-skip { font-size: 0.78rem; min-height: 44px; padding: 0.5rem 0.9rem; margin-top: 0.4rem; }
}

/* short phones: 375×667 and friends */
@media (max-width: 640px) and (max-height: 700px) {
  #screen-game.active { gap: 0.5rem; }
  .q-text { font-size: clamp(1rem, 4.6vw, 1.2rem); line-height: 1.45; }
  #screen-game .q-card:not(.clue-card):not(.note-card) { min-height: 104px; padding: 0.8rem 0.7rem; max-height: 48vh; }
  #screen-game .q-card:has(.shot-frame):not(.clue-card),
  #screen-game .q-card:has(.silhouette):not(.clue-card) { max-height: 32vh; }
  .q-chip { font-size: 0.56rem; }
  .answer { min-height: 56px; }

  /* four answers on a short phone: two columns, or the picture gets too small */
  #screen-game .answers:has(.answer:nth-child(4)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #screen-game .answers:has(.answer:nth-child(4)) .answer {
    min-height: 62px;
    padding: 0.7rem 0.55rem;
    font-size: clamp(0.8rem, 3.7vw, 1rem);
    line-height: 1.35;
  }
  .answer,
  .theme-subject .answer,
  .theme-outline .answer,
  .theme-board .answer { min-height: 62px; padding: 0.8rem 0.8rem; }
  .dot { width: 10px; height: 10px; }
  .hs-key { min-height: 42px; }
  .hs-char { font-size: 2.8rem; }
  .hs-title { margin-bottom: 0.8rem; }
  .hs-entry { margin-bottom: 0.9rem; }
}

/* ==========================================================================
   Sound-effects toggle — it had no position in the arcade theme, so it sat
   in the page flow at the bottom. Pin it, thumb-sized, bottom left.
   ========================================================================== */

.sound-toggle:not(.is-in-nav) {
  position: fixed;
  left: calc(0.6rem + env(safe-area-inset-left));
  bottom: calc(0.6rem + env(safe-area-inset-bottom));
  z-index: 90;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

.sound-toggle[aria-pressed='false'] { opacity: 0.55; }

@media (max-width: 640px) {
  .sound-toggle:not(.is-in-nav) {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
    left: calc(0.7rem + env(safe-area-inset-left));
    bottom: calc(1rem + env(safe-area-inset-bottom));
  }
}


/* the sound toggle, sitting beside the music toggle in the nav */
.sound-toggle.is-in-nav {
  position: static;
  inset: auto;
  width: 38px;
  height: 38px;
  margin: 0 0 0 0.3rem;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.06);
  box-shadow: none;
  color: var(--ink);
}

.sound-toggle.is-in-nav:hover { border-color: #19f2ff; }

@media (max-width: 640px) {
  .sound-toggle.is-in-nav { width: 36px; height: 36px; font-size: 0.95rem; }
}

/* clue ladder: both action buttons the same size */
#screen-game .clue-actions { align-items: stretch; }
#screen-game .clue-actions .btn {
  flex: 1 1 0;
  min-height: 56px;
  padding: 0.6rem 0.45rem;
  font-size: clamp(0.72rem, 3.3vw, 0.95rem);
  line-height: 1.45;
}

/* ==========================================================================
   Feedback verdict — "Correct!" / "Wrong" must read at a glance
   Loaded last so it beats the per-theme and mobile shrink passes.
   ========================================================================== */

.feedback-badge {
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  line-height: 1.25;
  margin-bottom: 0.35rem;
}

/* ==========================================================================
   READABILITY FLOOR & RESPONSIVE NORMALISATION
   --------------------------------------------------------------------------
   One auditable pass that sits last in the cascade.

   1. Type floor      — nothing readable below 12px (0.75rem).
   2. Tap targets     — interactive chrome is at least 44px tall.
   3. Desktop scale   — the page grows past 1000px instead of staying a
                        stretched phone column.
   4. Breakpoints     — collapsed onto 480 / 640 / 900 / 1200.
   ========================================================================== */

/* ---- 1. Type floor ------------------------------------------------------ */

/* Small meta/labels: these were 8–11.5px. */
.chip,
.card-cta,
.hero-kicker,
.q-chip,
.hud-title,
.hud-progress,
.hud-score small,
.hud-side-name,
.hud-side-turn,
.hud-side-turns,
.timer-value small,
.answer .key,
.clue-worth,
.clue-num,
.note-cutoff,
.feedback-source,
.feedback-next .fb-label,
.streak,
.results-kicker,
.rstat span,
.results-board h4,
.start-board h4,
.new-best,
.rule b,
.brand,
.nav-links a,
.board-row .rank,
.board-row .score,
.tune-sub,
.play-loud,
.diff-btn span,
.code-label,
.code-hint,
.bluff-round,
.bluff-topic,
.wind-unit,
.weapon-name,
.weapon-points,
.hs-hint,
.hs-skip,
.hs-key--fn,
.countdown__msg b,
.music-toggle,
.music-toggle__icon,
.crt-toggle {
  font-size: max(0.75rem, 1em);
}

/* Press Start 2P is wide, so its floor is a little lower than a text face. */
.btn,
.btn--big,
.btn-next,
body[class] .btn,
body[class] .btn--big,
body[class] .btn-next {
  font-size: max(0.75rem, 0.62em);
}

@media (min-width: 641px) {
  .btn, body[class] .btn { font-size: 0.8125rem; }
  .btn--big, body[class] .btn--big { font-size: 0.9375rem; }
  .btn-next, body[class] .btn-next { font-size: 0.9375rem; }
}

@media (max-width: 640px) {
  .btn,
  .btn--big,
  body[class] .btn,
  body[class] .btn--big {
    font-size: 0.75rem;
    line-height: 1.8;
    padding: 0.85rem 1rem;
  }
}

/* The intro hint was 0.38–0.52rem. */
.syn-hint { font-size: var(--fs-2xs); }

/* Hub marquee is decoration, but 8px is unreadable — give it the floor too. */
.hall-marquee span { font-size: var(--fs-2xs); }
.hall-marquee b { font-size: var(--fs-2xs); }

/* ---- 2. Tap targets ----------------------------------------------------- */

.brand {
  min-block-size: 44px;
}

.music-toggle,
.sound-toggle.is-in-nav,
.crt-toggle {
  min-block-size: 44px;
  min-inline-size: 44px;
  justify-content: center;
}

@media (max-width: 480px) {
  /* keep the nav on one line: no CRT toggle on the smallest phones */
  .crt-toggle { display: none; }
}

/* ---- 3. CRT toggle, as a nav pill --------------------------------------- */

.crt-toggle {
  display: inline-flex;
  align-items: center;
  padding: 0 0.7rem;
  font-family: var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.crt-toggle:hover { color: var(--ink); border-color: var(--line-strong); background: var(--panel); }

.crt-toggle[aria-pressed='true'] {
  color: #8ffcff;
  border-color: rgba(0, 240, 255, 0.55);
  background: rgba(0, 240, 255, 0.08);
}

/* ---- 4. Sound toggle reads as SFX, not a second mute -------------------- */

@media (min-width: 641px) {
  .sound-toggle.is-in-nav {
    inline-size: auto;
    min-inline-size: 44px;
    padding: 0 0.7rem;
    gap: 0.35rem;
  }

  .sound-toggle.is-in-nav::after {
    content: 'SFX';
    font-family: var(--font-body);
    font-size: var(--fs-2xs);
    letter-spacing: 0.12em;
  }
}

/* ---- 5. Desktop scale --------------------------------------------------- */

@media (min-width: 900px) {
  :root { --wrap-max: 1080px; }
}

@media (min-width: 1200px) {
  :root { --wrap-max: 1180px; }

  .hero { padding-block: clamp(3rem, 6vw, 5rem) clamp(2rem, 4vw, 3.5rem); }
  .hero h1 { font-size: clamp(2.6rem, 4.6vw, 4.4rem); }
  .hero-copy { max-inline-size: 34rem; }
  .grid { gap: 1.1rem; }
}

/* Keep the version badge tied to the brand instead of floating mid-nav. */
.nav-inner .version-badge {
  margin-inline-end: auto;
  font-family: var(--font-body);
  font-size: var(--fs-2xs);
  letter-spacing: 0.06em;
  color: var(--faint);
}

/* ---- 6. Breakpoints: 480 / 640 / 900 / 1200 ---------------------------- */

/* The old 600px blocks now apply at the shared 640 step; the old 430/400
   blocks share 480. These two rules keep the last word at those widths. */
@media (max-width: 480px) {
  .nav-inner > .version-badge { display: none; }
}

/* ---- 7. Small-screen play screen: no scrolling at 320x568 --------------- */

@media (max-width: 480px) {
  #screen-game.active { gap: 0.45rem; }
  .hud { margin-bottom: 0.25rem; }
  .q-card { padding: 0.75rem 0.65rem; }
  .answer { min-height: 56px; padding: 0.65rem 0.6rem; }
  .dots { margin-top: 0.35rem; }
}

/* ---- 8. Form fields and inline links meet the 44px target -------------- */

.subject-form input,
.join-form input,
.guess-input,
input[type='text'],
input[type='search'] {
  min-block-size: 44px;
}

.footer a {
  display: inline-block;
  padding-block: 0.35rem;
}

/* ---- 9. Nav and section headings on small screens ---------------------- */

@media (max-width: 640px) {
  .nav-inner {
    flex-wrap: nowrap;
    gap: 0.5rem;
    min-inline-size: 0;
  }

  .brand { flex: 0 1 auto; min-inline-size: 0; }
  .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* The CRT switch is cosmetic and off by default — no room for it here. */
  .crt-toggle { display: none; }

  /* Section headings sit above their subtitle instead of squeezing beside it. */
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .section-head h2 { font-size: 1.25rem; }
  .section-head p { font-size: var(--fs-sm); }
}

@media (max-width: 480px) {
  /* Music toggle keeps its icon and aria-pressed state, drops the word. */
  .music-toggle { padding-inline: 0.65rem; }
  .music-toggle__label {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
