:root {
  --bg: #f8f8f6;
  --surface: #ffffff;
  --ink: #111311;
  --muted: #5d625d;
  --line: #e3e5e1;
  --brand: #1f6b3a;
  --under: #b3261e;   /* under par: golf's red */
  --over: #111311;
  --row-hover: #f1f3ef;
  --cut: #8a8f8a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111311; --surface: #181b18; --ink: #ecefea; --muted: #9aa19a; --line: #2a2e2a;
    --brand: #8fc7a1; --under: #ff8a80; --over: #ecefea; --row-hover: #1f231f; --cut: #6f756f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111311; --surface: #181b18; --ink: #ecefea; --muted: #9aa19a; --line: #2a2e2a;
  --brand: #8fc7a1; --under: #ff8a80; --over: #ecefea; --row-hover: #1f231f; --cut: #6f756f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.event { padding: 40px 0 20px; }
.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.live { color: var(--brand); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
h1 { margin: 0; font-size: clamp(26px, 5vw, 40px); line-height: 1.1; letter-spacing: -0.01em; font-weight: 700; }
.meta { margin: 10px 0 0; color: var(--muted); }
.meta span + span::before { content: "·"; margin: 0 8px; color: var(--line); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button {
  font: inherit; background: none; border: 0; padding: 8px 12px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--brand); }

.tools { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; }
#filter {
  font: inherit; flex: 0 1 280px; min-width: 0; padding: 8px 10px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
#filter:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.count { color: var(--muted); font-size: 13px; white-space: nowrap; }

.board { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; text-align: right; white-space: nowrap; }
th { font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; }
td { border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--row-hover); }
th.l, td.l { text-align: left; }
td.pos { width: 52px; color: var(--muted); }
td.player { width: 100%; white-space: normal; }
.pl { display: flex; align-items: center; gap: 10px; }
.pl img { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; flex: none; background: var(--line); }
.pl .name { font-weight: 500; }
.pl .am { color: var(--muted); font-size: 12px; }
.mv { font-size: 11px; margin-left: 6px; }
.mv.up { color: var(--brand); }
.mv.down { color: var(--under); }
td.par { font-weight: 700; }
.u { color: var(--under); }
.o { color: var(--over); }
td.r { color: var(--muted); }
tr.out td { color: var(--cut); }
tr.out td.par { font-weight: 500; }
tr.cutline td { padding: 6px 10px; font-size: 12px; color: var(--muted); background: var(--bg); text-align: left; }
.tee { color: var(--muted); }

.notice { color: var(--muted); padding: 16px 0; }
.empty { padding: 32px 16px; color: var(--muted); text-align: center; }

.foot { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-top: 24px; padding-bottom: 40px; color: var(--muted); font-size: 13px; }

@media (max-width: 680px) {
  .event { padding-top: 24px; }
  th, td { padding: 8px 6px; }
  .rcol { display: none; }
  td.pos { width: 40px; }
  .tee + .tee { display: none; }
}
@media (prefers-reduced-motion: reduce) { .live::before { animation: none; } }
