/* leaderboard.css — shared leaderboard styles for index.html, trivia.html and versus.html.
   Requires CSS custom properties from the Playful-C palette:
   --bg, --surface, --rule, --faint, --text, --muted, --cool, --gold,
   --accent, --green, --font-display, --font-ui. */

.lb-overlay {
  display: none; position: fixed; inset: 0;
  background: var(--bg); z-index: 300; flex-direction: column;
  align-items: stretch; justify-content: flex-start; padding: 0;
}
.lb-overlay.active { display: flex; }

.lb-header {
  display: flex; align-items: center; position: relative;
  /* Safe-area top: the .lb-overlay is position:fixed inset:0, and the pages
     now run viewport-fit=cover + contentInset:never, so this header sits at
     the PHYSICAL top of the screen. Without the env() inset it slides under
     the status bar / notch — the back + close buttons land behind the clock
     and stop receiving taps. env() is 0 on the web, so this is iOS-only. */
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px; border-bottom: 1px solid var(--rule); flex-shrink: 0;
}
/* Stacked layout: back button sits on its own row above the title block,
   so the "You reached [Goal] in [Time]" line gets the full width and the
   goal name doesn't get crushed by a side-by-side nav button. */
.lb-header--stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.lb-header--stacked .lb-nav-btn {
  align-self: flex-start;
  width: 36px;
  height: 28px;
}
.lb-header--stacked .lb-header-center {
  width: 100%;
}
.lb-header-center { flex: 1; text-align: center; }
/* .wordmark class on host overrides font/letter-spacing; size dropped ~15%. */
.lb-header-name { font-size: 1rem; color: var(--text); }
.lb-header-sub {
  font-size: 0.82rem; color: var(--muted);
  letter-spacing: 0.12em; text-transform: uppercase; margin-top: 2px;
}
/* Structured completion title: "You reached [Goal] in [Time]" where the
   goal is highlighted green and truncates with an ellipsis if the article
   name is long, so the "in 2:45" suffix is always visible. */
.lb-header-sub.lb-title-structured {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 4px;
  max-width: 100%;
  overflow: hidden;
  padding: 0 8px;
  box-sizing: border-box;
}
.lb-title-prefix,
.lb-title-suffix { flex-shrink: 0; white-space: nowrap; }
.lb-title-goal {
  color: var(--green);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-nav-btn {
  width: 36px; flex-shrink: 0; background: none; border: none;
  color: var(--text); font-size: 1.5rem; cursor: pointer; padding: 0;
  line-height: 1; opacity: 0.6; text-align: center;
  display: inline-flex; align-items: center; justify-content: center;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.lb-nav-btn:hover { opacity: 1; }
.lb-nav-btn svg { display: block; width: 22px; height: 22px; }

.lb-filter-bar {
  display: flex; align-items: stretch; gap: 10px;
  margin: 14px 16px 0; flex-shrink: 0;
}

/* V2 three-toggle filter bar (This Round/All Rounds · Points/Correct ·
   Everyone/Friends). Three equal-width tap-to-flip pills in one row; must fit a
   ~390px screen without wrapping, so labels stay short + text can ellipsize. */
.lb-filter-bar.lb-toggles { gap: 8px; }
/* THE BOARD TAB'S METRIC PILL names the game too ("Trivia Points", "List Correct": George, 2026-11-22, in
   place of a fourth pill that cut "Total So Far" off), so it takes its words' width and the other two share
   the rest (triviahome.js _lbBarHtml). */
.lb-toggle.lb-metric-game { flex: 0 0 auto; padding: 0 14px; }
/* A LIST BLITZ DAY'S ROUND PILL names the list ("Premier League Clubs", leaderboard.js _listRoundTitle): it takes a row
   of its own, the full width, over Points and Everyone (half a row cut "Premier League Clubs" at 375). */
.lb-filter-bar.lb-toggles:has(.lb-round-wide) { flex-wrap: wrap; row-gap: 8px; }
.lb-toggle.lb-round-wide { flex: 1 0 100%; }
.lb-toggle {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 8px; border-radius: 999px;
  border: 1.5px solid var(--rule); background: var(--surface);
  font-family: var(--font-ui); font-weight: 700; font-size: 0.86rem;
  color: var(--text); cursor: pointer; white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.08s;
}
.lb-toggle > span { overflow: hidden; text-overflow: ellipsis; }
.lb-toggle:active { transform: translateY(1px); }
.lb-toggle:hover { border-color: var(--faint); }
/* Engaged / non-default state (All Rounds, Correct, Friends) tints to the board
   accent so the active mode reads at a glance beyond the label text. */
.lb-toggle.on {
  border-color: var(--lb-accent, #1F8A75);
  color: var(--lb-accent, #1F8A75);
  background: color-mix(in srgb, var(--lb-accent, #1F8A75) 12%, var(--surface));
}
.lb-toggle.lb-toggle-static { opacity: 0.6; cursor: default; }
.lb-toggle.lb-toggle-static:active { transform: none; }

.lb-friends-btn {
  /* Same width as .lb-nav-btn (36px) so the header's left and right slots are
     symmetric and .lb-header-center stays truly centred (trivia hides this icon
     but keeps its box as the right-hand counterweight — see leaderboard.js). */
  flex-shrink: 0; width: 36px; height: 36px;
  background: none; border: 1px solid var(--rule);
  border-radius: 10px; color: var(--muted);
  cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
/* In the stacked completion header (column layout) the friends toggle is
   pinned to the top-right corner so it doesn't push into the title block. */
.lb-header--stacked .lb-friends-btn {
  position: absolute; right: 16px;
  top: calc(14px + env(safe-area-inset-top, 0px));
}
.lb-friends-btn svg { width: 20px; height: 20px; display: block; }
/* LIVE, NOT A WIKI LEFTOVER: the overlay's header friends icon is never shown — the
   scope pill in the filter bar replaced it (it was only visible on Wiki Blitz boards)
   — but its BOX is load-bearing. It is the right-hand counterweight to the left nav
   button; visibility (not display) keeps that box, and without it .lb-header-center
   loses its right neighbour and the title shifts right of centre. */
#lb-friends-btn { visibility: hidden; }
.lb-friends-btn:hover { color: var(--text); border-color: var(--faint); }
/* Active state: cool-blue fill, white icon, soft blue shadow. Far more
   obvious than the gold glow it replaced. (It was styled to match the Wiki
   Blitz Time / Taps segmented tabs, which went with the sunset.) */
.lb-friends-btn.active {
  background: var(--lb-accent, var(--cool));
  border-color: var(--lb-accent, var(--cool));
  color: #FFF;
  box-shadow: 0 2px 6px rgba(91, 143, 178, 0.35);
}

.lb-friends-prompt {
  font-size: 0.85rem; color: var(--muted);
  text-align: center; padding: 18px 16px; line-height: 1.5;
}
.lb-friends-prompt strong { color: var(--accentDeep); font-weight: 600; }
.lb-invite-btn {
  display: inline-block; margin-top: 12px;
  background: var(--surface); border: 1px solid var(--accent);
  border-radius: 10px; color: var(--accentDeep);
  font-family: var(--font-ui); font-weight: 600;
  font-size: 0.85rem; letter-spacing: 0.04em;
  padding: 9px 24px; cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.lb-invite-btn:hover { border-color: var(--accentDeep); background: rgba(31, 138, 117, 0.08); }


.lb-list {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 0 16px 80px; margin-top: 6px;
  /* Prevent iOS bounce-scroll from revealing content behind the overlay
     (the page underneath) when the list reaches either end. */
  overscroll-behavior: contain;
}
/* Anything pinned to the bottom of the viewport (share/challenge row, the
   anon sign-up bar, or both stacked) eats into the list's scroll runway —
   without matching padding the last rows are unreachable behind it. Mirror
   the :has() stacking logic the share row itself uses. */
:root:has(#ps-bar.active) .lb-list {
  padding-bottom: calc(130px + env(safe-area-inset-bottom, 0px));
}
/* This padding IS the scroll runway: it is what makes the last row reachable above a
   fixed bar, so it follows that bar's height. The share row is one line again ("Share
   & Challenge", 2026-11-10; 72px with its own padding), so the runway is the bar plus
   16px. It was still 168px from the two-line button (2026-08-07), which left ~96px of
   empty board above the bar at the bottom of every list (George, 2026-11-18: "a massive
   gap"). e2e/board-bottom-gap holds the gap between the last row and the bar. */
:root:has(.lb-share-row) .lb-list {
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}
:root:has(.lb-share-row):has(#ps-bar.active) .lb-list {
  padding-bottom: calc(138px + env(safe-area-inset-bottom, 0px));
}
/* Gated (name-entry) state: nothing is meant to scroll — skeletons are a
   static preview. Killing overflow here prevents the iOS rubber-band
   scroll that was exposing the page underneath through the overlay. */
.lb-list.lb-list-gated {
  overflow: hidden;
  padding-bottom: 16px;
}
/* Trivia round-complete: .trc-bar is a fixed bottom footer (countdown ring /
   Plus pill) layered OVER the board. Give the list a runway so its last rows —
   and, when gated, the name row's Save button — are never trapped behind it. */
/* :not(.trc-bar-off) is load-bearing. The bar is HIDDEN whenever a board is open
   over this screen (_trcFooterHide, trivia.html) but stays in the DOM, and a bare
   :has(.trc-bar) matches a display:none element just the same — so the runway was
   being reserved for a bar that was not on screen, leaving 210px of dead space
   under the last row on every post-round board. */
:root:has(.trc-bar:not(.trc-bar-off)) .lb-list,
:root:has(.trc-bar:not(.trc-bar-off)) .lb-list.lb-list-gated {
  /* Footer = opaque countdown bar PLUS a floating "Send as Challenge" pill hovering
     above it over the board. The list must be able to scroll its last rows clear of
     the WHOLE stack (bar + gap + pill), so give it runway past the pill's top edge. */
  padding-bottom: calc(210px + env(safe-area-inset-bottom, 0px));
}
/* Inline name-entry validation message (see LB._nameError). Without visible
   feedback a rejected name just silently re-focused, reading as "won't save". */
.lb-name-err {
  color: #0E5346;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 2px 0;
  text-align: left;
}

.lb-row {
  display: flex; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--rule);
  font-size: 0.95rem; min-height: 44px;
}
.lb-row:last-child { border-bottom: none; }
.lb-row.you { color: var(--lb-accent, var(--gold)); }
.lb-row.clickable { cursor: pointer; }
@media (hover: hover) {
  /* The tint reaches 8px past the row's content, as your highlighted row's does (margin out, padding back in: nothing
     moves), so a hovered row's rank is not flush against its edge (follow-ups 2026-11-20: "4" looked pushed off the row). */
  .lb-row.clickable:hover { background: rgba(31, 26, 20, 0.04); border-radius: 8px; margin-left: -8px; margin-right: -8px; padding-left: 8px; padding-right: 8px; }
}

.lb-rank {
  width: 28px; flex-shrink: 0;
  font-family: var(--font-display); font-weight: 700;
  font-size: 0.95rem; color: var(--faint); letter-spacing: -0.01em;
}
.lb-row.you .lb-rank { color: var(--lb-accent, var(--gold)); }
.lb-avatar {
  /* box-sizing is load-bearing: .lb-avatar-ring (photos) declared it and
     .lb-avatar-init (our discs) did not, so a bordered disc rendered 32px next
     to a 28px photo — "the Google images are a different size to ours".
     Declared once on the base so every variant is the same circle. */
  box-sizing: border-box;
  width: 28px; height: 28px; border-radius: 50%;
  flex-shrink: 0; margin-right: 10px; overflow: hidden;
}
/* A photo avatar gets the account-colour ring too — otherwise only the players
   without a picture would be colour-coded. */
.lb-avatar-ring { box-sizing: border-box; }   /* ring dropped — see .lb-avatar-init */
/* Tappable avatars — every leaderboard row opens its player's profile. */
.lb-avatar-tap { cursor: pointer; transition: transform 0.15s ease; }
.lb-avatar-tap:active { transform: scale(0.92); }
.lb-avatar img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* NO RING on our own discs. The fill IS the identity — an outline around a solid
   colour only made it read as a different size from a photo, which has none.
   The ring survives exactly where it means something: the viewer's own row.
   George, 2026-08-02. */
.lb-avatar-init {
  background: var(--surface); border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 600; color: var(--muted);
}
/* No ring on your own photo either. This rule used to claim the exception, but
   _avatarHtml never put .lb-avatar-you on the PHOTO branch, so it has matched
   nothing for as long as it has existed — the daily board has always drawn an
   unringed photo for the viewer, and it looks right, because .lb-row.you already
   turns the whole row gold. Removed rather than repaired: the podium is the one
   place a ring still marks you (.lb-podium-col.you), because it has no row to
   colour. Guarded by tests/e2e/board-parity.e2e.test.mjs. */
/* min-width:0 lets the name cell shrink below the text input's intrinsic width —
   without it, at larger accessibility font sizes the row can't shrink and the
   "Add your name" input slides under the submit (→) button. */
.lb-name { flex: 1; text-align: left; min-width: 0; }
/* Name is a profile trigger (mirrors .lb-avatar-tap). Keep flex:1 so the row's
   layout is unchanged — this only adds the affordance, not a new box. */
.lb-name-tap { cursor: pointer; }
.lb-name-tap:active { opacity: 0.6; }
/* In the name-ENTRY row, drop the score/time preview — at larger accessibility
   fonts it crams the input so "Add your name" clips to "Add your". The input needs
   the full width between the avatar and the → button to stay readable; the score is
   already implied by "…to see where you rank" and shows on the row once submitted. */
.lb-row.unclaimed .lb-time { display: none; }
/* …the name-entry row only. The SIGN-UP row (#lb-signup-row, a guest's own row on a gated board) has no input, and is
   "real: their score either way" (leaderboard.js); the rule above hid it too (follow-ups 2026-11-20). */
#lb-signup-row.unclaimed .lb-time { display: block; }
.lb-time {
  color: var(--text);
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.05rem; letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.lb-row.you .lb-time { color: var(--lb-accent, var(--gold)); }

/* League "not played" rows — members of the league with no score on this board.
   De-emphasised (greyed identity, no rank number, a word where the metric
   goes): on the board, not in the running. Every board draws these through
   LB._idleRow, the daily overlay and the Board tab / league boards alike. */
.lb-row.lb-idle { color: var(--muted); }
.lb-row.lb-idle .lb-rank { color: var(--faint); }
.lb-row.lb-idle .lb-avatar img { opacity: 0.5; filter: grayscale(1); }
/* A dashed placeholder disc: a member, not a player on this board. (The Board tab's
   own idle row had this; the daily's set a border-color on a borderless disc, a no-op.
   One row since 2026-10-24, and the placeholder is the clearer of the two.) */
.lb-row.lb-idle .lb-avatar-init {
  opacity: 0.7; background: var(--bg); border: 1.5px dashed var(--faint); color: var(--faint);
}
.lb-row.lb-idle .lb-name { color: var(--muted); font-weight: 500; }
.lb-row.lb-idle .lb-time {
  font-family: var(--font-ui); font-weight: 500;
  font-size: 0.82rem; letter-spacing: 0.01em;
  color: #C4BAA9;                                          /* fallback for the line below */
  color: color-mix(in srgb, var(--faint) 68%, var(--bg));
}
/* The descendant selector is LOAD-BEARING, not decoration. triviahome.js injects
   row display rules into a <style> at runtime — i.e. AFTER this stylesheet — so a
   bare `.lb-idle-hid{display:none}` can tie on specificity and LOSE on order: the
   collapsed rows once stayed fully visible. (jsdom lays nothing
   out, so only the Chromium e2e case sees this.) */
.lb-idle-wrap .lb-idle-hid { display: none; }
.lb-idle-more {
  padding: 10px 4px; text-align: center; cursor: pointer;
  font-family: var(--font-ui); font-weight: 700; font-size: 0.82rem;
  color: var(--accent);
}
.lb-idle-more:active { opacity: 0.6; }

/* Trivia row: muted correct-count after the score (e.g. 184 · 17/20) */
.lb-tsub { color: var(--muted); font-family: var(--font-ui); font-weight: 600; font-size: 0.82rem; }
.lb-row.you .lb-tsub { color: var(--lb-accent, var(--gold)); opacity: 0.85; }

.lb-empty { font-size: 0.85rem; color: var(--muted); padding: 20px 0; text-align: center; }

/* ── Shared leaderboard frame ─────────────────────────────────────────────
   Wraps any leaderboard list. Full width on mobile, constrained with a
   subtle card-style outline on desktop. Use by setting class="lb-frame"
   on the container that holds the rows. */
.lb-frame {
  width: 100%;
  margin: 0 auto;
}
@media (min-width: 560px) {
  .lb-frame {
    max-width: 480px;
    border: 1px solid var(--rule);
    border-radius: 16px;
    padding: 8px 14px;
    background: var(--surface, transparent);
    box-shadow: 0 8px 24px -12px rgba(31, 26, 20, 0.10);
  }
}

/* Inside the overlay, the frame needs to behave as the flex child that
   fills remaining height so the inner .lb-list scrolls correctly. */
.lb-overlay .lb-frame {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.lb-overlay .lb-frame .lb-list {
  flex: 1;
  margin-top: 0;
}
@media (min-width: 560px) {
  .lb-overlay .lb-frame { margin-top: 14px; margin-bottom: 14px; }
  /* Keep the header and filter row aligned to the same 480px column so the
     nav bar and filters sit inside the leaderboard frame on desktop. */
  .lb-overlay .lb-header,
  .lb-overlay .lb-filter-bar {
    width: 100%;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }
  .lb-overlay .lb-filter-bar { margin-top: 14px; }
}

/* ── Dynamic live/results list (versus results screen) ───────────────────
   Rows reorder live (FLIP) as players score and finish. The Wiki Blitz route
   line each row used to carry went with the sunset. */
.lb-dynlist { position: relative; }

/* Row base — extends .lb-row semantics but applies to the dynlist rows. */
.lb-dynlist .lb-row { position: relative; will-change: transform; }

/* Pulsing ring for still-racing avatars inside a row (same keyframes as
   proximity.css but scoped to the flat avatar — no position-absolute).
   Colour is driven by --pulse-color set inline by leaderboard.js from the
   per-player colour (versus assigns each opponent a distinct palette entry
   at match start). color-mix() bakes in the 55% alpha at the start of the
   ripple and fades to transparent. */
@keyframes lb-avatar-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pulse-color, #c0392b) 55%, transparent); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.lb-avatar.pulsing { animation: lb-avatar-pulse 1.4s ease-out infinite; }

/* DNF row (timed out): normal colours — just a small "DNF" marker on the
   right. The name is NOT struck through and NOT greyed. */
.lb-row.dnf .lb-time {
  font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
/* Left row (abandoned the match): greyed out + name struck through. */
.lb-row.left { opacity: 0.55; }
.lb-row.left .lb-name { text-decoration: line-through; text-decoration-thickness: 1px; }
.lb-row.left .lb-time {
  font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}

/* ── Gated leaderboard (skeleton + unclaimed row) ────────────────────────── */
/* Skeleton rows — shown when the leaderboard is gated (user hasn't signed up
   or hasn't entered their name yet). Grey pulsing pills signal "locked". */
@keyframes lb-skel-pulse {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 0.85; }
}
.lb-row.skeleton .lb-rank { color: var(--faint); opacity: 0.7; }
.lb-skel-pill {
  display: inline-block;
  height: 0.9rem; width: 110px;
  background: rgba(31, 26, 20, 0.08);
  border-radius: 6px;
  animation: lb-skel-pulse 1.6s ease-in-out infinite;
  vertical-align: middle;
}
.lb-skel-pill-sm { width: 42px; }
.lb-avatar-skeleton {
  background: rgba(31, 26, 20, 0.06);
  border: 2px solid var(--rule);
  animation: lb-skel-pulse 1.6s ease-in-out infinite;
}
.lb-row.skeleton .lb-name { overflow: hidden; }

/* Podium-shaped loading skeleton (LB._loadingHtml). Grey pulsing pillars +
   avatar so the board loads in its real shape rather than popping from a bare
   text line. No entrance animation (`.lb-podium.loading` omits `.animate`). */
.lb-podium.loading { pointer-events: none; }
.lb-podium-av.lb-avatar-skeleton {
  background: rgba(31, 26, 20, 0.06); border-color: var(--rule); color: transparent;
}
/* Neutral grey pulse for every loading pillar. High specificity (4 classes)
   so it beats the silver/bronze medal rules (.lb-podium-pillar.h2 .lb-podium-riser)
   — otherwise the loading pillars would flash the medal colours. */
.lb-podium.loading .lb-podium-pillar .lb-podium-riser {
  background: rgba(31, 26, 20, 0.07); border-color: var(--rule);
  animation: lb-skel-pulse 1.6s ease-in-out infinite;
}

/* Hint banner shown above the pinned name-entry row — tells the user
   WHY they're being asked for a name (so the gated skeleton state isn't
   just an unexplained "Add your name" form). */
.lb-nameentry-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding: 14px 4px 6px;
  line-height: 1.35;
}
.lb-nameentry-hint strong {
  color: var(--accentDeep);
  font-weight: 600;
}
.lb-nameentry-hint--tap {
  cursor: pointer;
}
.lb-nameentry-hint--tap:hover strong {
  text-decoration: underline;
}

/* Unclaimed (pinned name-entry) row — highlighted with the player's gold
   accent and a subtle pulsing border to invite the interaction. */
@keyframes lb-unclaimed-pulse {
  0%, 100% { border-color: rgba(232, 181, 71, 0.42); }
  50%      { border-color: rgba(232, 181, 71, 0.95); }
}
.lb-row.unclaimed {
  border: 1px dashed rgba(232, 181, 71, 0.55);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 6px 0 10px;
  background: rgba(232, 181, 71, 0.08);
  animation: lb-unclaimed-pulse 1.8s ease-in-out infinite;
}
.lb-row.unclaimed .lb-rank { color: var(--gold); }
.lb-name-input {
  width: 100%;
  min-width: 0;   /* allow the flex row to shrink it instead of overlapping the → button */
  background: transparent;
  border: none;
  outline: none;
  color: #B58418;
  font-family: var(--font-ui);
  font-weight: 600;
  /* 16px min — anything smaller triggers iOS input-focus auto-zoom.
     Every other input in the app should follow this rule. */
  font-size: 16px;
  padding: 2px 0;
  letter-spacing: 0.02em;
}
.lb-name-input::placeholder {
  color: var(--muted); opacity: 0.85; font-style: italic; font-weight: 400;
}
/* Reveal animation — rows cross-fade in with a per-row delay after the gate
   drops (name submitted or sign-in completed). */
@keyframes lb-row-reveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lb-revealing-row {
  animation: lb-row-reveal 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Slot-reel reveal — used when the player ranks outside the top window.
   The list becomes a viewport (overflow:hidden) and an inner .lb-reel
   wrapper translates upward past filler ranks, landing the "you" row
   centered. Both classes are transient — the cleanup step in
   _revealReel strips .lb-reeling and unwraps .lb-reel, returning the
   list to its normal scrollable state. */
.lb-list.lb-reeling {
  overflow: hidden;
  /* Disable overscroll rubber-banding while the reel runs. */
  overscroll-behavior: none;
}
.lb-reel {
  display: flex;
  flex-direction: column;
  will-change: transform;
}
/* Filler rows are parade-past decorations — inert, unselectable, no
   profile lookup, no path toggle. Keeps the visual of rapidly-scrolling
   ranks without any of the interaction surface of a real leaderboard row. */
.lb-row.lb-filler {
  pointer-events: none;
  user-select: none;
}

/* Dynlist rows: top line (rank/avatar/name/time/chevron — same geometry as
   historic rows) plus an optional full-width live-path line beneath. Only
   applies inside .lb-dynlist so static leaderboards stay untouched. */
.lb-dynlist .lb-row {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
}
.lb-dynlist .lb-row-top {
  display: flex; align-items: center;
  padding: 14px 0;
  min-height: 44px;
}
.lb-dynlist .lb-row-top .lb-name { flex: 1; }
/* On dynlist rows the bottom border belongs to the row wrapper, not the inner
   .lb-row-top line. */
.lb-dynlist .lb-row { border-bottom: 1px solid var(--rule); }
.lb-dynlist .lb-row-top { border-bottom: none; }
.lb-dynlist .lb-row:last-child { border-bottom: none; }


/* ─── POST-RACE ACTION ROW (Share / Challenge) ─────────────────────────────
   Injected by LB.open when the leaderboard opens as the completion screen
   (showShareButtons:true). Pins to the bottom of the viewport so it sits
   immediately above whichever auth UI is showing — full sign-up sheet,
   collapsed bar, or nothing. Position adjusts via :has() so the button
   "rides on top" of the auth state. */
.lb-share-row {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  z-index: 365;            /* below ps-bar (370) and ps-sheet (380) */
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  /* Default bottom safe-area cushion. Removed when auth UI is showing
     because the bar/sheet already accounts for it. */
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  border-top: 1px solid var(--rule);
}
/* Auth bar showing (minimised): lift share row to sit just above it.
   Selector starts at :root because the auth sheet/bar are appended to
   <html> (not <body>), so body:has(...) can't see them. */
:root:has(#ps-bar.active) .lb-share-row {
  bottom: calc(46px + env(safe-area-inset-bottom, 0px));
  padding-bottom: 12px;
}
/* Full sign-up sheet showing: hide share row entirely — it'd be behind
   the backdrop anyway, and the sheet is the focused action. The user
   minimises the sheet (✕) to bring the share row back. */
:root:has(#ps-sheet.active) .lb-share-row { display: none; }

.lb-share-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accentDeep);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
/* Hover only where there is a real pointer. On iOS a tapped button keeps :hover after the
   app comes back from the background, and this cream fill outranked the teal one on the
   primary button: a white button with white words until the next tap elsewhere
   (George, 2026-11-10). */
@media (hover: hover) {
  .lb-share-btn:not(.lb-share-btn--primary):hover { background: var(--bg); border-color: var(--accent); }
  .lb-share-btn--primary:hover { filter: brightness(1.04); }
}
.lb-share-btn:active { transform: scale(0.97); }
.lb-share-btn svg { flex-shrink: 0; vertical-align: -2px; }

/* Challenge button is the primary CTA: teal fill, white text, the tactile press,
   more visual weight than Share which is the secondary action. It is the same
   control as trivia.html's .trc-challenge and is painted the same (gold until
   George, 2026-11-09). */
.lb-share-btn--primary {
  background: linear-gradient(180deg, var(--accent), var(--accentDeep));
  color: #fff;
  border-color: var(--accentDeep);
  box-shadow: 0 4px 0 #0E5346;
}
.lb-share-btn--primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #0E5346; }
.lb-share-t { white-space: nowrap; }

/* ═══════════════════════════════════════════════════════════════════════════
   PODIUM + RESULTS SYSTEM (shared: daily leaderboard + versus results)
   One podium(top-3) + ranked-list visual for every "you finished" moment.
   Game-aware only in copy/metric (handled in JS); the chrome is identical.
   Motion is CSS *keyframe animations* (not transitions) — per the spotlight
   pitfall, transitions stall when the WebView isn't actively painting, but
   keyframe animations run. --lb-accent (JS-set) is the per-game accent; gold
   is the "you"/winner colour everywhere.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Soft shades the podium needs, derived from the Playful-C palette. Kept off the
   global namespace, but declared on `.lb-podium` ITSELF as well as its two
   historical hosts — the component has to carry its own tokens now that it is
   mounted in a third place (the Board tab's #th-main, which is inside neither
   .lb-overlay nor .lb-results). Scoped to the hosts alone, every medal gradient
   resolved to nothing there and the pedestals rendered as pale outlined boxes
   while the overlay's looked correct. */
.lb-overlay, .lb-results, .lb-podium {
  --gold-soft: #F3E6C4;   /* winner/you pillar top + chip fill */
  --gold-deep: #D9A43A;   /* winner/you pillar bottom + gradient end */
  --rule-soft: #EFE7D6;   /* fallback pedestal fill (dnf / no medal) */
  /* Medal pedestals — a proper gold/silver/bronze podium. Each is a
     top-light → bottom-deep gradient echoing the winner's gold treatment, so
     2nd/3rd read as medals rather than blank beige. Tones are warmed slightly
     to sit in the cream Playful-C palette instead of cold metal. */
  --silver-soft: #EDEEF1; --silver-deep: #C7C9CF; --silver-line: #B4B7BF; --silver-ink: #7E828B;
  --bronze-soft: #EDCEA4; --bronze-deep: #C68A54; --bronze-line: #B87F49; --bronze-ink: #8F5A2E;
}

/* ── Podium ──────────────────────────────────────────────────────────────── */
.lb-podium {
  display: flex; justify-content: center; align-items: flex-end;
  gap: 12px; padding: 18px 14px 0; flex-shrink: 0;
}
.lb-podium-col { flex: 1; min-width: 0; text-align: center; }
/* The avatar/name/score block that sits on top of the pillar. */
.lb-podium-info { margin-bottom: 9px; }
.lb-podium-av {
  width: 46px; height: 46px; border-radius: 50%; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--faint); background: var(--surface); overflow: hidden;
  font-family: var(--font-ui); font-weight: 600; font-size: 1.1rem; color: var(--muted);
}
.lb-podium-av img { width: 100%; height: 100%; object-fit: cover; }
.lb-podium-col.win .lb-podium-av { width: 60px; height: 60px; font-size: 1.4rem; }
/* These two OUTRANK the transparent border a photo sets inline, because they mean
   something an identity colour does not: which column is yours, and which is the
   person who challenged you. Everything else with a photo shows no ring at all. */
.lb-podium-col.you .lb-podium-av { border: 2px solid var(--gold) !important; background: var(--gold-soft); color: var(--text); }
.lb-podium-col.opp .lb-podium-av { border: 2px solid var(--accent) !important; }
.lb-podium-name {
  font-family: var(--font-ui); font-weight: 600; font-size: 0.9rem;
  color: var(--text); margin-top: 6px; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-podium-col.win .lb-podium-name { font-size: 1rem; }
.lb-podium-col.you .lb-podium-name { color: var(--gold); }
.lb-podium-col.opp .lb-podium-name { color: var(--accent); }
.lb-podium-you-tag { color: var(--faint); font-weight: 600; font-size: 0.82rem; }
.lb-podium-score {
  font-family: var(--font-display); font-weight: 600; font-size: 1.2rem;
  color: var(--text); letter-spacing: -0.01em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.lb-podium-col.win .lb-podium-score { font-size: 1.65rem; }
.lb-podium-col.you .lb-podium-score { color: var(--gold); }
.lb-podium-col.dnf .lb-podium-score { color: var(--faint); font-family: var(--font-ui); font-size: 0.95rem; }
.lb-podium-sub { font-size: 0.82rem; color: var(--faint); font-weight: 600; margin-top: 1px; }

/* The rising pillar. Height by rank; overflow-clip so the inner riser can
   translateY from 100%→0 behind the clip (masked "grow up from the floor"). */
.lb-podium-pillar { border-radius: 12px 12px 0 0; overflow: hidden; }
.lb-podium-pillar.h1 { height: 104px; }
.lb-podium-pillar.h2 { height: 74px; }
.lb-podium-pillar.h3 { height: 56px; }
.lb-podium-riser {
  height: 100%; border-radius: 12px 12px 0 0;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 9px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.3rem;
  background: var(--rule-soft); border: 1px solid var(--rule); color: var(--faint);
}
/* Medal pedestals by rank (pillar height class == rank). Silver = 2nd,
   bronze = 3rd. Only the WINNER's pillar (.win) overrides to gold below — the
   viewer's own pillar keeps its rank medal, so a 2nd/3rd-place "you" isn't
   confused with 1st. The "you" signal is carried by the gold name + score +
   avatar ring, not the pedestal. */
.lb-podium-pillar.h2 .lb-podium-riser {
  background: linear-gradient(180deg, var(--silver-soft), var(--silver-deep));
  border-color: var(--silver-line); color: var(--silver-ink);
}
.lb-podium-pillar.h3 .lb-podium-riser {
  background: linear-gradient(180deg, var(--bronze-soft), var(--bronze-deep));
  border-color: var(--bronze-line); color: var(--bronze-ink);
}
.lb-podium-col.win .lb-podium-riser {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  border-color: var(--gold); color: var(--text);
}
.lb-podium-col.dnf .lb-podium-riser {
  background: var(--surface); border-color: var(--rule); color: var(--faint);
}

/* Duel (2-player versus): two pillars, winner taller. Reuses .lb-podium-col
   with .duel on the container for wider gaps + bigger avatars. */
.lb-podium.duel { gap: 16px; }
.lb-podium.duel .lb-podium-pillar.h1 { height: 150px; }
.lb-podium.duel .lb-podium-pillar.h2 { height: 96px; }
.lb-podium.duel .lb-podium-col.win .lb-podium-av { width: 70px; height: 70px; }

/* Compact podium (4-6 players: top-3 shrinks to leave room for the list). */
.lb-podium.compact .lb-podium-pillar.h1 { height: 88px; }
.lb-podium.compact .lb-podium-pillar.h2 { height: 64px; }
.lb-podium.compact .lb-podium-pillar.h3 { height: 48px; }
.lb-podium.compact .lb-podium-col.win .lb-podium-av { width: 52px; height: 52px; }

/* ── Podium entrance choreography (keyframes only) ───────────────────────── */
@keyframes lb-riser-rise { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes lb-pod-pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
/* animate mode: risers start hidden then rise; info blocks pop in after. Delays
   are set inline per-column in JS so 2·1·3 stagger with the winner landing last. */
.lb-podium.animate .lb-podium-riser { animation: lb-riser-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.lb-podium.animate .lb-podium-info  { animation: lb-pod-pop 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }
@media (prefers-reduced-motion: reduce) {
  .lb-podium.animate .lb-podium-riser,
  .lb-podium.animate .lb-podium-info { animation: none; }
}

/* Divider between the podium and the ranked list (rank 4+). */
.lb-podium-divider { height: 1px; background: var(--rule); margin: 18px 4px 4px; }

/* ── Solo state (only you finished today) ────────────────────────────────── */
.lb-solo { padding: 26px 22px 8px; text-align: center; }
/* Held behind the bloom (LB.holdSoloReveal). visibility, not display: the block
   keeps its space so nothing below it jumps when the flower finishes and it
   appears. */
.lb-solo.is-held { visibility: hidden; }
.lb-solo-hero { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.lb-solo-av {
  width: 78px; height: 78px; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--gold); background: var(--gold-soft);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-weight: 600; font-size: 2rem; color: var(--text);
}
.lb-solo-av img { width: 100%; height: 100%; object-fit: cover; }
.lb-solo-title { font-weight: 600; font-size: 1.05rem; color: var(--gold); }
.lb-solo-score {
  font-family: var(--font-display); font-weight: 600; font-size: 2.6rem;
  color: var(--text); line-height: 1; font-variant-numeric: tabular-nums;
}
.lb-solo-unit { font-size: 1.2rem; color: var(--faint); font-weight: 500; }
.lb-solo-sub { font-size: 0.95rem; color: var(--muted); }
.lb-solo-card {
  margin-top: 24px; background: var(--surface); border: 1px solid var(--rule);
  border-radius: 18px; padding: 18px 20px; text-align: left;
  display: flex; gap: 14px; align-items: center;
}
.lb-solo-badge {
  width: 50px; height: 50px; border-radius: 50%; flex-shrink: 0;
  background: color-mix(in srgb, var(--accent) 14%, #fff);
  border: 1.5px solid color-mix(in srgb, var(--accent) 40%, #fff);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.lb-solo-ct { font-weight: 700; font-size: 1rem; }
.lb-solo-cd { font-size: 0.9rem; color: var(--muted); margin-top: 2px; }
.lb-solo.animate .lb-solo-hero { animation: lb-pod-pop 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: 120ms; }
.lb-solo.animate .lb-solo-card { animation: lb-pod-pop 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: 340ms; }
@media (prefers-reduced-motion: reduce) {
  .lb-solo.animate .lb-solo-hero, .lb-solo.animate .lb-solo-card { animation: none; }
}

/* ── Anon reveal: gold name-chip that flies from the input into your slot ─── */
.lb-fly-chip {
  position: fixed; left: 0; top: 0; z-index: 400; pointer-events: none;
  display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 7px;
  background: var(--gold-soft); border: 1.5px solid var(--gold); border-radius: 999px;
  box-shadow: 0 8px 20px rgba(217, 164, 58, 0.4); will-change: transform;
}
.lb-fly-chip-av {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--gold); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-weight: 600; font-size: 0.85rem; color: var(--text);
}
.lb-fly-chip-name { font-family: var(--font-ui); font-weight: 600; font-size: 0.95rem; color: var(--gold); }
/* Landing flash on the destination row/column (settles to the persistent gold
   "you" treatment the row/column already carries). */
@keyframes lb-land-flash {
  0%   { background: var(--gold-soft); }
  100% { background: transparent; }
}
/* Keyframe pop on arrival (runs even when idle, unlike an opacity transition). */
.lb-landed { animation: lb-pod-pop 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }
.lb-row.lb-landed { animation: lb-pod-pop 0.42s cubic-bezier(0.22, 1, 0.36, 1) both, lb-land-flash 1.1s ease 0.2s; border-radius: 10px; }
/* Arriving on the board after entering your name uses the SAME accent flash as a
   live score update, so it reads as the board updating rather than a quiet redraw.
   This rule has to exist: both .lb-row.lb-landed and .lb-live-bump set the
   `animation` SHORTHAND, and the two-class selector above out-specifies the single
   class — so simply adding lb-live-bump was silently overridden and no flash ever
   played. Composed here explicitly, and the near-invisible gold wash
   (--gold-soft on cream) is dropped in its favour. */
/* 1.8s here too, in step with LB.FLASH_MS — this composed copy kept the old 0.8s
   when the standalone rule was lengthened, so the name-entry arrival still flashed
   for under a second and then sat with a dead class on it until 1.84s. */
.lb-row.lb-landed.lb-live-bump {
  animation: lb-pod-pop 0.42s cubic-bezier(0.22, 1, 0.36, 1) both, lbLiveFlash 1.8s ease 0.15s;
  border-radius: 10px;
}
@media (prefers-reduced-motion: reduce) {
  .lb-fly-chip { display: none; }
  .lb-landed, .lb-row.lb-landed { animation: none; }
  /* ...but a reduced-motion user still has to be able to FIND their own row. With
     the chip hidden and every animation off, the board simply appeared with them
     somewhere in it and nothing said where — the whole payoff of entering a name.
     A held colour tint is not vestibular motion, so it survives here: same accent,
     no movement, cleared when .lb-live-bump is removed ~1.9s later. */
  .lb-row.lb-live-bump {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
  }
}

/* ── Challenge finish: opponent lit warm, gold highlight travels to you ────── */
.lb-podium-col.lb-challenge-lit .lb-podium-name,
.lb-podium-col.lb-challenge-lit .lb-podium-score { color: var(--accent); }
.lb-podium-col.lb-challenge-lit .lb-podium-av { border: 2px solid var(--accent) !important; }
.lb-row.lb-challenge-lit {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 10px; color: var(--accent);
}
.lb-row.lb-challenge-lit .lb-name { color: var(--accent); }
/* The floating gold highlight that flies opponent → you. Translucent so the
   content underneath reads through as it passes. */
.lb-travel-hl {
  position: fixed; left: 0; top: 0; z-index: 390; pointer-events: none;
  border-radius: 12px;
  background: color-mix(in srgb, var(--gold) 20%, transparent);
  box-shadow: inset 0 0 0 1.5px var(--gold), 0 8px 20px rgba(217, 164, 58, 0.35);
  will-change: transform, width, height;
}
@media (prefers-reduced-motion: reduce) { .lb-travel-hl { display: none; } }


/* ── Header eyebrow (context line under the title) ───────────────────────── */
/* Reuses .lb-header-sub; the challenge variant tints green ("YOU BEAT SAM"). */
.lb-header-sub.lb-eyebrow-challenge { color: var(--green); }

/* ── Live poll: a row/podium column whose score just changed flashes an accent
   ring (box-shadow only — the row's transform is owned by the FLIP reorder). */
@keyframes lbLiveFlash {
  0%   { box-shadow: 0 0 0 0 rgba(31,138,117,0); }
  10%  { box-shadow: 0 0 0 3px rgba(31,138,117,0.34); }
  60%  { box-shadow: 0 0 0 3px rgba(31,138,117,0.26); }
  100% { box-shadow: 0 0 0 0 rgba(31,138,117,0); }
}
/* 1.8s, and it HOLDS through the middle rather than peaking at 25% and falling
   away — the old 0.8s blip was easy to miss entirely. Keep in step with
   LB.FLASH_MS in leaderboard.js, which times the class removal. */
.lb-live-bump { animation: lbLiveFlash 1.8s ease; border-radius: 12px; }

/* ── Event ticker (shared by daily board #lb-ticker and Board tab #th-lbticker).
   One live "what just happened" line at a time; a pulsing dot signals a fresh
   event vs the resting top-player readout. */
.lb-ticker {
  display: flex; align-items: center; gap: 9px;
  /* Fixed height, ALWAYS reserved (even when empty) so a ticker line appearing
     or clearing never shifts the podium below it up/down. */
  height: 30px; margin: 10px 16px 2px; padding: 0 2px;
  font-family: var(--font-ui); font-weight: 600; font-size: 0.9rem;
  color: var(--muted); overflow: hidden; white-space: nowrap;
}
/* THE DAILY BOARD'S TICKER TAKES NO ROOM UNTIL IT HAS A LINE (George, 2026-11-28: "a lot of space between the filters
   and the first place podium ... we still shouldn't show that much space unless we need it"). It is empty on most
   opens (it speaks only when someone finishes or overtakes), and the 42px it held sat as a blank band under the
   filters. Empty, it is 0 tall; a line opens it to its 30px with a short slide, which is the one time the podium moves.
   The end state needs no transition (reduced motion: none). The Board tab's ticker (#th-lbticker) is not this one. */
#lb-ticker:empty { height: 0; margin-top: 0; margin-bottom: 0; }
#lb-ticker { transition: height 0.24s ease, margin 0.24s ease; }
@media (prefers-reduced-motion: reduce) { #lb-ticker { transition: none; } }
.lb-tick-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.lb-tick-dot.live {
  background: var(--lb-accent, #1F8A75);
  animation: lbTickPulse 1.6s ease-out infinite;
}
@keyframes lbTickPulse {
  0%   { box-shadow: 0 0 0 0 rgba(31,138,117,0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(31,138,117,0); }
  100% { box-shadow: 0 0 0 0 rgba(31,138,117,0); }
}
.lb-tick-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; animation: lbTickIn 0.32s ease; }
@keyframes lbTickIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* Vertical roll between successive lines (old up-and-out, new up-and-in). The
   roll box clips one line tall; the slide holds two stacked lines and shifts up.

   THE LINE HEIGHT IS ONE NUMBER IN THREE PLACES — the clip box, the line box and
   the keyframe's travel — and they must never drift apart, or the roll lands with
   a sliver of the next line showing. They read a single custom property so a
   caller can rehome all three at once: the home social strip sets --tick-h to two
   lines because a full sentence does not fit on one at phone width. Unset, it is
   the 20px every existing ticker was written against, so nothing else moves. */
.lb-tick-roll { position: relative; flex: 1; min-width: 0; height: var(--tick-h, 20px); overflow: hidden; }
.lb-tick-slide { display: block; }
.lb-tick-slide.rolling { animation: lbTickRoll 0.42s cubic-bezier(0.22, 0.7, 0.2, 1) both; }
.lb-tick-line { display: block; height: var(--tick-h, 20px); line-height: var(--tick-h, 20px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes lbTickRoll { from { transform: translateY(0); } to { transform: translateY(calc(-1 * var(--tick-h, 20px))); } }
/* Optional companion for a caller whose two lines are DIFFERENT heights (the home
   social strip: a wrapped league standing giving way to a one-line round target).
   The clip box resizes on the same curve and duration as the slide, so the resize
   IS the roll rather than a snap before or after it.

   An ANIMATION, not a transition, and that is the whole point: the roll markup is
   written fresh by innerHTML, and a transition on a newly-inserted element has no
   previous computed height to interpolate from — it jumps straight to the end value.
   Measured: the accordion below moved 20px in a single frame. Animations run on
   fresh DOM, which is why the slide beside it has always worked.

   Inert unless a caller opts in by setting --tick-to and adding .resizing. */
@keyframes lbTickResize { to { height: var(--tick-to, var(--tick-h, 20px)); } }
.lb-tick-roll.resizing { animation: lbTickResize 0.42s cubic-bezier(0.22, 0.7, 0.2, 1) both; }

/* ── Player action sheet (LB.openPlayerSheet) ────────────────────────────────
   Serves a podium PILLAR and a list ROW identically. The top three are rendered
   as columns and never appear as rows, so an in-row control could not reach the
   people you most want to compare against. */
.lb-psheet {
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(31, 26, 20, 0.38);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom));
}
.lb-psheet-card {
  position: relative;
  width: 100%; max-width: 460px;
  background: var(--surface); border: 1.5px solid var(--rule); border-radius: 18px;
  padding: 16px; box-shadow: 0 12px 40px rgba(31, 26, 20, 0.18);
}
.lb-psheet-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.lb-psheet-av {
  width: 40px; height: 40px; border-radius: 50%; flex: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--faint); background: var(--bg);
  font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--muted);
}
.lb-psheet-av img { width: 100%; height: 100%; object-fit: cover; }
.lb-psheet-id { min-width: 0; }
.lb-psheet-nm {
  font-family: var(--font-ui); font-weight: 600; font-size: 1rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Their rank, their score and how far ahead/behind you are — the facts the sheet
   was opened to read. At 0.82rem in --faint they were the smallest, palest thing on
   a card whose least interesting element (the name you already tapped) was the
   biggest. Up to 0.9rem in --muted so the numbers carry. */
.lb-psheet-sub { font-size: 0.9rem; font-weight: 600; color: var(--muted); margin-top: 3px; }
.lb-psheet-btn {
  display: block; width: 100%; margin-top: 8px; padding: 13px;
  font-family: var(--font-ui); font-size: 0.95rem; font-weight: 600;
  border-radius: 12px; border: 1.5px solid var(--rule);
  background: var(--bg); color: var(--text); cursor: pointer;
}
.lb-psheet-btn.primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 4px 0 #0E5346;
}
.lb-psheet-btn.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #0E5346; }
/* Sized exactly like .lb-psheet-btn — it sits in the button stack and occupies
   the slot Compare would have, so a smaller pill read as a different kind of
   thing wedged between two buttons. Dashed border and muted ink still say it is
   a state, not something to press. */
.lb-psheet-note {
  display: block; width: 100%; margin-top: 8px; padding: 13px;
  border-radius: 12px; background: var(--bg); border: 1.5px dashed var(--rule);
  font-family: var(--font-ui); font-size: 0.95rem; font-weight: 600;
  color: var(--muted); text-align: center;
}

/* Close affordance. Sits inside the card's padding rather than floating over the
   name, so a long name can never run under it. */
.lb-psheet-x {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--rule); background: var(--bg);
  color: var(--muted); cursor: pointer; padding: 0;
}
.lb-psheet-x:active { background: var(--rule); }
/* Keep the identity block clear of the X. */
.lb-psheet-head { padding-right: 34px; }

.lb-psheet-h2h { display: flex; flex-wrap: wrap; gap: 6px; }
.lb-psheet-h2h:not(:empty) { margin: 0 0 12px; }
/* The head-to-head record. It is the reason most people open this sheet, so it is
   no longer whispered at the same size as a caption. */
.lb-psheet-chip {
  font-size: 0.9rem; font-weight: 600; color: var(--text);
  background: var(--bg); border: 1.5px solid var(--rule);
  border-radius: 999px; padding: 5px 11px;
}

/* The whole podium column is a tap target (LB.openPlayerSheet), so it needs to
   feel like one — the pedestal is the biggest thing on the podium and tapping
   it used to do nothing. */
.lb-podium-tap { cursor: pointer; }
.lb-podium-tap:active .lb-podium-info,
.lb-podium-tap:active .lb-podium-pillar { transform: scale(0.97); }
.lb-podium-info, .lb-podium-pillar { transition: transform 0.12s ease; }

/* The head-to-head placeholder. The sheet opens at its FINAL height with these
   in place, so nothing shifts when the record lands a moment later. */
.lb-psheet-chip.skeleton {
  width: 128px; height: 30px; border-color: transparent;
  background: linear-gradient(90deg, var(--bg), var(--surface), var(--bg));
  background-size: 200% 100%;
  animation: lbPsheetShim 1.2s ease-in-out infinite;
}
.lb-psheet-chip.skeleton.wide { width: 172px; }
@keyframes lbPsheetShim { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }
/* An empty record collapses the row rather than leaving a gap. */
.lb-psheet-h2h:empty { display: none; }

/* ── the "you" marker ────────────────────────────────────────────────────────
   Your own bloom, standing in for the words that used to be here ("(you)" on a
   list row, "· you" on a podium column, "· you" on the Board tab).

   IT LIVES OUTSIDE THE NAME ELEMENT everywhere. The text version sat INSIDE it,
   so a long name truncated its own marker away with the ellipsis — the "(you) is
   cut off" report. Outside, it cannot be clipped.

   The podium is the one place it can still be dropped: those columns are narrow
   and the NAME has to win, so _fitPodiumNames removes it when the name overflows.
   List rows are wide and always keep it. */
/* The marker belongs beside the NAME, not out by the score. .lb-name is flex:1,
   so left as siblings the name expands and shoves the marker to the far right of
   the row — which reads as a decoration on the score. This wrapper takes the
   flex:1 instead, and the name inside it sizes to its content. */
.lb-you-wrap { flex: 1; display: flex; align-items: center; gap: 7px; min-width: 0; }
.lb-you-wrap .lb-name { flex: 0 1 auto; }
.lb-you-bloom { flex: 0 0 auto; width: 20px; height: 20px; display: block; line-height: 0; }
.lb-you-bloom svg { display: block; width: 100%; height: 100%; }
.lb-podium-col .lb-you-bloom { width: 17px; height: 17px; margin: 3px auto 0; }
/* PRIVATE (AUTH.scoresPrivate): a padlock beside your own mark, because nobody else
   sees this row. Muted, the size of the text, never wider than the bloom. */
.lb-private { flex: 0 0 auto; display: inline-flex; align-items: center; color: var(--muted); line-height: 0; }
.lb-private .zb-lock { margin: 0; vertical-align: 0; }
.lb-podium-name .lb-private { margin-left: 4px; vertical-align: -1px; }

/* THE PLUS MARK shares the "you" bloom's slot, size and weight on purpose: they sit
   side by side on the round board, and a different box would read as a different
   KIND of thing rather than a second fact about the same player. See LB._plusMark.
   Outside .lb-name, like the you-mark, or a long name ellipsises its own badge away. */
.lb-plus { flex: 0 0 auto; width: 20px; height: 20px; display: block; line-height: 0; }
.lb-plus svg { display: block; width: 100%; height: 100%; }
.lb-podium-col .lb-plus { width: 17px; height: 17px; margin: 3px auto 0; }
/* "Zip Blitz Plus Member" — the profile and player sheet say it in words, where
   there is room for words. Gold, so the line and the mark are one statement. */
.lb-plus-line { display: flex; align-items: center; gap: 7px; margin-top: 4px;
  font-size: 0.82rem; font-weight: 600; color: #B58418; }
.lb-plus-line .lb-plus { width: 16px; height: 16px; }

/* A GUEST'S ROW (LB.row, George 2026-11-26): the board's one row, muted - the name in the
   board's quiet voice, a neutral disc with a head-and-shoulders mark, nothing to tap. */
.lb-row.lb-guest .lb-name, .lb-podium-col.guest .lb-podium-name { color: var(--muted); font-weight: 500; }
.lb-avatar.lb-avatar-guest, .lb-podium-av.lb-avatar-guest {
  background: var(--rule); color: var(--faint); border-color: var(--rule);
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
}
.lb-podium-av.lb-avatar-guest { display: flex; }

/* ── THE BOARD ON THE PAGE (LB.open({ dock }); WEB_SHELL_SPEC 3.3, decision 2) ─────────────────────
   The desktop round end draws the board ON the page: the same overlay element, moved into the page and
   drawn as a card there. The page scrolls; the list inside it does not. Only a docked board is touched
   here: every other open is the overlay above, unchanged. position: static on purpose, so the shell's
   "everything that covers the window moves beside the sidebar" (webshell.css, left) cannot shift it. */
.lb-overlay.lb-docked { position: static; inset: auto; z-index: auto; display: none; width: 100%; box-sizing: border-box;
  background: var(--surface, #FFFCF7); border: 1.5px solid var(--rule); border-radius: 20px;
  box-shadow: 0 6px 18px -12px rgba(31, 26, 20, 0.18); padding: 14px 18px 6px; }
.lb-overlay.lb-docked.active { display: flex; }
.lb-docked .lb-header, .lb-docked .lb-ticker, .lb-docked .lb-share-row { display: none !important; }
.lb-overlay.lb-docked .lb-filter-bar { max-width: none; margin: 0 0 6px; padding-left: 0; padding-right: 0; }
.lb-overlay.lb-docked .lb-frame { flex: none; display: block; overflow: visible; max-width: none; margin: 0;
  padding: 0; border: none; background: none; box-shadow: none; }
.lb-overlay.lb-docked .lb-list, .lb-overlay.lb-docked .lb-frame .lb-list { flex: none; overflow: visible; margin: 0;
  padding: 0 0 4px !important; position: relative; }
/* Your row stays in view: pinned to the foot of the window while it is below it, to the top while above. */
.lb-overlay.lb-docked .lb-row.you:not(.skeleton):not(.unclaimed) { position: sticky; top: 0; bottom: 0; z-index: 2;
  background: #FFF6E2; margin: 0 -18px; padding-left: 18px; padding-right: 18px;
  box-shadow: 0 -1px 0 var(--rule), 0 1px 0 var(--rule); }
.lb-overlay.lb-docked .lb-row.unclaimed { margin-left: 0; margin-right: 0; }
/* A guest's locked board: their own row real, the rest skeletons, and the ask on it. */
.lb-docked .lb-list-gated .lb-nameentry-hint { display: none; }
.lb-docked .lb-list-gated { min-height: 420px; }
.lb-dask { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); width: min(400px, calc(100% - 32px));
  box-sizing: border-box; padding: 24px 26px 20px; border-radius: 18px; background: var(--surface, #FFFCF7);
  border: 1.5px solid var(--rule); box-shadow: 0 18px 40px -18px rgba(31, 26, 20, 0.35); text-align: left; z-index: 3; }
.lb-dask-h { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.45rem; line-height: 1.2; color: var(--text); }
.lb-dask-sub:empty { display: none; }
.lb-dask-sub { margin: 6px 0 0; font-size: 0.95rem; color: var(--muted); }
.lb-dask-list { list-style: none; margin: 14px 0 18px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lb-dask-list li { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; color: var(--text); }
.lb-dask-list li::before { content: ''; flex: none; width: 12px; height: 7px; margin-top: -3px; border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.lb-dask-btn { display: block; width: 100%; padding: 14px; border: none; border-radius: 14px; cursor: pointer;
  background: linear-gradient(180deg, var(--accent), var(--accentDeep)); color: #fff; font-family: var(--font-ui);
  font-size: 1rem; font-weight: 700; box-shadow: 0 4px 0 #0E5346; }
.lb-dask-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #0E5346; }
.lb-dask-in { margin-top: 12px; text-align: center; font-size: 0.9rem; color: var(--muted); }
.lb-dask-in button { background: none; border: none; padding: 0; font: inherit; font-weight: 700; color: var(--accentDeep); cursor: pointer; }
