/* League section — productive UI. Predictable controls, brand carried by type and numerals. */

.league-head { padding-block: clamp(32px, 5vw, 64px) 0; }
.league-title { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; }
.league-switch { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 999px; }
.league-switch a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px; text-decoration: none; font-weight: 700; }
.league-switch a[aria-current="true"] { background: var(--action); color: var(--action-text); }
.season-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.season-line select { min-height: 40px; }

.tabs { display: flex; gap: 2px; margin-top: 28px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs a {
  flex: none; display: inline-flex; align-items: center; min-height: 52px; padding: 0 16px;
  text-decoration: none; font-weight: 700; color: var(--text-muted); white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-color: var(--action); }

.league-body { padding-block: 28px 96px; min-height: 60vh; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; margin-bottom: 20px; }
.field { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.field select, .field input {
  min-height: 42px; min-width: 150px; padding: 0 12px; font-size: 1rem; font-weight: 500; color: var(--text);
  background: var(--c-paper); border: 1px solid #b9adae; border-radius: var(--radius-s);
}
.seg { display: inline-flex; border: 1px solid #b9adae; border-radius: var(--radius-s); overflow: hidden; }
.seg button { min-height: 42px; padding: 0 14px; border: 0; background: var(--c-paper); font-weight: 600; cursor: pointer; }
.seg button + button { border-left: 1px solid #b9adae; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--surface); }
.toolbar-end { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.count { font-size: .95rem; color: var(--text-muted); margin: 0 0 16px; }

.week-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.week-nav h2 { margin: 0; min-width: 12ch; }
.week-range { color: var(--text-muted); font-weight: 600; }

/* schedule list */
.day { margin-bottom: 28px; }
.day h3 { position: sticky; top: 72px; z-index: 2; margin: 0; padding: 10px 0; background: var(--c-paper); font-size: 1rem; border-bottom: 2px solid var(--text); }
.games { list-style: none; margin: 0; padding: 0; }
.game {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) 150px 120px; gap: 16px; align-items: center;
  padding: 12px 8px; border-bottom: 1px solid var(--line); text-decoration: none;
  transition: background var(--t-fast);
}
.game:hover { background: var(--surface-raised); }
.game-time { font-weight: 700; }
.matchup { display: grid; gap: 4px; }
.side { display: grid; grid-template-columns: minmax(0, 1fr) 3ch 1.5ch; gap: 10px; align-items: baseline; }
.side .pts { font-weight: 800; text-align: right; }
.side.won { font-weight: 700; }
.side.lost { color: var(--text-muted); }
.side .wl { font-size: .8rem; font-weight: 800; }
.side.won .wl { color: var(--action); }
.game-loc, .game-type { font-size: .92rem; color: var(--text-muted); }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: var(--radius-s); background: var(--surface-raised); border: 1px solid var(--line); font-size: .8rem; font-weight: 700; color: var(--text); }
.tag-playoffs { background: var(--text); color: var(--surface); border-color: var(--text); }
@media (max-width: 760px) {
  .game { grid-template-columns: 64px minmax(0, 1fr); }
  .game-loc, .game-type { grid-column: 2; }
  .game-type { margin-top: -10px; }
}

/* calendar */
.cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal th { padding: 8px; font-size: .85rem; text-align: left; color: var(--text-muted); }
.cal td { vertical-align: top; height: 118px; padding: 6px; border: 1px solid var(--line); }
.cal .dnum { font-weight: 700; font-size: .9rem; }
.cal .out { background: var(--surface-raised); color: var(--text-muted); }
.cal .today { box-shadow: inset 0 0 0 2px var(--action); }
.cal-games { display: grid; gap: 3px; margin-top: 4px; }
.cal-games a { display: block; font-size: .78rem; line-height: 1.25; padding: 3px 5px; background: var(--surface-raised); border-radius: 3px; text-decoration: none; overflow-wrap: anywhere; }
.cal-games a:hover { background: var(--line); }
.cal-more { font-size: .78rem; font-weight: 700; }
.scroll-x { overflow-x: auto; }
.scroll-x > table { min-width: 720px; }

/* data tables */
.data { width: 100%; border-collapse: collapse; font-size: .98rem; }
.data caption { text-align: left; padding: 0 0 10px; }
.data th, .data td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data th:first-child, .data td:first-child { text-align: left; }
.data thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); border-bottom: 2px solid var(--text); }
.data tbody tr:hover { background: var(--surface-raised); }
.data td:first-child a { font-weight: 700; text-decoration: none; }
.data td:first-child a:hover { text-decoration: underline; }
.data .leader td:first-child::before { content: ""; display: inline-block; width: 6px; height: 18px; margin-right: 10px; vertical-align: -3px; background: var(--action); }
.data th button { all: unset; cursor: pointer; }
.data th button:focus-visible { outline: 2px solid var(--focus); }
.data th[aria-sort] button::after { content: " ↕"; opacity: .5; }
.data th[aria-sort="ascending"] button::after { content: " ↑"; opacity: 1; }
.data th[aria-sort="descending"] button::after { content: " ↓"; opacity: 1; }
.loc-block { margin-bottom: 48px; }
.loc-block > h2 { margin: 0 0 20px; }
.div-block { margin-bottom: 32px; }
.div-block h3 { margin: 0 0 8px; font-size: 1.15rem; }

/* rosters */
.team-groups { display: grid; gap: 28px; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.team-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-m); text-decoration: none; font-weight: 700; transition: border-color var(--t-fast), transform var(--t-fast) var(--ease-out); }
.team-card:hover { border-color: var(--action); transform: translateY(-2px); }
.team-card span { font-weight: 500; color: var(--text-muted); font-size: .9rem; white-space: nowrap; }
details.group { border-top: 1px solid var(--line); }
details.group > summary { display: flex; justify-content: space-between; align-items: center; min-height: 56px; cursor: pointer; font-weight: 700; list-style: none; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::after { content: "+"; font-size: 1.4rem; font-weight: 400; }
details.group[open] > summary::after { content: "–"; }
details.group > div { padding-bottom: 20px; }
.player-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.player-card { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-m); text-decoration: none; }
.player-card .ph { aspect-ratio: 1; border-radius: var(--radius-s); background: var(--surface-raised); display: grid; place-items: center; font-family: var(--font-display); font-stretch: 125%; font-weight: 850; font-size: 2rem; color: var(--text-muted); }

/* game + team + player */
.game-hero { display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(12px, 3vw, 40px); align-items: center; padding: clamp(24px, 4vw, 48px); border-radius: var(--radius-m); }
.game-hero .t { display: grid; gap: 8px; }
.game-hero .t:last-child { text-align: right; }
.game-hero .big { font-family: var(--font-display); font-stretch: 120%; font-weight: 850; font-size: clamp(3rem, 9vw, 6.5rem); line-height: .9; }
.game-hero .lost .big, .game-hero .lost .nm { opacity: .55; }
.game-hero .mid { text-align: center; font-weight: 700; color: var(--text-muted); }
.game-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; margin-top: 32px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px; display: grid; gap: 12px; align-content: start; }
.panel h2 { margin: 0; font-size: 1.1rem; }
.expander summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
@media (max-width: 860px) { .game-grid { grid-template-columns: 1fr; } .game-hero { grid-template-columns: 1fr; text-align: center; } .game-hero .t:last-child { text-align: center; } }

.empty { padding: 40px; border: 1px dashed #b9adae; border-radius: var(--radius-m); max-width: 64ch; }
.empty h2 { margin-top: 0; }
.albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.album { display: grid; gap: 10px; text-decoration: none; }
.album .ph { aspect-ratio: 4 / 3; border-radius: var(--radius-m); background: var(--c-ink); display: grid; place-items: end start; padding: 12px; color: #fff; font-family: var(--font-display); font-stretch: 125%; font-weight: 850; }
.album b { font-weight: 700; }

/* dialog (add to calendar) */
dialog { border: 0; border-radius: var(--radius-m); padding: 28px; max-width: min(520px, 92vw); box-shadow: 0 24px 60px rgb(0 0 0 / .35); }
dialog::backdrop { background: rgb(33 0 2 / .6); }
dialog[open] { animation: panel-in var(--t-std) var(--ease-out); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.dialog-actions .btn-ghost { --fg: var(--text); }

/* view change: directional slide for week stepping */
.swap-next { animation: slide-next var(--t-std) var(--ease-out); }
.swap-prev { animation: slide-prev var(--t-std) var(--ease-out); }
@keyframes slide-next { from { opacity: 0; transform: translateX(24px); } }
@keyframes slide-prev { from { opacity: 0; transform: translateX(-24px); } }
.fade-in { animation: fade var(--t-std) var(--ease-out); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }


/* roster list follows HomeTeam column order: No | Name | Team | Pos | Ht | Rating */
.data.roster th, .data.roster td { text-align: left; }
.data.roster td:nth-child(2) a { font-weight: 700; text-decoration: none; }
.player-card .ph-photo { width: 100%; height: auto; object-fit: cover; padding: 0; }
/* News posts */
.news-list { display: grid; gap: 32px; max-width: 760px; }
.news-post { display: grid; gap: 10px; padding-bottom: 28px; border-bottom: 1px solid var(--line, #e4dddd); }
.news-img { width: 100%; border-radius: var(--radius-m); }
.news-files { margin: 0; padding-left: 18px; }
/* Photo albums: album tiles are buttons that open the album in place. */
button.album { background: none; border: 0; padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.album img.ph { width: 100%; object-fit: cover; padding: 0; }
.album-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.album-photos figure { margin: 0; display: grid; gap: 6px; }
.album-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-m); }
