/* ==========================================================================
   Barn Burner: components.css
   Every component in the product, built from tokens.css and nothing else.
   There is not a single raw hex, px size or duration below that is not a var.

   Two prefixes:
     .bb-*  product components. Kate ships these.
     .sg-*  styleguide scaffolding. Kate deletes these.
   ========================================================================== */

/* ==========================================================================
   0. BASE
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-text);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

button, input, select { font: inherit; color: inherit; }

/* One focus treatment, everywhere. Never color alone. */
:where(a, button, input, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* Every number in this product is tabular. Scores must not shift as they tick. */
.bb-num, .bb-score, .bb-table td, .bb-table th, time {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   1. TYPE PRIMITIVES
   ========================================================================== */

.bb-display {
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width) * 1%);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  text-transform: uppercase;
}

.bb-eyebrow {
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width) * 1%);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  line-height: var(--leading-none);
  text-transform: uppercase;
  color: var(--text-secondary);
}

.bb-title   { font-size: var(--text-xl); font-weight: var(--weight-semibold); line-height: var(--leading-snug); margin: 0; }
.bb-subtitle{ font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: var(--leading-snug); margin: 0; }
.bb-body    { font-size: var(--text-base); color: var(--text-primary); margin: 0; }
.bb-help    { font-size: var(--text-sm); color: var(--text-secondary); margin: 0; }
.bb-meta    { font-size: var(--text-sm); color: var(--text-tertiary); margin: 0; }

.bb-score {
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width-wide) * 1%);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tighter);
  line-height: var(--leading-tight);
}

/* ==========================================================================
   2. WORDMARK
   Text only. The goal light is the one ornament the brand owns.
   ========================================================================== */

.bb-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.42em;
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width) * 1%);
  font-weight: var(--weight-black);
  font-size: var(--text-xl);
  letter-spacing: -0.015em;
  line-height: var(--leading-none);
  text-transform: uppercase;
  color: var(--text-primary);
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}

.bb-wordmark::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-radius: var(--radius-circle);
  background: var(--red-600);
  box-shadow: var(--glow-red);
  flex: none;
  /* optical alignment to cap height, not to the em box */
  transform: translateY(-0.04em);
}

.bb-wordmark .bb-wordmark-a { color: var(--silver-500); }
.bb-wordmark .bb-wordmark-b { color: var(--text-primary); }

/* Below a 14px cap height the goal light stops reading. Drop it, keep the word. */
.bb-wordmark--mini { font-size: var(--text-sm); }
.bb-wordmark--mini::before { display: none; }

.bb-wordmark--lg { font-size: var(--text-3xl); }
.bb-wordmark--tv { font-size: var(--text-4xl); }

/* On light surfaces */
.bb-wordmark--light .bb-wordmark-a { color: var(--navy-700); }
.bb-wordmark--light .bb-wordmark-b { color: var(--navy-900); }

/* The live pulse. Rationed to one thing: a game happening right now. */
.bb-wordmark--live::before { animation: bb-pulse var(--dur-pulse) var(--ease-spring) infinite; }

@keyframes bb-pulse {
  0%, 70%, 100% { transform: translateY(-0.04em) scale(1);    opacity: 1; }
  35%           { transform: translateY(-0.04em) scale(1.25); opacity: 0.75; }
}

/* ==========================================================================
   3. SURFACES
   ========================================================================== */

.bb-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: var(--card-pad);
  box-shadow: var(--shadow-1), var(--inset-hairline);
}

.bb-card--sunken { background: var(--bg-sunken); box-shadow: var(--inset-hairline); }
.bb-card--raised { background: var(--bg-surface-raised); box-shadow: var(--shadow-2), var(--inset-hairline); }
.bb-card--flush  { padding: 0; overflow: hidden; }

.bb-stack { display: flex; flex-direction: column; gap: var(--stack-gap); }
.bb-row   { display: flex; align-items: center; gap: var(--space-3); }
.bb-row--between { justify-content: space-between; }
.bb-divider { height: 1px; background: var(--border-subtle); border: 0; margin: 0; }

/* ==========================================================================
   4. CLUB MARKS
   A mark always sits in a well. The well is the clear space rule and the
   legibility rule in one move.
   ========================================================================== */

.bb-logo {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--logo-md);
  height: var(--logo-md);
  padding: var(--logo-well-pad);
  border-radius: var(--radius-md);
  background: var(--logo-well-bg);
  font-size: var(--logo-md); /* so the 0.25em pad = 25% of mark height */
}
.bb-logo img { width: 100%; height: 100%; object-fit: contain; }

.bb-logo--sm { width: var(--logo-sm); height: var(--logo-sm); font-size: var(--logo-sm); border-radius: var(--radius-sm); }
.bb-logo--lg { width: var(--logo-lg); height: var(--logo-lg); font-size: var(--logo-lg); }
.bb-logo--tv { width: var(--logo-tv); height: var(--logo-tv); font-size: var(--logo-tv); border-radius: var(--radius-lg); }
.bb-logo--bare { background: none; padding: 0; }

/* ==========================================================================
   5. CHIPS AND BADGES
   Status is never color alone. Every chip carries a word.
   ========================================================================== */

.bb-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--bg-surface-raised);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
  white-space: nowrap;
  box-shadow: var(--inset-hairline);
}

.bb-chip--go   { background: rgba(92, 225, 166, 0.12); color: var(--status-go-text); }
.bb-chip--wait { background: rgba(245, 197, 99, 0.12); color: var(--status-wait-text); }
.bb-chip--live { background: rgba(172, 22, 44, 0.18); color: var(--status-live-text); }
.bb-chip--next { background: rgba(116, 180, 255, 0.14); color: var(--action-link); }

.bb-chip__dot {
  width: 0.5em; height: 0.5em; border-radius: var(--radius-circle);
  background: currentColor; flex: none;
}
.bb-chip--live .bb-chip__dot {
  background: var(--red-600);
  box-shadow: var(--glow-red);
  animation: bb-pulse var(--dur-pulse) var(--ease-spring) infinite;
}

/* Uppercase structural badges: HOME / AWAY / PRESEASON */
.bb-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-xs);
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width) * 1%);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  line-height: var(--leading-none);
  text-transform: uppercase;
  white-space: nowrap;
}
.bb-badge--home { background: var(--blue-600); color: var(--text-on-fill); }
.bb-badge--away { background: transparent; color: var(--text-secondary); box-shadow: inset 0 0 0 1px var(--border-strong); }
.bb-badge--pre  { background: transparent; color: var(--status-wait-text); box-shadow: inset 0 0 0 1px rgba(245, 197, 99, 0.4); }

/* ==========================================================================
   6. BUTTONS
   One primary action per screen. Blue fill. Red is never a normal button.
   ========================================================================== */

.bb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap-min);
  padding: 0 var(--space-5);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-none);
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out);
}
.bb-btn:active { transform: scale(0.975); }

.bb-btn--primary { background: var(--action-primary); color: var(--text-on-fill); box-shadow: var(--glow-blue); }
.bb-btn--primary:hover { background: var(--action-primary-hover); }
.bb-btn--primary:active { background: var(--action-primary-active); }

.bb-btn--ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.bb-btn--ghost:hover { background: var(--bg-surface-raised); }

.bb-btn--text { background: transparent; color: var(--action-link); padding: 0 var(--space-2); }
.bb-btn--text:hover { text-decoration: underline; }

.bb-btn--danger { background: var(--red-600); color: var(--text-on-fill); }
.bb-btn--danger:hover { background: var(--red-700); }

.bb-btn--block { display: flex; width: 100%; }
.bb-btn--sm { min-height: 36px; padding: 0 var(--space-4); font-size: var(--text-sm); }

/* Done: the request has been granted. Reads as a statement, not an invitation. */
.bb-btn--done {
  background: rgba(92, 225, 166, 0.12);
  color: var(--status-go-text);
  box-shadow: inset 0 0 0 1px rgba(92, 225, 166, 0.3);
  cursor: default;
}
.bb-btn--done:active { transform: none; }

.bb-btn[disabled],
.bb-btn--disabled {
  background: var(--bg-sunken);
  color: var(--text-disabled);
  box-shadow: var(--inset-hairline);
  cursor: not-allowed;
}
.bb-btn[disabled]:active { transform: none; }

/* Pressed and waiting. The label's width is held so the button never resizes. */
.bb-btn--loading { color: transparent; pointer-events: none; position: relative; }
.bb-btn--loading::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  border-radius: var(--radius-circle);
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: var(--text-on-fill);
  animation: bb-spin 0.7s linear infinite;
}
@keyframes bb-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   7. FIELDS
   ========================================================================== */

.bb-field { display: flex; flex-direction: column; gap: var(--space-2); }
.bb-label {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-secondary);
}
.bb-input {
  min-height: var(--tap-min);
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--bg-field);
  color: var(--text-primary);
  font-size: var(--text-base);
  box-shadow: inset 0 0 0 1px var(--border-default);
  transition: box-shadow var(--dur-fast) var(--ease-out);
}
.bb-input::placeholder { color: var(--text-tertiary); }
.bb-input:focus { outline: none; box-shadow: var(--focus-ring); }

.bb-counter { font-size: var(--text-xs); color: var(--text-tertiary); text-align: right; }

/* Passcode boxes */
.bb-code { display: flex; gap: var(--space-3); justify-content: center; }
.bb-code__box {
  width: 56px; height: 64px;
  display: grid; place-items: center;
  border: 0;
  border-radius: var(--radius-md);
  background: rgba(3, 20, 44, 0.72);
  box-shadow: inset 0 0 0 1px var(--border-default);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width) * 1%);
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  text-align: center;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: box-shadow var(--dur-fast) var(--ease-out);
}
.bb-code__box--filled { box-shadow: inset 0 0 0 1px var(--border-strong); }
.bb-code__box--active { box-shadow: var(--focus-ring); }

/* Segmented control: pick'em winner, goal totals */
.bb-seg { display: flex; gap: var(--space-2); }
.bb-seg__opt {
  flex: 1;
  min-height: var(--tap-min);
  display: grid; place-items: center;
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--bg-field);
  box-shadow: inset 0 0 0 1px var(--border-default);
  color: var(--text-secondary);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.bb-seg__opt:hover { background: var(--bg-surface-raised); }
.bb-seg__opt[aria-pressed="true"] {
  background: var(--action-primary);
  color: var(--text-on-fill);
  box-shadow: var(--glow-blue);
}

/* ==========================================================================
   8. PASSCODE GATE
   ========================================================================== */

.bb-gate {
  position: relative;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-8) var(--gutter) var(--space-10);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--grad-arena);
  isolation: isolate;
}
.bb-gate__bg {
  position: absolute; inset: 0; z-index: -2;
  background-image: var(--img-arena);
  background-size: cover;
  background-position: 50% 62%;
}
/* The scrim is what makes AA contrast survive a photograph. */
.bb-gate__bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(2, 10, 22, 0.55) 0%,
    rgba(2, 10, 22, 0.35) 30%,
    rgba(2, 10, 22, 0.88) 68%,
    var(--navy-990) 100%
  );
}
.bb-gate__inner { display: flex; flex-direction: column; gap: var(--space-6); }
.bb-gate__copy  { display: flex; flex-direction: column; gap: var(--space-2); }

/* ==========================================================================
   9. GAME CARD
   A home game and an away game are different objects, not a variant switch.
   ========================================================================== */

.bb-game {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3) var(--space-4);
  align-items: center;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: var(--card-pad);
  box-shadow: var(--shadow-1), var(--inset-hairline);
}
/* Away games carry no seats. One step quieter, on purpose. */
.bb-game--away { background: var(--bg-sunken); box-shadow: var(--inset-hairline); }

.bb-game__logo { grid-row: span 2; }
.bb-game__head { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.bb-game__opp  { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.bb-game__when { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
.bb-game__date { font-size: var(--text-sm); color: var(--text-secondary); }
.bb-game__time { font-size: var(--text-sm); color: var(--text-secondary); }
.bb-game__tv   { font-size: var(--text-sm); color: var(--text-tertiary); }
.bb-game__foot {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: var(--space-2);
  flex-wrap: wrap;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}
.bb-game__spacer { flex: 1; }

/* "Who's going" */
.bb-going { display: inline-flex; align-items: center; gap: var(--space-2); }
.bb-avatars { display: flex; }
.bb-avatar {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: var(--radius-circle);
  background: var(--blue-600);
  color: var(--text-on-fill);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.02em;
  box-shadow: 0 0 0 2px var(--bg-surface);
}
.bb-avatar + .bb-avatar { margin-left: calc(var(--space-2) * -1); }
.bb-avatar--empty { background: var(--bg-field); color: var(--text-tertiary); box-shadow: 0 0 0 2px var(--bg-surface), inset 0 0 0 1px var(--border-default); }

/* ==========================================================================
   10. TICKET ASSIGNMENT CARD
   ========================================================================== */

.bb-ticket {
  position: relative;
  background: linear-gradient(150deg, var(--navy-800) 0%, var(--navy-900) 60%);
  border-radius: var(--radius-lg);
  padding: var(--card-pad);
  box-shadow: var(--shadow-2), var(--inset-hairline);
  display: flex; flex-direction: column; gap: var(--space-4);
}
.bb-ticket__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.bb-ticket__holders { display: flex; flex-direction: column; gap: var(--space-2); }
.bb-ticket__holder { display: flex; align-items: center; gap: var(--space-3); }
.bb-ticket__name { font-size: var(--text-lg); font-weight: var(--weight-semibold); }

/* The seat block. A perforation, because a ticket has one. */
.bb-seats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px dashed var(--border-strong);
}
.bb-seat { display: flex; flex-direction: column; gap: var(--space-1); }
.bb-seat__k {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-secondary);
}
.bb-seat__v {
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width) * 1%);
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-none);
}

/* ==========================================================================
   11. FAIRNESS BOARD
   The moral centre of the app, so it is the calmest screen. No red.
   ========================================================================== */

.bb-fair { display: flex; flex-direction: column; }
.bb-fair__row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}
.bb-fair__row + .bb-fair__row { border-top: 1px solid var(--border-subtle); }
.bb-fair__rank {
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width) * 1%);
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
  color: var(--text-tertiary);
  text-align: right;
}
.bb-fair__row--next .bb-fair__rank { color: var(--action-link); }
.bb-fair__who { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.bb-fair__name { font-size: var(--text-base); font-weight: var(--weight-medium); }
.bb-fair__count { display: flex; align-items: center; gap: var(--space-3); }
.bb-fair__games {
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width) * 1%);
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  line-height: var(--leading-none);
}

/* The fairness bar. Proportion, read at a glance, no legend needed. */
.bb-bar { height: 4px; border-radius: var(--radius-pill); background: var(--bg-field); overflow: hidden; }
.bb-bar__fill { height: 100%; border-radius: var(--radius-pill); background: var(--silver-500); }
.bb-fair__row--next .bb-bar__fill { background: var(--action-link); }

/* ==========================================================================
   12. ADMIN REQUEST QUEUE
   ========================================================================== */

.bb-queue__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-4) 0;
}
.bb-queue__item + .bb-queue__item { border-top: 1px solid var(--border-subtle); }
.bb-queue__who { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.bb-queue__acts { display: flex; gap: var(--space-2); }
.bb-queue__note {
  grid-column: 1 / -1;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: var(--space-3);
  background: var(--bg-sunken);
  border-radius: var(--radius-md);
  border-left: 2px solid var(--border-strong);
}
.bb-queue__head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.bb-iconbtn {
  width: var(--tap-min); height: var(--tap-min);
  display: grid; place-items: center;
  border: 0;
  border-radius: var(--radius-circle);
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  font-size: var(--text-lg);
  cursor: pointer;
  box-shadow: var(--inset-hairline);
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.bb-iconbtn:active { transform: scale(0.94); }
.bb-iconbtn--go { background: var(--go-600); color: var(--text-on-fill); }
.bb-iconbtn--no { background: transparent; color: var(--text-secondary); box-shadow: inset 0 0 0 1px var(--border-strong); }

/* ==========================================================================
   13. RECAP CARD
   ========================================================================== */

.bb-recap { border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-surface); box-shadow: var(--shadow-1), var(--inset-hairline); }
.bb-recap__photo { position: relative; aspect-ratio: 16 / 9; background: var(--grad-draft); }
.bb-recap__photo img { width: 100%; height: 100%; object-fit: cover; }
.bb-recap__photo::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(2,10,22,0) 40%, rgba(2,10,22,0.85) 100%);
}
.bb-recap__caption {
  position: absolute; left: var(--space-4); right: var(--space-4); bottom: var(--space-3);
  z-index: 1;
  font-size: var(--text-sm);
  color: var(--ice-300);
}
.bb-recap__body { padding: var(--card-pad); display: flex; flex-direction: column; gap: var(--space-4); }
.bb-recap__line {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-3);
}
.bb-recap__side { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.bb-recap__side--r { justify-content: flex-end; }
.bb-recap__abbr {
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width-wide) * 1%);
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tight);
  color: var(--text-secondary);
}
.bb-recap__abbr--win { color: var(--text-primary); }
.bb-recap__score { display: flex; align-items: baseline; gap: var(--space-2); }
.bb-recap__score .bb-score { font-size: var(--text-3xl); }
.bb-recap__score .bb-score--lose { color: var(--text-tertiary); }
.bb-recap__dash { color: var(--text-tertiary); font-size: var(--text-xl); }

/* ==========================================================================
   14. POOL: BOX PICK
   ========================================================================== */

.bb-boxhead { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.bb-boxno {
  display: grid; place-items: center;
  width: 48px; height: 48px; flex: none;
  border-radius: var(--radius-md);
  background: var(--bg-field);
  box-shadow: var(--inset-hairline);
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width) * 1%);
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  color: var(--text-secondary);
}

.bb-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}
@media (min-width: 560px) { .bb-tiles { grid-template-columns: repeat(4, 1fr); } }

.bb-tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  min-height: var(--tap-min);
  padding: var(--space-3) var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--bg-field);
  box-shadow: inset 0 0 0 1px var(--border-default);
  color: var(--text-primary);
  cursor: pointer;
  text-align: center;
  transition: transform var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.bb-tile:hover { background: var(--bg-surface-raised); transform: translateY(-2px); }

.bb-tile[aria-pressed="true"] {
  background: var(--bg-surface-raised);
  box-shadow: inset 0 0 0 2px var(--action-link), var(--shadow-2);
  animation: bb-land var(--dur-slow) var(--ease-spring);
}
@keyframes bb-land {
  from { transform: scale(0.94); }
  to   { transform: scale(1); }
}
/* The check is a shape as well as a color, so the selection is not color alone. */
.bb-tile[aria-pressed="true"]::after {
  content: "\2713";
  position: absolute; top: var(--space-2); right: var(--space-2);
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: var(--radius-circle);
  background: var(--action-link);
  color: var(--navy-990);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  line-height: 1;
}

/* Reserved square slot. Monogram today, headshot later, no layout change. */
.bb-tile__face {
  position: relative;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  box-shadow: var(--inset-hairline);
  overflow: hidden;
}
.bb-tile__mono {
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width) * 1%);
  font-size: var(--text-base);
  font-weight: var(--weight-black);
  color: var(--text-secondary);
  letter-spacing: var(--tracking-tight);
}
.bb-tile__badge {
  position: absolute; right: -2px; bottom: -2px;
  width: 20px; height: 20px;
  padding: 2px;
  border-radius: var(--radius-xs);
  background: var(--navy-990);
}
.bb-tile__badge img { width: 100%; height: 100%; object-fit: contain; }

.bb-tile__name { font-size: var(--text-sm); font-weight: var(--weight-semibold); line-height: var(--leading-snug); }
.bb-tile__meta { font-size: var(--text-xs); color: var(--text-tertiary); }

/* Popularity hint. Information, never pressure: it is a hairline, not a bar chart. */
.bb-tile__pop { width: 100%; display: flex; flex-direction: column; gap: var(--space-1); margin-top: auto; }
.bb-tile__poptrack { height: 2px; border-radius: var(--radius-pill); background: var(--border-subtle); overflow: hidden; }
.bb-tile__popfill { height: 100%; background: var(--silver-500); }
.bb-tile[aria-pressed="true"] .bb-tile__popfill { background: var(--action-link); }
.bb-tile__poptext { font-size: var(--text-2xs); color: var(--text-tertiary); letter-spacing: var(--tracking-wide); text-transform: uppercase; }

/* Box progress: 10 boxes, which are done */
.bb-pips { display: flex; gap: var(--space-1); }
.bb-pip { width: 100%; height: 3px; border-radius: var(--radius-pill); background: var(--border-strong); }
.bb-pip--done { background: var(--status-go-text); }
.bb-pip--now  { background: var(--action-link); }

/* ==========================================================================
   15. POOL: STANDINGS
   ========================================================================== */

.bb-table { width: 100%; border-collapse: collapse; }
.bb-table th {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-secondary);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
.bb-table td {
  padding: var(--space-3);
  font-size: var(--text-base);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.bb-table tr:last-child td { border-bottom: 0; }
.bb-table tbody tr:nth-child(odd) td { background: rgba(3, 20, 44, 0.4); }
.bb-table .bb-t-num { text-align: right; }
.bb-table tr.bb-t-you td { background: rgba(116, 180, 255, 0.10); }

.bb-rank {
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width) * 1%);
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
  color: var(--text-tertiary);
}
.bb-rank--medal { color: var(--text-primary); }
.bb-teamname { font-weight: var(--weight-semibold); }
.bb-owner { font-size: var(--text-sm); color: var(--text-tertiary); }
.bb-pts {
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width) * 1%);
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
}

/* Movers. Arrow plus number, so it is never color alone. */
.bb-move {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-tertiary);
}
.bb-move--up   { color: var(--status-go-text); }
.bb-move--down { color: var(--status-live-text); }

/* ==========================================================================
   16. PICK'EM
   ========================================================================== */

.bb-pickem { display: flex; flex-direction: column; gap: var(--space-5); }
.bb-pickem__matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-3);
}
.bb-pickem__vs {
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width) * 1%);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-tertiary);
  letter-spacing: var(--tracking-wide);
}
.bb-pickem__team { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.bb-pickem__abbr {
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width-wide) * 1%);
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-none);
}
.bb-goals { display: flex; gap: var(--space-2); }
.bb-goals .bb-seg__opt { font-family: var(--font-display); font-stretch: calc(var(--display-width) * 1%); font-size: var(--text-lg); }
.bb-lock { display: flex; align-items: center; gap: var(--space-2); justify-content: center; }

/* ==========================================================================
   17. PRIZE PODIUM
   Prizes are TBA on purpose. Build the podium at full size anyway, so the
   gap reads as deliberate rather than missing.
   ========================================================================== */

.bb-podium {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: end;
  gap: var(--space-2);
}
.bb-podium__col { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.bb-podium__prize {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  text-align: center;
}
.bb-podium__tba {
  display: inline-flex; align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--border-strong);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width) * 1%);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}
.bb-podium__block {
  width: 100%;
  display: grid; place-items: center;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--bg-surface-raised);
  box-shadow: var(--inset-hairline);
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width-wide) * 1%);
  font-weight: var(--weight-black);
  line-height: var(--leading-none);
}
.bb-podium__block--1 { height: 120px; font-size: var(--text-4xl); background: linear-gradient(180deg, var(--blue-600) 0%, var(--navy-800) 100%); color: var(--text-on-fill); }
.bb-podium__block--2 { height: 88px;  font-size: var(--text-3xl); color: var(--silver-500); }
.bb-podium__block--3 { height: 64px;  font-size: var(--text-2xl); color: var(--text-tertiary); }

/* ==========================================================================
   18. EMPTY AND LOADING
   ========================================================================== */

.bb-empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  padding: var(--space-10) var(--space-4);
  text-align: center;
}
.bb-empty__glyph {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: var(--radius-circle);
  box-shadow: inset 0 0 0 2px var(--glyph-quiet);
  color: var(--glyph-quiet);
  font-size: var(--text-2xl);
  line-height: 1;
}
.bb-empty__title { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.bb-empty__help  { font-size: var(--text-sm); color: var(--text-secondary); max-width: 30ch; }

/* Skeletons are the true final size, so nothing jumps when content lands. */
.bb-skel {
  position: relative;
  border-radius: var(--radius-md);
  background: var(--skeleton-base);
  overflow: hidden;
}
.bb-skel::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--skeleton-band);
  transform: translateX(-100%);
  animation: bb-shimmer var(--dur-shimmer) linear infinite;
}
@keyframes bb-shimmer { to { transform: translateX(100%); } }
.bb-skel--text  { height: 12px; border-radius: var(--radius-pill); }
.bb-skel--title { height: 18px; width: 60%; border-radius: var(--radius-pill); }
.bb-skel--logo  { width: var(--logo-md); height: var(--logo-md); }

/* ==========================================================================
   19. TV MODE: exactly 1920 x 1080
   No hover, no focus, no scroll, no loading states.
   ========================================================================== */

.bb-tv {
  position: relative;
  width: var(--tv-w);
  height: var(--tv-h);
  padding: var(--tv-safe);
  display: grid;
  grid-template-rows: var(--tv-header-h) 1fr var(--tv-footer-h);
  gap: var(--space-8);
  background: var(--navy-990);
  color: var(--text-primary);
  overflow: hidden;
  isolation: isolate;
}
.bb-tv__bg {
  position: absolute; inset: 0; z-index: -1;
  background-image: var(--img-ice);
  background-size: cover;
  background-position: center;
  opacity: var(--tv-bg-opacity);
}
.bb-tv__header {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 2px solid var(--border-subtle);
  padding-bottom: var(--space-6);
}
.bb-tv__clock {
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width) * 1%);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--text-secondary);
  letter-spacing: var(--tracking-tight);
}
.bb-tv__boardname {
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width) * 1%);
  font-size: var(--tv-text-min);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-secondary);
}

.bb-tv__body {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: var(--space-16);
  align-items: center;
  /* every board enters the same way: 8px rise, 700ms, opacity */
  animation: bb-tv-in var(--dur-tv) var(--ease-out);
}
@keyframes bb-tv-in {
  from { opacity: 0; transform: translateY(var(--rise)); }
  to   { opacity: 1; transform: none; }
}

.bb-tv__matchup { display: flex; align-items: center; gap: var(--space-10); }
.bb-tv__abbr {
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width-wide) * 1%);
  font-size: var(--text-6xl);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tighter);
  line-height: var(--leading-none);
}
.bb-tv__at { font-size: var(--text-4xl); color: var(--text-tertiary); font-weight: var(--weight-regular); }
.bb-tv__count {
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width-wide) * 1%);
  font-size: var(--text-7xl);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tighter);
  line-height: var(--leading-none);
}
.bb-tv__label {
  font-size: var(--tv-text-min);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-secondary);
}
.bb-tv__seatcard {
  background: rgba(4, 30, 66, 0.82);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-3), var(--inset-hairline);
  display: flex; flex-direction: column; gap: var(--space-6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.bb-tv__holder { display: flex; align-items: center; gap: var(--space-4); }
.bb-tv__holdername { font-size: var(--text-3xl); font-weight: var(--weight-semibold); }
.bb-tv__avatar {
  width: 64px; height: 64px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-circle);
  background: var(--blue-600);
  color: var(--text-on-fill);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
}
.bb-tv__seats { display: flex; gap: var(--space-10); padding-top: var(--space-6); border-top: 1px dashed var(--border-strong); }
.bb-tv__seat { display: flex; flex-direction: column; gap: var(--space-1); }
.bb-tv__seat dt { font-size: var(--tv-text-min); color: var(--text-secondary); letter-spacing: var(--tracking-wide); text-transform: uppercase; }
.bb-tv__seat dd {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: calc(var(--display-width) * 1%);
  font-size: var(--text-5xl);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-none);
}
.bb-tv__footer {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-10);
  border-top: 2px solid var(--border-subtle);
  padding-top: var(--space-6);
  font-size: var(--tv-text-body);
  color: var(--text-secondary);
}
.bb-tv__ticker { display: flex; align-items: center; gap: var(--space-8); min-width: 0; }
.bb-tv__ticker b { color: var(--text-primary); font-weight: var(--weight-semibold); }

/* Rotation progress: which of the five boards is up */
.bb-tv__dots { display: flex; gap: var(--space-3); flex: none; }
.bb-tv__dot { width: 12px; height: 12px; border-radius: var(--radius-circle); background: var(--glyph-quiet); }
.bb-tv__dot--on { background: var(--text-primary); }

/* ==========================================================================
   20. STICKY ACTION BAR (phone)
   One primary action per screen, parked under the thumb.
   ========================================================================== */

.bb-actionbar {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--gutter) calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(2,10,22,0) 0%, var(--navy-990) 35%);
  z-index: var(--z-sticky);
}

/* ==========================================================================
   21. LIGHT SURFACE
   Same components, ice background. Used for the logo usage panel.
   ========================================================================== */

.bb-on-light {
  background: var(--bg-light-surface);
  color: var(--text-light-primary);
  border-radius: var(--radius-lg);
  padding: var(--card-pad);
  box-shadow: inset 0 0 0 1px var(--ice-200);
}
.bb-on-light .bb-logo { background: rgba(4, 30, 66, 0.06); }
.bb-on-light .bb-help { color: var(--text-light-secondary); }

/* Styleguide .sg-* scaffolding (design/components.css lines 1087+) is not shipped. */
