/*
 * Round Ten.
 *
 * One column, generous type, and a single accent that only ever marks the
 * thing you are meant to look at next. A quiz is read at speed on a phone
 * between other tasks, so the question is the largest thing on screen and the
 * chrome gets out of the way.
 *
 * Right and wrong are never carried by colour alone — each verdict also
 * changes its label and its icon, because roughly one man in twelve cannot
 * reliably separate the green from the red.
 */

:root {
  --ink: #16202c;
  --muted: #5d6b7a;
  --bg: #fbf9f5;
  --surface: #ffffff;
  --border: #e2ddd3;
  --navy: #1d3557;
  /* Text that sits on --navy. It has to flip with the scheme: in dark mode
     --navy becomes a light blue, and white on light blue is about 2:1. */
  --on-navy: #ffffff;
  --gold: #c8942a;
  --right: #1f6f43;
  --right-bg: #e8f3ec;
  --wrong: #a32b2b;
  --wrong-bg: #fbeceb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(22, 32, 44, .06), 0 8px 24px rgba(22, 32, 44, .05);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef1f5;
    --muted: #9aa7b6;
    --bg: #11161d;
    --surface: #182029;
    --border: #2a343f;
    --navy: #7fa8d6;
    --on-navy: #0d1319;
    --gold: #e0b24f;
    --right: #6cc191;
    --right-bg: #14291f;
    --wrong: #e58a84;
    --wrong-bg: #2b1817;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  padding: 0 16px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 10;
  background: var(--navy);
  color: var(--on-navy);
  padding: .6rem 1rem;
  border-radius: 8px;
}

/* ── header ─────────────────────────────────────────────────────────────── */
.site {
  max-width: 44rem;
  margin: 0 auto;
  padding-block: 2.2rem 1.4rem;
  text-align: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  background: var(--navy);
  color: var(--on-navy);
  font: 700 .95rem/1 var(--serif);
}
.brand-text {
  font: 700 1.5rem/1 var(--serif);
  letter-spacing: -0.01em;
}
.brand-sub {
  margin: .5rem 0 0;
  color: var(--muted);
  font-size: .9rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ── shared ─────────────────────────────────────────────────────────────── */
main { max-width: 44rem; margin: 0 auto; }
.view { padding-bottom: 3rem; }
.lede {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 34rem;
  margin: 0 auto 2rem;
  text-align: center;
}

.btn {
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  padding: .7rem 1.2rem;
}
.btn:hover { border-color: var(--navy); }
.btn.primary {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--on-navy);
}
.btn.primary:hover { filter: brightness(1.12); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ── round picker ───────────────────────────────────────────────────────── */
.rounds {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}
.round {
  width: 100%;
  text-align: left;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.round:hover { transform: translateY(-2px); border-color: var(--navy); }
.round-icon {
  display: block;
  color: var(--gold);
  font-size: 1.3rem;
  line-height: 1;
  margin-bottom: .55rem;
}
.round-name { display: block; font: 700 1.18rem/1.25 var(--serif); margin-bottom: .3rem; }
.round-blurb { display: block; color: var(--muted); font-size: .92rem; }
.round-best {
  display: block;
  margin-top: .7rem;
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ── quiz ───────────────────────────────────────────────────────────────── */
.quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.back {
  font: inherit;
  font-size: .9rem;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: .3rem 0;
}
.back:hover { color: var(--navy); }
.quiz-name {
  margin: 0;
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.progress { margin-bottom: 1.8rem; }
.progress-bar {
  height: 5px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--navy);
  border-radius: 999px;
  transition: width .3s ease;
}
.progress-text {
  margin: .5rem 0 0;
  font-size: .82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.question {
  font: 700 clamp(1.4rem, 4.6vw, 1.95rem)/1.25 var(--serif);
  margin: 0 0 1.4rem;
  letter-spacing: -0.01em;
}

.options { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; gap: .65rem; }
.option {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  font: inherit;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .85rem 1rem;
  box-shadow: var(--shadow);
}
.option:hover:not(:disabled) { border-color: var(--navy); }
.option:disabled { cursor: default; }
.option-key {
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: .82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.option.is-right {
  border-color: var(--right);
  background: var(--right-bg);
}
.option.is-right .option-key {
  background: var(--right);
  border-color: var(--right);
  color: #fff;
}
.option.is-wrong {
  border-color: var(--wrong);
  background: var(--wrong-bg);
}
.option.is-wrong .option-key {
  background: var(--wrong);
  border-color: var(--wrong);
  color: #fff;
}

.verdict {
  border-left: 3px solid var(--border);
  padding: .1rem 0 .1rem 1rem;
  margin: 0 0 1.4rem;
}
.verdict.right { border-left-color: var(--right); }
.verdict.wrong { border-left-color: var(--wrong); }
.verdict-line {
  margin: 0 0 .35rem;
  font-weight: 700;
  font-size: .95rem;
}
.verdict.right .verdict-line { color: var(--right); }
.verdict.wrong .verdict-line { color: var(--wrong); }
.verdict-why { margin: 0; color: var(--muted); font-size: .95rem; }

.next {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--navy);
  border: 1px solid var(--navy);
  color: var(--on-navy);
  border-radius: 10px;
  padding: .75rem 1.5rem;
}
.next:hover { filter: brightness(1.12); }
.hint {
  margin: 1.4rem 0 0;
  font-size: .82rem;
  color: var(--muted);
}
kbd {
  font: inherit;
  font-size: .78rem;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 .3rem;
  background: var(--surface);
}
@media (hover: none) { .hint { display: none; } }

/* ── result ─────────────────────────────────────────────────────────────── */
#view-result { text-align: center; }
.result-kicker {
  margin: 0;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.result-score {
  font: 700 clamp(3.4rem, 16vw, 5.5rem)/1 var(--serif);
  margin: .5rem 0 .6rem;
  color: var(--navy);
}
.result-score .of { font-size: .38em; color: var(--muted); }
.result-line { margin: 0 auto 1rem; max-width: 30rem; font-size: 1.05rem; }
.result-best { margin: 0 0 1.8rem; color: var(--gold); font-size: .88rem; letter-spacing: .05em; text-transform: uppercase; }
.result-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-bottom: 2.6rem; }

.review { text-align: left; border-top: 1px solid var(--border); padding-top: 1.6rem; }
.review h2 { font: 700 1.1rem/1.3 var(--serif); margin: 0 0 1rem; }
.review ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.review li { border-left: 3px solid var(--wrong); padding-left: 1rem; }
.review .rq { margin: 0 0 .3rem; font-weight: 600; }
.review .ra { margin: 0 0 .2rem; font-size: .92rem; }
.review .ra b { color: var(--right); }
.review .rw { margin: 0; font-size: .92rem; color: var(--muted); }

/* ── footer ─────────────────────────────────────────────────────────────── */
.site-foot {
  max-width: 44rem;
  margin: 0 auto;
  border-top: 1px solid var(--border);
  padding-block: 1.6rem 2.4rem;
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
}
.site-foot p { margin: 0 0 .4rem; }
.site-foot .small { font-size: .82rem; }
