:root {
  --navy-950: #081328;
  --navy-900: #101f3d;
  --navy-800: #182b4f;
  --navy-700: #253d67;
  --paper: #f5eedf;
  --paper-deep: #e9dcc3;
  --ink: #17213a;
  --muted: #657087;
  --gold: #d4ab5f;
  --gold-light: #f0d79e;
  --red: #aa3039;
  --red-dark: #7f202b;
  --green: #227158;
  --white: #fffdf8;
  --line: rgba(27, 43, 73, 0.15);
  --shadow: 0 22px 60px rgba(6, 16, 34, 0.16);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(9, 25, 50, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(9, 25, 50, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 26px 26px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 16px;
  color: white;
  background: var(--navy-900);
  border-radius: 8px;
  transform: translateY(-140%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.author-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 24px);
  width: 100%;
  min-height: 54px;
  padding: 11px 24px 9px;
  color: var(--gold-light);
  background:
    linear-gradient(90deg, rgba(212, 171, 95, 0.05), rgba(212, 171, 95, 0.16), rgba(212, 171, 95, 0.05)),
    var(--navy-950);
  border-top: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 5px 18px rgba(6, 16, 34, 0.18);
  text-align: center;
}

.author-banner strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 2.3vw, 28px);
  font-weight: 700;
  letter-spacing: clamp(0.12em, 0.8vw, 0.24em);
  line-height: 1.15;
}

.author-banner span {
  color: var(--gold);
  font-size: 13px;
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  min-height: 112px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--navy-900);
  text-decoration: none;
}

.brand-logo {
  width: 86px;
  height: 86px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(9, 25, 50, 0.16));
}

.brand-subtitle {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.header-quiz-mark {
  width: clamp(108px, 12vw, 146px);
  height: auto;
  margin: 10px 0;
  filter: drop-shadow(0 8px 16px rgba(6, 16, 34, 0.2));
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  color: var(--navy-800);
  background: rgba(255, 253, 248, 0.55);
  border-radius: 999px;
  padding: 9px 13px;
  cursor: pointer;
  justify-self: end;
}

.icon-button:hover {
  border-color: rgba(27, 43, 73, 0.35);
  background: var(--white);
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.icon-button .sound-off {
  display: none;
}

.icon-button[aria-pressed="false"] .sound-on {
  display: none;
}

.icon-button[aria-pressed="false"] .sound-off {
  display: block;
}

.sound-label {
  font-size: 12px;
  font-weight: 700;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: screen-in 0.5s ease both;
}

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

.hero-grid {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.72fr);
  gap: clamp(34px, 6vw, 76px);
  align-items: center;
  min-height: 610px;
  margin: 28px 0 54px;
  padding: clamp(54px, 7vw, 82px) clamp(32px, 6vw, 72px);
  overflow: hidden;
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(4, 16, 35, 0.98) 0%, rgba(7, 24, 49, 0.94) 34%, rgba(7, 24, 49, 0.48) 62%, rgba(7, 24, 49, 0.12) 100%),
    url("./assets/constitution-hero.png") center / cover no-repeat;
  border: 1px solid rgba(212, 171, 95, 0.62);
  border-radius: 28px 4px 28px 4px;
  box-shadow: 0 28px 75px rgba(6, 16, 34, 0.28);
}

.hero-grid::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 10px;
  pointer-events: none;
  border: 1px solid rgba(240, 215, 158, 0.32);
  border-radius: 20px 2px 20px 2px;
}

.hero-grid::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--gold-light), var(--gold), transparent);
}

.hero-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
  max-width: 660px;
}

.eyebrow,
.kicker {
  margin: 0 0 16px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-grid .eyebrow {
  color: var(--gold-light);
}

.eyebrow span {
  margin-right: 7px;
  color: var(--gold);
}

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

h1,
h2,
.mode-name,
.final-score strong {
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  margin-bottom: 24px;
  color: #fff9ea;
  font-size: clamp(48px, 7.2vw, 86px);
  line-height: 0.94;
  letter-spacing: -0.045em;
  max-width: 740px;
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.32);
}

h1 span {
  display: block;
  margin-bottom: 11px;
  color: var(--gold-light);
  font-family: "Snell Roundhand", "Segoe Script", cursive;
  font-size: 0.44em;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
}

.hero-deck {
  max-width: 660px;
  margin-bottom: 26px;
  color: rgba(255, 249, 234, 0.84);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.65;
}

.hero-button {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 32px;
  padding: 13px 18px;
  color: var(--navy-950);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

.hero-button span {
  font-size: 16px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
}

.hero-stats div {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 8px;
}

.hero-stats strong {
  color: var(--gold-light);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
}

.hero-stats span {
  color: rgba(255, 249, 234, 0.68);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-side {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px;
  width: 100%;
}

.quiz-mark {
  width: min(100%, 300px);
  height: auto;
  align-self: center;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.38));
}

.preamble-card {
  position: relative;
  z-index: 2;
  width: min(100%, 410px);
  min-height: 0;
  align-self: end;
  justify-self: end;
  padding: 86px 30px 34px;
  overflow: hidden;
  color: #f2e5c8;
  background:
    radial-gradient(circle at 18% 16%, rgba(215, 176, 100, 0.2), transparent 28%),
    linear-gradient(145deg, rgba(24, 43, 79, 0.91), rgba(5, 15, 32, 0.94));
  border: 1px solid rgba(240, 215, 158, 0.5);
  border-radius: 3px 24px 3px 24px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
}

.preamble-card::before,
.preamble-card::after {
  content: "★  ★  ★  ★  ★";
  position: absolute;
  left: 28px;
  right: 28px;
  color: rgba(212, 171, 95, 0.5);
  font-size: 12px;
  letter-spacing: 0.9em;
  text-align: center;
}

.preamble-card::before { top: 28px; }
.preamble-card::after { bottom: 26px; }

.preamble-card p {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 2.2vw, 29px);
  font-style: italic;
  line-height: 1.38;
}

.quote-logo {
  position: absolute;
  top: 12px;
  right: 18px;
  width: 82px;
  height: 82px;
  object-fit: contain;
  filter: drop-shadow(0 7px 12px rgba(0, 0, 0, 0.28));
}

.signature {
  display: block;
  margin-top: 24px;
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.mode-section {
  padding: 58px 0 70px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin: 0;
  color: var(--navy-900);
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1;
}

.section-heading > p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.mode-card {
  min-height: 346px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 128px 30px 30px;
  position: relative;
  overflow: hidden;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 32px rgba(23, 33, 58, 0.055);
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.mode-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 98px;
  background-image:
    linear-gradient(180deg, rgba(8, 19, 40, 0.05), rgba(8, 19, 40, 0.38)),
    url("./assets/constitution-hero.png");
  background-size: auto 320px;
  background-position: 28% 48%;
  border-bottom: 1px solid rgba(212, 171, 95, 0.44);
  pointer-events: none;
}

.mode-card:nth-child(2)::before {
  background-position: 63% 42%;
}

.mode-card:nth-child(3)::before {
  background-position: 92% 76%;
}

.mode-card > * {
  position: relative;
  z-index: 1;
}

.mode-card:hover {
  z-index: 2;
  transform: translateY(-6px);
  border-color: rgba(170, 48, 57, 0.4);
  box-shadow: 0 20px 42px rgba(23, 33, 58, 0.13);
}

.mode-card.featured {
  color: var(--white);
  background: linear-gradient(150deg, var(--navy-800), var(--navy-950));
  border-color: transparent;
}

.popular-flag {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: -39px;
  width: 150px;
  padding: 7px 0;
  color: var(--navy-950);
  background: var(--gold);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(43deg);
}

.mode-number {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.featured .mode-number,
.featured .mode-description {
  color: #b9c2d0;
}

.mode-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 24px 0 22px;
  color: var(--red);
  background: rgba(170, 48, 57, 0.09);
  border-radius: 50%;
  font-size: 22px;
}

.featured .mode-icon {
  color: var(--gold-light);
  background: rgba(212, 171, 95, 0.12);
}

.mode-name {
  display: block;
  margin-bottom: 12px;
  font-size: 25px;
  font-weight: 700;
}

.mode-description {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.mode-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 22px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.featured .mode-meta {
  color: #b9c2d0;
  border-color: rgba(255, 255, 255, 0.12);
}

.mode-cta {
  display: block;
  margin-top: 18px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.featured .mode-cta {
  color: var(--gold-light);
}

.mode-cta span {
  display: inline-block;
  margin-left: 5px;
  transition: transform 0.2s ease;
}

.mode-card:hover .mode-cta span {
  transform: translateX(5px);
}

.learn-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 62px;
  padding: 22px 25px;
  background: rgba(212, 171, 95, 0.13);
  border: 1px solid rgba(151, 110, 42, 0.2);
  border-radius: 12px;
}

.learn-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--paper);
  background: var(--navy-800);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.learn-strip p {
  margin: 0;
  color: #535b69;
  font-size: 13px;
  line-height: 1.5;
}

.learn-strip a {
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.learn-strip a:hover {
  text-decoration: underline;
}

footer {
  min-height: 84px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-feedback-link {
  flex: 1 1 300px;
  color: var(--gold-light);
  line-height: 1.5;
  text-align: center;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.game-feedback-link:hover {
  color: #fff4d2;
}

.game-feedback-link:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 4px;
}

.visitor-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 14px;
  color: var(--gold-light);
  background: linear-gradient(145deg, var(--navy-800), var(--navy-950));
  border: 1px solid rgba(212, 171, 95, 0.56);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(6, 16, 34, 0.14);
  white-space: nowrap;
}

.visitor-counter strong {
  min-width: 4.8ch;
  color: var(--white);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
}

.visitor-counter span {
  color: var(--gold-light);
  font-size: 9px;
}

/* Game */
.game-screen,
.result-screen {
  min-height: calc(100vh - 180px);
  padding: 38px 0 80px;
}

.game-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.back-button {
  justify-self: start;
  padding: 8px 0;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.back-button:hover {
  color: var(--red);
}

.mode-pill,
.category-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-800);
  background: rgba(212, 171, 95, 0.16);
  border: 1px solid rgba(151, 110, 42, 0.2);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.mode-pill {
  padding: 8px 14px;
}

.question-count {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.progress-track {
  height: 4px;
  margin: 22px 0 20px;
  overflow: hidden;
  background: rgba(27, 43, 73, 0.1);
  border-radius: 99px;
}

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

.hud {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.hud-item {
  min-width: 106px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 13px;
  background: rgba(255, 253, 248, 0.55);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.hud-item span:first-child {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hud-item strong {
  color: var(--navy-900);
  font-size: 16px;
}

.hud-item.timer {
  display: none;
}

.hud-item.timer.is-visible {
  display: flex;
}

.hud-item.timer.is-urgent {
  color: var(--red);
  border-color: rgba(170, 48, 57, 0.45);
  animation: pulse 0.8s ease infinite alternate;
}

@keyframes pulse {
  to { background: rgba(170, 48, 57, 0.1); }
}

.question-card {
  width: min(860px, 100%);
  min-height: 500px;
  margin: 0 auto;
  padding: clamp(30px, 5vw, 54px);
  background: rgba(255, 253, 248, 0.93);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.category-chip {
  padding: 7px 12px;
  color: var(--red-dark);
  background: rgba(170, 48, 57, 0.07);
  border-color: rgba(170, 48, 57, 0.14);
}

.difficulty {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
}

.difficulty i {
  width: 4px;
  height: 10px;
  display: inline-block;
  background: rgba(27, 43, 73, 0.13);
  border-radius: 3px;
}

.difficulty i:nth-child(2) { height: 14px; }
.difficulty i:nth-child(3) { height: 18px; }
.difficulty.level-1 i:nth-child(1),
.difficulty.level-2 i:nth-child(-n+2),
.difficulty.level-3 i { background: var(--gold); }

.difficulty span {
  margin-left: 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.question-card h2 {
  max-width: 740px;
  margin-bottom: 32px;
  color: var(--navy-900);
  font-size: clamp(27px, 3.3vw, 39px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

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

.answer-button {
  min-height: 70px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  color: var(--ink);
  background: #fbf8f1;
  border: 1px solid rgba(27, 43, 73, 0.16);
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.answer-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #fffefd;
  border-color: var(--navy-700);
}

.answer-button:disabled {
  cursor: default;
}

.answer-key {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--navy-700);
  background: rgba(27, 43, 73, 0.06);
  border: 1px solid rgba(27, 43, 73, 0.12);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 900;
}

.answer-text {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.answer-state {
  width: 24px;
  height: 24px;
  display: none;
  place-items: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
}

.answer-button.is-correct {
  color: #155640;
  background: rgba(34, 113, 88, 0.08);
  border-color: rgba(34, 113, 88, 0.55);
}

.answer-button.is-correct .answer-state {
  display: grid;
  color: white;
  background: var(--green);
}

.answer-button.is-wrong {
  color: #7d2028;
  background: rgba(170, 48, 57, 0.07);
  border-color: rgba(170, 48, 57, 0.52);
}

.answer-button.is-wrong .answer-state {
  display: grid;
  color: white;
  background: var(--red);
}

.answer-button.is-dimmed {
  opacity: 0.48;
}

.feedback {
  display: none;
  grid-template-columns: auto 1fr;
  gap: 14px;
  margin-top: 18px;
  padding: 17px 18px;
  background: rgba(34, 113, 88, 0.07);
  border-left: 4px solid var(--green);
  border-radius: 8px;
}

.feedback.is-visible {
  display: grid;
  animation: feedback-in 0.25s ease both;
}

.feedback.is-wrong {
  background: rgba(170, 48, 57, 0.06);
  border-color: var(--red);
}

@keyframes feedback-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.feedback-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
  border-radius: 50%;
  font-weight: 900;
}

.feedback.is-wrong .feedback-icon {
  background: var(--red);
}

.feedback strong {
  display: block;
  color: var(--navy-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
}

.feedback p {
  margin: 4px 0 5px;
  color: #566078;
  font-size: 13px;
  line-height: 1.5;
}

.feedback span {
  color: var(--red-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.question-actions {
  min-height: 45px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
}

.keyboard-hint {
  color: var(--muted);
  font-size: 11px;
}

kbd {
  min-width: 21px;
  display: inline-block;
  padding: 3px 5px;
  color: var(--navy-700);
  background: #fff;
  border: 1px solid rgba(27, 43, 73, 0.18);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.primary-button,
.secondary-button,
.share-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 19px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.primary-button {
  color: white;
  background: var(--red);
  border: 1px solid var(--red);
  box-shadow: 0 8px 18px rgba(127, 32, 43, 0.18);
}

.primary-button:hover {
  background: var(--red-dark);
}

#next-question {
  display: none;
}

#next-question.is-visible {
  display: inline-flex;
}

/* Results */
.result-screen {
  display: none;
  place-items: center;
}

.result-screen.is-active {
  display: grid;
}

.result-card {
  width: min(740px, 100%);
  padding: clamp(34px, 6vw, 62px);
  position: relative;
  overflow: hidden;
  text-align: center;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.result-card::before,
.result-card::after {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(212, 171, 95, 0.2);
  border-radius: 50%;
}

.result-card::before { top: -145px; left: -70px; }
.result-card::after { right: -80px; bottom: -150px; }

.result-burst {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 0 auto 23px;
  color: var(--navy-900);
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 7px rgba(212, 171, 95, 0.15);
  font-size: 25px;
}

.result-card h2 {
  margin-bottom: 10px;
  color: var(--navy-900);
  font-size: clamp(38px, 6vw, 60px);
  line-height: 1;
}

.result-message {
  max-width: 540px;
  margin: 0 auto 24px;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.55;
}

.final-score {
  max-width: 310px;
  margin: 0 auto 26px;
  padding: 20px;
  background: rgba(16, 31, 61, 0.035);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.final-score span,
.final-score em {
  display: block;
}

.final-score span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.final-score strong {
  display: block;
  margin: 5px 0 4px;
  color: var(--red);
  font-size: 50px;
  line-height: 1;
}

.final-score em {
  color: var(--green);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.final-score em.is-hidden {
  visibility: hidden;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-stats div {
  padding: 18px 10px;
}

.result-stats div + div {
  border-left: 1px solid var(--line);
}

.result-stats strong,
.result-stats span {
  display: block;
}

.result-stats strong {
  color: var(--navy-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.result-stats span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.missed-review {
  margin-bottom: 24px;
  text-align: left;
}

.missed-review > button {
  width: 100%;
  padding: 12px 0;
  color: var(--navy-800);
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.missed-review > button span {
  display: inline-block;
  transition: transform 0.2s ease;
}

.missed-review > button[aria-expanded="true"] span {
  transform: rotate(180deg);
}

#review-list {
  display: none;
  max-height: 240px;
  overflow: auto;
  padding: 0 4px;
}

#review-list.is-visible {
  display: block;
}

.review-item {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.review-item strong {
  display: block;
  margin-bottom: 5px;
  color: var(--navy-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
}

.review-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.review-item span {
  color: var(--green);
  font-weight: 800;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.secondary-button,
.share-button {
  color: var(--navy-800);
  background: transparent;
  border: 1px solid rgba(27, 43, 73, 0.2);
}

.secondary-button:hover,
.share-button:hover {
  background: rgba(27, 43, 73, 0.05);
}

.share-status {
  min-height: 16px;
  margin: 13px 0 0;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  width: 9px;
  height: 15px;
  position: absolute;
  top: -20px;
  animation: confetti-fall 2.8s linear forwards;
}

@keyframes confetti-fall {
  to { transform: translate3d(var(--drift), 110vh, 0) rotate(760deg); opacity: 0.15; }
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 54px 42px 42px;
    background-position: 68% center;
  }

  .hero-copy {
    max-width: 740px;
  }

  .hero-side {
    align-items: center;
  }

  .quiz-mark {
    width: min(70vw, 320px);
  }

  .preamble-card {
    width: min(100%, 460px);
    min-height: 0;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .mode-card {
    min-height: 330px;
  }
}

@media (max-width: 680px) {
  .author-banner {
    min-height: 46px;
    padding-inline: 12px;
  }

  .author-banner strong {
    letter-spacing: 0.1em;
  }

  .author-banner span {
    font-size: 10px;
  }

  .page-shell {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    min-height: 104px;
    gap: 10px;
  }

  .sound-label,
  .brand-subtitle {
    display: none;
  }

  .brand-logo {
    width: 54px;
    height: 54px;
  }

  .header-quiz-mark {
    width: 84px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0;
  }

  .hero-grid {
    gap: 32px;
    margin: 18px 0 42px;
    padding: 40px 22px 28px;
    background:
      linear-gradient(90deg, rgba(4, 16, 35, 0.98) 0%, rgba(7, 24, 49, 0.92) 58%, rgba(7, 24, 49, 0.5) 100%),
      url("./assets/constitution-hero.png") 67% center / cover no-repeat;
    border-radius: 20px 3px 20px 3px;
  }

  .quiz-mark {
    width: min(76vw, 280px);
  }

  h1 {
    font-size: clamp(40px, 12vw, 52px);
    letter-spacing: -0.055em;
  }

  .hero-stats {
    gap: 20px;
  }

  .hero-stats div {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .preamble-card {
    min-height: 0;
    padding: 78px 24px 30px;
  }

  .preamble-card p {
    font-size: 22px;
  }

  .quote-logo {
    top: 12px;
    right: 14px;
    width: 72px;
    height: 72px;
  }

  .section-heading {
    display: block;
  }

  .section-heading > p {
    margin-top: 10px;
  }

  .learn-strip {
    grid-template-columns: auto 1fr;
  }

  .learn-strip a {
    grid-column: 2;
  }

  footer {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

  .game-screen {
    padding-top: 26px;
  }

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

  .mode-pill {
    display: none;
  }

  .answer-grid {
    grid-template-columns: 1fr;
  }

  .question-card {
    padding: 26px 18px;
    border-radius: 16px;
  }

  .question-card h2 {
    margin-bottom: 24px;
    font-size: 27px;
  }

  .question-meta {
    align-items: flex-start;
  }

  .difficulty span {
    display: none;
  }

  .hud {
    justify-content: stretch;
  }

  .hud-item {
    min-width: 0;
    flex: 1;
  }

  .question-actions {
    align-items: center;
  }

  .keyboard-hint {
    display: none;
  }

  #next-question {
    width: 100%;
  }

  .result-card {
    padding: 38px 18px;
  }

  .result-actions {
    display: grid;
  }

  .result-actions button {
    width: 100%;
  }
}

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