/* ============================================================================
   BE Fit Club · css/components.css · shared building blocks (see js/ui/components.js)
   Class names follow the design file (befit-designer.html, A · Floodlight), so
   markup can be lifted from the mock-ups. Light theme adds a 1 px ring (--ring).
   ========================================================================== */

/* ---------------------------------------------------------------- cards & rows */
.card { background: var(--s1); background-image: var(--sheen); border-radius: 16px; padding: var(--card-pad); box-shadow: var(--edge); }
.card + .card { margin-top: var(--card-gap); }
.rows { background: var(--s1); border-radius: 16px; overflow: hidden; box-shadow: var(--edge); }
.sheet .rows { background: var(--s2); box-shadow: none; }
.r {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: var(--h-row); padding: 8px 14px; border-top: 1px solid var(--line); text-align: left;
}
.r:first-child { border-top: 0; }
.r .grow { flex: 1; min-width: 0; }
.r .nm { font-weight: 550; overflow-wrap: anywhere; }
.r .meta { font-size: var(--fs-meta); color: var(--ink3); }
.r .end { flex: none; display: flex; align-items: center; gap: var(--sp-2); }
.r .pts { font: 600 15px var(--mono); font-variant-numeric: tabular-nums; }
button.r:active, a.r:active, .r[data-tap]:active { background: var(--s2); }
.sheet button.r:active, .sheet .r[data-tap]:active { background: var(--s3); }
.r.tall { min-height: 60px; padding: 10px 16px; }
.r.chg { box-shadow: inset 3px 0 0 var(--ink); }
.chev { color: var(--ink3); font-size: 18px; line-height: 1; flex: none; }

/* ---------------------------------------------------------------- marks */
.pos { font: 500 var(--fs-xs) var(--mono); color: var(--ink3); letter-spacing: .04em; }
.tm { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-meta); color: var(--ink2); white-space: nowrap; }
.tm::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--tc); flex: none; }
.bar-team { display: inline-block; width: 18px; height: 3px; border-radius: 2px; background: var(--tc); }
.wdl { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font: 700 12px var(--font); flex: none; }
.wdl.W { background: var(--ink); color: var(--on-ink); }
.wdl.D { box-shadow: inset 0 0 0 1px var(--ink3); color: var(--ink2); }
.wdl.L { background: var(--s2); color: var(--ink3); }
.mv { display: block; font: 500 var(--fs-xs)/1 var(--mono); margin-top: 2px; }
.mv.up { color: var(--ink); }
.mv.dn { color: var(--ink3); }
.pill-s { display: inline-flex; align-items: center; height: var(--h-pill); padding: 0 12px; border-radius: 999px; background: var(--s2); font-size: var(--fs-meta); color: var(--ink2); white-space: nowrap; pointer-events: none; }
.pill-s.warn { background: transparent; color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }
.pill-s.ink { background: var(--ink); color: var(--on-ink); }
.tagm { display: inline-flex; align-items: center; font-size: var(--fs-xs); font-weight: 500; padding: 3px 8px; border-radius: 999px; background: var(--s3); color: var(--ink2); margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
.warnchip { display: inline-flex; gap: 6px; align-items: center; font-size: var(--fs-meta); color: var(--warn); }
.warnchip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.ref-pill { font-size: var(--fs-meta); font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--ink); letter-spacing: .02em; white-space: nowrap; }
.av { --av: 32px; width: var(--av); height: var(--av); border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--ink); flex: none;
  background: color-mix(in srgb, var(--tc, var(--s3)) 22%, var(--s2)); box-shadow: inset 0 0 0 2px var(--tc, var(--s3)); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-meta); font-weight: 600; letter-spacing: .12em; }
.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 18%, transparent); }
.card-glyph { display: inline-block; width: 9px; height: 13px; border-radius: 2px; background: var(--yel); vertical-align: -1px; }
.card-glyph.red { background: var(--red); }
.tally { font: 500 var(--fs-xs) var(--mono); color: var(--ink2); }
.min { font: 500 var(--fs-meta) var(--mono); color: var(--ink2); width: 40px; flex: none; }
.kind { font-size: var(--fs-meta); color: var(--ink3); }

/* ---------------------------------------------------------------- buttons */
.btn {
  height: var(--h-btn); border-radius: var(--r-btn); width: 100%;
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-weight: 600; font-size: 15px; padding: 0 var(--sp-4); white-space: nowrap;
  transition: transform .08s ease, background-color .08s ease;
}
.btn.w { background: var(--ink); color: var(--on-ink); }
.btn.w:active { background: var(--ink-pressed); transform: scale(.98); }
.btn.g { background: var(--s2); color: var(--ink); }
.btn.g:active { background: var(--s3); transform: scale(.98); }
.btn.o { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--s3); }
.btn.o:active { background: var(--s1); transform: scale(.98); }
.btn.warn { background: transparent; color: var(--warn); box-shadow: inset 0 0 0 1px var(--s3); }
.btn.sm { height: var(--h-btn-sm); font-size: 14px; }
.btn.auto { width: auto; }
.btn.big { height: 56px; font-weight: 650; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn.w:disabled, .btn.w[aria-disabled="true"] { background: transparent; color: var(--ink2); box-shadow: inset 0 0 0 1.5px var(--s3); opacity: 1; }   /* disabled = outline, never a grey slab */
.link { min-height: var(--h-target-player); display: inline-flex; align-items: center; font-size: 14px; color: var(--ink2); }
.link.warn { color: var(--warn); }

/* save pattern states (Save.run) */
.is-saving { opacity: .55; pointer-events: none; }
.is-locked { opacity: .35; pointer-events: none; }
.ptile.is-saving { opacity: 1; background: var(--ink); color: var(--on-ink); }
.ptile.is-saving .pos { color: inherit; opacity: .6; }

/* ---------------------------------------------------------------- segmented + team switch */
.seg { display: flex; background: var(--s1); border-radius: var(--r-chip); padding: 3px; gap: 3px; box-shadow: var(--ring); }
.sheet .seg { background: var(--s2); box-shadow: none; }
.seg > button {
  flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13.5px; border-radius: 8px; color: var(--ink2); text-align: center; padding: 0 6px;
}
.sheet .seg > button, .seg.ref > button { min-height: var(--h-target); }
.seg > button.on { background: var(--s3); color: var(--ink); font-weight: 550; }
.seg > button .n { opacity: .6; font-weight: 500; }
.seg > button.team::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--tc); flex: none; }

/* page tabs (Players · Timeline) */
.tabs2 { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin: 0 calc(-1 * var(--gutter)) var(--sp-3); padding: 0 var(--gutter); }
.tabs2 > button { padding: 10px 0; min-height: var(--h-target-player); font-size: 14px; color: var(--ink3); }
.tabs2 > button.on { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--ink); }

/* ---------------------------------------------------------------- chips: one row, scrolls sideways, never wraps */
.chips { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chips > * { flex: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
  border-radius: 999px; background: var(--s1); color: var(--ink2); font-size: 13px; white-space: nowrap; box-shadow: var(--ring);
}
.sheet .chip, .chip.ref { min-height: var(--h-target); padding: 0 13px; font-size: 14px; background: var(--s2); box-shadow: none; }
.chip.on { background: var(--ink); color: var(--on-ink); font-weight: 600; box-shadow: none; }
.chip .n { opacity: .7; }

/* ---------------------------------------------------------------- tiles */
.ptile {
  height: var(--h-tile); min-height: var(--h-tile); width: 100%; border-radius: var(--r-btn); background: var(--s2);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
  padding: 8px 14px; font-weight: 550; text-align: left; line-height: 1.2; overflow: hidden;
}
.ptile > .pt-name { font-size: 14.5px; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ptile .pos { line-height: 1; }
.ptile.c { align-items: center; text-align: center; }
.ptile.sel { background: var(--ink); color: var(--on-ink); }
.ptile.sel .pos { color: inherit; opacity: .6; }
.ptile:active { transform: scale(.98); }
.page .ptile, .ptile.on-page { background: var(--s1); box-shadow: var(--ring); }
.tile { background: var(--s1); border-radius: 16px; display: flex; flex-direction: column; justify-content: center; padding: 0 14px; position: relative; overflow: hidden; box-shadow: var(--edge); text-align: left; }
.tile b { font-size: var(--fs-title); font-weight: 600; }
.tile small { font-size: var(--fs-meta); color: var(--ink3); }
.tile.team::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tc); }
.tile svg { width: 20px; height: 20px; stroke: var(--ink2); fill: none; stroke-width: 1.6; margin-bottom: 6px; }
.tile:active { background: var(--s2); transform: scale(.98); }
.grid4 .tile { align-items: center; padding: 0; text-align: center; }
.grid4 .tile b { font-size: 13px; font-weight: 550; }

/* ---------------------------------------------------------------- inputs */
.inp { height: var(--h-target); border-radius: var(--r-btn); background: var(--s1); display: flex; align-items: center; padding: 0 14px; color: var(--ink); font-size: 14px; gap: 10px; box-shadow: var(--ring); }
.sheet .inp { background: var(--s2); box-shadow: none; }
.inp svg { width: 18px; height: 18px; stroke: var(--ink3); fill: none; stroke-width: 1.8; }
.inp input { flex: 1; height: 100%; font-size: 16px; }   /* 16 px stops phones zooming in */
/* round 8: the eye in a password box (shows / hides what was typed) */
.inp-pw { padding-right: 2px; }
.inp-pw input { min-width: 0; }
.pw-eye { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; color: var(--ink3); }
.pw-eye svg { width: 20px; height: 20px; stroke: currentColor; }
.pw-eye[aria-pressed="true"] { color: var(--ink); }
.pw-eye:active { background: var(--s3); }
.inp input::placeholder { color: var(--ink3); }
.inp:focus-within { box-shadow: inset 0 0 0 1.5px var(--ink2); }   /* one 1.5 px ink2 ring; never a white line (base.css) */
.field-err { color: var(--warn); font-size: var(--fs-meta); min-height: 18px; margin-top: 6px; }
.step { width: var(--h-target); height: var(--h-target); border-radius: var(--r-chip); background: var(--s3); display: grid; place-items: center; font: 600 18px var(--font); color: var(--ink); }

/* ---------------------------------------------------------------- clock (the score block itself is in "round 5" below) */
.clock { font: 700 22px/1 var(--font); font-variant-numeric: tabular-nums; }
.clock-s { font-size: var(--fs-meta); color: var(--ink3); margin-top: 5px; }
.scorers { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); font-size: var(--fs-meta); color: var(--ink2); margin-top: var(--sp-3); }
.scorers > div:last-child { text-align: right; }
.scorers .n { color: var(--ink3); }

/* ---------------------------------------------------------------- table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { font: 500 var(--fs-xs) var(--mono); color: var(--ink3); text-align: right; padding: 6px; }
.tbl td { padding: 0 6px; height: var(--h-trow); border-top: 1px solid var(--line); text-align: right; font: 13px var(--mono); font-variant-numeric: tabular-nums; }
.tbl td.l, .tbl th.l { text-align: left; font-family: var(--font); }
.tbl tr.you td { background: var(--hl); }
.bk { font-weight: 650; }

/* ---------------------------------------------------------------- bottom sheet */
.dim { position: fixed; inset: 0; z-index: 60; background: var(--dimc); animation: fade-in .16s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  max-width: 520px; margin: 0 auto; max-height: 90vh; max-height: 90dvh;
  display: flex; flex-direction: column;
  background: var(--sheet); color: var(--ink); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  border-top: 1px solid var(--s3); box-shadow: var(--shadow-float);
  padding: 10px var(--gutter) calc(var(--sheet-safe) + var(--safe-b));
  animation: sheet-up .2s ease;
}
[data-theme="light"] .sheet, .sheet[data-theme="light"] { border-top-color: var(--line); }
.sheet .hdl { width: 36px; height: 4px; border-radius: 2px; background: var(--s3); margin: 0 auto 12px; flex: none; }
.sheet-h { flex: none; }
.sheet h4 { font-size: var(--fs-title); font-weight: 620; display: flex; align-items: center; gap: var(--sp-2); margin-bottom: 6px; }
.sheet h4 .end { margin-left: auto; font: 500 13px var(--font); font-variant-numeric: tabular-nums; color: var(--ink2); }   /* counts ("2 not paid", "Season 2026") in Geist; a minute inside uses .n (Mono) */
.sheet .sh-s { font-size: var(--fs-meta); color: var(--ink3); margin-bottom: var(--sp-3); }
.sheet-b { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.sheet-f { flex: none; padding-top: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
@keyframes sheet-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
/* round 8: popups you type into (sign-in, Find a player, New person) sit in the upper middle, clear of the phone's
   keyboard, with the page dimmed behind (Reuben, 5 Nov) */
.sheet.sh-shell-signin, .sheet.sh-setup-new {
  top: max(12dvh, calc(env(safe-area-inset-top, 0px) + 16px)); bottom: auto; left: var(--gutter); right: var(--gutter);
  max-height: 70dvh; border-radius: var(--r-sheet); border: 1px solid var(--s3);
  padding: 18px var(--gutter) var(--sheet-safe); animation: sheet-pop .18s ease;
}
.sheet.sh-shell-signin .hdl, .sheet.sh-setup-new .hdl { display: none; }
[data-theme="light"] .sheet.sh-shell-signin, [data-theme="light"] .sheet.sh-setup-new { border-color: var(--line); }
@keyframes sheet-pop { from { transform: scale(.97); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
body.sheet-open { overflow: hidden; }

/* ---------------------------------------------------------------- Undo bar, save bar, toast */
:root { --float-bottom: calc(var(--h-nav) + 12px + var(--safe-b)); }
body.no-nav { --float-bottom: calc(12px + var(--safe-b)); }
@media (min-width: 960px) { :root, body.no-nav { --float-bottom: 24px; } }
.undo, .savebar, .toast {
  position: fixed; left: 12px; right: 12px; bottom: var(--float-bottom); z-index: 80;
  max-width: 496px; margin: 0 auto;
  border-radius: var(--r-card); background: var(--ink); color: var(--on-ink);
  display: flex; align-items: center; gap: 10px; overflow: hidden; box-shadow: var(--shadow-float);
  animation: sheet-up .18s ease;
}
body.sheet-open .undo, body.sheet-open .toast { top: calc(12px + env(safe-area-inset-top, 0px)); bottom: auto; }
.undo { min-height: 64px; padding: 8px 8px 8px 14px; }   /* 64 px; grows only if a long name needs a 3rd line, never cuts text */
.undo .tx { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.25; white-space: normal; overflow-wrap: break-word; }
.undo .tx b { font-weight: 650; }
.undo .ub, .savebar .ub {
  height: var(--h-target); padding: 0 16px; border-radius: 10px; background: var(--bg); color: var(--ink);
  font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; flex: none;
}
.undo .ub.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; }
.undo .ub .n { opacity: .6; }
.undo .bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--bg); opacity: .35; transform-origin: left; }
.undo .tick { width: 22px; height: 22px; border-radius: 50%; background: var(--bg); color: var(--ink); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.undo.err { background: var(--warnfill); color: var(--on-warn); }
.undo.err .ub { background: var(--on-warn); color: var(--warnfill); }
.undo.err .tick { background: var(--on-warn); color: var(--warnfill); }
.undo.saving .tick { background: transparent; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.savebar { height: 64px; justify-content: space-between; padding: 0 8px 0 16px; font-size: 13.5px; }
.toast { height: var(--h-target); padding: 0 16px; font-size: 13.5px; font-weight: 550; justify-content: center; white-space: nowrap; pointer-events: none; left: 50%; right: auto; transform: translateX(-50%); max-width: calc(100vw - 24px); }
.toast.err { background: var(--warnfill); color: var(--on-warn); }
.toast .toast-act { pointer-events: auto; height: 100%; min-width: 44px; padding: 0 2px; margin-right: -4px; font: inherit; font-weight: 700; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.toast.has-act { gap: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- hold to confirm (2 s) */
.hold {
  position: relative; overflow: hidden; width: 100%; height: 56px; border-radius: var(--r-btn);
  box-shadow: inset 0 0 0 1px var(--s3); color: var(--ink); font-weight: 600; font-size: 15px;
  display: flex; align-items: center; justify-content: center; user-select: none; -webkit-user-select: none; touch-action: none;
}
.hold .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--s3); }
.hold.holding .fill { width: 100%; transition: width var(--hold-ms, 2000ms) linear; }
.hold .hl { position: relative; }
.hold.warn { color: var(--warn); }
.hold.done { pointer-events: none; }

/* ---------------------------------------------------------------- points delta, flags, money chips */
.delta { background: var(--hl); border-radius: var(--r-btn); padding: 10px 12px; margin-top: 10px; }
.delta .dr { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; padding: 3px 0; gap: var(--sp-2); }
.delta .dr b { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.flag { border-radius: var(--r-btn); padding: 12px 14px; background: var(--s1); box-shadow: inset 3px 0 0 var(--warnfill), var(--ring); }
.flag.info { box-shadow: inset 3px 0 0 var(--s3), var(--ring); }
.amt { display: flex; gap: 6px; }
.amt > button { height: var(--h-target); min-width: 72px; padding: 0 9px; border-radius: 9px; background: var(--s2); display: grid; place-items: center; font: 500 13px var(--mono); color: var(--ink2); }
.amt > button.on { background: var(--ink); color: var(--on-ink); font-weight: 600; }
.mv2 { height: var(--h-target); padding: 0 14px; border-radius: var(--r-btn); background: transparent; color: var(--ink2); box-shadow: inset 0 0 0 1px var(--s3); display: flex; align-items: center; font-size: 13.5px; font-weight: 600; flex: none; }
.prog { height: 6px; border-radius: 3px; background: var(--s3); overflow: hidden; }
.prog > i { display: block; height: 100%; background: var(--ink); }

/* ---------------------------------------------------------------- empty, skeleton, offline bar */
.empty { text-align: center; color: var(--ink3); padding: 40px 16px; font-size: 14px; }
.empty b { display: block; color: var(--ink); font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.skel { background: var(--s1); border-radius: var(--r-card); min-height: 48px; box-shadow: var(--ring); }
.offline {
  display: flex; align-items: center; gap: 10px; border-radius: var(--r-card); padding: 10px 8px 10px 14px;
  background: var(--warnfill); color: var(--on-warn); font-size: 13px; line-height: 1.3;
}
.offline svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.offline .grow { flex: 1; min-width: 0; }
.offline b { font-weight: 650; }
.offline .ub { height: 40px; padding: 0 14px; border-radius: 10px; background: var(--on-warn); color: var(--warnfill); font-weight: 600; flex: none; }
.placeholder { border: 1px dashed var(--s3); border-radius: var(--r-card); padding: var(--sp-4); color: var(--ink3); font-size: 13px; }
.placeholder b { color: var(--ink2); font-weight: 600; }
.toast { animation: fade-in .16s ease; }
.tick-on { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.hd-pill { position: relative; }
.hd-pill::after { content: ''; position: absolute; inset: -9px -4px; }
.undo .tx small { display: block; font-size: var(--fs-meta); opacity: .75; }
.undo .ub.icon { width: var(--h-target); padding: 0; justify-content: center; }
.undo.err .ub.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; }

/* ============================================================================
   ROUND 5 · "Floodlight with aura" shared pieces (js/ui/components.js documents the helpers)
   Light (gradients, glows) only inside .hero (one per screen) or .lit (listed components).
   ========================================================================== */

/* ---------------------------------------------------------------- the joined score block */
.sb { --h: 76px; --fs: var(--fs-score); --sb-mid: 72px; --sb-cols: 1fr var(--sb-mid) 1fr; display: block; width: 100%; text-align: left; color: var(--ink); }
.sb.sb-console { --h: 66px; --fs: var(--fs-score-console); }
.sb.sb-compact { --h: 60px; --fs: var(--fs-score-compact); }
.sb-names { display: grid; grid-template-columns: var(--sb-cols); margin-bottom: 8px; align-items: center; }
.sb-nm { font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; display: flex; align-items: center; gap: 7px; color: var(--ink); min-width: 0; overflow-wrap: break-word; }
.sb-nm::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--tc); flex: none; }
.sb-nm.rt { flex-direction: row-reverse; justify-content: flex-start; text-align: right; }
.sb-blk { display: grid; grid-template-columns: var(--sb-cols); border-radius: 14px; overflow: hidden; height: var(--h); box-shadow: inset 0 0 0 1px var(--line); }
.sb-half { display: grid; place-items: center; min-width: 0;
  background: radial-gradient(70% 90% at 50% 100%, color-mix(in srgb, var(--tc, var(--s3)) var(--glow), transparent), transparent 70%),
              color-mix(in srgb, var(--tc, var(--s3)) var(--tint-hero), var(--s1)); }
.sb-half .hn { font-size: var(--fs); }
.sb-mid { background: var(--s2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; padding: 0 4px; }
.sb-mid b { font: 700 17px/1.1 var(--font); letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-mid small { font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--ink3); text-align: center; line-height: 1.15; }
.sb-mid.is-stoppage { background: color-mix(in srgb, var(--warn) 20%, var(--s2)); }
.sb-mid.is-stoppage b, .sb-mid.is-stoppage small { color: var(--warn); }
.sb-scorers { display: grid; grid-template-columns: var(--sb-cols); margin-top: 10px; font-size: 13px; color: var(--ink2); line-height: 1.6; }
.sb-scorers .rt { text-align: right; grid-column: 3; }
.sb-scorers .sc-r { overflow-wrap: break-word; }
.sb-scorers .n { color: var(--ink3); font-size: 12px; }
.sb-scorers.multi { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--sp-3); }
button.sb:active .sb-blk { filter: brightness(1.08); }
@media (min-width: 960px) { .sb { max-width: 560px; margin-left: auto; margin-right: auto; } }   /* no numbers 700 px apart */

/* mini score (lists) */
.ms { display: inline-flex; gap: 3px; align-items: center; flex: none; }
.ms i { font-style: normal; width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center;
  font: 700 14px var(--font); font-variant-numeric: tabular-nums; color: var(--tc); background: color-mix(in srgb, var(--tc) var(--tint-hero), var(--s2)); }
[data-theme="light"] .ms i { color: color-mix(in srgb, var(--tc) 85%, #000); }
.ms i.lose, [data-theme="light"] .ms i.lose { color: var(--ink2); }

/* LIVE dot: pulses (1.6 s halo); off under reduced motion */
.live.pulse::before { animation: live-pulse 1.6s ease-out infinite; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ink) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
@media (prefers-reduced-motion: reduce) { .live.pulse::before { animation: none; } .hold.holding .fill { transition: none; } }

/* ---------------------------------------------------------------- team colour, visible */
/* team chip: 24 px pill, soft tint, team ring, 7 px square + word, 12/600 */
.tc { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; flex: none;
  background: color-mix(in srgb, var(--tc) var(--tint-soft), transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) var(--tint-ring), transparent); }
.tc::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: var(--tc); flex: none; }
/* W · D · L in the team's colour */
.wdl.tcol.W { background: var(--tc); color: var(--bg); }
.wdl.tcol.D { background: transparent; box-shadow: inset 0 0 0 1.5px var(--tc); color: var(--tc); }
[data-theme="light"] .wdl.tcol.D { color: color-mix(in srgb, var(--tc) 85%, #000); }
.wdl.tcol.L { background: color-mix(in srgb, var(--tc) 14%, transparent); color: var(--ink3); box-shadow: none; }
/* team row wash (linear 16% → 0 over 60%) and the "you" row (14% → 4% + 3 px team edge) */
.wash { background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 16%, transparent), transparent 60%); }
.you-row { background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 14%, transparent), color-mix(in srgb, var(--tc) 4%, transparent)); box-shadow: inset 3px 0 0 var(--tc); }
.tbl tr.you-row { box-shadow: none; }
.tbl tr.you-row td { background: transparent; }
.tbl tr.you-row td:first-child { box-shadow: inset 3px 0 0 var(--tc); }

/* ---------------------------------------------------------------- light: heroes and lit components */
/* .hero = THE one glowing element on a screen (score block, your points, #1 podium, goal moment, share cards) */
.hero { position: relative; }
.card.hero, .hero-card { position: relative; overflow: hidden; border-radius: var(--r-card);
  background: radial-gradient(90% 120% at 15% 110%, color-mix(in srgb, var(--tc, var(--s3)) var(--glow), transparent), transparent 65%), var(--s1); }
.card.hero::after, .hero-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), inset 0 0 0 1px color-mix(in srgb, var(--tc, var(--s3)) 22%, transparent); }
[data-theme="light"] .card.hero::after, [data-theme="light"] .hero-card::after { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc, var(--line)) 30%, var(--line)); }
.sheen { background-image: var(--sheen); }

/* sum pattern: values in one 72 px right column (Geist 650 16), a 2 px ink3 rule, the total as the hero */
.sum { background: var(--s2); border-radius: 16px; padding: 4px 16px 0; box-shadow: var(--edge); }
.sum .sr { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); min-height: 44px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.sum .sr:first-child { border-top: 0; }
.sum .sr-l { min-width: 0; overflow-wrap: break-word; }
.sum .sr .v { font: 650 16px var(--font); font-variant-numeric: tabular-nums; width: 72px; text-align: right; color: var(--ink); flex: none; }
.sum .sum-tot { display: flex; align-items: flex-end; justify-content: space-between; margin: 0 -16px; padding: 14px 16px 16px; border-top: 2px solid var(--ink3); border-radius: 0 0 16px 16px;
  background: radial-gradient(60% 120% at 100% 100%, color-mix(in srgb, var(--tc, var(--s3)) var(--glow), transparent), transparent 70%); }
.sum .sum-tot .lab { font-size: 12px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--ink3); padding-bottom: 6px; }
.sum .sum-tot .hn { font-size: 56px; text-align: right; min-width: 72px; }
.sheet .sum { background: var(--s2); }

/* stepped podium: order 2 · 1 · 3; steps 64 / 92 / 44; #1 1.18× wider, 58 px avatar with a halo, radial team light */
.pod { display: grid; grid-template-columns: 1fr 1.18fr 1fr; gap: 6px; align-items: end; }
.pcol { display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; min-width: 0; width: 100%; }
.pcol .who { display: flex; flex-direction: column; align-items: center; padding: 0 2px 10px; position: relative; width: 100%; }
.pcol.first .who::before { content: ''; position: absolute; left: -30%; right: -30%; top: -14px; bottom: -10px; z-index: 0; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 45%, color-mix(in srgb, var(--tc) 34%, transparent), transparent 72%); }
.pcol .who > * { position: relative; z-index: 1; }
.pcol .av { --av: 44px; font-size: 17px; margin-bottom: 6px; }
.pcol.first .av { --av: 58px; font-size: 22px; box-shadow: inset 0 0 0 2.5px var(--tc), 0 0 0 4px color-mix(in srgb, var(--tc) 22%, transparent); }
.pcol .nm { font-weight: 650; font-size: 13.5px; line-height: 1.15; overflow-wrap: break-word; }
.pcol .hn { font-size: 24px; margin-top: 4px; }
.pcol.first .hn { font-size: 34px; }
.pcol .st { font-size: 12px; color: var(--ink3); margin-top: 3px; line-height: 1.3; }
.pcol .step { width: 100%; border-radius: 12px 12px 4px 4px; display: flex; justify-content: center; padding-top: 8px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 30%, var(--s1)), color-mix(in srgb, var(--tc) 6%, var(--s1)));
  box-shadow: inset 0 2px 0 color-mix(in srgb, var(--tc) 75%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--tc) 22%, transparent); }
.pcol.r1 .step { height: 92px; } .pcol.r2 .step { height: 64px; } .pcol.r3 .step { height: 44px; }
.pcol .step b { font: 800 28px/1 var(--font); color: color-mix(in srgb, var(--tc) 70%, var(--ink)); opacity: .9; }
.pcol.first .step b { font-size: 36px; }
button.pcol:active .step { filter: brightness(1.1); }

/* leader rows: tinted 22% → 0 with a 1.5 px glowing top edge, 40 px number with a soft team text-glow */
.ldr { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; overflow: hidden; width: 100%; text-align: left;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 22%, var(--s1)), var(--s1) 70%);
  box-shadow: inset 0 1.5px 0 color-mix(in srgb, var(--tc) 70%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--tc) 20%, transparent); }
.ldr + .ldr { margin-top: 8px; }
.ldr .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ldr .k { font-size: 12px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--ink3); }
.ldr .w { font-weight: 650; font-size: 15px; margin-top: 2px; overflow-wrap: break-word; }
.ldr .nx { font-size: 12px; color: var(--ink3); margin-top: 2px; }
.ldr .hn { font-size: 40px; margin-left: auto; color: var(--ink); text-shadow: 0 0 24px color-mix(in srgb, var(--tc) 45%, transparent); }

/* ---------------------------------------------------------------- header pills (shell) */
.hd-pillbtn { min-height: var(--h-target-player); display: inline-flex; align-items: center; flex: none; }
body[data-mode="referee"] .hd-pillbtn { min-height: var(--h-target); }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 6px; border-radius: 999px; font-size: 13.5px; font-weight: 600; white-space: nowrap; color: var(--ink); }
.pill .car { font-size: 12px; color: var(--ink3); margin-left: 2px; }
.pill.out { box-shadow: inset 0 0 0 1.5px var(--s3); padding: 0 12px; }
.pill.out svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.pill.me { background: color-mix(in srgb, var(--tc) 14%, var(--s1)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tc) 45%, transparent); }
.pill.me .av { --av: 26px; font-size: 12px; }
.pill.role { box-shadow: inset 0 0 0 1.5px var(--ink); padding: 0 12px; }
.hd-pillbtn:active .pill { filter: brightness(1.15); }
.hd-title { font-size: 14px; color: var(--ink2); white-space: nowrap; }

/* sync chip (referee header) */
.sync { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink3); white-space: nowrap; position: relative; }
.hd-syncbtn { min-height: var(--h-target); display: inline-flex; align-items: center; flex: none; }   /* 48 px tap area */
.sync.wait { color: var(--warn); background: var(--attn); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 45%, transparent); }
.sync.wait::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
/* phone: while saves wait, the amber chip needs the room; the date steps aside until everything is sent */
@media (max-width: 959px) { .hd:has(.sync.wait) .hd-c { display: none; } .hd:has(.sync.wait) { grid-template-columns: auto 1fr auto; } }

/* front-door style option rows with a letter tile (welcome, pill sheets) */
.opt-l { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--s2); font-weight: 700; font-size: 13px; flex: none; }
.sheet .opt-l { background: var(--s3); }
/* name-chip sheet header: avatar, name, "DEF · Red · 12th" */
.pill-who { display: flex; align-items: center; gap: 12px; margin: 2px 0 14px; }
.pill-who .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pill-who b { font-size: 18px; font-weight: 700; overflow-wrap: break-word; }
.sh-shell-pill .r.quiet .nm { color: var(--ink2); font-weight: 500; }
/* the last group of every pill sheet: full-width 48 px buttons (Back to menu · Sign out) */
.sh-end { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-4); }
.btn.sh-act { height: var(--h-target); }
.btn.o.out { color: var(--red); }
