/* ─────────────────────────────────────────────
   HOLESTAT — Design System
   Georgia serif · Dark green · Scorecard colours
───────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&display=swap');

:root {
  --green-dark:   #0f1f08;
  --green-mid:    #1a3a10;
  --green-light:  #7ab84e;
  --green-pale:   #EAF3DE;
  --cream:        #f9f8f5;
  --cream-2:      #f0ede8;
  --text:         #1a1a1a;
  --text-2:       #555;
  --text-3:       #999;
  --border:       rgba(0,0,0,0.08);
  --border-2:     rgba(0,0,0,0.12);

  /* Score colours */
  --eagle:   #1D9E75;
  --birdie:  #378ADD;
  --par:     #c8c5c0;
  --bogey:   #FAC775;
  --double:  #EF9F27;
  --worse:   #E24B4A;

  --serif: Georgia, 'Times New Roman', serif;
  --sans:  'Lato', system-ui, sans-serif;
  --radius: 3px;
  --radius-lg: 4px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: var(--serif);
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
}

/* ── Navigation ────────────────────────────── */
.nav {
  background: var(--green-dark);
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.nav-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.logo-wordmark {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.8px;
  line-height: 1;
}

.logo-strip {
  display: flex;
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 2px;
}

.ls-cell {
  width: 14px;
  height: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 0.5px solid rgba(255,255,255,0.1);
}
.ls-cell:last-child { border-right: none; }

.ls-ci {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.ls-ci.eagle  { background: var(--eagle); }
.ls-ci.birdie { background: var(--birdie); }
.ls-ci.par    { background: rgba(255,255,255,0.15); }
.ls-ci.bogey  { background: var(--bogey); }

.nav-links {
  display: flex;
  gap: 0;
  flex: 1;
}

.nav-link {
  padding: 0 14px;
  height: 54px;
  display: flex;
  align-items: center;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--sans);
  border-bottom: 2px solid transparent;
  transition: color .15s;
  white-space: nowrap;
}

.nav-link:hover { color: rgba(255,255,255,0.7); }
.nav-link.active { color: #fff; border-bottom-color: var(--green-light); }

.nav-status {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
}
.status-dot.live  { background: var(--green-light); }
.status-dot.error { background: #E24B4A; }

.status-text {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  font-family: var(--sans);
}

/* ── Hero ───────────────────────────────────── */
.hero {
  background: var(--green-dark);
  padding: 52px 28px 44px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.hero-inner { max-width: 820px; }

.hero-eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--green-light);
  margin-bottom: 14px;
  font-family: var(--sans);
}

.hero-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 22px;
}

.hero-wordmark {
  font-family: var(--serif);
  font-size: 68px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -3px;
  line-height: 1;
}

.hero-scorecard {
  display: flex;
  border: 2.5px solid rgba(255,255,255,0.2);
  border-radius: 3px;
}

.hsc-cell {
  width: 54px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(255,255,255,0.08);
}
.hsc-cell:last-child { border-right: none; }

.hsc-ci {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--serif);
}
.hsc-ci.eagle  { background: var(--eagle);  color: #fff; }
.hsc-ci.birdie { background: var(--birdie); color: #fff; }
.hsc-ci.par    { background: rgba(255,255,255,0.08); border: 1.5px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.25); }
.hsc-ci.bogey  { background: var(--bogey);  color: #633806; }

.hero-sub {
  font-size: 16px;
  color: rgba(255,255,255,0.45);
  line-height: 1.7;
  max-width: 500px;
  margin-bottom: 28px;
}

.hero-search {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 4px 4px 4px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 680px;
}

.hs-select {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  padding: 9px 0;
  font-family: var(--serif);
  flex: 1;
}
.hs-select option { background: #1a3a10; color: #fff; }

.search-div {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.hero-btn {
  background: var(--green-light);
  color: var(--green-dark);
  border: none;
  border-radius: 2px;
  padding: 11px 22px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--sans);
  white-space: nowrap;
  flex-shrink: 0;
}
.hero-btn:hover { background: #8aca5e; }

.hero-numbers {
  display: flex;
  gap: 40px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.hn-val {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}
.hn-lbl {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
  font-family: var(--sans);
}

/* ── Main / Pages ───────────────────────────── */
.main { padding: 28px; max-width: 1100px; }

.page { display: none; }
.page.active { display: block; }

.page-header { margin-bottom: 20px; }
.page-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.page-sub {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ── Search row ────────────────────────────── */
.search-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-group label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-3);
  font-family: var(--sans);
  font-weight: 700;
}

.field-group select,
.field-group input {
  padding: 8px 10px;
  border: 0.5px solid var(--border-2);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--serif);
  background: #fff;
  color: var(--text);
  outline: none;
}

.field-group select:focus,
.field-group input:focus {
  border-color: var(--green-light);
}

.btn-primary {
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 9px 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--sans);
}
.btn-primary:hover { background: var(--green-mid); }

/* ── Cards ──────────────────────────────────── */
.card {
  background: #fff;
  border: 0.5px solid var(--border);
  margin-bottom: 16px;
}

.card-header {
  background: var(--green-dark);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
}

.card-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 3px;
  font-family: var(--sans);
}

.card-badge {
  font-size: 9px;
  padding: 3px 10px;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.4);
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--sans);
}

/* ── Leaderboard table ─────────────────────── */
.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.lb-table th {
  padding: 8px 14px;
  text-align: left;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #bbb;
  font-weight: 400;
  background: var(--cream-2);
  border-bottom: 0.5px solid var(--border-2);
  font-family: var(--sans);
}

.lb-table th.r { text-align: right; }
.lb-table th.c { text-align: center; }

.lb-table td {
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--border);
}

.lb-table tr:last-child td { border-bottom: none; }
.lb-table tr:hover td { background: var(--cream); cursor: pointer; }

.rank { font-size: 12px; color: #ccc; }
.rank.gold { color: #b8860b; font-weight: 700; }
.rank.silver { color: #888; font-weight: 700; }
.rank.bronze { color: #b87333; font-weight: 700; }

.player-name {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.player-country { font-size: 10px; color: #bbb; margin-top: 1px; }

.score { font-weight: 700; text-align: right; }
.score.pos { color: #173404; }
.score.neg { color: #501313; }
.score.neu { color: #888; }

.rounds { font-size: 11px; color: #ccc; text-align: center; }
.eagles-cell { font-size: 13px; font-weight: 700; color: #085041; text-align: center; }

/* Sparkline */
.spark {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 18px;
  justify-content: flex-end;
}
.spark-bar { width: 5px; border-radius: 1px 1px 0 0; }

/* Score circles in table */
.score-dots {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
}
.score-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.score-dot.eagle  { background: var(--eagle); }
.score-dot.birdie { background: var(--birdie); }
.score-dot.par    { background: #e0ddd8; }
.score-dot.bogey  { background: var(--bogey); }
.score-dot.double { background: var(--double); }

/* ── Insight bar ───────────────────────────── */
.insight {
  background: var(--green-pale);
  border-left: 3px solid #3B6D11;
  padding: 12px 16px;
  font-size: 12px;
  color: #27500A;
  line-height: 1.65;
  font-family: var(--serif);
}
.insight strong { font-weight: 700; color: #0f1f08; }

/* ── Stat tiles ────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 2px;
  margin-bottom: 16px;
}
.stat-tile {
  background: #fff;
  border: 0.5px solid var(--border);
  padding: 14px 16px;
}
.stat-val {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.stat-lbl {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 3px;
  font-family: var(--sans);
}

/* ── Distribution bar ─────────────────────── */
.dist-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.dist-label {
  font-size: 11px;
  color: var(--text-2);
  width: 80px;
  flex-shrink: 0;
}
.dist-track {
  flex: 1;
  height: 6px;
  background: var(--cream-2);
  border-radius: 3px;
  overflow: hidden;
}
.dist-fill {
  height: 100%;
  border-radius: 3px;
}
.dist-val {
  font-size: 11px;
  font-weight: 700;
  width: 40px;
  text-align: right;
}

/* ── Two column ────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 2px;
  margin-bottom: 16px;
}

/* ── Loading / empty states ────────────────── */
.loading {
  padding: 48px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-2);
  border-top-color: var(--green-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty {
  padding: 48px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  background: #fff;
  border: 0.5px solid var(--border);
}

.error-msg {
  padding: 16px;
  background: #FCEBEB;
  border-left: 3px solid #E24B4A;
  font-size: 13px;
  color: #791F1F;
  margin-bottom: 16px;
}

/* ── Filters ───────────────────────────────── */
.filters {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--border);
  background: var(--cream);
}
.filter-btn {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 10px;
  border: 0.5px solid var(--border-2);
  background: #fff;
  cursor: pointer;
  color: var(--text-2);
  font-family: var(--sans);
}
.filter-btn.active {
  background: var(--green-dark);
  color: #fff;
  border-color: var(--green-dark);
}

/* ── Footer ────────────────────────────────── */
.footer {
  background: var(--green-dark);
  padding: 20px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
}

.footer-logo { cursor: pointer; }

.footer-wordmark {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  letter-spacing: -0.5px;
}

.footer-strip {
  display: flex;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 2px;
}
.fs-cell {
  width: 12px;
  height: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 0.5px solid rgba(255,255,255,0.07);
}
.fs-cell:last-child { border-right: none; }
.fs-ci {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.fs-ci.eagle  { background: var(--eagle); opacity: 0.7; }
.fs-ci.birdie { background: var(--birdie); opacity: 0.7; }
.fs-ci.par    { background: rgba(255,255,255,0.12); }
.fs-ci.bogey  { background: var(--bogey); opacity: 0.7; }

.footer-tagline {
  font-size: 10px;
  color: rgba(255,255,255,0.2);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-family: var(--sans);
}
.footer-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.12);
  margin-top: 4px;
  font-family: var(--serif);
  font-style: italic;
}

.footer-links {
  display: flex;
  gap: 20px;
}
.footer-link {
  font-size: 10px;
  color: rgba(255,255,255,0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  font-family: var(--sans);
}
.footer-link:hover { color: rgba(255,255,255,0.5); }

/* ── Hole selector strip ───────────────────── */
.hole-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--border);
  background: var(--cream);
}
.hole-btn {
  width: 32px;
  height: 32px;
  border: 0.5px solid var(--border-2);
  background: #fff;
  color: var(--text-2);
  font-family: var(--serif);
  font-size: 13px;
  cursor: pointer;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hole-btn:hover { background: var(--cream-2); }
.hole-btn.active { background: var(--green-dark); color: #fff; border-color: var(--green-dark); }

/* ── Fingerprint bar ───────────────────────── */
.fp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 0.5px solid var(--border);
}
.fp-row:last-child { border-bottom: none; }
.fp-label {
  font-size: 12px;
  color: var(--text-2);
  width: 130px;
  flex-shrink: 0;
}
.fp-track {
  flex: 1;
  height: 5px;
  background: var(--cream-2);
  border-radius: 2px;
  overflow: hidden;
}
.fp-fill { height: 100%; border-radius: 2px; }
.fp-val {
  font-size: 12px;
  font-weight: 700;
  width: 42px;
  text-align: right;
}

/* ── Specialist badge ──────────────────────── */
.spec-badge {
  font-size: 8px;
  padding: 2px 6px;
  background: var(--green-pale);
  color: #27500A;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  font-family: var(--sans);
  display: inline-block;
  margin-top: 2px;
}
