/* ==========================================================================
   Barend & Erin's Baby Pool: component stylesheet
   Load order: fonts.css → tokens.css → app.css
   Classes mirror the design artboards one to one (see docs/design-system.md
   for the component inventory and which screen uses what).
   Mobile-first; layouts adapt with flex-wrap / auto-fit grids, so the same
   markup works on a phone and a laptop. Only two media queries exist:
   reduced motion, and the laptop top bar.
   ========================================================================== */

/* ---------- Base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
}
a { color: var(--grape); }
a:hover { color: var(--grape-hover); }
:focus-visible { outline: var(--focus); outline-offset: 2px; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul.plain, ol.plain { list-style: none; padding: 0; }
[x-cloak] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* ---------- Layout ------------------------------------------------------- */
.app { min-height: 100vh; }
.wrap { max-width: var(--container); margin: 0 auto; }
.wrap--wide { max-width: var(--container-wide); }
.main { padding: 8px var(--gutter) 48px; display: flex; flex-direction: column; gap: var(--gap-md); }
.main--wide { padding: 32px 32px 56px; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.stack--sm { gap: var(--gap-sm); }
.stack--lg { gap: var(--gap-md); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-sm); }
.row--between { justify-content: space-between; align-items: baseline; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
/* Laptop two-column: side column + main column; stacks on a phone */
.split { display: flex; flex-wrap: wrap; gap: var(--gap-lg); align-items: flex-start; }
.split__side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.split__main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: var(--gap-md); }
.center { text-align: center; }

/* ---------- Typography --------------------------------------------------- */
.h1 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-h1); line-height: 1.15; }
.h1--hero { font-size: var(--fs-hero); line-height: var(--lh-tight); }
.h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-h2); line-height: 1.2; }
.h3 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-h3); line-height: 1.2; }
.h4 { font-size: var(--fs-base); font-weight: 800; }
.eyebrow { font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--sun-ink); }
.muted { color: var(--ink-muted); }
.small { font-size: var(--fs-sm); }
.secondary { font-size: var(--fs-md); }
.num { font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; line-height: var(--lh-tight); }
.title-block { padding: 4px 4px 0; }
.title-block p { margin-top: 4px; font-size: var(--fs-md); color: var(--ink-muted); }

/* ---------- Top bar, brand, user chip ----------------------------------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); padding: 16px var(--gutter) 4px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: var(--tap); color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand__mark { width: 36px; height: 36px; flex: none; }
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: var(--lh-tight); }
@media (max-width: 399px) { .brand__name { font-size: 17px; } }
.user-chip {
  display: flex; align-items: center; gap: var(--gap-sm); min-height: var(--tap);
  padding: 4px 14px 4px 4px; border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700; font-size: var(--fs-md);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--grape-soft); color: var(--grape); font-weight: 800; font-size: var(--fs-md);
}
.avatar--host { background: var(--ink); color: var(--sun); }
.avatar--plain { background: var(--surface-sunk); color: var(--ink); width: 40px; height: 40px; }
.keepsake-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 800; color: var(--ink-muted);
}

/* Phone: the chrome (top bar + nav) is constrained like the content column */
.chrome { max-width: var(--container); margin: 0 auto; }
@media (min-width: 900px) { .chrome { max-width: none; margin: 0; } }

/* Static laptop previews only: white top bar with inline nav */
.topbar--wide { background: var(--surface); border-bottom: 1px solid var(--line); padding: 0; }
.topbar--wide > .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 12px 32px; }
.topbar--wide .brand__mark { width: 40px; height: 40px; }
.topbar--wide .brand__name { font-size: 22px; }

/* ---------- Navigation --------------------------------------------------- */
.nav { display: flex; gap: var(--gap-sm); overflow-x: auto; padding: 12px var(--gutter); scrollbar-width: none; }
.nav__item {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 18px;
  border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-weight: 700; font-size: var(--fs-md); text-decoration: none;
}
.nav__item:hover { color: var(--ink); border-color: var(--line-strong); }
.nav__item[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--ink-on-dark); }
.nav__item--locked { background: transparent; border: 1px dashed var(--line-strong); color: var(--ink-muted); padding: 0 16px; cursor: default; }
.nav__item .count { background: var(--surface-sunk); border-radius: var(--radius-pill); padding: 0 8px; font-size: 13px; }
.nav__item[aria-current="page"] .count { background: #4A3E5E; }
.nav--inline { flex: 1; justify-content: center; flex-wrap: wrap; overflow: visible; padding: 0; gap: var(--gap-xs); }
.nav--inline .nav__item { border-color: transparent; background: transparent; }
.nav--inline .nav__item[aria-current="page"] { background: var(--ink); }
.nav--inline .nav__item--locked { border: 0; }

/* Host mode strip */
.host-bar { background: var(--ink); color: var(--ink-on-dark); }
.host-bar > .wrap { padding: 8px var(--gutter); display: flex; justify-content: space-between; align-items: center; gap: var(--gap); font-size: var(--fs-sm); font-weight: 700; }
.host-bar a { color: var(--sun); min-height: 32px; display: inline-flex; align-items: center; }
.host-bar__label { display: inline-flex; align-items: center; gap: 6px; }
.host-bar__signout { background: none; border: 0; padding: 0; font: inherit; color: var(--sun); min-height: 32px; cursor: pointer; }

/* ---------- Cards / panels ---------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.card--tight { padding: 16px; }
.card--stack { display: flex; flex-direction: column; gap: 14px; }
.card--sun { background: var(--sun-soft); border: 0; border-radius: var(--radius-xl); }
.card--grape { background: var(--grape); color: var(--ink-on-dark); border: 0; }
.card--ink { background: var(--ink); color: var(--ink-on-dark); border: 0; border-radius: var(--radius-xl); }
.card--winner { background: var(--sun); border: 0; border-radius: var(--radius-xl); text-align: center; }
.card--dashed { background: transparent; border: 2px dashed var(--line-strong); }
.card--soft { background: var(--grape-soft); border: 0; }
.card--you { border: 2px solid var(--grape); }
.card--warn { background: var(--warn-soft); border: 2px solid var(--warn); }
.card--announce { border: 2px solid var(--ink); border-radius: 28px; text-align: center; position: relative; overflow: hidden; }
.card--hero { position: relative; overflow: hidden; padding: 24px 20px 22px; }
.card__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--gap); }
.confetti { position: absolute; pointer-events: none; }
.confetti--corner { right: -6px; top: -4px; }
.confetti--top { left: 50%; top: 0; transform: translateX(-50%); }
.icon-circle { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--good-soft); color: var(--good); }

/* ---------- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--gap-sm);
  min-height: var(--tap-lg); padding: 0 20px; border-radius: var(--radius); border: 2px solid transparent;
  font-weight: 800; font-size: var(--fs-base); text-decoration: none; cursor: pointer; text-align: center;
}
.btn--block { display: flex; width: 100%; }
.btn--lg { min-height: 56px; font-size: var(--fs-lg); border-radius: var(--radius-md); }
.btn--sm { min-height: var(--tap); padding: 0 14px; font-size: var(--fs-sm); border-radius: var(--radius-sm); }
.btn--primary { background: var(--grape); color: var(--ink-on-dark); }
.btn--primary:hover { background: var(--grape-hover); color: var(--ink-on-dark); }
.btn--sun { background: var(--sun); color: var(--ink); }
.btn--ink { background: var(--ink); color: var(--ink-on-dark); }
.btn--outline { background: var(--surface); border-color: var(--grape); color: var(--grape); }
.btn--secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn--danger { background: var(--warn); color: var(--ink-on-dark); }
.btn--danger-outline { background: var(--surface); border-color: var(--warn-line); color: var(--danger-text); }
.btn--on-dark { background: var(--surface); color: var(--grape); min-height: 48px; }
.btn--link-danger { background: transparent; border: 0; min-height: var(--tap); color: var(--danger-text); text-decoration: underline; font-weight: 700; font-size: var(--fs-md); }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--surface-sunk); border: 2px dashed var(--line-strong); color: var(--ink-muted); cursor: not-allowed; }
.btn.htmx-request { opacity: .7; cursor: progress; }

/* ---------- Chips & badges ---------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--gap-sm); list-style: none; padding: 0; }
.chip { background: var(--surface-sunk); border-radius: var(--radius-pill); padding: 6px 12px; font-weight: 700; font-size: var(--fs-md); }
.chip--girl { background: var(--girl-soft); color: var(--girl-ink); }
.chip--boy { background: var(--boy-soft); color: var(--boy-ink); }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-pill); padding: 3px 10px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.badge--provisional { background: var(--sun-soft); color: var(--sun-ink); }
.badge--final, .badge--revealed { background: var(--good-soft); color: var(--good); }
.badge--pending { background: var(--surface-sunk); color: var(--ink-muted); }
.badge--void, .badge--hidden { background: var(--void-soft); color: var(--calm-ink-2); }
.badge--late { background: var(--warn-soft); color: var(--warn-ink); }
.badge--host { background: var(--grape-soft); color: var(--grape); }
.badge--locked { background: var(--sun); color: var(--ink); font-size: var(--fs-sm); padding: 4px 12px; }
.badge--new { background: var(--grape); color: var(--ink-on-dark); letter-spacing: .06em; text-transform: uppercase; padding: 4px 12px; }
.badge--bonus { background: var(--sun); color: var(--ink); font-size: var(--fs-sm); }
.live-dot { display: inline-flex; align-items: center; gap: var(--gap-sm); font-size: var(--fs-sm); font-weight: 800; color: var(--good); }
.live-dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--good); animation: bbp-pulse 1.6s ease-in-out infinite; }

/* ---------- Countdown ---------------------------------------------------- */
.countdown { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-sm); }
.countdown__cell { background: var(--surface); border-radius: var(--radius-md); padding: 10px 8px; text-align: center; }
.countdown__num { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-num); line-height: var(--lh-tight); font-variant-numeric: tabular-nums; }
.countdown__unit { font-size: var(--fs-sm); color: var(--ink-muted); font-weight: 700; }

/* ---------- Crowd Summary ------------------------------------------------ */
.split-bar { display: flex; height: 44px; border-radius: 12px; overflow: hidden; gap: 3px; font-weight: 800; }
.split-bar__girl { background: var(--girl); color: var(--girl-ink-deep); display: flex; align-items: center; padding-left: 12px; }
.split-bar__boy { background: var(--boy); color: var(--ink-on-dark); display: flex; align-items: center; justify-content: flex-end; padding-right: 12px; }
/* Histogram: set style="--h: 66%" on each bar (0–100 % of the tallest) */
.histogram { display: flex; align-items: flex-end; gap: 4px; height: 96px; border-bottom: 2px solid var(--ink); }
.histogram--hours { gap: 2px; height: 72px; }
.histogram__col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; }
.histogram__count { font-size: var(--fs-xs); font-weight: 800; }
.histogram__bar { width: 100%; height: var(--h, 2px); min-height: 2px; background: var(--grape); border-radius: 4px 4px 0 0; }
.histogram--hours .histogram__bar { border-radius: 3px 3px 0 0; }
.histogram__bar--due { background: var(--tangerine); }
.histogram__ticks { display: flex; gap: 4px; margin-top: 4px; font-size: 11px; font-weight: 700; color: var(--ink-muted); }
.histogram__ticks > span { flex: 1; text-align: center; }
.histogram__ticks .is-due { color: var(--sun-ink); }
.axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; color: var(--ink-muted); }
.stat__label { font-size: var(--fs-sm); font-weight: 800; color: var(--ink-muted); }
.stat__value { font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: var(--lh-tight); margin-top: 2px; }
.stat__hint { font-size: 13px; color: var(--ink-muted); margin-top: 4px; }
.letter-rank { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; list-style: none; padding: 0; }
.letter-rank li { background: var(--surface-sunk); border-radius: var(--radius-md); padding: 12px 8px; text-align: center; font-size: var(--fs-sm); font-weight: 700; }
.letter-rank li:first-child { background: var(--grape-soft); }
.letter-rank b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 40px; line-height: 1; }
.letter-rank li:first-child b { color: var(--grape); }

/* ---------- Progress ---------------------------------------------------- */
.progress { height: 10px; border-radius: var(--radius-pill); background: var(--line-soft); overflow: hidden; }
.progress__fill { height: 100%; width: var(--pct, 0%); background: var(--good); border-radius: var(--radius-pill); }
.progress--on-grape { background: var(--grape-track); }
.progress--on-grape .progress__fill { background: var(--sun); }
.progress-steps { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; }
.progress-steps > span { height: 16px; border-radius: 6px; background: var(--line); }
.progress-steps > span.is-on { background: var(--grape); }

/* ---------- Forms -------------------------------------------------------- */
.field { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: var(--gap-sm); min-width: 0; margin: 0; }
fieldset.field { display: block; }
fieldset.field > legend { float: left; width: 100%; padding: 0; margin-bottom: var(--gap); }
fieldset.field > legend + * { clear: both; }
.field__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--gap-sm); flex-wrap: wrap; }
.field__label { font-weight: 800; font-size: var(--fs-lg); }
.field__pts { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-muted); }
.field__help { font-size: var(--fs-sm); color: var(--ink-muted); }
.field__error { font-size: var(--fs-md); font-weight: 700; color: var(--warn); }
.field--bonus { background: var(--sun-softer); border: 2px dashed var(--sun); }
.field--error { border: 2px solid var(--warn); }
.field--error .input { border-color: var(--warn); }
.input {
  width: 100%; min-height: 56px; padding: 0 14px; border-radius: var(--radius); border: 2px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-size: 19px; font-weight: 700;
}
.input:focus { border-color: var(--grape); }
.input--lg { font-size: 20px; padding: 0 16px; }
.input--center { text-align: center; font-size: 22px; font-weight: 800; }
.input--ok { border-color: var(--good); }
.input--taken { border-color: #E58A4E; }
textarea.input { min-height: 96px; padding: 12px 14px; font-size: var(--fs-base); font-weight: 400; resize: vertical; }
.input-unit { position: relative; flex: 1; min-width: 0; }
.input-unit > .input { padding-right: 44px; }
.input-unit > .unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-weight: 800; color: var(--ink-muted); pointer-events: none; }
.stepper { display: flex; align-items: stretch; gap: var(--gap-sm); }
.stepper__btn {
  flex: none; width: 56px; min-height: 56px; border-radius: var(--radius); border: 2px solid var(--line-strong);
  background: var(--surface-sunk); font-size: 26px; font-weight: 800; cursor: pointer;
}
/* Boy / girl toggle: two buttons with aria-pressed */
.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.segmented__opt { min-height: 64px; border-radius: var(--radius-md); border: 3px solid; background: var(--surface); font-weight: 800; font-size: 20px; cursor: pointer; }
.segmented__opt--boy { border-color: var(--boy-line); color: var(--boy-ink); }
.segmented__opt--girl { border-color: var(--girl-line); color: var(--girl-ink); }
.segmented__opt--boy[aria-pressed="true"], .segmented__opt--boy[aria-checked="true"] { background: var(--boy); border-color: var(--boy); color: var(--ink-on-dark); }
.segmented__opt--girl[aria-pressed="true"], .segmented__opt--girl[aria-checked="true"] { background: var(--girl); border-color: var(--girl-strong); color: var(--girl-ink-deep); }
/* A–Z picker */
.letter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: var(--gap-xs); }
.letter-grid__btn { min-height: 48px; border-radius: 12px; border: 2px solid #E3D8CA; background: var(--surface); font-family: var(--font-display); font-weight: 600; font-size: 20px; cursor: pointer; }
.letter-grid__btn[aria-pressed="true"] { background: var(--grape); border-color: var(--grape); color: var(--ink-on-dark); }
/* Pill toggles (sort) */
.toggle { min-height: var(--tap); padding: 0 14px; border-radius: var(--radius-pill); border: 2px solid #E3D8CA; background: var(--surface); font-weight: 700; font-size: var(--fs-md); cursor: pointer; }
.toggle[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--ink-on-dark); }
a.toggle { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
a.toggle[aria-pressed="true"] { color: var(--ink-on-dark); }
/* On/off switch (Pause) */
.switch { flex: none; width: 64px; height: 36px; padding: 4px; border: 0; border-radius: var(--radius-pill); background: var(--line-strong); cursor: pointer; display: flex; justify-content: flex-start; }
.switch::after { content: ""; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); }
.switch[aria-checked="true"] { background: var(--calm-ink-2); justify-content: flex-end; }
.status-msg { min-height: 26px; font-weight: 800; color: var(--good); }
.status-msg--warn { color: var(--warn); }

/* ---------- Scored card rows (My card after results) --------------------- */
.score-row { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: var(--gap-sm); }
.score-row__pts { font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.score-row__pts small { font-size: var(--fs-sm); color: var(--ink-muted); }
.score-row__pts--full { color: var(--good); }
.score-row__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-sm); }
.score-row__cell { background: var(--surface-sunk); border-radius: 12px; padding: 8px 10px; }
.score-row__cell--real { background: var(--good-soft); }
.score-row__cell--pending { background: var(--surface); border: 2px dashed var(--line-strong); color: var(--ink-muted); }
.score-row__k { display: block; font-size: 13px; font-weight: 700; color: var(--ink-muted); }
.score-row__v { font-weight: 800; font-size: var(--fs-base); }
.score-row__meter { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); font-weight: 800; color: var(--good); white-space: nowrap; }
.score-row__meter .progress { flex: 1; height: 8px; }

/* ---------- Revealed-so-far tiles --------------------------------------- */
.tile { background: var(--surface-sunk); border-radius: var(--radius); padding: 12px; }
.tile__k { display: block; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-muted); }
.tile__v { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-h3); }
.tile--pending { background: transparent; border: 2px dashed var(--line-strong); padding: 10px 12px; }
.tile--pending .tile__v { font-family: var(--font-body); font-size: 16px; font-weight: 700; color: var(--ink-muted); }

/* ---------- Leaderboard -------------------------------------------------- */
.lb { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lb__row { display: flex; align-items: center; gap: var(--gap); padding: 10px 8px; border-radius: 12px; }
.lb__row--you { background: var(--grape-soft); }
.lb__toggle { width: 100%; display: flex; align-items: center; gap: var(--gap); min-height: 56px; padding: 6px 10px; border: 0; background: transparent; text-align: left; cursor: pointer; border-radius: 12px; }
.lb__name { flex: 1; min-width: 0; font-weight: 800; }
.lb__award { display: block; font-size: 13px; font-weight: 700; color: var(--sun-ink); }
.lb__pts { font-family: var(--font-display); font-weight: 600; font-size: 20px; font-variant-numeric: tabular-nums; }
.lb__chev { transition: transform .15s; }
[aria-expanded="true"] .lb__chev { transform: rotate(180deg); }
.lb__breakdown { padding: 4px 12px 14px 56px; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: var(--gap-xs); }
.lb__breakdown > div { background: var(--surface); border-radius: var(--radius-sm); padding: 6px 10px; }
.lb__breakdown dt { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-muted); }
.lb__breakdown dd { font-weight: 800; }
.rank { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: var(--fs-md); background: var(--surface-sunk); color: var(--ink); }
.rank--1 { background: var(--gold); }
.rank--2 { background: var(--silver); }
.rank--3 { background: var(--bronze); }

/* ---------- Awards & podium ---------------------------------------------- */
.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.award { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.award__k { font-size: 13px; font-weight: 800; color: var(--sun-ink); text-transform: uppercase; letter-spacing: .06em; }
.award__who { font-weight: 800; margin-top: 2px; }
.award__how { font-size: var(--fs-sm); color: var(--ink-muted); }
.award--you { background: var(--grape-soft); border: 2px solid var(--grape); padding: 13px; }
.award--you .award__k { color: var(--grape); }
.award--oracle { grid-column: 1 / -1; background: var(--ink); color: var(--ink-on-dark); border: 0; display: flex; align-items: center; gap: 14px; padding: 16px; }
.award--oracle .award__k { color: var(--sun); }
.award-list { list-style: none; padding: 0; }
.award-list li { display: flex; justify-content: space-between; gap: var(--gap); padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.award-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-sm); align-items: end; text-align: center; list-style: none; padding: 0; }
.podium li { display: flex; flex-direction: column; gap: 6px; font-weight: 800; }
.podium__block { border-radius: 12px 12px 4px 4px; display: flex; flex-direction: column; justify-content: center; font-size: var(--fs-sm); }
.podium__block b { font-family: var(--font-display); font-weight: 700; font-size: 26px; }
.podium__block--1 { background: var(--gold); height: 112px; }
.podium__block--2 { background: var(--silver); height: 84px; }
.podium__block--3 { background: var(--bronze); height: 64px; }

/* ---------- Player card (All Cards) & notes ------------------------------ */
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.pcard--you { border: 2px solid var(--grape); }
.pcard__head { display: flex; align-items: center; gap: 10px; }
.pcard__name { flex: 1; font-size: var(--fs-lg); font-weight: 800; line-height: 1.2; }
.pcard__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; font-size: 16px; }
.pcard__facts dt { font-size: 13px; font-weight: 700; color: var(--ink-muted); }
.pcard__facts dd { font-weight: 800; }
.pcard__facts .full { grid-column: 1 / -1; }
.pcard__part { background: var(--surface-sunk); border-radius: var(--radius-sm); padding: 6px 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.pcard__part .pts { font-weight: 800; color: var(--good); }
.pcard__part .pts--zero { color: var(--ink-muted); }
.note-quote { background: var(--sun-soft); border-radius: var(--radius); padding: 10px 12px; font-size: 16px; }
.note-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 18px 16px; display: flex; flex-direction: column; gap: var(--gap-sm); }
.note-card blockquote { font-size: var(--fs-lg); line-height: 1.45; }
.note-card figcaption { font-weight: 800; font-size: var(--fs-md); color: var(--grape); }

/* ---------- The reveal --------------------------------------------------- */
.envelope {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 20px;
  border: 3px dashed var(--grape); border-radius: 28px; background: var(--grape-soft); color: var(--ink); cursor: pointer;
}
.envelope__q { font-family: var(--font-display); font-weight: 600; font-size: 28px; line-height: 1.15; }
.envelope__cta { font-size: 16px; font-weight: 700; color: var(--grape); }
.reveal { position: relative; overflow: hidden; border-radius: 28px; padding: 28px 20px; text-align: center; animation: bbp-pop .6s ease-out both; }
.reveal--girl { background: var(--girl-soft); color: var(--girl-ink); }
.reveal--boy { background: var(--boy-soft); color: var(--boy-ink); }
.reveal__word { font-family: var(--font-display); font-weight: 700; font-size: 64px; line-height: 1; }
.reveal__sub { margin-top: 12px; font-size: 16px; color: var(--ink); }

/* ---------- Host --------------------------------------------------------- */
.state-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; list-style: none; padding: 0; text-align: center; }
.state-steps li { background: var(--surface-sunk); color: var(--ink-muted); border-radius: 12px; padding: 8px 4px; font-weight: 700; font-size: var(--fs-sm); }
.state-steps li[aria-current="step"] { background: var(--grape); color: var(--ink-on-dark); font-weight: 800; }
.result-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.result-panel--active { border: 2px solid var(--grape); }
.result-panel__value { font-family: var(--font-display); font-weight: 600; font-size: 24px; }
/* Inline confirm that works without JS: <details class="confirm-toggle"> (macro ui.confirm_post). */
.confirm-toggle > summary { list-style: none; }
.confirm-toggle > summary::-webkit-details-marker { display: none; }
.confirm-toggle[open] > summary { display: none; }
.confirm { background: var(--surface); border: 2px solid var(--warn); border-radius: var(--radius-md); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.diff { width: 100%; border-collapse: collapse; font-size: var(--fs-md); background: var(--surface); border-radius: 12px; overflow: hidden; }
.diff th, .diff td { text-align: left; padding: 8px 10px; }
.diff thead th { color: var(--ink-muted); font-weight: 700; }
.diff tbody tr { border-top: 1px solid var(--line-soft); }
.diff .changed { font-weight: 800; color: var(--warn-ink); }
.player-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; display: flex; flex-direction: column; gap: var(--gap-sm); }
.player-row--hidden { background: var(--calm-bg); }
.player-row--hidden .player-row__name { color: var(--ink-muted); }
.player-row--late { border-color: var(--warn-line); }
.player-row__name { font-weight: 800; }
.player-row__meta { font-size: 13px; color: var(--ink-muted); overflow-wrap: anywhere; }
.scenario { background: var(--surface-sunk); border-radius: 12px; padding: 8px 12px; font-size: var(--fs-sm); color: var(--ink-muted); }
.calm-preview { background: var(--calm-bg); border-radius: var(--radius); padding: 12px 14px; color: var(--calm-ink-2); font-size: var(--fs-md); }

/* ---------- Numbered steps (Welcome, How it works) ------------------------ */
.steps { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--gap); }
.steps li { display: flex; gap: var(--gap); align-items: flex-start; }
.steps--boxed li { align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; gap: 14px; }
.steps__num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--sun-soft); color: var(--sun-ink); font-weight: 800; }
.steps--boxed .steps__num { width: 36px; height: 36px; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg); }
.rule { display: flex; gap: 14px; align-items: flex-start; }
.rule__max { flex: none; min-width: 52px; height: 52px; padding: 0 6px; border-radius: var(--radius); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 20px; background: var(--sun-soft); }

/* ---------- Paused (replaces every page) --------------------------------- */
.calm { min-height: 100vh; background: var(--calm-bg); color: var(--calm-ink); font-size: var(--fs-lg); line-height: 1.6; display: flex; flex-direction: column; }
.calm__brand { padding: 20px 20px 0; text-align: center; font-size: var(--fs-md); font-weight: 700; color: var(--calm-muted); }
.calm__body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 24px 64px; }
.calm__inner { max-width: 420px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--gap-md); }
.calm__icon { width: 56px; height: 56px; border-radius: 50%; background: var(--calm-tile); display: grid; place-items: center; }
.calm h1 { font-weight: 700; font-size: var(--fs-h2); line-height: 1.3; }
.calm p { color: var(--calm-ink-2); }
.calm :focus-visible { outline-color: var(--calm-ink-2); }

/* ---------- Footer ------------------------------------------------------- */
.foot { text-align: center; font-size: var(--fs-md); color: var(--ink-muted); padding-top: 8px; }

/* ---------- Motion ------------------------------------------------------- */
@keyframes bbp-pop { 0% { transform: scale(.85); opacity: 0; } 60% { transform: scale(1.04); opacity: 1; } 100% { transform: scale(1); } }
@keyframes bbp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Laptop (≥ 900 px) --------------------------------------------
   Same markup as on the phone. The .chrome block (top bar + nav) turns into
   one white bar with the nav inline; pages that have a laptop layout use
   .wrap--wide + .split (see previews/laptop/*). */
@media (min-width: 900px) {
  .chrome {
    display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 12px max(32px, calc((100% - var(--container-wide)) / 2 + 32px));
  }
  .chrome > .topbar { display: contents; }
  .chrome .brand { order: 0; }
  .chrome .brand__mark { width: 40px; height: 40px; }
  .chrome .brand__name { font-size: 22px; }
  .chrome > .nav { order: 1; flex: 1; justify-content: center; flex-wrap: wrap; overflow: visible; padding: 0; gap: var(--gap-xs); }
  .chrome > .nav .nav__item { border-color: transparent; background: transparent; }
  .chrome > .nav .nav__item[aria-current="page"] { background: var(--ink); }
  .chrome > .nav .nav__item--locked { border: 0; }
  .chrome .user-chip, .chrome .keepsake-tag { order: 2; }
  .wrap--wide > .main { padding: 32px 32px 56px; gap: 20px; }
  .h1--hero { font-size: 40px; }
  .countdown__num { font-size: 36px; }
  .reveal__word { font-size: 88px; }
}

/* ---------- Radio-backed pickers (no-JS friendly) -------------------------
   Markup: <label class="pick"><input class="sr-only" type="radio" name="sex" value="girl">
           <span class="segmented__opt segmented__opt--girl">Girl</span></label>
   Works without Alpine and posts as a normal form field. */
.pick { display: block; cursor: pointer; }
.pick > .segmented__opt, .pick > .letter-grid__btn { display: grid; place-items: center; width: 100%; height: 100%; }
.pick input:focus-visible + span { outline: var(--focus); outline-offset: 2px; }
.pick input:checked + .segmented__opt--boy { background: var(--boy); border-color: var(--boy); color: var(--ink-on-dark); }
.pick input:checked + .segmented__opt--girl { background: var(--girl); border-color: var(--girl-strong); color: var(--girl-ink-deep); }
.pick input:checked + .letter-grid__btn { background: var(--grape); border-color: var(--grape); color: var(--ink-on-dark); }
