:root {
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e7eef9;
  background: #101827;
  line-height: 1.6;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: radial-gradient(circle at top left, rgba(76, 95, 168, 0.22), transparent 35%),
              #0d1726;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent 45%);
  pointer-events: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  background: rgba(10, 18, 36, 0.95);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1rem;
  background: #17233d;
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.field-label {
  color: #9fb4d4;
  font-size: 0.88rem;
}

select,
.button {
  font: inherit;
}

select {
  min-width: 140px;
  padding: 0.95rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(16, 24, 39, 0.95);
  color: #edf2f7;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.status-pill span {
  color: #a1b0d4;
  font-size: 0.85rem;
}

.status-pill strong {
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.page-shell {
  max-width: 1080px;
  margin: 2rem auto 3rem;
  padding: 0 1.5rem 1rem;
}

.hero-card,
.result-card {
  background: rgba(16, 24, 39, 0.95);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 30px 70px rgba(0,0,0,0.15);
}

.hero-card {
  display: grid;
  gap: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: #8ba0d2;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
}

h1, h2 {
  margin: 0;
  color: #f8fafc;
  line-height: 1.1;
}

.lead,
.result-summary,
.quiz-subtitle,
.wrong-answer p,
.alert {
  color: #c3cee4;
}

.lead {
  margin: 0;
  max-width: 60ch;
}

.hidden {
  display: none !important;
}

.button {
  border: none;
  cursor: pointer;
  border-radius: 0.95rem;
  padding: 0.95rem 1.4rem;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button.primary {
  background: linear-gradient(135deg, #4f7fff, #2e5bf9);
  color: white;
  box-shadow: 0 18px 30px rgba(72, 103, 255, 0.2);
}

.button.secondary {
  background: rgba(255,255,255,0.07);
  color: #d8e0f0;
  border: 1px solid rgba(255,255,255,0.12);
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.question-list {
  display: grid;
  gap: 1.5rem;
}

.quiz-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

.question-card,
.answer-detail {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1.25rem;
  padding: 1.5rem;
}

.question-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.question-card p {
  margin: 0 0 1rem;
}

.choice-group {
  display: grid;
  gap: 0.85rem;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid transparent;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.choice input {
  margin-top: 0.2rem;
}

.choice label {
  margin: 0;
  cursor: pointer;
  color: #e5ecff;
}

.choice:hover,
.choice input:focus-visible ~ span,
.choice input:focus-visible {
  border-color: rgba(79, 127, 255, 0.45);
}

.choice.selected {
  border-color: #70a2ff;
  background: rgba(79, 127, 255, 0.16);
}

.choice.correct {
  border-color: #2ed69a;
  background: rgba(46, 214, 154, 0.12);
}

.choice.incorrect {
  border-color: #f55f6f;
  background: rgba(245, 95, 111, 0.12);
}

.wrong-answers {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.answer-detail h3 {
  margin: 0 0 0.75rem;
}

.answer-detail p {
  margin: 0.5rem 0;
}

.answer-detail strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #fff;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-end;
}

.score-time {
  color: #e5ecff;
  font-weight: 600;
}

.explanation {
  margin-top: 0.8rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
}

.alert {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  background: rgba(248, 113, 113, 0.95);
  color: white;
  min-width: 280px;
  text-align: center;
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .quiz-header {
    flex-direction: column;
    align-items: stretch;
  }
}
