:root {
  --bg: #0b1220;
  --panel: #121a2b;
  --panel-2: #182338;
  --text: #e8eefc;
  --muted: #9aa8c7;
  --accent: #5b9dff;
  --accent-2: #3dd6c6;
  --good: #3ecf8e;
  --bad: #ff6b7a;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(91, 157, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(61, 214, 198, 0.12), transparent 50%),
    var(--bg);
}

.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.header h1 {
  margin: 0.2rem 0 0.75rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
}

.disclaimer {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.disclaimer a { color: var(--accent); }

.panel {
  margin-top: 1.25rem;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem 1.4rem;
}

.controls {
  display: grid;
  gap: 0.9rem;
}

.controls label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

select, button, .button-link {
  font: inherit;
}

select {
  appearance: none;
  background: #0d1524;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}

button, .button-link {
  border: 0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.primary {
  background: linear-gradient(135deg, var(--accent), #7a6cff);
  color: white;
  font-weight: 650;
}

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

button.ghost, .button-link {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.hidden { display: none !important; }

.progress-row { margin-bottom: 1rem; }
.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}
.progress-bar {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}
#progressFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.25s ease;
}

.topic-tag {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(91, 157, 255, 0.12);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}

#questionText {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  line-height: 1.35;
}

.choices {
  display: grid;
  gap: 0.6rem;
}

.choice {
  text-align: left;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  transition: border-color 0.15s, background 0.15s;
}

.choice:hover:not(:disabled) {
  border-color: rgba(91, 157, 255, 0.5);
  background: rgba(91, 157, 255, 0.08);
}

.choice.correct {
  border-color: var(--good);
  background: rgba(62, 207, 142, 0.12);
}

.choice.wrong {
  border-color: var(--bad);
  background: rgba(255, 107, 122, 0.12);
}

.feedback {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  line-height: 1.45;
}

.feedback strong { color: var(--text); }
.feedback .sources { margin-top: 0.45rem; font-size: 0.85rem; }

.nav-row {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}

.result-summary {
  font-size: 1.15rem;
  line-height: 1.4;
}

.missed {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}

.missed h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.muted { color: var(--muted); }

.footer {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.footer code {
  background: rgba(255,255,255,0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  font-size: 0.8rem;
}
