:root {
  --bg: #0f1420;
  --panel: #171d2c;
  --border: #2a3244;
  --text: #e6e9f0;
  --muted: #8b93a7;
  --accent: #5b8def;
  --accent-hover: #7aa4f2;
  --accent-soft: rgba(91, 141, 239, 0.14);
  --row-hover: #1e2536;
  --playoff: #e0b03e;
  --playoff-bg: rgba(224, 176, 62, 0.14);
  --championship: #ffd24d;
  --championship-bg: rgba(255, 210, 77, 0.22);
  --consolation: #e0793e;
  --consolation-bg: rgba(224, 121, 62, 0.14);
  --loser-bracket: #8b93a7;
  --loser-bracket-bg: rgba(139, 147, 167, 0.12);
  --injury-warn: #e0b03e;
  --injury-warn-bg: rgba(224, 176, 62, 0.22);
  --injury-danger: #e0543e;
  --injury-danger-bg: rgba(224, 84, 62, 0.24);
}

* { box-sizing: border-box; }

/* NOT overflow-x: hidden on html/body as a "safety net" -- tried that, and
   it silently breaks position: sticky everywhere on the site (the topbar
   included): any ancestor with non-visible overflow on either axis, even
   html/body, stops a sticky descendant from ever un-sticking from the
   normal document flow, no matter how far down the tree it is. Same family
   of bug as the draft board / box score / nav dropdown overflow-x quirks
   already documented elsewhere in this file, just at the root this time.
   table-scroll.js plus the per-page wrappers below (.bracket-scroll,
   .boxscore-scroll, .draft-grid-scroll) are the actual, targeted fix. */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* ===========================================================================
   Top bar (design v2 -- see design_versions/v1/ for the previous version)

   One row, three zones: the league you're in (left), where you can go
   (center), who you are (right). v1 crammed this into a two-row grid with
   eight identical flat links, no current-page indicator, and a league
   switcher hidden behind a hover on the team badge.
   =========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 18px;
}

/* --- Shared bits: chevrons and pop-over menus --- */

.chevron {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0.7;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s ease;
}
[aria-expanded="true"] .chevron { transform: translateY(1px) rotate(-135deg); }

.menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  z-index: 60;
}
.menu-panel[hidden] { display: none; }
.menu-panel-right { left: auto; right: 0; }

.menu-item {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.menu-item:hover { background: var(--row-hover); color: var(--text); text-decoration: none; }
.menu-item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.menu-item-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.menu-label {
  padding: 6px 10px 2px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.menu-email {
  padding: 0 10px 6px;
  font-size: 0.82rem;
  color: var(--text);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-empty { display: block; padding: 8px 10px; font-size: 0.85rem; color: var(--muted); }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--border); }

/* --- Left: league switcher --- */

/* Shrinks before the nav does, so a long league name ellipsises rather than
   the nav links overflowing (min-width:0 is what lets the ellipsis kick in). */
.league-switcher { position: relative; flex-shrink: 1; min-width: 0; }
.league-switcher-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 250px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.league-switcher-btn:hover { background: var(--row-hover); border-color: var(--border); }
.league-switcher-text { display: flex; flex-direction: column; min-width: 0; }
.league-switcher-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.league-switcher-meta {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.league-switcher-meta:empty { display: none; }

.brand-wordmark {
  flex-shrink: 0;
  padding: 6px 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
}

/* --- Center: primary nav --- */

.mainnav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 14px;
  /* Deliberately NOT a scroll container. `overflow-x: auto` here implicitly
     computes overflow-y to auto as well (the same CSS quirk that broke the
     draft board and box scores), which clips the History dropdown -- the
     panel opens correctly but paints inside a box only 35px tall, so nothing
     is visible. The nav never needs to scroll anyway: it's ~520px wide and
     collapses to a hamburger at 940px, well before space runs out. */
  flex-shrink: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nav-link:hover { background: var(--row-hover); color: var(--text); text-decoration: none; }
.nav-link.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.nav-group { position: relative; }

/* --- Right: account --- */

.account { position: relative; flex-shrink: 0; margin-left: auto; }
.account-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px 4px 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.account-btn:hover { background: var(--row-hover); border-color: var(--border); }
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* --- Hamburger (mobile only) --- */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  margin-left: auto;
  padding: 0 9px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
}
.nav-toggle:hover { background: var(--row-hover); border-color: var(--border); }
.nav-toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--muted);
}

@media (max-width: 940px) {
  .topbar { position: relative; }
  .nav-toggle { display: flex; }
  .account { margin-left: 0; }

  .mainnav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin-left: 0;
    padding: 8px 12px 12px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
    z-index: 40;
  }
  .mainnav.is-open { display: flex; }
  .nav-link { padding: 11px 12px; }

  /* Grouped items flatten inline instead of popping over, so the whole menu
     is one scannable list on a small screen. */
  .nav-group-btn { display: none; }
  .nav-group .menu-panel {
    display: block;
    position: static;
    padding: 0 0 0 10px;
    border: 0;
    border-left: 2px solid var(--border);
    border-radius: 0;
    margin: 2px 0 2px 12px;
    box-shadow: none;
    min-width: 0;
  }
  .nav-group .menu-panel[hidden] { display: block; }
  .nav-group .menu-item { padding: 10px 10px; font-size: 0.88rem; }
}

@media (max-width: 560px) {
  .topbar-inner { gap: 6px; padding: 0 12px; }
  .league-switcher-btn { max-width: 170px; }
}

.content { max-width: 1100px; margin: 0 auto; padding: 24px; }
/* Pages with wide/dense tables (5+ columns) opt in via {% block content_class %}. */
.content-wide { max-width: none; width: 100%; }

.content a {
  color: var(--text);
  text-decoration: none;
}
.content a:hover { color: var(--accent); text-decoration: none; }

h1 {
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
}
h2 {
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}
.muted { color: var(--muted); font-size: 0.9rem; }
/* Only used on the My Leagues cards now -- the topbar has its own
   .league-switcher-meta, and the standings h1 no longer repeats the name. */
.league-est { font-size: 0.7rem; margin-top: -6px; }
.inline-link { font-size: 0.7em; }

.collapsible-season { margin-bottom: 8px; }
.collapsible-season > summary {
  cursor: pointer;
  list-style: none;
}
.collapsible-season > summary::-webkit-details-marker { display: none; }
.collapsible-season > summary h2::before,
.collapsible-season > summary h3::before {
  content: "\25B8";
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.15s ease;
}
.collapsible-season[open] > summary h2::before,
.collapsible-season[open] > summary h3::before { transform: rotate(90deg); }
.collapsible-season > summary:hover h2,
.collapsible-season > summary:hover h3 { color: var(--accent); }
.legend-badge { display: inline-block; padding: 1px 8px; }

.table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
/* .data-table's own width: 100% would otherwise stretch to fill this
   wrapper and squeeze every column instead of overflowing it -- min-width
   keeps a short table filling the space like before, while letting a wide
   one grow past the wrapper so it scrolls instead of compressing. */
.table-scroll .data-table { width: auto; min-width: 100%; }

.data-table {
  width: 100%;
  /* border-collapse: collapse + a sticky <thead th> is a known rendering bug
     -- collapsed borders confuse sticky's stacking/paint, making a data row
     appear to render above its own header (worst on pages with two tables
     stacked close together, like box scores). separate + zero spacing looks
     identical (borders still come from border-bottom on the cells) without
     the bug. */
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
  font-size: 0.92rem;
}

.data-table th, .data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.data-table thead th {
  /* Was `position: sticky; top: 84px` to keep the header visible while
     scrolling a long table -- removed because it has a reproducible
     rendering bug in practice: the header can visually paint in the wrong
     place relative to its own tbody (a row appears to render above the
     column titles), most visible on pages with a default-sort column that
     reorders rows on load (box scores, Free Agents, etc). Confirmed by
     toggling this one declaration back and forth -- static fixes it
     immediately, sticky reproduces it every time. Not worth the visual
     corruption for the scroll convenience. */
  background: var(--panel);
  color: var(--muted);
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
}

.data-table.sortable thead th {
  cursor: pointer;
  user-select: none;
}
.data-table.sortable thead th:hover { color: var(--accent); }
.data-table.sortable thead th.sort-asc,
.data-table.sortable thead th.sort-desc { color: var(--accent); }
.data-table.sortable thead th.sort-asc::after { content: " \25B2"; }
.data-table.sortable thead th.sort-desc::after { content: " \25BC"; }

.data-table tbody tr.is-playoff { background: var(--playoff-bg); }
.data-table tbody tr.is-playoff:hover { background: var(--playoff-bg); filter: brightness(1.15); }
.data-table tbody tr.is-playoff td:first-child { border-left: 3px solid var(--playoff); }

.data-table tbody tr.is-championship { background: var(--championship-bg); font-weight: 600; }
.data-table tbody tr.is-championship:hover { background: var(--championship-bg); filter: brightness(1.15); }
.data-table tbody tr.is-championship td:first-child { border-left: 4px solid var(--championship); }

.data-table tbody tr.is-consolation { background: var(--consolation-bg); }
.data-table tbody tr.is-consolation:hover { background: var(--consolation-bg); filter: brightness(1.15); }
.data-table tbody tr.is-consolation td:first-child { border-left: 3px solid var(--consolation); }

.data-table tbody tr.is-loser-bracket { background: var(--loser-bracket-bg); }
.data-table tbody tr.is-loser-bracket:hover { background: var(--loser-bracket-bg); filter: brightness(1.15); }
.data-table tbody tr.is-loser-bracket td:first-child { border-left: 3px solid var(--loser-bracket); }

.data-table td.cell-warn { background: var(--injury-warn-bg); color: var(--injury-warn); }
.data-table td.cell-danger { background: var(--injury-danger-bg); color: var(--injury-danger); }

.legend-swatch {
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  border-radius: 2px;
  margin: 0 0.2em;
  vertical-align: middle;
}
.legend-swatch.legend-warn { background: var(--injury-warn-bg); border: 1px solid var(--injury-warn); }
.legend-swatch.legend-danger { background: var(--injury-danger-bg); border: 1px solid var(--injury-danger); }

.badge-playoff, .badge-championship, .badge-consolation, .badge-loser-bracket {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge-playoff { background: var(--playoff-bg); color: var(--playoff); }
.badge-championship { background: var(--championship-bg); color: var(--championship); }
.badge-consolation { background: var(--consolation-bg); color: var(--consolation); }
.badge-loser-bracket { background: var(--loser-bracket-bg); color: var(--loser-bracket); }

.data-table tbody tr:hover { background: var(--accent-soft); }

.champion-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 20px 0 8px;
  padding: 20px 28px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--championship-bg), var(--panel) 70%);
  border: 1px solid var(--championship);
  box-shadow: 0 0 24px -6px var(--championship);
}
.champion-trophy { font-size: 3rem; line-height: 1; }
.champion-label {
  color: var(--championship);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.champion-name { font-size: 1.7rem; font-weight: 800; margin-top: 2px; }
.champion-name a { color: var(--text); }
.champion-score { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.champion-score a { color: var(--muted); text-decoration: underline; }

.bracket-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 4px 16px;
}
.bracket {
  display: flex;
  align-items: stretch;
  width: max-content;
  margin-top: 8px;
}
.bracket-round {
  display: flex;
  flex-direction: column;
  width: 270px;
  flex-shrink: 0;
}
.bracket-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  flex-shrink: 0;
  margin-top: 34px;
  color: var(--border);
  font-size: 1.3rem;
}
.bracket-round-label {
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.bracket-round-matches {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 22px;
  flex: 1;
}
.bracket-match {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.9rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.bracket-match.is-championship {
  border-color: var(--championship);
  background: var(--championship-bg);
  box-shadow: 0 0 0 1px var(--championship);
}
.bracket-match.is-consolation { border-color: var(--consolation); }
.bracket-match.is-loser-bracket { border-color: var(--loser-bracket); background: var(--loser-bracket-bg); }

.bracket-match-week {
  position: absolute;
  top: -9px;
  right: 12px;
  background: var(--bg);
  padding: 0 6px;
  font-size: 0.68rem;
  color: var(--muted);
}
.placement-label {
  position: absolute;
  top: -9px;
  left: 12px;
  background: var(--bg);
  padding: 0 6px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--consolation);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bracket-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
}
.bracket-team + .bracket-team { border-top: 1px solid var(--border); }
.bracket-team-name { color: var(--muted); line-height: 1.25; }
.bracket-team-name a { color: inherit; }
.bracket-team.is-winner .bracket-team-name { font-weight: 700; color: var(--text); }
.bracket-team.is-loser { opacity: 0.6; }
.bracket-team .score { font-variant-numeric: tabular-nums; font-size: 1.1rem; color: var(--muted); }
.bracket-team.is-winner .score { color: var(--accent); font-weight: 700; }

.bracket-trophy {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--championship);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--championship);
}
.bracket-match .box-link { display: block; margin-top: 8px; font-size: 0.75rem; text-align: right; }

.placement-games {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 16px;
}
.placement-games .bracket-match { width: 250px; padding-top: 20px; }

.boxscore { margin-top: 16px; }
.boxscore > div { margin-bottom: 28px; }
/* overflow-x alone implicitly computes overflow-y to "auto" too (a real CSS
   quirk), turning this into its own scroll container -- which breaks the
   thead's `position: sticky; top: 84px` (it sticks relative to this little
   box instead of the page), making the header appear to float away from its
   own table with a player row visible above it. Same bug, same fix, as the
   draft board earlier. */
.boxscore-scroll { overflow-x: auto; overflow-y: visible; }
.stat-line { white-space: nowrap; }

/* Draft board -- teams as columns, rounds as rows, matching Sleeper's own
   draft board layout (a team's whole draft reads down one column, instead
   of being scattered across separately-headed round sections).

   The board can be both wide (many teams) and tall (many rounds), so the
   scroll container owns BOTH axes with a capped height. That makes the
   team-name header (sticky top:0) and the round-number column (sticky
   left:0) both freeze relative to THIS container -- vertical `position:
   sticky` can't anchor to the viewport from inside an overflow container,
   which is exactly why an earlier `overflow-x`-only version let the header
   scroll away entirely. */
.draft-grid-scroll {
  overflow: auto;
  max-height: calc(100vh - 140px);
  margin-top: 16px;
  border: 1px solid var(--border);
}
.draft-grid { border-collapse: collapse; }
.draft-grid th, .draft-grid td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  min-width: 150px;
  font-size: 0.85rem;
}
.draft-grid thead th {
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  position: sticky;
  top: 0;
  border-bottom: 2px solid var(--accent);
  z-index: 2;
}
/* Round-number column: narrow and frozen on the left. The width override
   has to beat the shared `min-width: 150px` above, hence !important on the
   min-width specifically. */
.draft-round-col {
  position: sticky;
  left: 0;
  background: var(--panel);
  min-width: 48px !important;
  width: 48px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  z-index: 1;
}
/* Top-left corner cell must sit above both the sticky header row and the
   sticky round column so neither slides under it. */
.draft-grid thead .draft-round-col { z-index: 4; }
.draft-grid tbody .draft-round-col { z-index: 3; }
.draft-cell.is-keeper { border-color: var(--championship); background: var(--championship-bg); }
.draft-cell-empty { background: var(--row-hover); }
.draft-pick-no { font-size: 0.7rem; color: var(--muted); }
.draft-player { font-weight: 600; margin: 2px 0; }

/* Auth forms + league picker/add-league card */
.auth-page { max-width: 380px; margin: 64px auto; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
}
.form-field { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 0.85rem; color: var(--muted); }
.form-field input, .form-field select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.95rem;
}
.form-field input:focus, .form-field select:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
.form-actions { margin-top: 20px; }

.field-error { color: var(--consolation); font-size: 0.82rem; }
.hidden { display: none; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #0f1420;
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn-disabled { opacity: 0.4; pointer-events: none; }

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 16px 0;
}
.pagination .muted {
  /* Left unconstrained, this shrinks to whatever's left of a nowrap flex row
     after the buttons and page-size select -- on a narrow phone that can be
     just a few px, wrapping "Page 1 of 5 (998 free agents)" one word per
     line and blowing the whole bar's height out. flex-wrap above already
     lets it drop to its own line if needed instead. */
  flex: 1 1 auto;
  min-width: 140px;
}
.page-size-label {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}
.page-size-label select {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.9rem;
}

.link-button {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.link-button:hover { color: var(--text); text-decoration: none; }

.error-message {
  background: var(--consolation-bg);
  color: var(--consolation);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.88rem;
  margin-top: 12px;
}

.success-message {
  background: var(--championship-bg);
  color: var(--championship);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.88rem;
  margin-top: 12px;
}

.notice-message {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 12px;
  font-size: 0.9rem;
  margin-top: 12px;
}
.notice-message form { margin-top: 10px; }


.auth-switch { margin-top: 16px; font-size: 0.88rem; color: var(--muted); }

.league-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
}
.league-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 16px 18px;
  display: block;
  /* Grow to fit the name on one line instead of the fixed-width grid track
     this used to be -- a grid's 1fr columns all stretch together, so a long
     name in one card either wrapped or forced every card in the row wider
     than it needed to be. flex-shrink: 0 means a card that doesn't fit the
     remaining row width wraps whole onto the next line, never squeezes. */
  flex: 0 0 auto;
  min-width: 240px;
}
.league-card:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.league-card .league-name { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.league-card-footer {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.pill {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 20px;
  padding: 3px 10px;
}
.pill-provider { background: var(--accent-soft); color: var(--accent); }
.pill-role { background: var(--row-hover); color: var(--muted); }
.add-league-card { max-width: 420px; }

.season-nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 8px;
  vertical-align: middle;
}

.stat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 28px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 22px;
  min-width: 100px;
  text-align: center;
}
.stat-value { font-size: 1.4rem; font-weight: 700; }
.stat-label {
  margin-top: 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.stat-card.stat-champion { border-color: var(--championship); background: var(--championship-bg); }
.stat-card.stat-champion .stat-value { color: var(--championship); }

.admin-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--championship-bg);
  border: 1px solid rgba(255, 210, 77, 0.35);
  border-radius: 8px;
  padding: 10px 16px;
  margin: 16px 0;
  font-size: 0.9rem;
}
.admin-banner-label {
  font-weight: 700;
  color: var(--championship);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}
.admin-banner a { color: var(--text); }
.admin-banner a:hover { color: var(--accent); }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 28px;
  align-items: start;
}
.settings-grid .card h2 { margin-top: 0; }

.invite-link-row { display: flex; gap: 8px; max-width: 520px; margin-top: 8px; }
.narrow-input { max-width: 100px; }
.invite-link-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.9rem;
}
