:root {
  color-scheme: light;
  --ink: #171716;
  --ink-soft: #39342c;
  --paper: #f7f1df;
  --paper-deep: #eadfc5;
  --cream: #fffaf0;
  --red: #b31942;
  --blue: #0a3161;
  --cyan: #59c7df;
  --gold: #e5b84b;
  --green: #1c7a55;
  --muted: #696154;
  --line: rgba(23, 23, 22, 0.16);
  --shadow: 0 24px 60px rgba(23, 23, 22, 0.14);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 22%, rgba(23, 23, 22, 0.055) 0 0.5px, transparent 0.8px) 0 0 / 7px 7px,
    radial-gradient(circle at 68% 34%, rgba(10, 49, 97, 0.035) 0 0.45px, transparent 0.75px) 0 0 / 11px 11px,
    linear-gradient(180deg, #fffdfa 0%, var(--paper) 52%, #ffffff 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(89, 199, 223, 0.8);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  min-height: 68px;
  padding: 10px clamp(14px, 4vw, 34px);
  background: rgba(255, 250, 240, 0.93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  width: max-content;
  color: var(--ink);
  font-weight: 950;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #ffffff;
  background: var(--red);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--gold);
}

.header-links {
  display: flex;
  gap: 6px;
  justify-self: center;
}

.header-links a,
.share-button,
.button {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
}

.header-links a {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
}

.header-links a:hover {
  background: rgba(18, 58, 74, 0.08);
}

.share-button {
  justify-self: end;
  padding: 0 15px;
  color: #ffffff;
  background: var(--blue);
  border: 0;
}

.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(460px, 1.28fr);
  gap: clamp(42px, 7vw, 92px);
  align-items: center;
  width: min(var(--max), calc(100% - 32px));
  min-height: calc(100svh - 68px);
  margin: 0 auto;
  padding: clamp(32px, 7vh, 78px) 0;
}

.intro-panel {
  align-self: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  letter-spacing: 0;
  line-height: 0.98;
}

h1 {
  max-width: 460px;
  margin-bottom: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.9rem, 5.45vw, 5.85rem);
  font-weight: 950;
}

h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4.7vw, 4.4rem);
  font-weight: 950;
}

p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.58;
}

.lede {
  max-width: 570px;
  color: var(--ink-soft);
  font-size: clamp(1.12rem, 2vw, 1.38rem);
  font-weight: 720;
  line-height: 1.34;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 28px 0;
}

.stat-strip div {
  min-height: 88px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat-value,
.stat-label {
  display: block;
}

.stat-value {
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.05rem;
  font-weight: 950;
  line-height: 1;
}

.stat-label {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.intro-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button,
.receipt-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 17px;
  border-radius: 8px;
  font-weight: 930;
}

.button.primary {
  color: #ffffff;
  background: var(--red);
  border: 0;
  box-shadow: 0 13px 28px rgba(181, 36, 36, 0.2);
}

.button.secondary,
.receipt-link {
  color: var(--blue);
  background: #ffffff;
  border: 1px solid var(--line);
  text-decoration: none;
}

.button.jump-link {
  display: none;
  margin-top: 16px;
  width: fit-content;
}

.quiz-card {
  position: relative;
  min-height: 630px;
  scroll-margin-top: 82px;
  padding: clamp(18px, 3vw, 32px);
  background:
    radial-gradient(circle at 18% 26%, rgba(23, 23, 22, 0.05) 0 0.45px, transparent 0.8px) 0 0 / 6px 6px,
    radial-gradient(circle at 74% 38%, rgba(10, 49, 97, 0.035) 0 0.45px, transparent 0.75px) 0 0 / 10px 10px,
    #fffdf8;
  border: 1px solid var(--line);
  border-top: 8px solid var(--blue);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.quiz-topline {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
}

.progress-track {
  height: 10px;
  margin: 14px 0 24px;
  overflow: hidden;
  background: rgba(18, 58, 74, 0.12);
  border-radius: 999px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  border-radius: inherit;
  transition: width 280ms ease;
}

.quote-stage {
  display: grid;
  align-items: center;
  min-height: 245px;
  margin: 0;
  padding: clamp(22px, 4vw, 40px);
  background: #ffffff;
  border: 1px solid rgba(23, 23, 22, 0.16);
  border-radius: 8px;
}

blockquote {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4.2vw, 4rem);
  font-weight: 900;
  line-height: 1.04;
}

blockquote::before {
  content: open-quote;
  color: var(--gold);
}

blockquote::after {
  content: close-quote;
  color: var(--gold);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.choice-button {
  min-height: 96px;
  padding: 18px;
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  font-size: clamp(1.1rem, 2.1vw, 1.42rem);
  font-weight: 950;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.choice-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 26px rgba(23, 23, 22, 0.16);
}

.choice-button:disabled {
  cursor: default;
  opacity: 0.62;
  transform: none;
}

.choice-button.smith {
  background: var(--blue);
}

.choice-button.separatist {
  background: var(--red);
}

.choice-button.correct {
  outline: 5px solid rgba(28, 122, 85, 0.34);
  background: var(--green);
  opacity: 1;
}

.choice-button.incorrect {
  outline: 5px solid rgba(181, 36, 36, 0.24);
}

.result-panel,
.final-panel {
  margin-top: 16px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 7px solid var(--gold);
  border-radius: 8px;
}

.result-kicker {
  margin-bottom: 6px;
  color: var(--red);
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-panel h2,
.final-panel h2 {
  margin-bottom: 8px;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
}

.result-panel p,
.final-panel p {
  margin-bottom: 10px;
}

.section {
  padding: clamp(48px, 8vw, 86px) 0;
}

.section-inner {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.section-head {
  max-width: 780px;
  margin-bottom: 24px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--ink);
  font-weight: 850;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.filter-button[aria-pressed="true"] {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
}

.bank-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  color: var(--muted);
}

.bank-meta strong {
  color: var(--ink);
}

.quote-bank {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.bank-card {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid rgba(23, 23, 22, 0.15);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(23, 23, 22, 0.08);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  background: rgba(229, 184, 75, 0.24);
  border-radius: 999px;
}

.tag.smith {
  color: #ffffff;
  background: var(--blue);
}

.tag.separatist {
  color: #ffffff;
  background: var(--red);
}

.bank-card h3 {
  margin: 0 0 12px;
  font-size: 1.18rem;
  line-height: 1.15;
}

.bank-quote {
  color: var(--ink-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.24rem;
  font-weight: 850;
  line-height: 1.25;
}

.bank-source {
  margin-top: auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.bank-card a {
  width: max-content;
  max-width: 100%;
  margin-top: 10px;
  color: var(--red);
  font-weight: 900;
  text-underline-offset: 4px;
}

.footer {
  padding: 34px 0 calc(34px + env(safe-area-inset-bottom));
  color: #ffffff;
  background: var(--ink);
}

.footer-inner {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  justify-content: space-between;
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
}

.footer a {
  color: #ffffff;
  text-underline-offset: 3px;
}

.footer-disclaimer {
  max-width: 690px;
  font-size: 0.9rem;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .header-links {
    display: none;
  }

  .game-shell {
    grid-template-columns: 1fr;
  }

  .game-shell {
    min-height: auto;
  }

  .quiz-card {
    min-height: 0;
  }

  .quote-bank {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 62px;
    padding: 8px 12px;
  }

  .brand {
    font-size: 0.85rem;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .game-shell,
  .section-inner {
    width: min(100% - 24px, 520px);
  }

  h1 {
    font-size: clamp(2.8rem, 14vw, 4.05rem);
  }

  .button.jump-link {
    display: inline-flex;
  }

  .stat-strip,
  .choice-grid,
  .quote-bank {
    grid-template-columns: 1fr;
  }

  .quiz-card {
    display: grid;
    max-height: calc(100svh - 78px);
    min-height: 0;
    overflow: auto;
    padding: 16px;
  }

  .quiz-topline {
    display: contents;
  }

  #quoteLabel {
    order: 1;
  }

  .progress-track {
    order: 2;
    margin: 10px 0 12px;
  }

  .quote-stage {
    order: 3;
    min-height: clamp(150px, 34svh, 225px);
    padding: 16px;
    overflow: auto;
  }

  blockquote {
    font-size: clamp(1.55rem, 8vw, 2.45rem);
  }

  .choice-grid {
    order: 4;
    gap: 10px;
    margin-top: 12px;
  }

  .choice-button {
    min-height: 68px;
    padding: 14px;
  }

  #scorePill {
    order: 5;
    justify-self: start;
    margin-top: 10px;
    padding: 6px 9px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: 6px;
  }

  .result-panel,
  .final-panel {
    order: 6;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
