/* ==========================================================================
   Tee League design tokens
   Centralised colour + type tokens per the Tee League brand guidelines
   (deep navy + metallic gold, supported by white/off-white and restrained
   blue/green accents). Change the palette here, not by hard-coding colours
   throughout the stylesheet.
   ========================================================================== */
:root {
  /* Brand palette */
  --color-navy: #071a2b;
  --color-navy-2: #10263b;
  --color-gold: #c9a24a;
  --color-gold-light: #e0c47a;
  --color-white: #ffffff;
  --color-off-white: #f5f3ee;
  --color-blue: #214f9b;
  --color-sky: #a9c7e8;
  --color-green: #0d5c46;
  --color-forest: #123d2e;
  --color-danger: #a63a2f;

  /* Text on dark (navy) surfaces */
  --text-primary: #ffffff;
  --text-secondary: #d7dee6;
  --border-subtle: rgba(255, 255, 255, 0.14);
  --focus-ring: #c9a24a;

  /* Applied tokens: this app uses navy for the header/nav/footer "frame"
     and a light, off-white content area so dense score tables stay easy
     to read, with gold reserved for primary actions, active state and
     key numbers. */
  --bg: var(--color-off-white);
  --card: var(--color-white);
  --text: #12202f;
  --muted: #5b6b7a;
  --border: rgba(7, 26, 43, 0.12);
  --radius: 10px;

  --font-heading: "Gotham", "Inter", Arial, Helvetica, sans-serif;
  --font-body: "Inter", Arial, Helvetica, sans-serif;

  /* "Scoreboard" direction — condensed display type + navy-first surfaces,
     scoped to specific screens (see the `.scoreboard-view` rules below)
     rather than repointing the tokens above, so pages that haven't been
     redesigned yet (season, handicaps, stats, profile, admin, auth) keep
     their current look untouched. --font-display IS applied globally to the
     shared app-bar/nav chrome, since that's shared across every page. */
  --font-display: "Barlow Condensed", "Inter", Arial, Helvetica, sans-serif;
  --sb-card: var(--color-navy-2);
  --sb-card-deep: #05101a;
  --sb-muted: #8fa1b3;
  --sb-muted-2: #5b7185;
  --sb-green-light: #6fbf9d;
  --sb-border: rgba(255, 255, 255, 0.09);
  --sb-border-gold: rgba(201, 162, 74, 0.35);
  --sb-fill-gold-soft: rgba(201, 162, 74, 0.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--color-blue); }

h1, h2, h3, .brand, .logo-wordmark {
  font-family: var(--font-heading);
}

/* ---- Header / navigation --------------------------------------------- */
.topbar {
  background: var(--color-navy);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.topbar .logo-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.12em;
}

.logo-wordmark {
  text-transform: uppercase;
}
.logo-wordmark .accent { color: var(--color-gold); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.season-chip {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--sb-muted-2);
  white-space: nowrap;
}

/* ---- Shared app navigation --------------------------------------------
   A single 4-item nav: a fixed bottom tab bar (icon + label) below 700px,
   an inline underlined nav in the app bar at 700px and up. Replaces the
   old wrapping .topnav, which broke onto two rows at phone widths. */
.app-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  background: var(--sb-card-deep);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 8px calc(16px + env(safe-area-inset-bottom, 0px));
}

.app-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--sb-muted-2);
  text-decoration: none;
  padding: 4px 0;
  transition: color 180ms ease;
}
.app-nav-item:hover { color: var(--color-gold-light); text-decoration: none; }
.app-nav-item.active { color: var(--color-gold); }

.app-nav-icon { flex-shrink: 0; }

.app-nav-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.has-app-nav { padding-bottom: 0; }
@media (max-width: 699px) {
  body.has-app-nav .container { padding-bottom: 92px; }
}

@media (min-width: 700px) {
  .app-nav {
    position: static;
    background: none;
    border-top: none;
    padding: 0;
    gap: 1.35rem;
  }
  .app-nav-item {
    flex: none;
    flex-direction: row;
    gap: 0.45rem;
    padding-bottom: 0.2rem;
    border-bottom: 2px solid transparent;
  }
  .app-nav-icon { display: none; }
  .app-nav-label { font-size: 0.92rem; letter-spacing: 0.01em; }
  .app-nav-item.active { border-bottom-color: var(--color-gold); color: var(--text-primary); }
}

.inline-form { display: inline; }

.link-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* ---- Cards -------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

/* ---- Dashboard hero ------------------------------------------------------ */
.hero {
  background: linear-gradient(135deg, var(--color-green) 0%, var(--color-navy) 100%);
  color: #fff;
  border: none;
}
.hero h2 { color: #fff; }
.hero p { color: rgba(255,255,255,0.92); margin: 0.5rem 0; }
.hero-tagline { font-weight: 700; font-size: 1.05rem; color: #fff; }

h1 { font-size: 1.6rem; margin-top: 0; color: var(--color-navy); }
h2 { font-size: 1.25rem; color: var(--color-navy); }
h3 { font-size: 1.05rem; color: var(--color-navy); }

.muted { color: var(--muted); }

/* ---- Badges --------------------------------------------------------------
   Small uppercase labels, restrained letter spacing, brand colours. */
.badge {
  display: inline-block;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #e7efe9;
  color: var(--color-green);
}
.badge.closed { background: #f3e7e4; color: var(--color-danger); }
.badge.admin { background: #f7edd8; color: #8a6a1f; }
.badge.test { background: #e6eaf0; color: #4a5a70; }

/* ---- Tables --------------------------------------------------------------
   Navy base for header cells, gold for important / selected numbers. */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
th, td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
th { color: var(--color-navy); font-weight: 700; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; }
tr:last-child td { border-bottom: none; }
tr.me { background: #faf5e8; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.rank-1 td:first-child { font-weight: 700; color: var(--color-gold); }

.trend-arrow { font-weight: 700; font-size: 1.05rem; }
.trend-down { color: var(--color-green); }
.trend-up { color: var(--color-danger); }

.weather-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #eaf1f8;
  color: var(--color-navy);
  border-radius: 12px;
  padding: 0.6rem 1.1rem;
  font-size: 1.1rem;
  font-weight: 700;
}
.weather-chip .weather-emoji { font-size: 1.5rem; line-height: 1; }
.weather-chip .weather-tag {
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-navy);
  background: rgba(7, 26, 43, 0.1);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

/* ---- Leaderboard (card list, replaces a table so nothing needs to
   scroll sideways on narrow screens) --------------------------------- */
.leaderboard-row.me { background: #faf5e8; }
.leaderboard-row .rank-num { display: inline-block; min-width: 1.4rem; font-weight: 700; color: var(--text-secondary); }
.leaderboard-row.rank-1 .rank-num { color: var(--color-gold); }
.leaderboard-stats { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; }
.leaderboard-stats .stat-label { display: block; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-navy); }
.leaderboard-stats strong { font-size: 1.35rem; font-weight: 800; color: var(--color-navy); font-variant-numeric: tabular-nums; }

/* ---- Forms / inputs ------------------------------------------------------
   Subtle border, gold focus ring, per brand spec. */
form.stacked label { display: block; margin-bottom: 1rem; font-size: 0.92rem; }
form.stacked input, form.stacked select {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--color-white);
  color: var(--text);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
form.stacked input:focus, form.stacked select:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px rgba(201, 162, 74, 0.25);
}

/* ---- Buttons ---------------------------------------------------------
   Primary CTA: gold fill, navy text. Secondary: navy/white outline.
   Rounded but not pill-shaped, for a premium/athletic feel. */
button, .btn, .btn-secondary, .btn-danger {
  background: var(--color-gold);
  color: var(--color-navy);
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.2;
  box-sizing: border-box;
  vertical-align: middle;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 180ms ease, transform 180ms ease;
}
button:hover, .btn:hover { background: var(--color-gold-light); }
button:focus-visible, .btn:focus-visible, .btn-secondary:focus-visible, .btn-danger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 162, 74, 0.35);
}

.btn-secondary { background: transparent; color: var(--color-navy); border: 1px solid var(--color-navy); }
.btn-secondary:hover { background: var(--color-navy); color: var(--text-primary); }

.btn-danger { background: white; color: var(--color-danger); border: 1px solid var(--color-danger); }
.btn-danger:hover { background: var(--color-danger); color: white; }

.error-box {
  background: #f6e9e6;
  color: var(--color-danger);
  border: 1px solid #e5c7c0;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}
.success-box {
  background: #e9f1eb;
  color: var(--color-green);
  border: 1px solid #c9dccd;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

.holes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 0.6rem;
  margin: 1rem 0;
}
.hole-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  text-align: center;
}
.hole-box label { font-size: 0.72rem; color: var(--muted); display: block; }
.hole-box input {
  width: 100%;
  text-align: center;
  padding: 0.4rem 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1.05rem;
  margin-top: 0.25rem;
}
.hole-box input:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px rgba(201, 162, 74, 0.25);
}
.hole-box .par { font-size: 0.7rem; color: var(--muted); }

/* ---- Score entry (stepper rows, one hole per row + a live running total —
   phone-first, similar to how apps like HowDidiDo do live scoring). */
.score-summary {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-navy);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  margin: 0 0 1rem;
  text-align: center;
}
.score-summary .sub { font-size: 0.72rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.score-summary strong { display: block; font-size: 1.2rem; color: var(--color-gold); }

.hole-list { display: flex; flex-direction: column; gap: 0.5rem; margin: 1rem 0; }
.score-hole-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  transition: border-color 180ms ease, background 180ms ease;
}
.score-hole-row.done { border-color: var(--color-gold); background: #fdf9ef; }
.score-hole-row .hole-num { font-weight: 700; color: var(--color-navy); font-size: 0.95rem; }
.score-hole-row .hole-meta { font-size: 0.78rem; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.stepper button {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--color-navy);
  background: var(--color-white);
  color: var(--color-navy);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stepper button:hover { background: var(--color-navy); color: var(--text-primary); }
.stepper input {
  width: 2.6rem;
  text-align: center;
  padding: 0.4rem 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1.15rem;
  font-weight: 700;
}
.stepper input:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px rgba(201, 162, 74, 0.25);
}

.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.list-plain li:last-child { border-bottom: none; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.center { text-align: center; }
.mt-0 { margin-top: 0; }

/* ---- Offline score queue banner -------------------------------------- */
.offline-banner {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 50;
  background: var(--color-navy);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: space-between;
  font-size: 0.85rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
@media (max-width: 699px) {
  body.has-app-nav .offline-banner { bottom: calc(0.75rem + 78px); }
}
.offline-banner button { padding: 0.35rem 0.7rem; font-size: 0.82rem; flex-shrink: 0; }

/* ---- Footer ------------------------------------------------------------- */
.site-footer {
  background: var(--color-navy);
  color: var(--text-primary);
  text-align: center;
  padding: 1.25rem 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  margin-top: 2rem;
}
.site-footer .accent { color: var(--color-gold); }
.site-footer .logo-wordmark { text-transform: none; }

/* ---- Score reactions ------------------------------------------------------ */
.reaction-row { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.reaction-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.85rem;
  line-height: 1.6;
  cursor: pointer;
  color: var(--text);
}
.reaction-btn:hover { background: var(--card-alt, #f2f2f0); }
.reaction-btn.reacted { background: var(--color-gold); border-color: var(--color-gold); color: var(--color-navy); font-weight: 700; }
.reaction-btn .reaction-count { margin-left: 0.15rem; font-size: 0.78rem; }

/* ==========================================================================
   "Scoreboard" direction — navy-first dashboard, competition/leaderboard and
   score-entry screens. Scoped entirely under .scoreboard-view (applied to
   <main> on those three views only) so every other page is unaffected.
   ========================================================================== */
@keyframes sb-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes sb-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sb-pop { 0% { transform: scale(1); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } }

body.scoreboard-page { background: var(--color-navy); }

.scoreboard-view {
  background: var(--color-navy);
  color: var(--text-primary);
  margin-top: -1.5rem;
  padding: 0 0 2rem;
}
@media (min-width: 700px) {
  .scoreboard-view { margin-top: -1.5rem; padding: 1.5rem 0 3rem; }
}
.scoreboard-view h1, .scoreboard-view h2, .scoreboard-view h3 { color: var(--text-primary); }
.scoreboard-view a { color: inherit; }
.scoreboard-view .muted { color: var(--sb-muted); }

/* Secondary sections on the competition page that aren't individually
   itemised in the design spec (entry fee, pairing sheet, admin actions) get
   the same dark-card treatment as the rest of the page for consistency. */
.scoreboard-view .card {
  background: var(--sb-card);
  border-color: var(--sb-border);
  margin: 0.75rem 20px;
}
.scoreboard-view .card h2, .scoreboard-view .card h3 { font-size: 1rem; }
.scoreboard-view select, .scoreboard-view input {
  background: var(--color-navy);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.18);
}
.scoreboard-view .error-box {
  background: rgba(166, 58, 47, 0.14);
  border-color: rgba(166, 58, 47, 0.5);
  color: #f0b8b0;
  margin: 0.75rem 20px;
}
.scoreboard-view .success-box { margin: 0.75rem 20px; }

/* form.stacked input/select carry an explicit white background at higher
   specificity than the plain ".scoreboard-view input" rule above, so admin
   forms built with the .stacked convention (Add a player, new competition,
   new/edit course) need their own equally-specific override to actually
   pick up the dark styling instead of staying white-on-white's opposite. */
.scoreboard-view form.stacked input,
.scoreboard-view form.stacked select {
  background: var(--color-navy);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Secondary/danger buttons default to navy-on-white and white-fill, which
   read as light-mode controls — recoloured here so every admin screen
   (built from the same .card/.btn-secondary/.badge vocabulary as the rest
   of the app, just denser) stays legible on the navy ground. */
.scoreboard-view .btn-secondary {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.3);
}
.scoreboard-view .btn-secondary:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-primary); }
.scoreboard-view .btn-danger {
  background: rgba(166, 58, 47, 0.14);
  color: #f0b8b0;
  border-color: rgba(166, 58, 47, 0.5);
}
.scoreboard-view .btn-danger:hover { background: var(--color-danger); color: white; }

.scoreboard-view .badge { background: rgba(13, 92, 70, 0.25); color: var(--sb-green-light); }
.scoreboard-view .badge.closed { background: rgba(166, 58, 47, 0.2); color: #f0b8b0; }
.scoreboard-view .badge.admin { background: rgba(201, 162, 74, 0.18); color: var(--color-gold-light); }
.scoreboard-view .badge.test { background: rgba(255, 255, 255, 0.12); color: var(--sb-muted); }

.scoreboard-view .list-plain li { border-color: var(--sb-border); }
.scoreboard-view input[type="checkbox"] { accent-color: var(--color-gold); }

/* Plain inline links (not styled as a button) need their own colour on a
   dark ground rather than inheriting body text colour. */
.sb-link { color: var(--color-gold-light); }
.sb-link:hover { color: var(--color-gold); }

/* Hole-grid / stepper components (course editor, round correction) default
   to light-card styling. */
.scoreboard-view .hole-box { border-color: var(--sb-border); }
.scoreboard-view .hole-box label { color: var(--sb-muted); }
.scoreboard-view .score-hole-row { border-color: var(--sb-border); }
.scoreboard-view .score-hole-row.done { border-color: var(--color-gold); background: rgba(201, 162, 74, 0.1); }
.scoreboard-view .score-hole-row .hole-num { color: var(--text-primary); }
.scoreboard-view .score-hole-row .hole-meta { color: var(--sb-muted); }
.scoreboard-view .stepper button { background: none; border-color: rgba(255, 255, 255, 0.3); color: var(--text-primary); }
.scoreboard-view .stepper button:hover { background: rgba(255, 255, 255, 0.1); }
.scoreboard-view .stepper input { background: var(--color-navy); color: var(--text-primary); border-color: rgba(255, 255, 255, 0.18); }
.scoreboard-view .score-summary { background: var(--sb-card); }

/* Genuinely tabular data (the hole-by-hole scorecard) stays a <table> rather
   than being forced into the card-row pattern used elsewhere — just needs
   its light-mode colours (navy headers, navy-on-white rank highlight)
   swapped for dark-safe equivalents. */
.scoreboard-view th, .scoreboard-view td { border-color: var(--sb-border); }
.scoreboard-view th { color: var(--text-primary); }
.scoreboard-view tr.me { background: var(--sb-fill-gold-soft); }
.scoreboard-view .rank-1 td:first-child { color: var(--color-gold); }
.scoreboard-view .leaderboard-stats .stat-label { color: var(--sb-muted); }
.scoreboard-view .leaderboard-stats strong { color: var(--text-primary); }

/* ---- Auth / setup / error: centred card on the navy ground --------------- */
.auth-wrap { display: flex; justify-content: center; padding: 40px 20px; }
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--sb-card);
  border: 1px solid var(--sb-border);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.auth-card .brand-mark { display: block; margin: 0 auto 14px; }
.auth-card h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: 0.02em;
  text-align: center;
  margin: 0 0 4px;
}
.auth-card .auth-foot { margin-top: 1rem; font-size: 0.85rem; text-align: center; color: var(--sb-muted); }

/* ---- Handicaps: row list (replaces a table so the big number can carry
   the same condensed-numeral treatment as the rest of the app) ------------ */
.hcp-list { display: flex; flex-direction: column; gap: 1px; padding: 12px 20px 0; }
.hcp-row {
  background: var(--sb-card);
  border-left: 3px solid rgba(255, 255, 255, 0.14);
  padding: 14px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hcp-row--me { border-left-color: var(--color-gold); }
.hcp-name { font-weight: 700; font-size: 1.0625rem; color: var(--text-primary); }
.hcp-basis { font-weight: 500; font-size: 0.75rem; color: var(--sb-muted); margin-top: 2px; }
.hcp-value-block { display: flex; align-items: center; gap: 10px; }
.hcp-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.875rem;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.hcp-trend { font-weight: 700; font-size: 1.1rem; }
.hcp-trend--down { color: var(--sb-green-light); }
.hcp-trend--up { color: var(--color-danger); }
.hcp-edit-form { display: flex; align-items: center; gap: 0.4rem; }
.hcp-edit-form input {
  width: 64px;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: var(--font-display);
  text-align: center;
}

/* ---- Admin: tab row ------------------------------------------------------ */
.admin-tabs { display: flex; gap: 1.5rem; padding: 16px 20px 0; flex-wrap: wrap; }
.admin-tab {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sb-muted);
  text-decoration: none;
  padding-bottom: 8px;
  border-bottom: 2px solid transparent;
}
.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active { color: var(--text-primary); border-bottom-color: var(--color-gold); }
.admin-header-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem; margin: 0.75rem 20px 0; }

.sb-empty {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.03em;
  color: var(--sb-muted-2);
  padding: 1.5rem 20px;
}

/* ---- Dashboard: Order of Merit block ----------------------------------- */
.oom-block {
  margin: 18px 20px 0;
  padding: 18px 0 16px;
  border-top: 1px solid var(--sb-border-gold);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.oom-kicker {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 12px;
}
.oom-row { display: flex; align-items: flex-end; gap: 8px; }
.oom-rank {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 4.75rem;
  line-height: 0.8;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.oom-suffix {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.375rem;
  letter-spacing: 0.05em;
  color: var(--sb-muted-2);
  padding-bottom: 8px;
}
.oom-spacer { flex: 1; }
.oom-side { text-align: right; padding-bottom: 6px; }
.oom-points {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.125rem;
  line-height: 0.9;
  color: var(--color-gold);
  font-variant-numeric: tabular-nums;
}
.oom-gap { font-size: 0.6875rem; font-weight: 600; color: var(--sb-muted-2); margin-top: 4px; }
.oom-empty { font-size: 0.85rem; color: var(--sb-muted-2); }
.oom-empty a { color: var(--color-gold-light); font-weight: 600; }

/* ---- Dashboard: brief intro above the competition list ------------------ */
.dashboard-intro { margin: 18px 20px 0; }
.dashboard-intro-tagline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.dashboard-intro-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--sb-muted);
  margin: 0;
}

/* ---- Dashboard: competition list ---------------------------------------- */
.comp-section-heading {
  padding: 20px 20px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.comp-section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.375rem;
  letter-spacing: 0.1em;
  color: var(--text-primary);
}
.comp-filter-link {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  color: var(--color-gold);
  text-decoration: none;
}

.comp-list { display: flex; flex-direction: column; gap: 1px; padding: 12px 20px 0; }
.comp-row {
  background: var(--sb-card);
  border-left: 3px solid rgba(255, 255, 255, 0.14);
  padding: 14px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  animation: sb-rise 400ms ease both;
}
.comp-row--major { border-left-color: var(--color-gold); }
.comp-row--entered { border-left-color: var(--color-green); }
.comp-row--sprint { border-left-color: var(--color-blue); }
.comp-list .comp-row:nth-child(1) { animation-delay: 0ms; }
.comp-list .comp-row:nth-child(2) { animation-delay: 60ms; }
.comp-list .comp-row:nth-child(3) { animation-delay: 120ms; }
.comp-list .comp-row:nth-child(4) { animation-delay: 180ms; }
.comp-list .comp-row:nth-child(5) { animation-delay: 240ms; }
.comp-list .comp-row:nth-child(6) { animation-delay: 300ms; }
.comp-row:hover { background: #16314a; }
.comp-row:active { transform: translateY(1px); background: #0d1f30; }
.comp-row-kicker {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 4px;
}
.comp-row-kicker--entered { color: var(--sb-green-light); }
.comp-row-kicker--sprint { color: var(--color-sky); }
.comp-row-name { font-weight: 700; font-size: 1.125rem; color: var(--text-primary); }
.comp-row-meta { font-weight: 500; font-size: 0.75rem; color: var(--sb-muted); margin-top: 4px; }
.comp-row-days-wrap { text-align: right; flex: none; }
.comp-row-days {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.875rem;
  line-height: 0.9;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.comp-row-days--soon { color: var(--color-gold-light); }
.comp-row-days--closed { color: var(--sb-muted-2); font-size: 1.1rem; }
.comp-row-days-label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.5625rem;
  letter-spacing: 0.12em;
  color: var(--sb-muted-2);
}

@media (prefers-reduced-motion: reduce) {
  .comp-row { animation: none; opacity: 1; }
}

/* ---- Competition page: header block -------------------------------------- */
.comp-header { padding: 6px 20px 16px; }
.comp-back-link {
  display: inline-block;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--sb-muted);
  text-decoration: none;
  margin-bottom: 9px;
}
.comp-back-link:hover { color: var(--text-primary); }
.comp-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.5rem;
  line-height: 0.95;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0;
}
.comp-meta { font-weight: 500; font-size: 0.75rem; line-height: 1.5; color: var(--sb-muted); margin-top: 6px; }
.comp-fact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--sb-border-gold);
}
.comp-fact {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.625rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--sb-muted);
}
.comp-fact--status { color: var(--color-gold); }
.comp-fact-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 12px 20px 0; }
.comp-fact-actions .btn-secondary, .comp-fact-actions .btn-danger { border-color: rgba(255, 255, 255, 0.3); color: var(--text-primary); }
.comp-fact-actions .btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }

/* ---- Competition page: your-round strip ---------------------------------- */
.your-round-strip {
  margin: 0 20px;
  background: var(--sb-card);
  border-radius: 10px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.yrs-kicker {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.59375rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 5px;
}
.yrs-figures { display: flex; gap: 18px; flex-wrap: wrap; }
.yrs-figure {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.625rem;
  line-height: 0.9;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.yrs-figure--points { color: var(--color-gold); }
.yrs-figure .unit { font-family: var(--font-body); font-size: 0.6875rem; color: var(--sb-muted-2); letter-spacing: 0.1em; }
.yrs-card-btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gold-light);
  border: 1px solid rgba(201, 162, 74, 0.5);
  border-radius: 7px;
  padding: 7px 9px;
  text-decoration: none;
  flex-shrink: 0;
}
.yrs-card-btn:hover { background: var(--sb-fill-gold-soft); }
.yrs-note { font-size: 0.8rem; color: var(--sb-muted); margin: 10px 20px 0; }

/* ---- Competition page: leaderboard v2 ------------------------------------ */
.lb-section { padding: 20px 20px 0; }
.lb-heading-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 0.35rem; }
.lb-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  color: var(--text-primary);
}
.lb-explainer-toggle {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  color: var(--sb-muted-2);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-transform: uppercase;
}
.lb-explainer-toggle:hover { color: var(--sb-muted); }
.lb-explainer {
  display: none;
  font-size: 0.8rem;
  color: var(--sb-muted);
  margin: -8px 0 14px;
}
.lb-explainer.open { display: block; }

.lb-list { list-style: none; margin: 0; padding: 0; }
.lb-row {
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  opacity: 0;
  animation: sb-rise 400ms ease both;
}
.lb-list li:first-child.lb-row { border-top: 1px solid var(--sb-border-gold); }
.lb-list li:nth-child(1) { animation-delay: 0ms; }
.lb-list li:nth-child(2) { animation-delay: 60ms; }
.lb-list li:nth-child(3) { animation-delay: 120ms; }
.lb-list li:nth-child(4) { animation-delay: 180ms; }
.lb-list li:nth-child(5) { animation-delay: 240ms; }
.lb-list li:nth-child(6) { animation-delay: 300ms; }
.lb-list li:nth-child(7) { animation-delay: 360ms; }
.lb-list li:nth-child(8) { animation-delay: 420ms; }
@media (prefers-reduced-motion: reduce) {
  .lb-row { animation: none; opacity: 1; }
}
.lb-main-row { display: flex; align-items: center; gap: 13px; }
.lb-rank-diamond {
  width: 30px; height: 30px; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  color: var(--sb-muted);
  display: grid;
  place-items: center;
  transform: rotate(45deg);
}
.lb-rank-diamond span { transform: rotate(-45deg); font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem; }
.lb-row--leader .lb-rank-diamond { background: var(--color-gold); color: var(--color-navy); }
.lb-name-block { flex: 1; min-width: 0; }
.lb-name { font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.lb-sub { font-weight: 500; font-size: 0.6875rem; color: var(--sb-muted); margin-top: 2px; }
.lb-score-block { text-align: right; flex-shrink: 0; }
.lb-score {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.5rem;
  line-height: 0.85;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.lb-row--leader .lb-score { color: var(--color-gold); }
.lb-gap { font-weight: 600; font-size: 0.625rem; letter-spacing: 0.08em; color: var(--color-danger); margin-top: 3px; }
.lb-bar-track { height: 2px; background: rgba(255, 255, 255, 0.22); margin-top: 10px; transform-origin: left; animation: sb-grow 900ms ease both; }
.lb-row--leader .lb-bar-track { background: var(--color-gold); animation-duration: 700ms; }
@media (prefers-reduced-motion: reduce) {
  .lb-bar-track { animation: none; }
}
.lb-reactions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; }
.lb-reaction-pill {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--sb-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px 9px;
  cursor: pointer;
}
.lb-reaction-pill.reacted { background: var(--sb-fill-gold-soft); border-color: rgba(201, 162, 74, 0.5); color: #e9edf2; }
.lb-reaction-pill .count { margin-left: 0.15em; }
.lb-reaction-add { position: relative; }
.lb-picker {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 10;
  background: var(--sb-card-deep);
  border: 1px solid var(--sb-border);
  border-radius: 10px;
  padding: 6px;
  gap: 2px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.lb-picker.open { display: flex; }
.lb-picker button {
  background: none;
  border: none;
  font-size: 1.1rem;
  padding: 6px 7px;
  border-radius: 6px;
  cursor: pointer;
}
.lb-picker button:hover { background: rgba(255, 255, 255, 0.08); }

.lb-pending-row { display: flex; align-items: center; justify-content: space-between; }
.lb-pending-name { font-weight: 700; font-size: 0.9375rem; color: var(--sb-muted); }
.lb-pending-sub { font-weight: 500; font-size: 0.6875rem; color: var(--sb-muted-2); margin-top: 2px; }
.lb-pending-dash { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; color: var(--sb-muted-2); }

/* ---- Shared: outline primary button (SUBMIT A SCORE) --------------------- */
.sb-primary-action { padding: 14px 20px 22px; }
.sb-outline-btn {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid var(--color-gold);
  color: var(--color-gold-light);
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}
.sb-outline-btn:hover { background: rgba(201, 162, 74, 0.12); }

/* ---- Score entry: one hole at a time ------------------------------------- */
.score-flow { background: var(--color-navy); }
.sf-exit-row { padding: 6px 20px 14px; display: flex; align-items: center; justify-content: space-between; }
.sf-exit-link { font-weight: 600; font-size: 0.75rem; color: var(--sb-muted); text-decoration: none; }
.sf-exit-link:hover { color: var(--text-primary); }
.sf-course-label { font-family: var(--font-body); font-weight: 700; font-size: 0.625rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sb-muted); }

.sf-progress { display: flex; gap: 3px; padding: 0 20px 18px; }
.sf-progress-seg { flex: 1; height: 4px; background: rgba(255, 255, 255, 0.14); border: none; padding: 0; cursor: pointer; }
.sf-progress-seg.done { background: var(--color-gold); }
.sf-progress-seg.current { background: var(--color-gold-light); }

.sf-hole-heading { text-align: center; padding: 6px 20px 0; }
.sf-hole-number {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 5.5rem;
  line-height: 0.8;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.sf-hole-facts { display: flex; justify-content: center; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.sf-hole-fact { font-family: var(--font-body); font-weight: 700; font-size: 0.6875rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--sb-muted); }
.sf-hole-fact--par { color: var(--color-gold); }

.sf-stepper-row { display: flex; align-items: center; justify-content: center; gap: 26px; padding: 34px 20px 10px; }
.sf-stepper-btn {
  width: 62px; height: 62px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: none;
  color: var(--text-primary);
  font-size: 1.875rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 180ms ease;
}
.sf-stepper-btn.plus { background: var(--color-gold); color: var(--color-navy); border-color: var(--color-gold); }
.sf-stepper-btn:active { transform: translateY(1px); }
.sf-stepper-value {
  width: 132px; height: 132px;
  border-radius: 50%;
  background: var(--sb-card);
  border: 2px solid var(--color-gold);
  display: grid;
  place-items: center;
  transition: transform 180ms ease-out;
}
.sf-stepper-value.pop { animation: sb-pop 180ms ease-out; }
@media (prefers-reduced-motion: reduce) {
  .sf-stepper-value.pop { animation: none; }
}
.sf-stepper-value span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 5.25rem;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.sf-stepper-value.empty span { color: var(--sb-muted-2); }

.sf-feedback {
  text-align: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  min-height: 1.2em;
  transition: opacity 150ms ease;
}
.sf-feedback--good { color: var(--sb-green-light); }
.sf-feedback--ok { color: var(--color-gold-light); }
.sf-feedback--bad { color: var(--color-danger); }

.sf-chips { display: flex; gap: 8px; padding: 26px 20px 0; justify-content: center; flex-wrap: wrap; }
.sf-chip {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: 0.08em;
  color: var(--sb-muted);
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.sf-chip.selected { background: var(--color-gold-light); border-color: var(--color-gold-light); color: var(--color-navy); }

.sf-totals {
  margin: 0 20px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.sf-total-label { font-family: var(--font-body); font-weight: 700; font-size: 0.59375rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sb-muted-2); }
.sf-total-value { font-family: var(--font-display); font-weight: 600; font-size: 1.875rem; line-height: 0.9; color: var(--text-primary); font-variant-numeric: tabular-nums; margin-top: 4px; }
.sf-total--points .sf-total-value { color: var(--color-gold); }
.sf-total--center { text-align: center; }
.sf-total--right { text-align: right; }

.sf-footer-nav { display: flex; gap: 10px; padding: 6px 20px 22px; }
.sf-back-btn {
  width: 56px; flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: none;
  color: var(--sb-muted);
  font-size: 1.375rem;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.sf-next-btn {
  flex: 1;
  background: var(--color-gold);
  color: var(--color-navy);
  border: none;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 180ms ease;
}
.sf-next-btn:hover { background: var(--color-gold-light); }
.sf-next-btn:disabled { opacity: 0.6; cursor: default; }

@media (min-width: 700px) {
  .score-flow { max-width: 480px; margin: 0 auto; }
}

/* ---- Setup card: course + marker pick before scoring starts -------------- */
.sf-setup-card { margin: 0 20px; }
