:root {
  color-scheme: dark;
  --bg: #071426;
  --panel: #0c1f36;
  --panel-2: #102a48;
  --text: #f4f8ff;
  --muted: #a8b8cc;
  --blue: #4aa3ff;
  --blue-2: #78c4ff;
  --green: #27d17f;
  --red: #ff5f6d;
  --border: rgba(255,255,255,.14);
  --shadow: 0 24px 80px rgba(0,0,0,.38);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  background: radial-gradient(circle at top left, #123a63 0, #071426 34%, #040b14 100%);
  color: var(--text);
}

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

.stage {
  width: min(96vw, 1420px);
  aspect-ratio: 16 / 9;
  min-height: 620px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(9,28,49,.98), rgba(6,16,30,.98));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

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

.progress { color: var(--blue-2); }

.meter {
  height: 6px;
  background: rgba(255,255,255,.08);
}

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

.timer-meter {
  height: 10px;
  background: rgba(255,255,255,.10);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

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

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

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

.screen.active {
  display: block;
  animation: enter .45s ease forwards;
}

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

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

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

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

h2 {
  margin: 22px 0 0;
  color: #d8e8fb;
  font-size: clamp(26px, 2.6vw, 42px);
  font-weight: 650;
  letter-spacing: 0;
}

.disclaimer {
  max-width: 900px;
  margin: 34px 0;
  color: var(--muted);
  font-size: 26px;
  line-height: 1.35;
}

button {
  border: 1px solid rgba(255,255,255,.16);
  background: var(--panel-2);
  color: var(--text);
  padding: 14px 18px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: var(--blue);
  background: #16395f;
}

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

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  color: var(--blue-2);
  font-size: 22px;
  font-weight: 800;
}

.countdown-badge {
  float: right;
  min-width: 110px;
  margin: 0 0 16px 24px;
  padding: 12px 18px;
  border: 1px solid rgba(120,196,255,.55);
  background: rgba(74,163,255,.14);
  color: var(--text);
  text-align: center;
  font-size: clamp(34px, 3.6vw, 58px);
  line-height: 1;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

.quiz-screen h1 {
  font-size: clamp(34px, 3.7vw, 58px);
  line-height: 1.12;
}

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

.option {
  min-height: 104px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  background: rgba(16,42,72,.72);
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: center;
  font-size: clamp(21px, 1.85vw, 30px);
  line-height: 1.2;
}

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

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

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

.option.incorrect {
  border-color: rgba(255,95,109,.62);
  background: rgba(255,95,109,.10);
}

.answer-panel {
  margin-top: 28px;
  padding: 24px 28px;
  background: rgba(6,16,30,.66);
  border: 1px solid var(--border);
}

.answer-panel h2 {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 30px;
}

.answer-panel p, .answer-panel li {
  font-size: clamp(18px, 1.45vw, 23px);
  line-height: 1.35;
  color: #e6f1ff;
}

.answer-panel h3 {
  margin: 18px 0 8px;
  color: var(--blue-2);
  font-size: 22px;
}

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

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

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

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

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

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

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