:root {
  color-scheme: light;
  --bg: #f4efe6;
  --card: #fffaf1;
  --ink: #1f2933;
  --muted: #64748b;
  --line: #ddcdb4;
  --accent: #8f3f21;
  --accent-dark: #6f2d18;
  --success: #166534;
  --error: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, #ffe3c2, transparent 28rem), var(--bg);
  color: var(--ink);
  font: 18px/1.55 Georgia, "Times New Roman", serif;
}

.shell {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  padding: 42px 0;
}

.hero {
  margin-bottom: 22px;
}

.hero h1,
.card h2 {
  margin: 0 0 8px;
  line-height: 1.05;
}

.hero h1 {
  font-size: clamp(3rem, 11vw, 6.5rem);
  letter-spacing: -0.08em;
}

.hero p,
.meta,
.question-text {
  max-width: 760px;
}

.eyebrow {
  color: var(--accent);
  font: 700 0.78rem/1.2 system-ui, sans-serif;
  letter-spacing: 0.16em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.card {
  background: color-mix(in srgb, var(--card) 92%, white);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(68, 45, 24, 0.13);
  padding: clamp(20px, 4vw, 42px);
}

.start-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  max-width: 520px;
}

label,
legend {
  color: var(--muted);
  font: 700 0.88rem/1.2 system-ui, sans-serif;
}

input[type="number"] {
  border: 1px solid var(--line);
  border-radius: 14px;
  font: inherit;
  padding: 13px 14px;
  width: 100%;
}

button {
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  color: white;
  cursor: pointer;
  font: 800 0.92rem/1 system-ui, sans-serif;
  padding: 15px 22px;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.notice {
  border-radius: 16px;
  margin: 18px 0;
  padding: 14px 16px;
}

.notice.error {
  background: #fff1f0;
  color: var(--error);
}

.notice.success {
  background: #edfdf3;
  color: var(--success);
}

.choices {
  border: 0;
  display: grid;
  gap: 12px;
  margin: 24px 0;
  padding: 0;
}

.choice {
  align-items: start;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: auto auto 1fr;
  padding: 16px;
}

.choice.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
}

.choice-key {
  color: var(--accent);
  font-weight: 800;
}

.correct-answer {
  border-left: 4px solid var(--accent);
  padding-left: 14px;
}

.explanations {
  display: grid;
  gap: 14px;
  margin: 18px 0 26px;
}

.explanation {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.explanation.correct {
  border-color: color-mix(in srgb, var(--success) 55%, var(--line));
}

.explanation.selected {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
}

.explanation h4 {
  margin: 0 0 8px;
}

.explanation p {
  margin: 0;
}

.score-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 24px 0;
}

.score-grid div {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.score-grid span,
.score-grid small {
  display: block;
}

.score-grid span {
  font-size: clamp(1.8rem, 7vw, 3rem);
  font-weight: 800;
  line-height: 1;
}

.score-grid small {
  color: var(--muted);
  font: 700 0.82rem/1.2 system-ui, sans-serif;
  margin-top: 8px;
  text-transform: uppercase;
}

@media (max-width: 680px) {
  body {
    font-size: 16px;
  }

  .shell {
    padding: 24px 0;
    width: min(100% - 16px, 980px);
  }

  .start-form,
  .score-grid {
    grid-template-columns: 1fr;
  }

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

  .choice input {
    grid-row: span 2;
  }
}
