/* Year Zero: Zero-In's card, board and clock (style.css), plus the year box and the reveal.
   Everything here is scoped under body.yearzero so Zero-In never sees it. */
body.yearzero .stage .round, body.yearzero .final .round { margin: 0 0 -8px; }
body.yearzero .rules { margin: -6px 0 0; text-align: center; color: var(--muted); font-size: 15px; line-height: 1.45; }
body.yearzero.intro .prompt { text-align: center; }
body.yearzero .board .flap:empty, body.yearzero .board .flap { min-width: 0; }

/* The year box and the BC | AD switch: one row with Lock it in. Both are real tap targets (48px).
   The switch is two radio buttons drawn as one segmented control: one tap flips the era. */
body.yearzero .yearform { display: flex; gap: 8px; align-items: stretch; }
body.yearzero .yearfield { flex: 1 1 auto; min-width: 0; display: flex; gap: 8px; }
body.yearzero #year { flex: 1 1 auto; min-width: 0; width: 100%; min-height: 48px; font: 600 22px var(--body); padding: 10px 14px; border-radius: 12px;
  border: 1.5px solid var(--field); background: var(--bg); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
body.yearzero #era { flex: none; display: flex; min-height: 48px; border-radius: 12px; border: 1.5px solid var(--field); background: var(--bg); overflow: hidden; }
body.yearzero #era input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap; }
body.yearzero #era label { display: flex; align-items: center; justify-content: center; min-width: 48px; padding: 0 12px; font: 700 18px var(--body); color: var(--muted);
  cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
body.yearzero #era label + input + label { border-left: 1.5px solid var(--field); }
body.yearzero #era input:checked + label { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { body.yearzero #era input:checked + label { color: #0f1418; } }   /* the dark accent is light: dark ink reads on it */
body.yearzero #year:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
body.yearzero #era:has(input:focus-visible) { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
body.yearzero #go { flex: none; min-height: 48px; }
body.yearzero .hint { margin: -10px 0 0; text-align: center; color: var(--bad); font-size: 14px; font-weight: 600; }
@media (prefers-color-scheme: dark) { body.yearzero .hint { color: #ff8f85; } }

/* The reveal: the verdict, then one short line about the event. */
body.yearzero .fact { margin: -8px 0 0; text-align: center; color: var(--muted); font-size: 15px; line-height: 1.45; }

/* The score screen: one row per question, the score at the right. */
body.yearzero .yzrecap li { grid-template-columns: minmax(0, 1fr) auto; }
body.yearzero .yzrecap small { color: var(--muted); font-size: 13px; }
body.yearzero .yzrecap .n { min-width: 3ch; }
body.yearzero .later { display: grid; gap: 6px; }
body.yearzero .foot .other { color: #9aa3ad; }

/* A wide number: the board grows a flap, so shrink the flaps a little to keep it on a phone. */
@media (max-width: 560px) {
  body.yearzero .board:has(.flap:nth-child(5)) .flap { width: 44px; height: 64px; font-size: 50px; line-height: 64px; }
  body.yearzero .board:has(.flap:nth-child(5)) .flap .leaf { line-height: 64px; }
  body.yearzero #go { padding-inline: 12px; }
  body.yearzero #era label { min-width: 44px; padding: 0 8px; }
}

/* Phone keypad open: keep the question, clock and the year box above it. */
body.yearzero.kb #stage .fact { display: none; }

/* A step circle holding a three- or four-digit score: smaller digits so it fits the circle. */
body.yearzero .steps li.wide { font-size: 12px; letter-spacing: -.03em; }
body.yearzero.kb .steps li.wide { font-size: 9px; }

/* The reveal: the right year on the big board, your year on a smaller one under it, clicking
   toward the answer while "years off" counts up beside it. */
body.yearzero .reveal { display: grid; gap: 6px; justify-items: center; }
body.yearzero .reveal .yrow { display: flex; align-items: center; justify-content: center; gap: 10px; }
body.yearzero .reveal .era { font: 600 22px var(--board); color: var(--ink); min-width: 1.6em; }
body.yearzero .reveal .era:empty { display: none; }
body.yearzero .reveal .ylabel { margin: -2px 0 6px; font: 700 12px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
body.yearzero .reveal .you { flex-wrap: wrap; gap: 8px 10px; }
body.yearzero .reveal .ytag { font: 700 12px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
body.yearzero .board.small { padding: 8px; gap: 4px; }
body.yearzero .board.small .flap { width: 34px; height: 48px; font-size: 38px; line-height: 48px; }
body.yearzero .board.small .flap .leaf { line-height: 48px; }
body.yearzero .reveal .off { font: 700 17px var(--body); color: var(--ink); white-space: nowrap; }
body.yearzero .reveal .off b { font: 600 26px var(--board); font-variant-numeric: tabular-nums; }
body.yearzero .reveal .you.none .ytag::after { content: ""; }
body.yearzero .crowd, body.yearzero .teach { margin: -8px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
body.yearzero .checkfail { margin: 0; text-align: center; color: var(--bad); font-weight: 600; }
@media (prefers-color-scheme: dark) { body.yearzero .checkfail { color: #ff8f85; } }

/* Score screen extras: friends, leagues. */
body.yearzero .leagues { display: grid; gap: 10px; }
body.yearzero .league { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
body.yearzero .league h3 { margin: 0; font: 700 13px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
body.yearzero .board-rows li { grid-template-columns: minmax(0, 1fr) auto; cursor: pointer; }
body.yearzero .board-rows li .said { grid-column: 1 / -1; color: var(--muted); white-space: pre-line; }
body.yearzero #friends .said { white-space: pre-line; }
body.yearzero .board-rows li.you { background: transparent; box-shadow: inset 4px 0 0 #e8b400; color: var(--ink); }
body.yearzero .board-rows li.you .n { color: var(--ink); }
body.yearzero .leaguestart { display: grid; gap: 6px; }
body.yearzero .leaguestart label { font-size: 13px; color: var(--muted); }
body.yearzero .leaguestart input { font: 600 16px var(--body); padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--field); background: var(--bg); color: var(--ink); }
@media (max-width: 560px) {
  body.yearzero .board.small .flap { width: 30px; height: 42px; font-size: 32px; line-height: 42px; }
  body.yearzero .board.small .flap .leaf { line-height: 42px; }
}
body.yearzero.kb #stage .reveal { display: none; }
/* One divider above the leagues, not two; the league links sit close together. */
body.yearzero .leagues { border-top: 0; padding-top: 0; gap: 6px; }
body.yearzero .leagues:not(:has(.league)) { margin-top: -6px; }
body.yearzero .league .linkish, body.yearzero #leaguenew { justify-self: start; padding: 6px 0; }
