:root {
  --navy: #17232d;
  --ink: #26333d;
  --teal: #137f74;
  --teal-dark: #0d5f58;
  --sky: #dceff7;
  --mist: #f3f6f7;
  --line: #d7e0e4;
  --red: #b4232c;
  --gold: #c69228;
  --white: #ffffff;
  --max: 1180px;
  font-family: Aptos, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--white); }
button, input { font: inherit; }

.site-header {
  min-height: 86px;
  padding: 18px max(24px, calc((100vw - var(--max)) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--navy);
  color: var(--white);
}

.brand-block { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid #78c5bd;
  color: #a9e1db;
  font-weight: 800;
  font-size: 16px;
}
.brand-block h1 { margin: 0; font-size: 24px; line-height: 1.1; letter-spacing: 0; }
.brand-block p { margin: 4px 0 0; color: #c6d3d9; font-size: 14px; }
.freshness { display: flex; align-items: center; gap: 8px; color: #dce7eb; font-size: 13px; white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #55c878; box-shadow: 0 0 0 4px rgba(85, 200, 120, .15); }

.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 4px;
  padding: 0 max(24px, calc((100vw - var(--max)) / 2));
  overflow-x: auto;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.tab { min-height: 50px; padding: 0 18px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #52636d; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--teal-dark); background: var(--mist); }
.tab.active { color: var(--navy); border-bottom-color: var(--teal); font-weight: 700; }

main { min-height: calc(100vh - 188px); }
.panel { display: none; max-width: var(--max); margin: 0 auto; padding: 38px 24px 64px; }
.panel.active { display: block; animation: panel-in .28s ease both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.eyebrow { margin: 0 0 6px; color: var(--teal-dark); text-transform: uppercase; font-size: 12px; font-weight: 800; }
h2, h3 { margin: 0; color: var(--navy); letter-spacing: 0; }
h2 { font-size: 30px; }
h3 { font-size: 20px; }

.scoreboard-band { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.scoreboard-copy > p:last-child { margin: 9px 0 0; color: #5f707a; }
.season-numbers { display: flex; gap: 32px; }
.season-number { min-width: 92px; }
.season-number strong { display: block; color: var(--navy); font-size: 28px; line-height: 1; }
.season-number span { display: block; margin-top: 6px; color: #687983; font-size: 12px; }

.leaders { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.leader { padding: 30px 28px; border-right: 1px solid var(--line); position: relative; }
.leader:last-child { border-right: 0; }
.leader-rank { color: var(--red); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.leader-name { display: block; margin-top: 9px; color: var(--navy); font-size: 25px; font-weight: 800; }
.leader-points { display: block; margin-top: 4px; color: #687983; font-size: 14px; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(250px, .8fr); gap: 46px; padding-top: 38px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-heading > p { margin: 0; color: #687983; font-size: 13px; }
.chart-wrap { position: relative; width: 100%; height: 390px; border-bottom: 1px solid var(--line); }
.chart-wrap canvas { width: 100%; height: 100%; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; padding-top: 14px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #52636d; }
.legend-swatch { width: 15px; height: 3px; }

.next-event { padding-left: 28px; border-left: 4px solid var(--gold); align-self: start; }
.next-event h3 { margin-bottom: 18px; }
.event-date { display: block; color: var(--red); font-size: 34px; font-weight: 800; line-height: 1.05; }
.event-name { display: block; margin-top: 8px; font-size: 17px; font-weight: 700; }
.next-event p { color: #687983; line-height: 1.55; }

.controls-row { align-items: center; }
.filters { display: flex; align-items: flex-end; gap: 18px; }
.search-label span { display: block; margin-bottom: 5px; font-size: 11px; color: #687983; }
.search-label input { width: 210px; height: 38px; padding: 0 10px; border: 1px solid #b9c7cd; border-radius: 4px; color: var(--ink); }
.check-label { display: flex; align-items: center; gap: 7px; min-height: 38px; font-size: 13px; }
.check-label input { width: 17px; height: 17px; accent-color: var(--teal); }

.table-scroll { width: 100%; overflow-x: auto; border-top: 3px solid var(--teal); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 13px 12px; text-align: right; background: var(--navy); color: var(--white); font-size: 12px; }
td { padding: 12px; text-align: right; border-bottom: 1px solid var(--line); }
th:nth-child(2), td:nth-child(2) { text-align: left; }
tbody tr:nth-child(even) { background: #f7fafb; }
tbody tr:hover { background: var(--sky); }
.rank-cell { color: var(--red); font-weight: 800; }
.player-cell { color: var(--navy); font-weight: 700; }
.status { display: inline-block; color: var(--teal-dark); font-size: 12px; font-weight: 800; }
.status.out { color: #81919a; font-weight: 600; }
.empty { padding: 50px 0; color: #687983; text-align: center; }

.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.report { margin: 0; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.report button { width: 100%; padding: 0; border: 0; background: var(--mist); cursor: zoom-in; overflow: hidden; border-radius: 6px; }
.report img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; transition: transform .25s ease; }
.report button:hover img { transform: scale(1.018); }
.report figcaption { margin-top: 10px; color: var(--navy); font-weight: 700; }

.schedule-list { border-top: 3px solid var(--teal); }
.schedule-row { display: grid; grid-template-columns: 76px 1fr 150px 120px; gap: 18px; align-items: center; min-height: 62px; border-bottom: 1px solid var(--line); }
.schedule-row.completed { background: #f3faf8; }
.schedule-event { color: var(--red); font-size: 12px; font-weight: 800; }
.schedule-name { color: var(--navy); font-weight: 700; }
.schedule-date, .schedule-state { color: #647680; font-size: 13px; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 24px max(24px, calc((100vw - var(--max)) / 2)); background: var(--navy); color: #c7d3d8; font-size: 12px; }

dialog { width: min(96vw, 1280px); max-height: 94vh; padding: 48px 18px 18px; border: 0; border-radius: 6px; background: var(--white); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(10, 18, 24, .82); }
dialog img { display: block; width: 100%; max-height: 78vh; object-fit: contain; }
dialog p { margin: 12px 0 0; text-align: center; font-weight: 700; }
.dialog-close { position: absolute; right: 14px; top: 8px; width: 38px; height: 38px; border: 0; background: transparent; color: var(--navy); font-size: 30px; cursor: pointer; }

@media (max-width: 760px) {
  .site-header { min-height: 76px; padding: 13px 16px; }
  .brand-mark { width: 42px; height: 42px; font-size: 14px; }
  .brand-block h1 { font-size: 18px; }
  .freshness { display: none; }
  .tabs { padding: 0 8px; }
  .tab { min-height: 46px; padding: 0 13px; font-size: 13px; }
  .panel { padding: 26px 16px 48px; }
  h2 { font-size: 25px; }
  .scoreboard-band, .section-heading { align-items: flex-start; flex-direction: column; }
  .season-numbers { width: 100%; justify-content: space-between; gap: 10px; }
  .season-number { min-width: 0; }
  .season-number strong { font-size: 23px; }
  .leaders { grid-template-columns: 1fr; }
  .leader { padding: 20px 4px; border-right: 0; border-bottom: 1px solid var(--line); }
  .leader:last-child { border-bottom: 0; }
  .leader-name { font-size: 21px; }
  .overview-grid { grid-template-columns: 1fr; gap: 32px; }
  .chart-wrap { height: 300px; }
  .next-event { padding-left: 18px; }
  .filters { width: 100%; align-items: flex-start; flex-direction: column; gap: 10px; }
  .search-label, .search-label input { width: 100%; }
  table { min-width: 690px; font-size: 13px; }
  .report-grid { grid-template-columns: 1fr; }
  .schedule-row { grid-template-columns: 64px 1fr; gap: 5px 12px; padding: 12px 0; }
  .schedule-date, .schedule-state { grid-column: 2; }
  footer { padding: 20px 16px; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
