:root {
  color-scheme: dark;
  --bg: #061425;
  --panel: #0d223a;
  --panel-2: #122f50;
  --text: #f7fbff;
  --muted: #aebfd3;
  --blue: #4aa3ff;
  --blue-soft: #8bc9ff;
  --green: #28d17c;
  --red: #ff6673;
  --border: rgba(255,255,255,.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(45, 115, 180, .42), transparent 34%),
    linear-gradient(135deg, #061425, #030914);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 0;
  padding: 24px;
}

.stage {
  width: min(96vw, 1440px);
  aspect-ratio: 16 / 9;
  min-height: 620px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(9, 28, 50, .98), rgba(5, 14, 27, .99));
  box-shadow: 0 26px 86px rgba(0,0,0,.45);
}

.top-bar, footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px 34px;
  color: var(--muted);
  font-weight: 800;
}

.brand, .progress { color: var(--blue-soft); }

.timer-meter {
  width: calc(100% - 68px);
  margin: 0 34px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  height: 8px;
  background: rgba(74,163,255,.10);
}

.timer-meter div {
  height: 100%;
  width: 0;
  transition: width .25s linear;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.timer-meter.paused div { background: linear-gradient(90deg, #ffd166, #f59e0b); }

.screen {
  display: none;
  padding: 42px 64px;
  opacity: 0;
  transform: translateY(12px);
}

.screen.active {
  display: block;
  animation: fadeIn .42s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; transform: translateY(0); }
}

.intro-screen, .end-screen {
  align-self: center;
  max-width: 1120px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--blue-soft);
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 78px);
  line-height: 1.03;
  letter-spacing: 0;
}

h2 {
  margin: 20px 0 0;
  color: #dcecff;
  font-size: clamp(26px, 2.6vw, 42px);
  line-height: 1.15;
}

.subline {
  max-width: 980px;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.35;
  color: var(--muted);
}

.disclaimer {
  max-width: 980px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: clamp(13px, 1.1vw, 16px);
  line-height: 1.45;
}

button {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  padding: 14px 18px;
  font-size: 18px;
  font-weight: 850;
  cursor: pointer;
}

button:hover {
  border-color: var(--blue);
  background: #17416e;
}

.primary {
  padding: 18px 28px;
  font-size: 22px;
  background: #1269b8;
}

.countdown-badge {
  float: right;
  min-width: 82px;
  margin: 0 0 16px 24px;
  padding: 8px 12px;
  border: 1px solid rgba(139,201,255,.26);
  border-radius: 12px;
  background: rgba(74,163,255,.08);
  color: var(--muted);
  text-align: center;
  font-size: clamp(20px, 2vw, 30px);
  line-height: 1;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

.quiz-screen h1 {
  font-size: clamp(32px, 3.2vw, 52px);
  line-height: 1.16;
}

.quiz-screen.answer-mode {
  padding-top: 30px;
}

.quiz-screen.answer-mode h1 {
  font-size: clamp(24px, 2.5vw, 40px);
  line-height: 1.12;
}

.options {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.quiz-screen.answer-mode .options {
  margin-top: 18px;
  gap: 12px;
}

.option {
  min-height: 98px;
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(18, 47, 80, .72);
  font-size: clamp(20px, 1.7vw, 28px);
  line-height: 1.22;
}

.quiz-screen.answer-mode .option {
  min-height: 68px;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  padding: 11px 14px;
  font-size: clamp(16px, 1.25vw, 21px);
  line-height: 1.18;
}

.letter {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(74,163,255,.15);
  color: var(--blue-soft);
  border: 1px solid rgba(255,255,255,.18);
  font-weight: 950;
}

.quiz-screen.answer-mode .letter {
  width: 38px;
  height: 38px;
  border-radius: 9px;
}

.option.correct {
  border-color: rgba(40,209,124,.9);
  background: rgba(40,209,124,.16);
}

.option.correct .letter {
  background: var(--green);
  color: #03130a;
}

.option.incorrect {
  border-color: rgba(255,102,115,.72);
  background: rgba(255,102,115,.11);
}

.answer-panel {
  margin-top: 16px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(3, 11, 20, .68);
}

.answer-panel h2 {
  margin: 0 0 8px;
  color: var(--green);
  font-size: clamp(20px, 1.6vw, 26px);
  line-height: 1.16;
}

.answer-panel h3 {
  margin: 10px 0 6px;
  color: var(--blue-soft);
  font-size: 18px;
}

.answer-panel p, .answer-panel li {
  color: #e8f3ff;
  font-size: clamp(14px, 1.05vw, 18px);
  line-height: 1.26;
}

.answer-panel ul {
  margin: 0;
  padding-left: 20px;
}

footer {
  min-height: 58px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 17px;
}

.hidden-footer {
  display: none;
}

.controls {
  width: min(96vw, 1440px);
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.toggle {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(18, 47, 80, .72);
  font-weight: 850;
}

.toggle input { width: 20px; height: 20px; }

.shortcuts {
  width: 100%;
  margin: 2px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 900px) {
  .app-shell { padding: 12px; }
  .stage { aspect-ratio: auto; min-height: 820px; }
  .screen { padding: 28px 22px; }
  .top-bar, footer { padding: 14px 20px; }
  .options { grid-template-columns: 1fr; }
}
