/**
 * nfl-lb.css — page-scoped layout for the leaderboards board (/leaderboards/),
 * v0.44.5, dec 78. Loaded only when Leaderboards_Page renders.
 *
 * Layout only — cards, badges and empty states come from the shared design
 * system (assets/css/nfl-lines-ds.css).
 *
 * NOTE: `.nfl-lb` (wrapper) and `.nfl-lb__container` (constrain + centre) are
 * defined in nfl-lines-ds.css by v0.44.1.5 alongside the other page shells.
 * Do not duplicate them here; do not remove them there.
 */

/* --------------------------------------------------------------- shell -- */

.nfl-lb {
  --lb-gap: var(--nfl-gap-5, 16px);
  color: var(--nfl-text, #111827);
}

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

/* -------------------------------------------------------------- header -- */

.nfl-lb__header {
  margin: 4px 0 18px;
}

.nfl-lb__title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
}

.nfl-lb__subtitle {
  color: var(--nfl-text-muted, #6b7280);
  margin: 0;
  max-width: 68ch;
  font-size: 0.95rem;
}

.nfl-lb__subtitle-note {
  display: block;
  margin-top: 4px;
  font-size: 0.875rem;
  color: var(--nfl-text-faint, #9ca3af);
}

/* Active filters as chips rather than a run-on sentence. */
.nfl-lb__active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--nfl-gap-2, 8px);
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.nfl-lb__active-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--nfl-text-muted, #6b7280);
}

.nfl-lb__chip {
  display: inline-flex;
  align-items: center;
  gap: var(--nfl-gap-1, 6px);
  padding: 4px 11px;
  border-radius: var(--nfl-radius-pill, 999px);
  background: var(--nfl-accent-bg, #dbeafe);
  color: var(--nfl-accent, #2563eb);
  font-size: 0.84rem;
  font-weight: 600;
}

/* ------------------------------------------------------------- toolbar -- */

.nfl-lb__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--nfl-gap-4, 12px) 16px;
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 1px solid var(--nfl-card-border, #e6e8ec);
  border-radius: var(--nfl-radius-card, 12px);
  background: var(--nfl-card-bg, #fff);
}

.nfl-lb__field {
  display: flex;
  flex-direction: column;
  gap: var(--nfl-gap-0, 4px);
  font-size: 0.875rem;
}

.nfl-lb__field > span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--nfl-text-muted, #6b7280);
}

.nfl-lb__field select,
.nfl-lb__field input[type="number"] {
  padding: 8px 10px;
  border: 1px solid var(--nfl-card-border, #e6e8ec);
  border-radius: var(--nfl-radius-control, 9px);
  font-size: 0.92rem;
  min-width: 130px;
  background: var(--nfl-card-bg, #fff);
  color: var(--nfl-text, #111827);
}

.nfl-lb__field--checkbox {
  flex-direction: row;
  align-items: center;
  gap: var(--nfl-gap-2, 8px);
  padding-bottom: 9px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.nfl-lb__apply {
  padding: 9px 20px;
  border: 1px solid var(--nfl-accent, #2563eb);
  border-radius: var(--nfl-radius-control, 9px);
  background: var(--nfl-accent, #2563eb);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}

.nfl-lb__apply:hover { background: var(--nfl-text, #111827); border-color: var(--nfl-text, #111827); }

.nfl-lb__reset {
  align-self: center;
  padding-bottom: 2px;
  color: var(--nfl-text-muted, #6b7280);
  font-size: 0.9rem;
  text-decoration: none;
}

.nfl-lb__reset:hover { text-decoration: underline; }

/* ------------------------------------------------------------- streaks -- */

.nfl-lb__streaks {
  padding: 18px 20px;
  margin: 0 0 var(--lb-gap);
}

.nfl-lb__streaks-title {
  font-size: 1.1rem;
  margin: 0 0 10px;
}

.nfl-lb__streaks-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--nfl-gap-2, 8px);
}

.nfl-lb__streaks-item {
  padding: 10px 12px;
  border-radius: var(--nfl-radius-control, 9px);
  background: var(--nfl-page-bg, #fafafa);
  font-size: 0.9rem;
}

/* ---------------------------------------------------------- board grid -- */

.nfl-lb__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--lb-gap);
  align-items: start;
}

/* By-team renders a single wide board rather than a lonely half-width card. */
.nfl-lb__grid--single { grid-template-columns: 1fr; }

.nfl-lb__card {
  padding: 18px 18px 14px;
}

.nfl-lb__card-title {
  font-size: 1.05rem;
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--nfl-card-border, #e6e8ec);
}

.nfl-lb__card-empty {
  margin: 0;
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------- rows -- */

.nfl-lb__list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}

/* One grid template for every row in every card, so rank / name / record /
   pct line up down the whole column instead of wandering with name length. */
.nfl-lb__row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--nfl-gap-3, 10px);
  padding: 7px 0;
  border-bottom: 1px solid var(--nfl-card-border, #e6e8ec);
  font-size: 0.92rem;
}

.nfl-lb__row:last-child { border-bottom: none; }

.nfl-lb__rank {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--nfl-text-muted, #6b7280);
  text-align: right;
}

.nfl-lb__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--nfl-accent, #2563eb);
  text-decoration: none;
  font-weight: 600;
}

.nfl-lb__name:hover { text-decoration: underline; }

.nfl-lb__team {
  grid-column: 2;
  justify-self: start;
  padding: 1px 7px;
  border-radius: var(--nfl-radius-pill, 999px);
  background: var(--nfl-mid-bg, #f3f4f6);
  font-size: 0.75rem;
  font-weight: 700;
}

.nfl-lb__rec {
  font-variant-numeric: tabular-nums;
  color: var(--nfl-text-muted, #6b7280);
  white-space: nowrap;
}

/* ATS% is banded at the BREAK-EVEN line, not at 50%. Against standard -110
   juice you need 52.4% to profit, so 51% is a losing algorithm and must not
   read as green on a board whose entire job is honest comparison. */
.nfl-lb__pct {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 58px;
  text-align: right;
  padding: 2px 8px;
  border-radius: var(--nfl-radius-badge, 7px);
}

/* v0.46.16 — ABOVE THE LINE CARRIES REAL WEIGHT. Colour alone is not a
   design: a reader scanning four windows has to see which records actually
   beat the vig without reading each number. The band itself is decided in
   PHP off ATS_BREAK_EVEN — nothing here changes which band a number is in. */
.nfl-lb__pct--good {
  background: var(--nfl-good-bg, #dcfce7);
  color: var(--nfl-good, #15803d);
  box-shadow: inset 2px 0 0 var(--nfl-good, #15803d);
  font-weight: 700;
}
.nfl-lb__pct--mid  { background: var(--nfl-mid-bg,  #f3f4f6); color: var(--nfl-text, #111827); }
.nfl-lb__pct--bad  { background: var(--nfl-bad-bg,  #fee2e2); color: var(--nfl-bad, #b91c1c); }

/* --------------------------------------------------------- empty board -- */

.nfl-lb__board-empty {
  padding: 34px 24px;
  text-align: center;
}

.nfl-lb__board-empty-title {
  font-size: 1.2rem;
  margin: 0 0 8px;
}

.nfl-lb__board-empty-body {
  color: var(--nfl-text-muted, #6b7280);
  margin: 0 auto 18px;
  max-width: 52ch;
}

/* ------------------------------------------------------------- footnote -- */

.nfl-lb__footnote {
  margin: 26px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--nfl-card-border, #e6e8ec);
  font-size: 0.92rem;
}

.nfl-lb__footnote a {
  color: var(--nfl-accent, #2563eb);
  text-decoration: none;
  font-weight: 600;
}

.nfl-lb__footnote a:hover { text-decoration: underline; }

/* -------------------------------------------------------- responsive   -- */

@media (max-width: 900px) {
  .nfl-lb__grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .nfl-lb__toolbar { padding: 12px; gap: var(--nfl-gap-3, 10px) 12px; }
  .nfl-lb__field select,
  .nfl-lb__field input[type="number"] { min-width: 0; width: 100%; }
  .nfl-lb__field { flex: 1 1 100%; }
  .nfl-lb__apply { flex: 1 1 100%; }
  .nfl-lb__row { grid-template-columns: 24px minmax(0, 1fr) auto; row-gap: 2px; }
  .nfl-lb__rec { grid-column: 2 / -1; font-size: 0.85rem; }
}

/* ═══════════════════════════════════════════════════════════════════════
 * v0.45.8b — THE CONSOLIDATED BOARD.
 *
 * One card per algorithm carrying all four .84 windows, replacing four
 * separate top-10 grids. Geometry and colour come from the ds scale — no raw
 * values, so §46.1's token pass has nothing to unpick here.
 * ═══════════════════════════════════════════════════════════════════════ */

.nfl-lb__cards {
  display: flex;
  flex-direction: column;
  gap: var(--nfl-gap-4, 12px);
}

.nfl-lb-card {
  padding: var(--nfl-gap-5, 16px);
}

.nfl-lb-card__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--nfl-gap-3, 8px);
  margin-bottom: var(--nfl-gap-4, 12px);
}

.nfl-lb-card__rank {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--nfl-text-muted, #6b7280);
  font-variant-numeric: tabular-nums;
}

.nfl-lb-card__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.nfl-lb-card__name a { text-decoration: none; color: var(--nfl-text, #111827); }
.nfl-lb-card__name a:hover { text-decoration: underline; }

.nfl-lb-card__db { display: inline-flex; align-items: center; }

.nfl-lb-card__builder {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--nfl-text-muted, #6b7280);
}

/* The four windows. Equal columns so the ranks line up down the page —
   comparing an algorithm's four ranks is the whole point of the card. */
.nfl-lb-card__windows {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--nfl-gap-3, 8px);
}

.nfl-lb-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  padding: var(--nfl-gap-3, 8px);
  text-align: center;
  border: 1px solid var(--nfl-card-border, #e6e8ec);
  border-radius: var(--nfl-radius-control, 9px);
  background: var(--nfl-page-bg, #fafafa);
}

/* A replayed window is visually quieter than an earned one — the label says
   "Historical", and the surface should not shout a record nobody played. */
.nfl-lb-stat--simulated { opacity: 0.82; }

.nfl-lb-stat__label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--nfl-text-muted, #6b7280);
  line-height: 1.25;
}

.nfl-lb-stat__pct {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

/* Above the 52.4% break-even a bettor actually faces at -110. */
.nfl-lb-stat__pct--good { color: var(--nfl-good, #15803d); }
.nfl-lb-stat__pct--flat { color: var(--nfl-text, #111827); }
.nfl-lb-stat__pct--none { color: var(--nfl-text-muted, #6b7280); font-weight: 600; }

.nfl-lb-stat__wlp,
.nfl-lb-stat__rank {
  font-size: 0.78rem;
  color: var(--nfl-text-muted, #6b7280);
  font-variant-numeric: tabular-nums;
}

.nfl-lb-card__actions {
  display: flex;
  gap: var(--nfl-gap-3, 8px);
  margin-top: var(--nfl-gap-4, 12px);
}

/* ---- pagination ------------------------------------------------------- */

.nfl-lb__pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--nfl-gap-3, 8px);
  margin-top: var(--nfl-gap-5, 16px);
  font-size: 0.88rem;
}

.nfl-lb__pagesize,
.nfl-lb__pages {
  display: inline-flex;
  align-items: center;
  gap: var(--nfl-gap-2, 6px);
  color: var(--nfl-text-muted, #6b7280);
}

.nfl-lb__pagesize-current { color: var(--nfl-text, #111827); }

@media (max-width: 900px) {
  .nfl-lb-card__windows { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .nfl-lb-card__windows { grid-template-columns: 1fr; }
  .nfl-lb-card__builder { margin-left: 0; width: 100%; }
  .nfl-lb__pagination { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════════════════════
 * v0.45.11 — the board earns the page width, and the filter strip becomes
 * a toolbar instead of a stack of bare form fields.
 * ═══════════════════════════════════════════════════════════════════════ */

/* Cards ran ½-⅔ width, which pushed Download onto a row of its own and left
   a column of dead space beside every card. The CONTAINER is a shared shell
   in nfl-lines-ds.css — widening it there would move every page on the site —
   so the board widens itself and nothing else moves. */
.nfl-lb .nfl-lb__cards,
.nfl-lb .nfl-lb__pagination {
  width: 100%;
  max-width: none;
}

.nfl-lb-card { width: 100%; }

/* Actions sit inline with the card, not stranded on their own row. */
.nfl-lb-card__actions {
  flex-wrap: wrap;
  align-items: center;
}

/* ---- the filter strip, as a toolbar ------------------------------------ */

.nfl-lb__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--nfl-gap-4, 12px);
  padding: var(--nfl-gap-4, 12px) var(--nfl-gap-5, 16px);
  border: 1px solid var(--nfl-card-border, #e6e8ec);
  border-radius: var(--nfl-radius-card, 12px);
  background: var(--nfl-card-bg, #fff);
  margin-bottom: var(--nfl-gap-5, 16px);
}

.nfl-lb__field {
  display: flex;
  flex-direction: column;
  gap: var(--nfl-gap-1, 4px);
  font-size: 0.82rem;
  color: var(--nfl-text-muted, #6b7280);
}

.nfl-lb__field > span {
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.nfl-lb__field select,
.nfl-lb__field input[type="number"],
.nfl-lb__field input[type="text"] {
  padding: 6px 10px;
  border: 1px solid var(--nfl-card-border, #e6e8ec);
  border-radius: var(--nfl-radius-control, 9px);
  background: var(--nfl-page-bg, #fafafa);
  color: var(--nfl-text, #111827);
  font-size: 0.9rem;
  line-height: 1.3;
}

.nfl-lb__field select:focus-visible,
.nfl-lb__field input:focus-visible {
  outline: 2px solid var(--nfl-focus, #2563eb);
  outline-offset: 1px;
}

/* A checkbox is a control, not a stacked label — it sits on the baseline. */
.nfl-lb__field--checkbox {
  flex-direction: row;
  align-items: center;
  gap: var(--nfl-gap-2, 6px);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.88rem;
  color: var(--nfl-text, #111827);
  align-self: center;
}

@media (max-width: 560px) {
  .nfl-lb__filters { flex-direction: column; align-items: stretch; }
  .nfl-lb__field select,
  .nfl-lb__field input { width: 100%; }
}


/* ==================================================== v0.46.16 §P5 ====== */
/* These are PAGE-SCOPED .nfl-lb__* rules and they belong in THIS sheet, not
   in ds.css. First pass put them in the ds layer — the .13.2 rule inverted:
   ds.css carries shared components, and a page class in it is as wrong as a
   ds class in a page sheet. This page is enqueued with its own sheet
   (Leaderboards_Page L413), so page rules live here. */
/* LEADERBOARDS. Everything here is appearance on logic that already exists:
   the above/below-break-even branch is in the page (L485) and reads the same
   ATS_BREAK_EVEN constant every other surface reads. Nothing below changes
   which band a number falls into. */

/* ABOVE THE LINE CARRIES REAL WEIGHT. Green text on a number is not a design
   — a reader scanning four windows needs to see which records actually beat
   the vig without reading each one. */
/* ONE BAR, not loose form elements. */
.nfl-lb__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--nfl-gap-4, 12px);
  padding: var(--nfl-gap-4, 12px);
  border: 1px solid var(--nfl-color-border, #e5e7eb);
  border-radius: var(--nfl-radius-card, 12px);
  background: var(--nfl-color-surface, #fff);
  margin-bottom: var(--nfl-gap-5, 16px);
}
.nfl-lb__field { display: flex; flex-direction: column; gap: var(--nfl-gap-0, 4px); font-size: 0.85rem; }
.nfl-lb__field > span { color: var(--nfl-color-text-muted, #6b7280); }

.nfl-lb__freshness { margin: var(--nfl-gap-1, 6px) 0 0; }
.nfl-lb__footer-links { margin-top: var(--nfl-gap-6, 20px); }
.nfl-lb__scatter { margin-top: var(--nfl-gap-7, 28px); }
.nfl-lb__pagination { margin-top: var(--nfl-gap-5, 16px); }

@media (max-width: 479px) {
  .nfl-lb__toolbar { gap: var(--nfl-gap-2, 8px); }
  .nfl-lb__field { flex: 1 1 100%; }
}
