/* Quarter leaderboard page (season.html). LAYOUT ONLY.
   Every colour on this page comes from style.css: its CSS variables (var(--gold), ...)
   and the board's own classes (.row, .rank-1, .photo-wrap, .chip-kpi-N, .total,
   .view-pill), so the page follows the board's look with no rebuild if the board is
   restyled (Matt, 2026-10-20). Do NOT put a colour value (#hex, rgb(), a colour name)
   in this file: test-season-page.js fails if one appears. */

/* The board's style.css sets display:flex on .leaderboard, which beats the browser's
   own rule for the `hidden` attribute, so a hidden list stayed on the page and pushed
   the empty message off screen. Make `hidden` win on this page. */
.season-page [hidden] { display: none !important; }

/* Tabs sit where the board shows its round banner. */
.season-tabs {
  display: flex;
  gap: clamp(8px, 0.8vw, 20px);
}
.season-tab {
  cursor: pointer;
  background: none;
  font-family: inherit;
  margin-right: 0;
}
/* The selected tab borrows the board's "This round" pill (.view-round in style.css). */

/* Name column: first name, then a small "N sales days · best X" line under it. */
.season-sub {
  display: block;
  font-size: 0.5em;
  font-weight: 700;
  color: var(--grey);
  letter-spacing: 0;
  margin-top: 0.2em;
  white-space: nowrap;
}

/* Several sales days in a quarter: chips may wrap rather than push the total off. */
.season-page .breakdown {
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: clamp(3px, 0.5vh, 10px);
}

.season-empty {
  text-align: center;
  font-size: clamp(20px, 3vh, 48px);
  font-weight: 800;
  color: var(--grey);
  margin-top: 12vh;
}

.season-version {
  margin-left: 1em;
  opacity: 0.6;
}

/* Two session leaderboards side by side (Matt, 2026-10-21). Rows are tighter than the
   board's so seven fit in each half on a 1080p TV; `.season-board .row` (two classes)
   overrides the board's TV-size rules on purpose. Layout only, still no colours. */
.season-boards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(12px, 1.6vw, 44px); height: 100%; }
.season-board { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.season-board-title { font-size: clamp(16px, 2.2vh, 42px); font-weight: 900; color: var(--gold);
  margin: 0 0 clamp(4px, 0.8vh, 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.season-board .leaderboard { flex: 1; min-height: 0; gap: clamp(4px, 0.9vh, 16px); }
.season-board .row { grid-template-columns: clamp(30px, 2.6vw, 80px) clamp(44px, 6.4vh, 124px) minmax(0, 1fr) auto auto;
  gap: clamp(8px, 0.8vw, 22px); padding: clamp(5px, 0.8vh, 16px) clamp(10px, 1vw, 26px);
  max-height: none; border-radius: clamp(10px, 0.8vw, 20px); }
.season-board .rank { font-size: clamp(22px, 4.2vh, 80px); }
.season-board .photo-wrap { width: clamp(44px, 6.4vh, 124px); height: clamp(44px, 6.4vh, 124px);
  border-width: clamp(2px, 0.25vw, 5px); font-size: clamp(16px, 2.4vh, 46px); }
.season-board .name { font-size: clamp(16px, 2.5vh, 46px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.season-board .breakdown { flex-wrap: nowrap; gap: clamp(4px, 0.4vw, 12px); margin-right: 0; }
.season-board .chip { font-size: clamp(11px, 1.25vh, 24px); padding: clamp(3px, 0.4vh, 8px) clamp(6px, 0.55vw, 14px); }
.season-board .total { font-size: clamp(24px, 4.2vh, 80px); min-width: clamp(44px, 3.6vw, 120px); }
.season-board .total-label { font-size: clamp(9px, 0.9vh, 16px); }

/* Hover / tap breakdown (2026-10-21). Hidden until someone hovers or taps, so the TV view is
   unchanged. Colours from style.css variables only. */
#season-tip { position: fixed; z-index: 50; max-width: min(92vw, 560px); padding: 10px 14px;
  border-radius: 10px; background: var(--navy-2); color: var(--white); border: 1px solid var(--grey);
  font-size: clamp(13px, 1.5vh, 24px); font-weight: 700; line-height: 1.35; pointer-events: none; }
#season-tip[hidden] { display: none; }
.season-tip-head { color: var(--grey); font-weight: 800; margin-bottom: 4px; }
.season-board [data-tip] { cursor: help; }
.season-board [data-tip]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Phones and narrow tablets: stack the two boards and let the page scroll (the board's
   style.css locks scrolling for the TV). 900px and wider, the TV included, is unchanged. */
@media (max-width: 899.98px) {
  html:has(.season-page), body.season-page { overflow: auto; height: auto; }
  .season-page .board { overflow: visible; }
  .season-boards { grid-template-columns: minmax(0, 1fr); height: auto; }
  .season-board .leaderboard { height: auto; }
  .season-page .topbar { flex-wrap: wrap; gap: 8px 12px; padding: 10px 12px; }
  .season-page .brand { font-size: 20px; gap: 8px; }
  .season-page .brand-icon { width: 32px; height: 32px; }
  .season-page .season-tabs { order: 3; width: 100%; }
  .season-page .board { padding: 12px; }
  .season-board .row { grid-template-columns: 22px 34px minmax(64px, 1fr) auto auto; gap: 6px; padding: 6px 8px; }
  .season-board .rank { font-size: 20px; }
  .season-board .photo-wrap { width: 34px; height: 34px; font-size: 14px; border-width: 2px; }
  .season-board .name { font-size: 16px; }
  .season-board .breakdown { flex-wrap: wrap; justify-content: flex-end; max-width: 130px; row-gap: 4px; }
  .season-board .chip { font-size: 11px; padding: 2px 6px; }
  .season-board .total { font-size: 22px; min-width: 32px; }
}
