:root {
  color-scheme: dark;
  --black: #000;
  --white: #fff;
  --soft-white: #dedede;
  --muted-white: #a8a8a8;
  --line: #404040;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--black);
}

body {
  min-height: 100vh;
  color: var(--white);
  font-family: Arial, Helvetica, sans-serif;
}

button { font: inherit; }

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--black);
}

.stage {
  width: min(100%, 1600px);
  aspect-ratio: 16 / 9;
  min-height: 720px;
  display: grid;
  grid-template-rows: 70px 5px 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--black);
}

.top-bar {
  display: grid;
  grid-template-columns: 150px 1fr 100px;
  align-items: center;
  gap: 24px;
  padding: 0 42px;
  border-bottom: 1px solid #1d1d1d;
  font-size: 17px;
  font-weight: 700;
}

.brand { font-size: 20px; letter-spacing: 0; }
.exam-name { color: var(--soft-white); text-align: center; }
.progress { text-align: right; font-variant-numeric: tabular-nums; }

.timer-meter {
  margin: 0 42px;
  overflow: hidden;
  background: #222;
}

.timer-meter div {
  width: 0;
  height: 100%;
  background: var(--white);
  transition: width .1s linear;
}

.timer-meter.paused div { background: #777; }

.screen {
  display: none;
  min-height: 0;
  padding: 38px 64px 44px;
}

.screen.active {
  display: block;
  animation: enter .25s ease-out;
}

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

.intro-screen,
.end-screen {
  align-self: center;
  max-width: 1220px;
  padding-left: 90px;
}

.eyebrow,
.question-meta,
.answer-label {
  margin: 0;
  color: var(--soft-white);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  max-width: 1100px;
  margin: 18px 0;
  font-size: 68px;
  line-height: 1.03;
}

.intro-screen h1 { font-size: 76px; }

.exam-code {
  margin: 12px 0 20px;
  color: var(--white);
  font-size: 54px;
  font-weight: 700;
  line-height: 1;
}

.subline {
  margin: 18px 0;
  color: var(--soft-white);
  font-size: 30px;
  line-height: 1.25;
}

.timing {
  margin: 34px 0 14px;
  color: var(--white);
  font-size: 22px;
}

.disclaimer {
  max-width: 980px;
  margin: 0 0 28px;
  color: var(--muted-white);
  font-size: 16px;
  line-height: 1.45;
}

button {
  border: 2px solid var(--white);
  border-radius: 4px;
  padding: 14px 24px;
  background: var(--white);
  color: var(--black);
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  background: var(--black);
  color: var(--white);
  outline: 2px solid var(--white);
  outline-offset: 4px;
}

.question-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 58px;
}

.countdown-badge {
  width: 58px;
  height: 58px;
  display: grid;
  flex: 0 0 58px;
  place-items: center;
  border: 2px solid var(--white);
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.quiz-screen h2 {
  max-width: 1380px;
  margin: 18px 0 22px;
  font-size: 34px;
  line-height: 1.2;
}

.long-question h2 { font-size: 29px; }

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.option {
  min-height: 94px;
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 16px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--black);
  color: var(--white);
  font-size: 22px;
  line-height: 1.25;
}

.letter {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--white);
  border-radius: 50%;
  font-weight: 700;
}

.option.correct {
  border: 3px solid var(--white);
  background: var(--white);
  color: var(--black);
}

.option.correct .letter {
  border-color: var(--black);
}

.option.dimmed {
  border-color: #222;
  color: #666;
}

.option.dimmed .letter { border-color: #555; }

.answer-mode { padding-top: 24px; }
.answer-mode .question-heading { min-height: 44px; }
.answer-mode .countdown-badge { width: 46px; height: 46px; flex-basis: 46px; font-size: 18px; }
.answer-mode h2 { margin: 8px 0 12px; font-size: 24px; }
.answer-mode .options { gap: 8px; }
.answer-mode .option { min-height: 55px; grid-template-columns: 34px 1fr; gap: 10px; padding: 8px 12px; font-size: 16px; }
.answer-mode .letter { width: 32px; height: 32px; }

.answer-panel {
  margin-top: 14px;
  padding: 16px 20px;
  border: 2px solid var(--white);
  background: var(--black);
}

.answer-panel h3 {
  margin: 7px 0 8px;
  font-size: 24px;
  line-height: 1.2;
}

.answer-panel > p:last-child {
  margin: 0;
  color: var(--soft-white);
  font-size: 18px;
  line-height: 1.35;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@media (max-width: 900px) {
  .app-shell { padding: 0; }
  .stage { width: 100%; min-height: 100vh; aspect-ratio: auto; border: 0; }
  .top-bar { grid-template-columns: 90px 1fr 60px; gap: 8px; padding: 0 16px; font-size: 12px; }
  .brand { font-size: 14px; }
  .timer-meter { margin: 0 16px; }
  .screen { padding: 28px 20px; }
  .intro-screen, .end-screen { padding-left: 26px; }
  .intro-screen h1, h1 { font-size: 48px; }
  .exam-code { font-size: 38px; }
  .quiz-screen h2, .long-question h2 { font-size: 25px; }
  .options { grid-template-columns: 1fr; }
  .option { min-height: 70px; font-size: 17px; }
}
