/* Season Database page uses the unified brand blue (from /styles.css). The
   blue tokens are restated here so the page's accents, focus rings, sort
   highlights, and peer-rank chips stay consistent with every other route. */
:root {
  --blue: #2563eb;            /* blue-600 — primary accent */
  --blue-bright: #3b82f6;     /* blue-500 */
  --blue-dark: #1d4ed8;       /* blue-700 — darker, for hover/active */
  --blue-deep: #1e3a8a;       /* blue-900 */
  --blue-glow: #60a5fa;       /* blue-400 */
  --ice-100: #eaf3ff;         /* soft blue tint */
  --ice-200: #c8dbfb;
  --ice-300: #8fb4f5;
}
[data-theme="dark"] {
  --blue: #3b82f6;            /* blue-500 */
  --blue-bright: #60a5fa;     /* blue-400 */
  --blue-dark: #2563eb;       /* blue-600 */
  --blue-deep: #1d4ed8;
  --blue-glow: #60a5fa;
}

.season-main {
  max-width: 1620px;
  margin: 0 auto;
  padding: 1.4rem clamp(1rem, 3vw, 2.4rem) 4rem;
}

/* ===========================================================================
   Broadcast-scoreboard masthead — same family as the team-pipeline band:
   one dense always-dark blue unit. Kicker + date up top, big white title,
   short lede/source, and the live filtered totals as hairline-separated
   scoreboard digits across the bottom deck.
   ======================================================================== */

.season-masthead {
  position: relative;
  border: 0;
  border-radius: 14px;
  color: #fff;
  padding: 1.1rem 1.3rem 0.95rem;
  margin: 0.5rem 0 1.1rem;
  background:
    radial-gradient(120% 180% at 100% 0%, color-mix(in srgb, var(--blue-deep, #1e3a8a) 60%, #16243f) 0%, transparent 55%),
    linear-gradient(100deg, color-mix(in srgb, var(--blue-deep, #1e3a8a) 62%, #000) 0%, var(--blue-deep, #1e3a8a) 56%, color-mix(in srgb, var(--blue-deep, #1e3a8a) 58%, #000) 100%);
  box-shadow: 0 18px 44px -18px rgba(4, 12, 28, 0.45);
  overflow: hidden;
}
.season-masthead::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 9px);
  pointer-events: none;
}
.season-masthead > * { position: relative; z-index: 1; }
.season-mast-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.55rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.season-mast-issue { color: rgba(255, 255, 255, 0.65); }
.season-mast-date  { color: rgba(255, 255, 255, 0.5); letter-spacing: 0.06em; }
.season-mast-title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1.02;
  color: #fff;
  max-width: 1080px;
}
.season-mast-title em {
  font-weight: 900;
  font-style: normal;
  color: #8db7ff;
}
.season-mast-lede {
  margin: 0.5rem 0 0;
  max-width: 760px;
  font-family: "Instrument Sans", sans-serif;
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}
.season-mast-lede b { color: rgba(255, 255, 255, 0.92); }

/* Source/scope line — small, mono-ish, explicit about where the data comes
   from. Sits between the lede and the scoreboard deck. */
.season-mast-source {
  margin: 0.5rem 0 0;
  font-family: "Instrument Sans", sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
}
.season-mast-source-label {
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  padding: 0.08rem 0.45rem;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}
.season-mast-source a {
  color: #8db7ff;
  text-decoration: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  border-bottom: 1px dashed #8db7ff;
}
.season-mast-source a:hover { border-bottom-style: solid; }
.season-mast-source-meta { color: rgba(255, 255, 255, 0.55); }

/* Filtered totals — scoreboard digits on the band's lower deck, divided by
   hairlines. Updates live with filters, same ids/markup as before. */
.season-metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0;
  margin: 0.85rem 0 0;
  padding: 0.8rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.season-metrics-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  white-space: nowrap;
  margin-right: 1.1rem;
}
.season-metrics > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 0 1.1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}
.season-metrics > div:first-of-type { border-left: 0; padding-left: 0; }
.season-metrics strong {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
}
.season-metrics span {
  font-family: "JetBrains Mono", monospace;
  margin-top: 0.2rem;
  font-size: 0.52rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.62);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.season-panel {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.season-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) repeat(7, minmax(108px, 1fr));
  gap: 0.55rem 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.season-toolbar > div { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.season-toolbar label {
  font-family: "Instrument Sans", sans-serif;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.season-toolbar input,
.season-toolbar select {
  width: 100%;
  padding: 0.42rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.season-toolbar input:focus,
.season-toolbar select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.season-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.78rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
}

#tableStatus b {
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 700;
}

.season-actions {
  display: flex;
  gap: 0.45rem;
}

.season-actions button {
  min-height: 34px;
  padding: 0 0.85rem;
  font-size: 0.82rem;
}

/* CSV export is a secondary action — ghost treatment so Reset/Copy/Export read
   as one quiet utility row instead of competing with the table itself. */
.season-actions #exportCsv {
  background: transparent;
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: none;
}

.season-actions #exportCsv:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: var(--blue-dark);
  color: var(--blue-dark);
}

[data-theme="dark"] .season-actions #exportCsv:hover {
  background: rgba(96, 165, 250, 0.14);
  border-color: var(--blue-glow);
  color: var(--blue-glow);
}

.season-actions #resetFilters {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.season-actions #resetFilters:hover {
  background: var(--frost-2);
  border-color: var(--ice-300);
}

.season-table-wrap {
  max-height: 70vh;
  overflow: auto;
  background: var(--surface, #fff);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-xs, 0 1px 2px rgba(15, 23, 42, 0.06));
}

.season-table-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.season-table-wrap::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; }
.season-table-wrap::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }

.season-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
  font-size: 0.83rem;
  table-layout: fixed;
  /* Lining/tabular digits so stat columns align vertically down the table. */
  font-variant-numeric: tabular-nums;
}

.season-table col.col-player { width: 260px; }
.season-table col.col-season { width: 86px; }
.season-table col.col-age    { width: 78px; }
.season-table col.col-tier   { width: 130px; }
.season-table col.col-split  { width: 96px; }
.season-table col.col-league { width: 118px; }
.season-table col.col-team   { width: 170px; }
.season-table col.col-num    { width: 48px; }
.season-table col.col-pts    { width: 56px; }
.season-table col.col-ppg    { width: 60px; }
.season-table col.col-peer   { width: auto; }

.season-table th,
.season-table td {
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.season-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface, #fff);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1.5px solid var(--border-2, var(--line-2));
  transition: color 0.12s ease, background 0.12s ease;
}
[data-theme="dark"] .season-table th { background: var(--surface, #0f1e36); color: var(--muted); }

.season-table th:first-child { padding-left: 1rem; }
.season-table td:first-child { padding-left: 1rem; }
.season-table th:last-child { padding-right: 1rem; }
.season-table td:last-child { padding-right: 1rem; }

.season-table tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}

.season-table tbody tr:hover td {
  background: rgba(37, 99, 235, 0.06);
}

.season-table tbody tr:hover .season-player strong {
  color: var(--blue-dark);
}
[data-theme="dark"] .season-table tbody tr:hover td { background: rgba(96, 165, 250, 0.10); }

.season-table tbody tr:hover .row-open {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.season-table .num {
  text-align: right;
  font-family: var(--mono);
  font-weight: 700;
}

/* Player cell — photo on the left, name + meta line on the right, both on a
   single row. The meta line carries the inline flag, position, and nation
   so the visual hierarchy is: photo · name · everything else. */
.season-player {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.season-player-text {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

/* Direct-child selector so this only sizes the player photo, not the
   nested .season-flag (which lives deeper in .season-sub). */
.season-player > img,
.season-player > .season-fallback {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  background: linear-gradient(135deg, var(--ink), var(--blue-deep));
  border: 1px solid var(--line);
}

.season-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
}

.season-player strong,
.season-line-main {
  display: block;
  color: var(--ink);
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.12s ease;
}
/* Other cells (season, age, league) keep the mono/numeric feel. */
.season-line-main {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: -0.01em;
}

.season-sub {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.season-sub em {
  font-style: normal;
  font-weight: 700;
  color: var(--ink);
  font-size: 0.7rem;
  padding: 0.06rem 0.36rem;
  background: var(--frost-2);
  border-radius: 999px;
}
/* Tiny "draft" tag shown next to the age number when the row is inside the
   15-17 draft window. Subtle so the age number stays primary. */
.season-sub.age-window {
  display: inline-block;
  margin-top: 0.18rem;
  padding: 0.04rem 0.36rem;
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue-dark);
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.split-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: var(--radius-full);
  padding: 0 0.55rem;
  background: var(--frost-2);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 800;
}

.tier-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: var(--radius-full);
  padding: 0 0.55rem;
  background: var(--frost-2);
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
}

.tier-major-junior {
  background: rgba(37, 99, 235, 0.12);
  color: var(--blue-dark);
}

.tier-junior,
.tier-junior-a {
  background: var(--ice-100);
  color: var(--blue-dark);
}

.tier-u18-prep {
  background: var(--purple-bg);
  color: #6d28d9;
}

.tier-college {
  background: var(--gold-bg);
  color: #92400e;
}

.tier-elite-pro,
.tier-pro {
  background: var(--blue-dark);
  color: #fff;
}

.tier-international,
.tier-tournament {
  background: rgba(34, 211, 238, 0.12);
  color: #155e75;
}

/* Dark-mode legibility: the pill text hexes above are tuned for light surfaces. */
[data-theme="dark"] .tier-u18-prep { color: #c4b5fd; }
[data-theme="dark"] .tier-college { color: #fcd34d; }
[data-theme="dark"] .tier-international,
[data-theme="dark"] .tier-tournament { color: #67e8f9; }

.split-pill.playoff {
  background: var(--blue);
  color: #fff;
}

.split-pill.cup {
  background: var(--gold);
  color: var(--ink);
}

.season-table td.peer-cell {
  white-space: normal;
  overflow: visible;
}

.season-peer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  min-width: 0;
  align-items: center;
}

.season-peer .peer-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.55rem 0.2rem 0.45rem;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.16;
  white-space: nowrap;
}

.season-peer .peer-chip b {
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.7rem;
}

.season-peer .peer-chip em {
  color: var(--muted);
  font-style: normal;
  font-weight: 600;
}

.season-peer .peer-chip.peer-strong {
  background: var(--ice-100);
  border-color: var(--ice-300);
  color: var(--blue-dark);
}

.season-peer .peer-chip.peer-strong b {
  color: var(--blue-dark);
}

.season-peer .peer-chip.peer-elite {
  background: var(--gold-bg);
  border-color: var(--gold);
  color: #7c2d12;
}

.season-peer .peer-chip.peer-elite b {
  color: #7c2d12;
}

.season-peer .peer-dim {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.row-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.4rem;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--frost-2);
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.85rem;
  line-height: 1;
  flex: 0 0 auto;
  transition: all 0.12s ease;
}

.season-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--frost);
  border-top: 1px solid var(--line);
}

.season-pager button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.season-pager button:hover {
  background: var(--frost-2);
  border-color: var(--ice-300);
}

.season-pager button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.empty {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

@media (max-width: 1420px) {
  .season-toolbar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .season-toolbar .search-field { grid-column: span 2; }
}

@media (max-width: 800px) {
  .season-toolbar { grid-template-columns: 1fr; }
  .season-toolbar .search-field { grid-column: auto; }
  .season-status { align-items: flex-start; flex-direction: column; }
  .season-metrics { gap: 0.85rem; }
}

/* ===========================================================================
   Click-to-sort column headers + sort arrow indicators
   ======================================================================== */

.season-table thead th[data-sort-key] {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 1.4rem;
  transition: background 0.12s ease, color 0.12s ease;
}
.season-table thead th[data-sort-key]:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue);
}
[data-theme="dark"] .season-table thead th[data-sort-key]:hover {
  background: rgba(96, 165, 250, 0.14);
  color: var(--blue-glow);
}
.season-table thead th[data-sort-key].num {
  padding-right: 1.4rem;
}
.season-table thead th .sort-arrow {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  opacity: 0.32;
}
.season-table thead th .sort-arrow::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -6px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid currentColor;
}
.season-table thead th .sort-arrow::after {
  content: "";
  position: absolute;
  left: -4px;
  top: 1px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}
.season-table thead th.is-sorted {
  background: rgba(37, 99, 235, 0.10);
  color: var(--blue);
}
[data-theme="dark"] .season-table thead th.is-sorted {
  background: rgba(96, 165, 250, 0.18);
  color: var(--blue-glow);
}
.season-table thead th.is-sorted .sort-arrow { opacity: 1; }
.season-table thead th.is-sorted-asc .sort-arrow::after { opacity: 0.2; }
.season-table thead th.is-sorted-desc .sort-arrow::before { opacity: 0.2; }

.season-table tbody tr.is-goalie {
  background: rgba(245, 158, 11, 0.04);
}

[data-theme="dark"] .season-table tbody tr.is-goalie {
  background: rgba(245, 158, 11, 0.08);
}

/* ===========================================================================
   Quick-preset chips above the toolbar
   ======================================================================== */

.season-presets {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.6rem 0.8rem 0;
  margin-bottom: 0.6rem;
}
.preset-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--rink);
  color: var(--ink-2);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.preset-chip:hover {
  border-color: var(--blue-bright);
  color: var(--blue-dark);
  background: var(--ice-100);
}
.preset-chip.is-active {
  background: linear-gradient(135deg, var(--blue), var(--blue-bright));
  color: #fff;
  border-color: var(--blue-bright);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.28);
}

/* ===========================================================================
   Inline country flag with player name
   ======================================================================== */

/* SVG flags from flagcdn don't have intrinsic dimensions, so we anchor a
   layout box via aspect-ratio. ~3:2 is close to most national flags; the
   SVG scales crisply inside this box at any DPR. */
.season-flag {
  width: 18px;
  aspect-ratio: 3 / 2;
  height: auto;
  border-radius: 2px;
  flex: 0 0 auto;
  display: inline-block;
}

.season-foot {
  max-width: 1180px;
  margin: 1.2rem auto 3rem;
  padding: 0 0.2rem;
  color: var(--muted);
  font-size: 0.86rem;
}
.season-foot p {
  margin: 0;
}
.season-foot a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}
.season-foot a:hover {
  text-decoration: underline;
}

/* ===== Season DB upgrades (2026-06-06): pills, dual headers, chips, declutter ===== */
/* Two-line dual-stat headers: skater label primary, goalie label faint below. */
.th-dual{display:inline-flex;flex-direction:column;align-items:flex-end;line-height:1;vertical-align:middle;}
.th-dual em{font-style:normal;font-size:.82em;font-weight:700;opacity:.5;margin-top:1px;}

/* Let tier / split chips wrap instead of clipping with an ellipsis. */
.season-table td.cell-wrap{white-space:normal;}
.season-table td.cell-wrap .tier-pill,.season-table td.cell-wrap .split-pill{white-space:normal;overflow-wrap:anywhere;line-height:1.15;}

/* Zebra striping + stronger hover for scanning long tables. */
.season-table tbody tr:nth-child(even) td{background:rgba(15,23,42,.025);}
[data-theme="dark"] .season-table tbody tr:nth-child(even) td{background:rgba(255,255,255,.045);}
.season-table tbody tr:hover td{background:rgba(37,99,235,.09);}
[data-theme="dark"] .season-table tbody tr:hover td{background:rgba(96,165,250,.13);}

/* Grouped player rows: repeated identity collapses to a quiet continuation. */
.season-player-cont{display:flex;align-items:center;gap:.55rem;padding-left:.2rem;}
.season-player-cont .cont-dash{width:34px;flex:0 0 auto;text-align:center;color:var(--line-2);font-weight:700;}
.season-player-cont .cont-name{font-size:.74rem;color:var(--muted);font-style:italic;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:.65;}

/* Active-filter chips bar. */
.season-active{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;padding:.6rem 1rem;border-bottom:1px solid var(--line);background:var(--surface);}
.season-active:empty{display:none;}
.season-active .lbl{font-size:.55rem;font-weight:800;letter-spacing:.13em;text-transform:uppercase;color:var(--muted);margin-right:.1rem;}
.season-active .chip{display:inline-flex;align-items:center;gap:.3rem;font-size:.74rem;font-weight:700;color:var(--blue-dark);background:rgba(37,99,235,.08);border:1px solid color-mix(in srgb,var(--blue) 30%,var(--line));border-radius:999px;padding:.2rem .25rem .2rem .58rem;}
.season-active .chip b{font-weight:800;color:var(--ink);}
.season-active .chip button{width:18px;height:18px;border:0;border-radius:50%;background:transparent;color:var(--muted);cursor:pointer;font-size:.95rem;line-height:1;display:grid;place-items:center;padding:0;}
.season-active .chip button:hover{background:var(--blue);color:#fff;}
.season-active .clear-all{margin-left:.15rem;font-size:.7rem;font-weight:700;color:var(--muted);background:none;border:0;cursor:pointer;text-decoration:underline;text-underline-offset:2px;}
.season-active .clear-all:hover{color:var(--blue);}

/* One-line scout's toolbar: search grows, selects size to content, the
   Filters pill opens the collapsible panel (quick views + advanced groups).
   Labels stay in the DOM for screen readers but are visually hidden. */
.season-more-toggle{display:inline-flex;align-items:center;gap:.4rem;flex:0 0 auto;margin:0;padding:.42rem .7rem;background:var(--surface);border:1px solid var(--line);border-radius:8px;color:var(--blue-dark);font:inherit;font-size:.72rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;cursor:pointer;transition:border-color .12s ease,color .12s ease;}
.season-more-toggle:hover{border-color:var(--blue);color:var(--blue);}
.season-more-toggle[aria-expanded="true"]{border-color:var(--blue);background:rgba(37,99,235,.08);}
.season-more-toggle .caret{transition:transform .18s ease;font-size:.9rem;}
.season-more-toggle[aria-expanded="true"] .caret{transform:rotate(180deg);}
.season-more-toggle .more-count{font-family:var(--mono);font-size:.62rem;color:#fff;background:var(--blue);border-radius:999px;padding:.05rem .4rem;margin-left:.1rem;}
.season-more-toggle .more-count:empty{display:none;}
.season-toolbar-core{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;}
.season-toolbar-core>div{flex:0 1 auto;}
.season-toolbar-core .search-field{flex:1 1 230px;min-width:180px;}
.season-toolbar-core select{width:auto;max-width:200px;}
.season-toolbar-core label{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;}
.season-toolbar-more .season-presets{padding:0;margin:0;}

/* Collapsed page-context explainer: heading visible, prose on demand. */
.launch-fold > summary{list-style:none;cursor:pointer;display:flex;align-items:baseline;gap:.5rem;}
.launch-fold > summary::-webkit-details-marker{display:none;}
.launch-fold > summary h2{margin:0;}
.launch-fold > summary::after{content:"▾";font-size:.85rem;color:var(--muted);transition:transform .18s ease;}
.launch-fold[open] > summary::after{transform:rotate(180deg);}
.launch-fold > summary:hover h2{color:var(--blue);}
/* Advanced filters read as three labeled sub-groups (Age / Season / Context)
   instead of one undifferentiated 10-control cliff. */
.season-toolbar-more{display:flex;flex-direction:column;gap:.55rem;padding-top:.55rem;border-top:1px dashed var(--line);}
.season-toolbar-more[hidden]{display:none;}
/* One flat dense grid — every advanced control in a single compact row set,
   tiny inline labels, no boxed sub-groups. The child selectors out-rank the
   generic `.season-toolbar > div` column-flex rule. */
.season-toolbar-more>.season-presets{flex-direction:row;flex-wrap:wrap;}
.season-toolbar-more>.season-more-grid,.season-more-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(124px,1fr));gap:.4rem .45rem;}
.season-more-grid>div{display:flex;flex-direction:column;gap:.12rem;min-width:0;}
.season-more-grid label{font-size:.54rem;}
.season-more-grid input,.season-more-grid select{padding:.34rem .5rem;font-size:.76rem;}
@media(max-width:980px){
  .season-toolbar-core{grid-template-columns:repeat(2,minmax(0,1fr));}
  .season-more-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
  .season-toolbar-core .search-field{grid-column:span 2;}
}
@media(max-width:620px){
  .season-toolbar-core{grid-template-columns:1fr;}
  .season-more-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .season-toolbar-core .search-field{grid-column:auto;}
}

/* ===== Sticky header inside the 70vh table scroller ===== */
.season-table-wrap .season-table thead th,
.season-table-wrap .season-table thead th[data-sort-key] { position: sticky; top: 0; z-index: 6; background: var(--surface, #fff); box-shadow: 0 1px 0 var(--line); }
[data-theme="dark"] .season-table-wrap .season-table thead th,
[data-theme="dark"] .season-table-wrap .season-table thead th[data-sort-key] { background: var(--surface, #0f1e36); }

/* ===== Goalie-primary dual headers when the view is goalies-only ===== */
.th-dual b { font-weight: inherit; }
.season-table.is-goalies .th-dual { flex-direction: column-reverse; }
.season-table.is-goalies .th-dual b { font-size: .82em; font-weight: 700; opacity: .5; margin-top: 1px; }
.season-table.is-goalies .th-dual em { font-size: 1em; font-weight: inherit; opacity: 1; margin-top: 0; }

/* ===== Pin rows ===== */
.season-pin { flex: 0 0 auto; margin-left: auto; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); font-family: var(--mono); font-size: .54rem; font-weight: 800; letter-spacing: .08em; border-radius: 999px; padding: .14rem .42rem; cursor: pointer; opacity: 0; transition: opacity .12s ease, color .12s ease, border-color .12s ease; }
.season-table tr:hover .season-pin, .season-pin.is-on, .season-pin:focus-visible { opacity: 1; }
.season-pin:hover { color: var(--blue); border-color: var(--blue); }
.season-pin.is-on { color: var(--blue-dark); border-color: var(--blue); background: rgba(37, 99, 235, .08); }
.season-player .season-pin { align-self: center; }
.season-player-cont .season-pin { margin-left: auto; }
tr.is-pinned td { background: rgba(37, 99, 235, .06) !important; }
[data-theme="dark"] tr.is-pinned td { background: rgba(96, 165, 250, .1) !important; }
tr.season-pin-sep td { padding: 0; height: 4px; background: var(--blue); opacity: .25; border-bottom: 0; }

/* ===== Data bars behind PTS / P-GP (skaters) ===== */
td.has-bar { position: relative; }
td.has-bar::before { content: ""; position: absolute; right: 4px; top: 18%; bottom: 18%; width: calc(var(--bar, 0%) * .92); max-width: 92%; border-radius: 3px; background: rgba(37, 99, 235, .12); pointer-events: none; }
[data-theme="dark"] td.has-bar::before { background: rgba(96, 165, 250, .16); }
td.has-bar strong { position: relative; }

/* ===== Peer chips on the cohort-band palette (hid-cohort hues) ===== */
.peer-chip.peer-elite { color: #065f46; background: rgba(16, 185, 129, .16); border-color: rgba(16, 185, 129, .35); }
.peer-chip.peer-strong { color: #1d4ed8; background: rgba(37, 99, 235, .12); border-color: rgba(37, 99, 235, .3); }
.peer-chip.peer-average { color: #475569; background: rgba(100, 116, 139, .12); border-color: rgba(100, 116, 139, .28); }
.peer-chip.peer-depth { color: #64748b; background: rgba(148, 163, 184, .1); border-color: rgba(148, 163, 184, .22); }
[data-theme="dark"] .peer-chip.peer-elite { color: #34d399; }
[data-theme="dark"] .peer-chip.peer-strong { color: #93c5fd; }
[data-theme="dark"] .peer-chip.peer-average { color: #cbd5e1; }
[data-theme="dark"] .peer-chip.peer-depth { color: #94a3b8; }
