:root {
  --ink: #18231f;
  --muted: #6b7468;
  --green: #1d684c;
  --green-soft: #e9eee5;
  --orange: #c9692f;
  --throw: #df8547;
  --paper: #f6f5ee;
  --card: #ffffff;
  --line: #e1e2d8;
  --danger: #a55343;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ecefe8; --muted: #a3ab9f; --green: #6fbf97; --green-soft: #1f2b25; --orange: #e59a66; --throw: #e8925a;
    --paper: #121815; --card: #1b231f; --line: #2c3631; --danger: #e08a78;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #ecefe8; --muted: #a3ab9f; --green: #6fbf97; --green-soft: #1f2b25; --orange: #e59a66; --throw: #e8925a;
  --paper: #121815; --card: #1b231f; --line: #2c3631; --danger: #e08a78;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--green); }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; line-height: 1.2; }
h1 { font-size: clamp(28px, 6vw, 40px); margin: 8px 0 6px; }
h2 { font-size: 22px; margin: 28px 0 10px; }
button, input { font: inherit; color: inherit; }

.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; display: block; }
.brand-name { font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.site-nav { margin-left: auto; display: flex; gap: 18px; font-size: 14px; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--green); }

.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 48px; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.meta { color: var(--muted); margin: 0 0 16px; }
.lede { color: var(--muted); font-size: 18px; max-width: 34em; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel { background: var(--green-soft); border-radius: var(--radius); padding: 18px; }
.stack > * + * { margin-top: 12px; }

.search { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 8px; }
.search input { flex: 1 1 220px; min-width: 0; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 46px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--green); background: var(--green); color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .04em; cursor: pointer; text-decoration: none; }
.button.secondary { background: transparent; color: var(--green); }
.button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.button:disabled { opacity: .5; cursor: default; }
.status { color: var(--muted); min-height: 1.5em; margin: 8px 0; }
.error { color: var(--danger); }

.map { height: 360px; border-radius: var(--radius); overflow: hidden; background: var(--green-soft); margin: 14px 0; border: 1px solid var(--line); }
.map.tall { height: min(62vh, 520px); }
.map-note { color: var(--muted); font-size: 13px; margin-top: -6px; }

.results { list-style: none; padding: 0; margin: 12px 0; }
.results li { border-bottom: 1px solid var(--line); }
.results a, .results button.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 14px 4px; text-decoration: none; color: var(--ink); background: none; border: 0; text-align: left; cursor: pointer; }
.results .name { font-family: Georgia, serif; font-size: 18px; }
.results .sub { display: block; color: var(--muted); font-size: 13px; }
.results .chev { color: var(--green); font-size: 22px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 16px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.stat .value { font: 26px Georgia, serif; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .stat-note { color: var(--muted); font-size: 12px; margin-top: 2px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 12px 0 8px; }
.filters label { font-size: 14px; color: var(--muted); }
.filters select { height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); max-width: 100%; }
.filters .check { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
tbody tr[data-course] { cursor: pointer; }
tbody tr[data-course]:hover { background: var(--green-soft); }
.round-summary h3 { margin: 20px 0 4px; font-size: 17px; }
.summary-table td:first-child { font-weight: 600; }
@media (max-width: 520px) { .summary-table th, .summary-table td { padding: 8px 5px; font-size: 13px; } }

.score { display: flex; gap: 14px; align-items: baseline; font-family: Georgia, serif; margin: 8px 0 4px; }
.score .total { font-size: 52px; line-height: 1; }
.score .par { font-size: 28px; }
.under { color: var(--green); }
.over { color: var(--orange); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.tabs button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 14px; }
.tabs button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }

table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 12px 0; }
th, td { padding: 9px 12px; text-align: center; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-size: 11px; letter-spacing: .08em; font-weight: 800; background: var(--paper); }
td:first-child, th:first-child { text-align: left; }
tfoot td { font-weight: 700; border-bottom: 0; background: var(--paper); }
tbody tr[data-hole] { cursor: pointer; }
tbody tr[data-hole]:hover, tbody tr.active { background: var(--green-soft); }

.notes { white-space: pre-wrap; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.throws { margin: 6px 0 0; padding-left: 22px; color: var(--muted); font-size: 14px; }

form.auth { max-width: 420px; }
form.auth label { display: block; font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--muted); margin-top: 14px; }
form.auth input { width: 100%; height: 46px; padding: 0 12px; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
form.auth .button { margin-top: 18px; width: 100%; }
.auth-links { display: flex; justify-content: center; margin: 12px 0 0; font-size: 14px; }

.hole-label { background: var(--card); color: var(--ink); border: 0; border-radius: 6px; padding: 1px 6px; font: 700 11px system-ui, sans-serif; box-shadow: none; }
.hole-label::before { display: none; }
.throw-marker { width: 22px; height: 22px; border-radius: 50%; background: var(--throw); border: 2px solid #fff; color: #fff; display: grid; place-items: center; font: 800 10px system-ui, sans-serif; }
/* Quality colors; fair is light, so it takes dark text. */
.throw-marker.good, .legend-dot.good { background: #2e9d5b; }
.throw-marker.fair, .legend-dot.fair { background: #e3b505; }
.throw-marker.fair { color: #18231f; }
.throw-marker.poor, .legend-dot.poor { background: #d64541; }
.throw-marker.ob, .legend-dot.ob { box-shadow: 0 0 0 2px #18231f; }
.segment-label { display: inline-block; transform: translate(-50%, -50%); white-space: nowrap; background: rgba(24, 35, 31, 0.82); color: #fff; border-radius: 6px; padding: 1px 6px; font: 700 11px system-ui, sans-serif; }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--muted); font-size: 13px; margin: -6px 0 6px; }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--throw); border: 2px solid #fff; margin-right: -6px; vertical-align: middle; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 20px 0 32px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer a { color: var(--muted); }

[hidden] { display: none !important; }
@media (max-width: 520px) {
  .site-nav { gap: 12px; font-size: 13px; }
  .brand-name { display: none; }
  th, td { padding: 8px 8px; }
}
