/* Compact league overview, connected playoff bracket and three-column matchup. */
.player-stat-modal {
  width: min(96vw, 1320px);
  max-width: 1320px;
  max-height: 96vh;
  padding: 20px 24px;
}
.player-stat-modal .table-scroll { overflow-x: auto; overflow-y: visible; }
.player-stat-modal-table { min-width: 990px; table-layout: fixed; }
.player-stat-modal-table th, .player-stat-modal-table td { padding: 7px 5px; text-align: right; }
.player-stat-modal-table th:first-child { width: 165px; min-width: 165px; text-align: left; }
.player-stat-modal-table tbody th:first-child { text-align: left; }
.player-stat-modal-table thead th:not(:first-child) { text-align: right; }
.player-stat-modal-table th:nth-child(9), .player-stat-modal-table td:nth-child(9),
.player-stat-modal-table th:nth-child(10), .player-stat-modal-table td:nth-child(10) { width: 94px; font-size: 11px; }

.postseason-summary { max-width: 450px; align-items: flex-start; flex-direction: column; gap: 3px; }
.postseason-summary strong { font-size: 13px; line-height: 1.35; font-weight: 700; }
.league-hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.league-hub-grid .panel { min-width: 0; margin: 0; }
.league-hub-grid .section-head { gap: 12px; }
.league-hub-grid .section-head a { white-space: nowrap; }
.league-hub-grid + .panel { margin-top: 18px; }
.league-matchup-list, .league-fixture-list, .league-activity-list { display: grid; gap: 7px; }
.league-activity-list { max-height: 395px; overflow-y: auto; }
.league-matchup-row { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 8px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); }
.league-matchup-row:hover { background: #f0f6fd; }
.league-matchup-row span { overflow-wrap: anywhere; }
.league-matchup-row span:last-child { text-align: right; }
.league-matchup-row strong { color: var(--blue); font-size: 17px; }
.league-fixture-row { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.league-fixture-row time { color: var(--muted); white-space: nowrap; }
.league-activity-row { display: grid; grid-template-columns: 115px minmax(0,1fr) auto; gap: 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.league-activity-row span { min-width: 0; overflow-wrap: anywhere; }
.league-activity-row small { color: var(--muted); white-space: nowrap; }

.playoff-bracket { display: flex; gap: 28px; min-height: 370px; overflow-x: auto; padding: 5px 16px 12px 0; }
.bracket-stage-column { display: flex; flex: 1 0 215px; flex-direction: column; justify-content: space-around; min-width: 215px; }
.bracket-stage-column h3 { margin: 0 0 12px; color: var(--navy); font-size: 14px; }
.bracket-pair { display: flex; flex: 1; flex-direction: column; justify-content: space-around; position: relative; gap: 14px; }
.bracket-pair:not(.single)::after { content: ''; position: absolute; right: -14px; top: 25%; bottom: 25%; border-right: 2px solid #a8bbce; }
.bracket-playin .bracket-pair.single { flex: 0 0 50%; }
.bracket-stage-column .bracket-card { position: relative; z-index: 1; min-width: 0; background: #fff; padding: 10px; }
.bracket-stage-column:not(:last-child) .bracket-card::after { content: ''; position: absolute; top: 50%; right: -14px; width: 14px; border-top: 2px solid #a8bbce; }
.bracket-stage-column:not(:first-child) .bracket-card::before { content: ''; position: absolute; top: 50%; left: -14px; width: 14px; border-top: 2px solid #a8bbce; }
.bracket-stage-column .bracket-team { gap: 8px; }
.bracket-stage-column .bracket-team strong { min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.bracket-stage-column .bracket-team span { font-size: 14px; }
.bracket-games { display: flex; gap: 7px; margin-top: 8px; }
.bracket-games a { font-size: 11px; }

.matchup-workspace { display: grid; grid-template-columns: minmax(190px,.7fr) minmax(0,3fr) minmax(250px,.9fr); gap: 12px; align-items: start; }
.matchup-workspace > *, .matchup-roster-pair > * { min-width: 0; }
.matchup-sidebar { display: contents; }
.matchup-selector { grid-column: 1; grid-row: 1; }
.matchup-rosters-column { grid-column: 2; grid-row: 1; }
.matchup-categories { grid-column: 3; grid-row: 1; }
.matchup-workspace .panel { margin-bottom: 0; }
.matchup-selector .section-head h2, .matchup-categories .section-head h2 { font-size: 16px; }
.matchup-selector { max-height: min(75vh, 760px); overflow-y: auto; }
.matchup-selector .matchup-overview-grid { display: flex; flex-direction: column; }
.matchup-selector .matchup-overview-card { padding: 9px; font-size: 12px; }
.matchup-selector .matchup-card-score { font-size: 16px; }
.matchup-selector .team-logo-small { width: 23px; height: 23px; }
.matchup-head-compact { padding: 9px 12px; border-radius: 6px; margin-bottom: 10px; }
.matchup-head-compact h2 { font-size: 14px; line-height: 1.2; }
.matchup-head-compact .team-logo-large { width: 34px; height: 34px; }
.matchup-head-compact .big-score strong { font-size: 24px; }
.matchup-roster-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.matchup-roster-panel { padding: 10px; }
.matchup-roster-panel .section-head { gap: 6px; }
.matchup-roster-panel .section-head h3 { font-size: 13px; margin: 0; overflow-wrap: anywhere; }
.matchup-roster-panel .section-head span { font-size: 10px; }
.matchup-roster-panel .note { font-size: 10px; padding: 6px 8px; margin: 6px 0; }
.matchup-roster-scroll { max-height: min(61vh, 650px); overflow-y: auto; }
.matchup-mini-heading, .matchup-mini-stats { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 2px; text-align: center; }
.matchup-mini-heading { position: sticky; top: 0; z-index: 1; background: #e8edf3; padding: 5px 2px; color: #526477; font-size: 9px; font-weight: 800; }
.matchup-player-row { padding: 6px 2px 7px; border-bottom: 1px solid var(--line); }
.matchup-player-row.bench { background: #f8fafc; }
.matchup-player-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 6px; font-size: 11px; }
.matchup-player-meta small { color: var(--muted); font-size: 10px; }
.matchup-mini-stats { margin-top: 4px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.matchup-mini-stats > span { min-width: 0; overflow-wrap: anywhere; }
.matchup-mini-stats small { display: block; font-size: 9px; font-weight: 600; color: var(--muted); }
.matchup-player-row.game-live { background: #eef8f1; box-shadow: inset 3px 0 #8ccaa2; }
.matchup-player-row.game-live.bench { background: #f0f7f3; }
.roster-table tr.bench { background: #eaf0f7; }
.roster-table tr.bench:hover { background: #e3ebf5; }
.matchup-categories { padding: 10px; }
.matchup-categories .category-table { font-size: 12px; }
.matchup-categories .category-table th, .matchup-categories .category-table td { padding: 8px 3px; white-space: normal; }
.matchup-categories .category-table th { font-size: 9px; overflow-wrap: anywhere; }
.matchup-categories .category-table small { display: block; }

@media (min-width: 751px) {
  .matchup-selector, .matchup-roster-scroll { max-height: none; overflow-y: visible; }
}
@media (max-width: 1150px) {
  .matchup-workspace { grid-template-columns: minmax(240px, .8fr) minmax(0, 2fr); }
  .matchup-sidebar { display: flex; flex-direction: column; gap: 12px; grid-column: 1; grid-row: 1; }
  .matchup-sidebar > * { min-width: 0; }
  .matchup-rosters-column { grid-column: 2; grid-row: 1; }
  .matchup-roster-pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 750px) {
  .league-hub-grid, .matchup-workspace { grid-template-columns: minmax(0, 1fr); }
  .matchup-sidebar { grid-column: 1; grid-row: 1; }
  .matchup-rosters-column { grid-column: 1; grid-row: 2; }
  .matchup-selector { max-height: 220px; }
  .matchup-roster-pair { grid-template-columns: minmax(0, 1fr); }
  .league-activity-row { grid-template-columns: 1fr auto; }
  .league-activity-row span { grid-column: 1 / -1; }
  .postseason-summary { max-width: 100%; }
  .player-stat-modal { width: 98vw; padding: 12px; }
}
