:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #66726c;
  --surface: #ffffff;
  --canvas: #f3f5f0;
  --line: #dfe4dc;
  --green: #1f694e;
  --green-soft: #dcece4;
  --lime: #d8ee7a;
  --gold: #c4932f;
  --shadow: 0 18px 55px rgba(40, 58, 49, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 92% 3%, rgba(216, 238, 122, 0.33), transparent 25rem),
    var(--canvas);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 28px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 42px;
}

.eyebrow,
.section-kicker,
.card-label {
  margin: 0;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1, h2, .card-value {
  font-family: "Manrope", sans-serif;
  letter-spacing: -0.04em;
}

h1 {
  margin: 8px 0 10px;
  max-width: 760px;
  font-size: clamp(3rem, 8vw, 6.4rem);
  line-height: 0.92;
}

.hero-copy {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.play-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease;
}

.play-link:hover { transform: translateY(-2px); background: var(--green); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card,
.panel {
  border: 1px solid rgba(23, 33, 29, 0.07);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.summary-card { min-height: 164px; padding: 22px; }
.accent-card { background: var(--green); color: white; }
.accent-card .card-label, .accent-card .card-detail { color: rgba(255,255,255,0.72); }

.card-value {
  margin: 20px 0 4px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1;
}

.card-detail { margin: 0; color: var(--muted); font-size: 0.9rem; }
.panel { margin-top: 18px; padding: 28px; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

h2 { margin: 5px 0 0; font-size: clamp(1.7rem, 3vw, 2.35rem); }
.updated { margin: 0; color: var(--muted); font-size: 0.86rem; }
.table-wrap { overflow-x: auto; }

table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 15px 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; }
.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.number .sort-button { margin-left: auto; }
.sort-button:hover,
.sort-button:focus-visible { color: var(--green); }
.sort-button:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; border-radius: 2px; }
.sort-indicator { min-width: 1em; color: var(--green); font-size: 0.9rem; text-align: center; }
tbody tr:last-child td { border-bottom: 0; }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.rank { width: 62px; color: var(--muted); font-weight: 700; }
.player-cell { font-weight: 700; }
.player-name { display: inline-flex; align-items: center; gap: 10px; }
.leader-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(216,238,122,0.3); }
.points { color: var(--green); font-size: 1.05rem; font-weight: 800; }

.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 16px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 0.8rem; }
.legend-button {
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 140ms ease, background 140ms ease, border-color 140ms ease;
}
.legend-button:hover { background: var(--canvas); color: var(--ink); }
.legend-button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.legend-button.is-hidden { opacity: 0.42; text-decoration: line-through; }
.legend-button.is-hidden .legend-swatch { background: transparent !important; border: 2px solid currentColor; }
.legend-swatch { width: 9px; height: 9px; border-radius: 50%; }
.chart-wrap { min-height: 330px; overflow-x: auto; }
.chart-svg { display: block; width: 100%; min-width: 700px; height: 330px; overflow: visible; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.axis-label { fill: var(--muted); font-family: "DM Sans", sans-serif; font-size: 11px; }
.series-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.series-dot { stroke: white; stroke-width: 3; }

.daily-list { display: grid; gap: 12px; }
.daily-row {
  display: grid;
  grid-template-columns: 138px 1fr;
  align-items: center;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.daily-row:last-child { border-bottom: 0; }
.daily-date { font-family: "Manrope", sans-serif; font-weight: 800; }
.finishers { display: flex; flex-wrap: wrap; gap: 9px; }
.finisher { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 999px; background: #f2f4ef; font-size: 0.88rem; }
.place { color: var(--green); font-weight: 800; }
.score { color: var(--muted); font-variant-numeric: tabular-nums; }

footer { padding: 28px 20px 44px; color: var(--muted); text-align: center; font-size: 0.82rem; }

.error-state { padding: 60px 20px; color: var(--muted); text-align: center; }

@media (max-width: 860px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { align-items: flex-start; flex-direction: column; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .legend { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .page-shell { width: min(100% - 24px, 1180px); padding-top: 36px; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: 140px; }
  .panel { padding: 20px 16px; border-radius: 18px; }
  th, td { padding: 13px 8px; }
  .daily-row { grid-template-columns: 1fr; gap: 10px; }
}
