/* ── Zip Blitz — THE FACE-OFF's look (faceoff.js moves it) ───────────────────────
   GHOSTS_SPEC.md "Countdown", George 2026-10-26. ONE look for every round: the daily,
   archive days, topics, challenges, invites (trivia.html) and multiplayer
   (versus.html). A page places .cd-faceoff (its position and height) and owns the bar
   the discs land on; everything here is shared, so the two cannot drift.
   Requires the page's tokens: --surface --rule --text --cool --gold --accentDeep
   --font-display --font-ui, and --t-accent or --accent. */
.cd-faceoff {
  display: none;
  flex-direction: column; align-items: center; justify-content: flex-start; gap: 14px;
  padding: 0 20px; pointer-events: none;
}
.cd-faceoff.on { display: flex; }
/* SAFE CENTRE: centred while the cards fit, and when they do not, the overflow goes
   DOWN, never up. Plain justify-content:center split an overflow both ways, so a
   face-off a few pixels too tall for its box rose into the round's pill, which sits
   16px above it (George, 2026-11-11). Auto margins do what 'safe center' does and work
   on every WebKit we ship to: they share the free space and collapse to 0 when there
   is none. */
.cd-faceoff > :first-child { margin-top: auto; }
.cd-faceoff > :last-child { margin-bottom: auto; }
.cd-fo-you { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cd-fo-vs { font-family: var(--font-display); font-weight: 700; font-size: 2.2rem; line-height: 1; color: var(--t-accent, var(--accent)); }
.cd-fo-cards { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 380px; }
.cd-fo-card {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 16px;
  padding: 10px 14px 10px 10px;
  /* Left, whatever page the card sits on: versus.html's screens centre their text, and with
     no "Played" column on the right (nobody has a prior score in a room) the name and tag
     floated to the middle of the card instead of lining up beside the disc. */
  text-align: left;
}
.cd-faceoff.many .cd-fo-cards { gap: 6px; }
.cd-faceoff.many .cd-fo-card { padding: 6px 12px 6px 7px; }
.cd-faceoff.many .cd-fo-av.me { width: 54px; height: 54px; font-size: 1.25rem; }
/* Compact (a short screen): smaller discs and tighter spacing, so the cards fit under
   the round's pill instead of taking the full height (FACEOFF.start measures). */
.cd-faceoff.compact { gap: 10px; }
.cd-faceoff.compact .cd-fo-you { gap: 4px; }
.cd-faceoff.compact .cd-fo-av.me { width: 48px; height: 48px; font-size: 1.1rem; }
.cd-faceoff.compact .cd-fo-vs { font-size: 1.7rem; }
.cd-faceoff.compact .cd-fo-cards { gap: 6px; }
.cd-faceoff.compact .cd-fo-card { padding: 6px 12px 6px 7px; }
.cd-faceoff.compact .cd-fo-card .cd-fo-av { width: 36px; height: 36px; font-size: 0.9rem; }
.cd-fo-av {
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--pcolor, var(--cool)); color: #fff; font-family: var(--font-ui); font-weight: 700; font-size: 1rem;
}
.cd-fo-av.me { --pcolor: var(--gold); color: #3a2e12; width: 72px; height: 72px; font-size: 1.6rem; }
.cd-fo-av img { width: 100%; height: 100%; object-fit: cover; }
.cd-fo-av.has-photo { background: transparent; }
.cd-fo-text { min-width: 0; flex: 1; }
/* "Already played": the opponent's total, "✓ Played" under it, on the card's right. */
.cd-fo-played { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.cd-fo-pts { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; line-height: 1; color: var(--text); font-variant-numeric: lining-nums tabular-nums; }
.cd-fo-mark { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-ui); font-size: 0.82rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.cd-fo-mark svg { color: var(--accentDeep); flex-shrink: 0; }
.cd-faceoff.compact .cd-fo-pts, .cd-faceoff.many .cd-fo-pts { font-size: 1.05rem; }
.cd-faceoff.compact .cd-fo-played, .cd-faceoff.many .cd-fo-played { gap: 1px; }
.cd-fo-name { font-family: var(--font-ui); font-size: 1rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-fo-you .cd-fo-name { font-size: 0.95rem; }
.cd-fo-tag {
  display: inline-block; margin-top: 3px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-ui); font-size: 0.82rem; font-weight: 600; border-radius: 999px; padding: 1px 8px;
  color: #7A4A12; background: #F8EBD6;                                   /* Rival */
}
.cd-fo-tag.friend { color: var(--accentDeep); background: #E1F0EA; }
.cd-fo-tag.league { color: #5B3F8C; background: #EEE7F8; }
.cd-fo-tag.chal   { color: #fff; background: var(--t-accent, var(--accent)); }
/* The one action card (LIVE_BLITZ_SPEC.md): "Play live against friends", dashed because
   it is not a player, and the only part of the face-off that takes a tap. */
.cd-fo-card.cd-fo-act {
  pointer-events: auto; cursor: pointer; width: 100%; text-align: left; font: inherit; color: inherit;
  border-style: dashed; border-color: var(--accentDeep); background: transparent;
  -webkit-tap-highlight-color: transparent;
}
.cd-fo-act .cd-fo-name { color: var(--accentDeep); }
.cd-fo-av.act { background: #E1F0EA; color: var(--accentDeep); }
.cd-fo-sub { display: block; margin-top: 2px; font-family: var(--font-ui); font-size: 0.82rem; color: var(--muted); }
.cd-fo-act.chosen { background: #E1F0EA; border-style: solid; }
.cd-faceoff.compact .cd-fo-act .cd-fo-av { width: 36px; height: 36px; }
/* With a `cta` (the face-off's live card) it is a BUTTON, not a slot: solid border, the
   primary CTA's tactile shadow and 2px press, and the word in a teal pill on the right.
   A dashed card there read as a tooltip (George, 2026-10-27). */
.cd-fo-card.cd-fo-act.cta {
  border: 2px solid var(--accentDeep); background: var(--surface);
  box-shadow: 0 4px 0 #0E5346; margin-bottom: 4px;
}
.cd-fo-card.cd-fo-act.cta:active, .cd-fo-card.cd-fo-act.cta.chosen { transform: translateY(2px); box-shadow: 0 2px 0 #0E5346; }
.cd-fo-card.cd-fo-act.cta.chosen { background: #E1F0EA; }
.cd-fo-act.cta .cd-fo-name { white-space: normal; }
.cd-fo-go {
  flex-shrink: 0; font-family: var(--font-ui); font-size: 0.9rem; font-weight: 700; white-space: nowrap;
  color: #fff; background: var(--t-accent, var(--accent)); border-radius: 999px; padding: 7px 12px;
}
/* The "or" between the opponents and that button: it is another way to play, not a player. */
.cd-fo-or {
  display: flex; align-items: center; gap: 10px; width: 100%;
  font-family: var(--font-ui); font-size: 0.82rem; font-weight: 600; color: var(--muted);
}
.cd-fo-or::before, .cd-fo-or::after { content: ''; flex: 1; height: 1px; background: var(--rule); }

/* Arrivals are keyframe ANIMATIONS that hold their end state, never transitions: an
   idle WKWebView can freeze a transition near its start (CLAUDE.md pitfall), and
   .settled pins the end state outright as a backstop. */
/* You drop in from 10px, not 36: with four or more opponents the face-off fills its box and
   you sit 16px under the round's pill, so a 36px drop passed through it, your photo over the
   pill (George, 2026-11-10; tests/e2e/countdown-faceoff.e2e.test.mjs samples every frame). */
@keyframes cdFoDrop  { from { opacity: 0; transform: translateY(-10px) scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes cdFoVs    { from { opacity: 0; transform: scale(2.2); } to { opacity: 1; transform: none; } }
@keyframes cdFoSlide { from { opacity: 0; transform: translateX(110px); } to { opacity: 1; transform: none; } }
@keyframes cdFoEmpty { to { opacity: 0; transform: translateY(14px) scale(0.96); } }
.cd-fo-in { opacity: 0; }
.cd-fo-you.go  { animation: cdFoDrop 0.45s cubic-bezier(.2,.9,.3,1.1) both; }
.cd-fo-vs.go   { animation: cdFoVs 0.35s cubic-bezier(.2,.9,.3,1.3) both; }
.cd-fo-card.go, .cd-fo-or.go { animation: cdFoSlide 0.42s cubic-bezier(.2,.9,.3,1.15) both; }
.cd-fo-in.settled { animation: none; opacity: 1; transform: none; }
.cd-fo-in.empty, .cd-fo-in.settled.empty { animation: cdFoEmpty 0.32s ease-in both; }
.cd-fo-hold { visibility: hidden; }

/* The flying discs ride their own fixed layer (nothing fixed is ever transformed;
   the discs inside it move), above both the countdown and the bar they land on. */
.cd-fo-flylayer { position: fixed; inset: 0; z-index: 370; pointer-events: none; }
.cd-fo-fly { position: absolute; margin: 0; transform-origin: 0 0; box-shadow: 0 6px 16px rgba(30, 20, 5, 0.18); }

/* THE LANDING PAD. A bar marked .fo-landing shows each pill as a dashed outline at
   full size until its disc lands, so nothing moves when it fills in. */
.fo-landing .t-pb:not(.landed) { border-style: dashed; background: transparent; }
.fo-landing .t-pb:not(.landed) > * { visibility: hidden; }
@keyframes tPbLand { 0% { transform: scale(1.18); } 60% { transform: scale(0.94); } 100% { transform: scale(1); } }
.t-pb.landed { animation: tPbLand 0.42s cubic-bezier(.2,.9,.3,1.4); }

@media (prefers-reduced-motion: reduce) {
  .cd-fo-you.go, .cd-fo-vs.go, .cd-fo-card.go, .cd-fo-or.go, .cd-fo-in.empty, .t-pb.landed { animation: none; opacity: 1; transform: none; }
}
