/* ── Zip Blitz — THE ROUND'S PILL AS THE COUNTDOWN (countpill.css; countpill.js runs it) ──
   Moved from trivia.html unchanged (2026-11-21) so List Blitz's pre-round is the same pill:
   trivia.html and list.html both link this.
   WHERE THE PILL SITS, HOW TALL IT IS, AND WHERE THE FACE-OFF STARTS UNDER IT LIVE HERE, ONCE
   (George, 2026-11-22: List Blitz's pill sat at the top of the screen under Back because
   list.html had its own copy of the place; "why isn't it using the same code"). Each page
   says only how far down its face-off may run (its bar differs). launch.css mirrors the two
   numbers for index.html, which does not load this file (tests/invite_screens.test.mjs). */
:root {
  /* In vh, because the carousel's art is placed in vh: 26.07vh = 220px on an 844 screen.
     Read by the countdown's pill, trivia's intro carousel, and both games' face-offs. */
  --pill-top: 26.07vh;
  /* ONE HEIGHT for both pills on these screens -- the round pill (.countdown-tier) and the
     invite pill (.t-league): the ladder dot's own 34 x 1.25. */
  --pill-h: 42.5px;
}
/* THE FACE-OFF UNDER THE PILL (faceoff.css draws it; this is where it starts): 16px below
   the pill, out of the flow so whatever is under it lays out as it would without it. A
   screen too short for both (.tall, measured by FACEOFF.start) gives the cards the height,
   and the page hides its pill until they land. The page sets only `bottom`. */
.cd-faceoff { position: absolute; left: 0; right: 0; top: calc(var(--pill-top) + var(--pill-h) + 16px); }
.cd-faceoff.tall { top: calc(var(--sat, env(safe-area-inset-top, 0px)) + 60px); }
.countdown-tier {
  display: none; position: absolute; top: var(--pill-top); left: 50%;
  transform: translateX(-50%);
  align-items: center; justify-content: center;
  width: 128px; height: var(--pill-h); border-radius: 999px;
  color: #fff; font-family: var(--font-ui); font-weight: 700;
  font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase;
  /* THE SAME LINE BOX AS THE RUNG THIS IS TAKING OVER FROM. .zl-label sets
     line-height:1 and this inherited `normal`, so at every handover into the
     countdown — the carousel's, the one between rounds, and Home's across the
     navigation — the capsule held still and the WORD inside it dropped a pixel.
     Nothing structural can see that: same text, same box, same colour, one
     pixel of ink. All four are scanned by tests/invite_screens.test.mjs, and the
     one that crosses the navigation is measured in pixels by
     tests/e2e/round-launch.e2e.test.mjs. */
  line-height: 1;
}
.countdown-tier.on { display: flex; }
/* THE PILL IS THE COUNTDOWN (George, 2026-11-14). With a face-off there is no 3-2-1:
   the round's pill runs out of colour from right to left while everyone is introduced,
   and the round starts as it empties (_faceoffCount). The empty part is this ::after, a
   copy of the label in the tier's own dark on its tint, uncovered from the right by a
   clip-path KEYFRAME animation (never a transition: an idle WKWebView can freeze one,
   CLAUDE.md), with .cd-drained pinning the end state. It starts 600ms in, because
   between rounds the launch's own copy of this pill holds over it until then (launch.js
   DONE_AT - HANDOVER_AT), and runs out by the count's end at 2.7s. visibility: inherit,
   so a tall face-off that hides the pill hides this with it. */
.countdown-tier::after {
  content: attr(data-label); position: absolute; inset: 0; border-radius: inherit;
  display: flex; align-items: center; justify-content: center; visibility: hidden;
  background: #EAF2EC; background: color-mix(in srgb, var(--tier-c, var(--accent)) 16%, var(--bg));
  color: var(--tier-d, var(--accentDeep));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tier-c, var(--accent)) 45%, transparent);
  clip-path: inset(0 0 0 100%);
}
.countdown-tier.cd-drain::after { visibility: inherit; animation: cdTierDrain 2100ms linear var(--cd-drain-delay, 600ms) both; }
.countdown-tier.cd-drain.cd-held::after { animation-play-state: paused; }
.countdown-tier.cd-drained::after { visibility: inherit; animation: none; clip-path: inset(0 0 0 0); }
@keyframes cdTierDrain { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
/* A small swell on each beat (the haptic's moment), and a glow as it empties. The
   transform keeps the pill's own centring. */
.countdown-tier.cd-beat { animation: cdTierBeat 0.32s ease-out; }
.countdown-tier.cd-drained { animation: cdTierEmpty 0.6s ease-out; }
@keyframes cdTierBeat { from { transform: translateX(-50%) scale(1.06); } to { transform: translateX(-50%) scale(1); } }
@keyframes cdTierEmpty {
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tier-c, var(--accent)) 55%, transparent); }
  to   { box-shadow: 0 0 0 14px transparent; }
}
@media (prefers-reduced-motion: reduce) { .countdown-tier.cd-beat, .countdown-tier.cd-drained { animation: none; } }
