/* ==========================================================================
   GRIDIRON — css/gridiron-season.css
   The SEASON screen: the kickoff gate and its per-unit rating strip, the
   week-by-week regular season, standings, the single-elimination playoff
   bracket, the unit-split box score, awards, and past seasons.

   Every value is a var(--token) from css/gridiron-tokens.css. No literal
   colours and none of COMBINE's hexes. Where COMBINE's season CSS reaches
   for --cb-tier-98 to gild a championship banner, this file uses the
   grade-A gold (--c-grade-a), which is GRIDIRON's own top-of-the-ramp
   colour.

   Two shapes here have no COMBINE counterpart at all, because COMBINE's
   season has no league and no bracket:
     .season-standings  a fourteen-row table sorted by win percentage
     .season-bracket    left-to-right rounds of a single-elimination draw
   ========================================================================== */

/* ---------------------------------------------------------------------
   1. Shell
   --------------------------------------------------------------------- */
#screen-season .container {
  display: flex;
  flex-direction: column;
  padding-top: var(--s-4);
  padding-bottom: var(--s-8);
}

.season {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}
.season__stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.season__title {
  letter-spacing: 0.04em;
}
.season__panel {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-4);
}
.season__note {
  color: var(--c-text-3);
  letter-spacing: 0.06em;
}
.season__controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

/* ---------------------------------------------------------------------
   2. Kickoff gate — the per-unit rating strip. Offense / defense /
   special teams are the three things a football team IS, so the rating
   is shown as three numbers that add up, not one opaque figure.
   --------------------------------------------------------------------- */
.season__gatecounts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.season__gatecount {
  padding: 4px 10px;
  border: var(--bw) solid var(--c-line-2);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  color: var(--c-text-3);
}
.season__gatecount.is-ready {
  border-color: var(--c-turf);
  color: var(--c-turf-bright);
}

.season__rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-5);
}
.season__rating-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.season__rating-num {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  color: var(--c-metal);
  font-variant-numeric: tabular-nums;
}
.season__rating-label {
  letter-spacing: 0.16em;
  color: var(--c-text-3);
}
.season__rating-units {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--s-3);
  flex: 1 1 320px;
}
.season__rating-unit {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-2) var(--s-3);
  border-left: 3px solid var(--c-line-strong);
  background: var(--c-panel-2);
  border-radius: var(--r-xs);
}
.season__rating-unit[data-unit="offense"] { border-left-color: var(--c-off); }
.season__rating-unit[data-unit="defense"] { border-left-color: var(--c-def); }
.season__rating-unit[data-unit="special"] { border-left-color: var(--c-st); }
.season__rating-unit-label {
  letter-spacing: 0.12em;
  color: var(--c-text-3);
}
.season__rating-unit-num {
  font-size: var(--fs-stat-num);
  font-weight: 700;
  line-height: 1;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}
.season__rating-unit[data-unit="offense"] .season__rating-unit-num { color: var(--c-off); }
.season__rating-unit[data-unit="defense"] .season__rating-unit-num { color: var(--c-def); }
.season__rating-unit[data-unit="special"] .season__rating-unit-num { color: var(--c-st); }
.season__rating-unit-sub {
  letter-spacing: 0.1em;
  color: var(--c-text-3);
}

/* ---------------------------------------------------------------------
   3. Record + banner
   --------------------------------------------------------------------- */
.season__record {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--s-3);
}
.season__record-num {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--c-turf-bright);
  font-variant-numeric: tabular-nums;
}
.season__record-label {
  letter-spacing: 0.1em;
  color: var(--c-text-2);
}

.season__banner {
  align-self: flex-start;
  padding: var(--s-2) var(--s-4);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-2);
  border: var(--bw) solid var(--c-line-strong);
  border-radius: var(--r-sm);
}
.season__banner.is-champion {
  color: var(--c-grade-a);
  border-color: var(--c-grade-a);
  background: color-mix(in srgb, var(--c-grade-a) 12%, transparent);
  box-shadow: var(--glow-md);
}
.season__banner.is-missed {
  color: var(--c-text-3);
}

/* ---------------------------------------------------------------------
   4. Game log — one cell per week of the 17-game season
   --------------------------------------------------------------------- */
.season__log {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.season__log-label {
  letter-spacing: 0.16em;
  color: var(--c-text-2);
}
.season__log-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.season__game {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: var(--r-xs);
  color: var(--c-text-inv);
}
.season__game.is-win { background: var(--c-ok); }
.season__game.is-loss { background: var(--c-bad); }
/* Ties are rare but legal, so they need their own read — neither the win
   green nor the loss red. */
.season__game.is-tie { background: var(--c-warn); }
.season__game.is-pending {
  background: var(--c-panel-2);
  border: var(--bw) solid var(--c-line);
}

/* ---------------------------------------------------------------------
   5. One game's result
   --------------------------------------------------------------------- */
.season__game-panel {
  align-items: flex-start;
  gap: var(--s-2);
}
.season__game-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}
.season__game-label {
  letter-spacing: 0.12em;
  color: var(--c-text-2);
}
.season__game-score {
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}
.season__game-score.is-win { color: var(--c-ok); }
.season__game-score.is-loss { color: var(--c-bad); }
.season__game-score.is-tie { color: var(--c-warn); }
.season__game-result {
  letter-spacing: 0.16em;
  font-weight: 700;
}
.season__game-result.is-win { color: var(--c-ok); }
.season__game-result.is-loss { color: var(--c-bad); }
.season__game-result.is-tie { color: var(--c-warn); }

/* ---------------------------------------------------------------------
   6. Box score — SPLIT BY UNIT, then by what each group does. Each table
   scrolls inside itself so a wide passing line never makes the page
   scroll sideways.
   --------------------------------------------------------------------- */
.season-boxes {
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
  width: 100%;
}
.season-unit {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding-left: var(--s-3);
  border-left: 3px solid var(--c-line-strong);
}
.season-unit[data-unit="offense"] { border-left-color: var(--c-off); }
.season-unit[data-unit="defense"] { border-left-color: var(--c-def); }
.season-unit[data-unit="special"] { border-left-color: var(--c-st); }
.season-unit__label {
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--c-text-2);
}
.season-unit[data-unit="offense"] .season-unit__label { color: var(--c-off); }
.season-unit[data-unit="defense"] .season-unit__label { color: var(--c-def); }
.season-unit[data-unit="special"] .season-unit__label { color: var(--c-st); }

.season-box {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.season-box__title {
  letter-spacing: 0.14em;
  color: var(--c-text-3);
}
.season-box__table {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-x: auto;
}
.season-box__row {
  display: grid;
  grid-template-columns: var(--cols);
  gap: var(--s-2);
  min-width: 100%;
  padding: var(--s-1) var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--c-text-2);
  border-bottom: var(--bw) solid var(--c-line);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.season-box__row--head {
  color: var(--c-text-3);
  letter-spacing: 0.08em;
  font-size: 0.625rem;
  border-bottom: var(--bw) solid var(--c-line-strong);
}
.season-box__name {
  color: var(--c-text);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}
.season-box__pos {
  text-align: left;
  color: var(--c-text-3);
}
/* Reserve tag beside a name. The depth chart calls these seats RESERVES,
   never "bench" — that word belongs to a different sport. */
.season-box__role {
  margin-left: var(--s-2);
  padding: 0 4px;
  border: var(--bw) solid var(--c-line-strong);
  border-radius: var(--r-xs);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: var(--c-text-3);
  vertical-align: 1px;
}

/* ---------------------------------------------------------------------
   7. Standings
   --------------------------------------------------------------------- */
.season-standings {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-x: auto;
}
.season-standings__row {
  display: grid;
  grid-template-columns: 28px minmax(140px, 2fr) repeat(7, minmax(40px, 0.7fr));
  gap: var(--s-2);
  min-width: 100%;
  padding: var(--s-1) var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--c-text-2);
  border-bottom: var(--bw) solid var(--c-line);
  border-left: 3px solid transparent;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.season-standings__row--head {
  color: var(--c-text-3);
  letter-spacing: 0.08em;
  font-size: 0.625rem;
  border-bottom: var(--bw) solid var(--c-line-strong);
}
.season-standings__name {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The playoff line: everything above it qualifies. */
.season-standings__row.is-playoff {
  border-left-color: var(--c-turf-dim);
}
.season-standings__row.is-user {
  background: var(--c-turf-a10);
  border-left-color: var(--c-turf);
  color: var(--c-text);
}
.season-standings__row.is-user .season-standings__name {
  color: var(--c-turf-bright);
  font-weight: 700;
}

/* ---------------------------------------------------------------------
   8. Playoff bracket — rounds left to right, single elimination
   --------------------------------------------------------------------- */
.season-bracket {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  overflow-x: auto;
  padding-bottom: var(--s-2);
}
.season-bracket__round {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  justify-content: center;
  min-width: 210px;
  flex: 1 1 210px;
}
.season-bracket__round-label {
  letter-spacing: 0.14em;
  color: var(--c-text-3);
}
.season-bracket__arrow {
  align-self: center;
  color: var(--c-line-strong);
  font-family: var(--font-mono);
  padding-top: var(--s-6);
}
.season-bracket__game {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: var(--bw) solid var(--c-line);
  border-radius: var(--r-sm);
  background: var(--c-panel-2);
  overflow: hidden;
}
.season-bracket__game.is-user {
  border-color: var(--c-turf);
  box-shadow: var(--glow-sm);
}
.season-bracket__game.is-bye {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--c-text-3);
}
.season-bracket__side {
  display: grid;
  grid-template-columns: 24px 1fr 36px;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--c-text-2);
  background: var(--c-panel);
}
.season-bracket__side.is-winner {
  color: var(--c-text);
  background: color-mix(in srgb, var(--c-turf) 14%, var(--c-panel));
}
.season-bracket__side.is-out {
  color: var(--c-text-3);
}
.season-bracket__seed {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: var(--r-xs);
  border: var(--bw) solid var(--c-line-2);
  font-size: 0.625rem;
  color: var(--c-text-3);
}
.season-bracket__team {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.season-bracket__score {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.season-bracket__note {
  letter-spacing: 0.12em;
  color: var(--c-st);
}

/* ---------------------------------------------------------------------
   9. Awards
   --------------------------------------------------------------------- */
.season__awards {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}
.season__award {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-2) var(--s-3);
  border: var(--bw) solid var(--c-line);
  border-radius: var(--r-sm);
  background: var(--c-panel-2);
}
.season__award-label {
  letter-spacing: 0.14em;
  color: var(--c-turf-bright);
}
.season__award-name {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  color: var(--c-text);
}
.season__award-pos {
  letter-spacing: 0.12em;
  color: var(--c-text-3);
}
.season__award.is-negative {
  border-color: var(--c-bad);
}
.season__award.is-negative .season__award-label {
  color: var(--c-bad);
}

/* ---------------------------------------------------------------------
   10. Past seasons
   --------------------------------------------------------------------- */
.season__history {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.season__history-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.season__history-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(70px, 0.6fr) minmax(120px, 1.2fr);
  gap: var(--s-3);
  padding: var(--s-1) var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--c-text-2);
  border-bottom: var(--bw) solid var(--c-line);
  font-variant-numeric: tabular-nums;
}
.season__history-row.is-champion {
  color: var(--c-grade-a);
}

/* ---------------------------------------------------------------------
   11. Narrow screens
   --------------------------------------------------------------------- */
@media (max-width: 720px) {
  .season__rating {
    gap: var(--s-3);
  }
  .season__record-num {
    font-size: 1.75rem;
  }
  .season__game-score {
    font-size: 2rem;
  }
  .season-bracket__arrow {
    display: none;
  }
}
