:root { color-scheme: light dark; --ok: #1a8f3c; --bad: #c62828; --accent: #1565c0; --muted: #666; --bg: #f5f6f8; --card: #fff; --border: #ddd; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #15171a; --card: #1f2226; --border: #333; --muted: #999; --accent: #64a0ff; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 17px/1.45 system-ui, sans-serif; background: var(--bg); color: CanvasText; }
#app { max-width: 820px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); margin-bottom: 8px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent); }
.media { width: 100%; aspect-ratio: 16 / 9; max-height: 460px; object-fit: contain; background: #000; border-radius: 8px; display: block; }
.video-wrap { position: relative; }
.play { position: absolute; inset: 0; margin: auto; width: fit-content; height: fit-content; font-size: 1.1em; padding: 14px 22px; }
.question { font-size: 1.15em; font-weight: 600; margin: 14px 0; }
.answers { display: grid; gap: 8px; }
.answers.tn { grid-template-columns: 1fr 1fr; }
button { font: inherit; padding: 12px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: inherit; cursor: pointer; text-align: left; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.selected { border: 2px solid var(--accent); }
button.correct { border: 2px solid var(--ok); background: color-mix(in srgb, var(--ok) 15%, transparent); }
button.wrong { border: 2px solid var(--bad); background: color-mix(in srgb, var(--bad) 15%, transparent); }
button.primary { background: var(--accent); color: #fff; border: none; text-align: center; }
.actions { display: flex; justify-content: flex-end; margin-top: 14px; }
label { display: block; margin: 10px 0; }
select { font: inherit; padding: 6px; }
.score { font-size: 1.6em; font-weight: 700; }
.pass { color: var(--ok); } .fail { color: var(--bad); }
details { border-top: 1px solid var(--border); padding: 8px 0; }
summary { cursor: pointer; }
.muted { color: var(--muted); }

@media (max-width: 600px) {
  #app { padding: 0 0 16px; }
  .card { border-radius: 0; border-inline: 0; }
  .card > .media, .card > .video-wrap { margin-inline: -16px; width: calc(100% + 32px); }
  .media { border-radius: 0; max-height: none; }
  .answers button { min-height: 56px; }
  .actions button { width: 100%; padding: 16px; }
}
/* phone turned sideways: the video fills the screen, leaving room for the counter/timer bar above it */
@media (orientation: landscape) and (max-height: 500px) {
  #app { padding: 0; max-width: none; }
  .card { border: 0; border-radius: 0; padding: 8px 16px; }
  .media { height: calc(100svh - 48px); max-height: none; border-radius: 0; }
}
