:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --inset: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-tint: rgba(99, 102, 241, 0.12);
  --correct: #16a34a;
  --wrong: #dc2626;
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.12);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171717;
    --surface: #262626;
    --inset: #1c1c1c;
    --text: #e5e5e5;
    --muted: #a3a3a3;
    --correct: #22c55e;
    --wrong: #ef4444;
    --accent-tint: rgba(99, 102, 241, 0.18);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.title {
  font-size: 1.75rem;
  margin: 0 0 1.5rem;
  text-align: center;
}

.close-button {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 1.75rem;
  line-height: 1;
  box-shadow: var(--shadow);
}

@media (hover: hover) {
  .close-button:hover {
    color: var(--accent);
  }
}

.landing {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  text-align: center;
}

.landing-title {
  font-size: 3rem;
  margin: 0;
}

.landing-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.landing-button {
  width: auto;
  min-width: 240px;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.quiz {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.progress {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.prompt {
  margin: 0 0 1.5rem;
  font-size: 1.375rem;
  line-height: 1.3;
}

.hint {
  margin: -1rem 0 1rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.option {
  text-align: left;
  padding: 0.875rem 1rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--inset);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

@media (hover: hover) {
  .option:hover {
    border-color: var(--accent);
  }
}

.option--selected {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.primary {
  width: 100%;
  padding: 0.875rem 1rem;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

@media (hover: hover) {
  .primary:hover:not(:disabled) {
    background: var(--accent-hover);
  }
}

.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.review {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.review-item {
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--inset);
  border: 1px solid rgba(120, 120, 120, 0.2);
  border-left: 4px solid var(--muted);
}

.review-item--correct {
  border-left-color: var(--correct);
}

.review-item--wrong {
  border-left-color: var(--wrong);
}

.review-prompt {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.review-answer {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.review-answer--correct {
  color: var(--correct);
}

.review-page {
  font-weight: 600;
  color: var(--text);
}
