:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #102030;
  --muted: #5f6d7a;
  --blue: #1267c9;
  --blue-dark: #0d4f9b;
  --green: #1c8f55;
  --red: #c43d3d;
  --border: #d8e1ec;
  --shadow: 0 20px 60px rgba(16, 32, 48, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(18, 103, 201, 0.16), transparent 34rem),
    linear-gradient(135deg, #f8fbff, var(--bg));
}

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

.hero {
  margin-bottom: 24px;
}

.hero h1 {
  max-width: 760px;
  margin: 8px 0 12px;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.hero p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 36px);
  backdrop-filter: blur(10px);
}

.setup {
  display: grid;
  grid-template-columns: 1fr minmax(160px, 220px) auto;
  gap: 18px;
  align-items: end;
}

h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.setup p,
.results p {
  color: var(--muted);
  line-height: 1.55;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

select,
button {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font: inherit;
}

select {
  padding: 0 12px;
  background: white;
}

button {
  cursor: pointer;
  padding: 0 18px;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

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

.primary {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.primary:hover:not(:disabled) {
  background: var(--blue-dark);
}

.ghost {
  color: var(--blue);
  background: #eef6ff;
  border-color: #cfe3fb;
}

.quiz-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;
}

.scorebox {
  min-width: 140px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f8fbff;
  text-align: right;
}

.scorebox span,
.scorebox strong {
  display: block;
}

.scorebox span {
  color: var(--muted);
  font-size: 0.9rem;
}

.scorebox strong {
  margin-top: 4px;
  font-size: 1.1rem;
}

.progress {
  height: 12px;
  margin: 24px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e5edf6;
}

.progress div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue), #1cba7d);
  transition: width 240ms ease;
}

.options {
  display: grid;
  gap: 12px;
}

.option {
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  color: var(--ink);
  background: white;
  border: 2px solid var(--border);
  text-align: left;
}

.option.correct {
  border-color: rgba(28, 143, 85, 0.45);
  background: #eaf8f1;
}

.option.wrong {
  border-color: rgba(196, 61, 61, 0.45);
  background: #fff0f0;
}

.feedback {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  line-height: 1.55;
}

.feedback.ok {
  color: #0d5434;
  background: #eaf8f1;
  border: 1px solid rgba(28, 143, 85, 0.25);
}

.feedback.error {
  color: #6f2222;
  background: #fff0f0;
  border: 1px solid rgba(196, 61, 61, 0.25);
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.review-item {
  margin: 14px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f8fbff;
}

.review-item strong {
  display: block;
  margin-bottom: 6px;
}

.review-item p {
  margin: 6px 0 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 980px);
    padding: 24px 0;
  }

  .setup,
  .quiz-top {
    grid-template-columns: 1fr;
  }

  .scorebox {
    text-align: left;
  }

  .actions {
    flex-direction: column-reverse;
  }

  .actions button,
  .setup button {
    width: 100%;
  }
}
