/* ============================================
   MILLER CUP — Design System
   Country club aesthetic, mobile-first
   ============================================ */

:root {
  /* Brand palette */
  --green-900: #0f3324;
  --green-800: #1f4d3a;
  --green-700: #2d6a4f;
  --green-600: #40916c;
  --green-500: #52b788;
  --green-100: #d8f3dc;

  --gold-900: #7a5a1c;
  --gold-700: #9c7a2c;
  --gold-500: #c9a14a;
  --gold-300: #e8c878;
  --gold-100: #f5e6c0;

  --cream-50: #fdfbf5;
  --cream-100: #f7f1e3;
  --cream-200: #ebe3cf;

  --ink-900: #1a1a1a;
  --ink-700: #3d3d3d;
  --ink-500: #6b6b6b;
  --ink-300: #b0b0b0;
  --ink-100: #e8e8e8;

  --red-600: #c0392b;
  --blue-600: #2c5282;

  /* Burgundy from the Miller Cup logo (the script "Miller" + "Cup" wordmark) */
  --burgundy-900: #5a1f1c;
  --burgundy-800: #6e2722;
  --burgundy-700: #7a2e2a;
  --burgundy-100: #f3dedb;

  /* Typography:
     - Libre Baskerville matches the official Kiawah resort scorecards.
     - Cormorant Garamond italics echo the script wordmark in the logo. */
  --font-display: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
  --font-script: 'Cormorant Garamond', 'Libre Baskerville', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Layout */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(15, 51, 36, 0.06), 0 1px 3px rgba(15, 51, 36, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 51, 36, 0.08), 0 2px 4px rgba(15, 51, 36, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 51, 36, 0.12), 0 4px 8px rgba(15, 51, 36, 0.06);
  --shadow-gold: 0 4px 16px rgba(201, 161, 74, 0.25);

  --tap: 44px; /* min touch target */
  --maxw: 720px;
  --header-h: 64px;
  --tabbar-h: 72px;
}

/* ============================================
   Reset & base
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--cream-50);
}
body {
  /* Serif throughout — matches the official Kiawah scorecard aesthetic.
     Use --font-sans only on micro-labels (eyebrows, tabbar) and form inputs. */
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-900);
  background: var(--cream-50);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  /* Subtle paper texture */
  background-image:
    radial-gradient(at 20% 0%, rgba(201, 161, 74, 0.04) 0%, transparent 50%),
    radial-gradient(at 80% 100%, rgba(31, 77, 58, 0.04) 0%, transparent 50%);
}

/* Sans-serif holdouts for legibility at small sizes / rapid scanning */
.tabbar button span,
.eyebrow,
.card-eyebrow,
.muted.small,
.small,
input, select, textarea,
.btn,
.role-pill,
.you-tag,
.lts-label {
  font-family: var(--font-sans);
}

button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green-700); text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; margin: 0; color: var(--green-900); }
h1 { font-size: 2rem; line-height: 1.15; }
h2 { font-size: 1.5rem; line-height: 1.2; }
h3 { font-size: 1.15rem; line-height: 1.3; }
h4 { font-size: 1rem; line-height: 1.4; }
p { margin: 0 0 var(--space-3) 0; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-700);
  font-weight: 600;
}

.serif { font-family: var(--font-display); }

/* ============================================
   App shell
   ============================================ */
#app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0));
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  padding: 0 var(--space-4);
  background: linear-gradient(180deg, var(--green-900) 0%, var(--green-800) 100%);
  color: var(--cream-50);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-md);
  border-bottom: 1px solid var(--gold-700);
  padding-top: env(safe-area-inset-top, 0);
  height: calc(var(--header-h) + env(safe-area-inset-top, 0));
}
.app-header .header-brand {
  flex: 1; min-width: 0;
  display: flex; align-items: center;
}
.app-header .header-logo {
  height: 44px; width: auto;
  /* The logo's burgundy text needs a subtle glow to hold up against the
     dark green header. Cream drop-shadow gives it a gentle separation. */
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
  /* The transparent PNG has burgundy text — invert the burgundy to gold/cream
     for max contrast on the dark green header.
     We lift the cream/gold tones in the PNG using a brightness+contrast tune. */
  background: rgba(253, 251, 245, 0.92);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-700);
}
.app-header .header-status {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-300);
  font-weight: 500;
}
.app-header .header-action {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--gold-300);
  border: 1px solid rgba(232, 200, 120, 0.25);
  transition: background 0.15s ease;
}
.app-header .header-action:hover, .app-header .header-action:active {
  background: rgba(232, 200, 120, 0.1);
}
.app-header .header-action svg { width: 20px; height: 20px; }

.sync-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-300);
  margin-right: 4px;
  vertical-align: middle;
}
.sync-dot.online { background: var(--green-500); box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.2); }
.sync-dot.offline { background: var(--gold-500); }

/* ============================================
   Main content
   ============================================ */
main {
  flex: 1;
  padding: var(--space-5) var(--space-4) var(--space-6);
  width: 100%;
}
.view { display: none; animation: fadeIn 0.25s ease; }
.view.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.section-head h2 { font-size: 1.4rem; }
.section-head .meta { font-size: 0.85rem; color: var(--ink-500); }

/* ============================================
   Cards
   ============================================ */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--cream-200);
  overflow: hidden;
}
.card + .card { margin-top: var(--space-4); }
.card-pad { padding: var(--space-5); }
.card-pad-sm { padding: var(--space-4); }

.card-hero {
  background:
    linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 60%, var(--green-700) 100%);
  color: var(--cream-50);
  border: 1px solid var(--green-700);
  position: relative;
  overflow: hidden;
}
.card-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(at 0% 0%, rgba(201, 161, 74, 0.18) 0%, transparent 50%),
    radial-gradient(at 100% 100%, rgba(82, 183, 136, 0.12) 0%, transparent 50%);
  pointer-events: none;
}
.card-hero > * { position: relative; }
.card-hero h2, .card-hero h3 { color: var(--cream-50); }

/* ============================================
   Dashboard pieces
   ============================================ */
.hero-tournament {
  padding: var(--space-6) var(--space-5);
  text-align: center;
}
.hero-tournament .crest {
  width: 88px; height: 88px;
  margin: 0 auto var(--space-3);
}
.hero-tournament .year {
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.3em;
  color: var(--gold-300);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}
.hero-tournament .name {
  font-family: var(--font-display);
  font-size: 2.4rem;
  letter-spacing: -0.01em;
  font-weight: 700;
  line-height: 1;
  margin-bottom: var(--space-2);
  color: var(--cream-50);
}
.hero-tournament .tagline {
  font-size: 0.95rem;
  color: var(--gold-100);
  opacity: 0.9;
  font-style: italic;
}
.hero-tournament .divider {
  width: 60px;
  height: 1px;
  background: var(--gold-500);
  margin: var(--space-4) auto;
  position: relative;
}
.hero-tournament .divider::before, .hero-tournament .divider::after {
  content: ''; position: absolute; top: -2px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--gold-500);
}
.hero-tournament .divider::before { left: -10px; }
.hero-tournament .divider::after { right: -10px; }

/* Quick stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.stat {
  background: #fff;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-2);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat .v {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--green-900);
  line-height: 1;
}
.stat .l {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-top: 4px;
  font-weight: 500;
}

/* Next round card */
.next-round {
  display: flex; align-items: center; gap: var(--space-4);
}
.next-round .when {
  background: var(--green-900);
  color: var(--cream-50);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  text-align: center;
  flex-shrink: 0;
  border: 1px solid var(--gold-700);
}
.next-round .when .day {
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 700;
  color: var(--gold-300); line-height: 1;
}
.next-round .when .time {
  font-size: 0.75rem; letter-spacing: 0.08em;
  color: var(--cream-100); margin-top: 4px;
  text-transform: uppercase;
}
.next-round .where { flex: 1; min-width: 0; }
.next-round .where .course {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700; color: var(--green-900);
  line-height: 1.2;
}
.next-round .where .label {
  font-size: 0.75rem; color: var(--ink-500);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-top: 2px;
}

/* Top of leaderboard mini */
.lb-mini {
  display: flex; flex-direction: column; gap: var(--space-2);
}
.lb-mini .row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--cream-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--cream-200);
}
.lb-mini .row.gold { background: linear-gradient(90deg, rgba(245, 230, 192, 0.5), rgba(245, 230, 192, 0.1)); border-color: var(--gold-300); }
.lb-mini .pos {
  font-family: var(--font-display); font-weight: 700;
  width: 28px; text-align: center;
  color: var(--green-900);
}
.lb-mini .row.gold .pos { color: var(--gold-700); }
.lb-mini .name { flex: 1; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-mini .pts { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--green-800); }

/* ============================================
   Leaderboard
   ============================================ */
.lb-tabs {
  display: flex; gap: var(--space-1); overflow-x: auto;
  padding-bottom: var(--space-1);
  margin: 0 calc(-1 * var(--space-4)) var(--space-4);
  padding-left: var(--space-4); padding-right: var(--space-4);
  scrollbar-width: none;
}
.lb-tabs::-webkit-scrollbar { display: none; }
.lb-tabs button {
  white-space: nowrap;
  padding: var(--space-2) var(--space-4);
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--cream-200);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-700);
  transition: all 0.15s ease;
}
.lb-tabs button.active {
  background: var(--green-900);
  color: var(--gold-300);
  border-color: var(--green-900);
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.lb-table thead th {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-500);
  padding: var(--space-2) var(--space-2);
  text-align: right;
  border-bottom: 1px solid var(--cream-200);
}
.lb-table thead th:first-child, .lb-table thead th.left { text-align: left; }
.lb-table tbody td {
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--cream-100);
  text-align: right;
}
.lb-table tbody tr:last-child td { border-bottom: 0; }
.lb-table tbody td.left { text-align: left; }
.lb-table tbody td.player { font-weight: 500; }
.lb-table tbody td.pts { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--green-900); }
.lb-table tbody tr.pos-1 td.pos { color: var(--gold-700); font-weight: 700; }
.lb-table tbody tr.pos-1 td.player::before {
  content: '★'; color: var(--gold-500); margin-right: 6px;
}
.lb-table .pos { width: 28px; color: var(--ink-500); font-family: var(--font-display); font-weight: 700; }
.lb-table .hcp { color: var(--ink-500); font-size: 0.85rem; }

.thru { font-size: 0.75rem; color: var(--ink-500); }

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap);
  padding: 0 var(--space-5);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: all 0.15s ease;
  text-align: center;
}
.btn-primary {
  background: linear-gradient(180deg, var(--green-800), var(--green-900));
  color: var(--cream-50);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--green-900);
}
.btn-primary:hover, .btn-primary:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.btn-gold {
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  color: var(--green-900);
  box-shadow: var(--shadow-gold);
  border: 1px solid var(--gold-700);
  font-weight: 700;
}
.btn-ghost {
  background: transparent;
  color: var(--green-800);
  border: 1px solid var(--cream-200);
}
.btn-ghost:hover { background: var(--cream-50); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 var(--space-3); font-size: 0.85rem; }

/* ============================================
   Scorecard entry
   ============================================ */
.scorecard-controls {
  display: flex; gap: var(--space-2); margin-bottom: var(--space-4);
  align-items: center;
  flex-wrap: wrap;
}
.scorecard-controls select {
  flex: 1; min-width: 0;
  height: var(--tap);
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--cream-200);
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%231f4d3a' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") right 12px center / 12px no-repeat;
  appearance: none; -webkit-appearance: none;
  font-weight: 500;
  color: var(--green-900);
}

.holes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
.hole {
  background: #fff;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.hole-head {
  display: flex; justify-content: space-between; align-items: baseline;
}
.hole-num {
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 700;
  color: var(--green-900);
}
.hole-meta { font-size: 0.7rem; color: var(--ink-500); letter-spacing: 0.05em; text-transform: uppercase; }
.hole-stroke { color: var(--gold-700); font-weight: 600; }

.score-input {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--cream-50);
  border-radius: var(--radius-md);
  padding: var(--space-1);
  border: 1px solid var(--cream-200);
}
.score-input button {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--cream-200);
  font-weight: 700; font-size: 1.1rem;
  color: var(--green-800);
  display: grid; place-items: center;
  transition: all 0.1s ease;
}
.score-input button:hover { background: var(--green-100); }
.score-input button:active { transform: scale(0.94); }
.score-input .val {
  flex: 1; text-align: center;
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 700;
  color: var(--green-900);
  font-variant-numeric: tabular-nums;
}
.score-input .val.empty { color: var(--ink-300); }

.hole-points {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8rem; color: var(--ink-500);
}
.hole-points .pts {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1rem;
  padding: 2px 10px;
  border-radius: 999px;
}
.pts-0 { background: var(--ink-100); color: var(--ink-700); }
.pts-1 { background: #fdecd9; color: #a05a1e; }
.pts-2 { background: var(--green-100); color: var(--green-800); }
.pts-4 { background: linear-gradient(135deg, #f5e6c0, #e8c878); color: var(--gold-900); }
.pts-6, .pts-8, .pts-10 {
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  color: var(--green-900); font-weight: 700;
}

/* Scorecard summary footer */
.score-summary {
  position: sticky;
  bottom: var(--tabbar-h);
  background: linear-gradient(180deg, transparent, var(--cream-50) 30%, var(--cream-50));
  padding: var(--space-4) 0 var(--space-2);
  margin-top: var(--space-4);
}
.score-summary-card {
  background: linear-gradient(135deg, var(--green-900), var(--green-800));
  color: var(--cream-50);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex; justify-content: space-around; align-items: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gold-700);
}
.score-summary-card .col { text-align: center; }
.score-summary-card .lbl {
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold-300); margin-bottom: 2px; font-weight: 500;
}
.score-summary-card .v {
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 700; color: var(--cream-50);
  line-height: 1;
}

/* ============================================
   Schedule
   ============================================ */
.day-block { margin-bottom: var(--space-5); }
.day-block .day-label {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 700;
  color: var(--green-900);
  display: flex; align-items: baseline; gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.day-block .day-label .date {
  font-family: var(--font-sans);
  font-size: 0.85rem; color: var(--ink-500); font-weight: 500;
  letter-spacing: 0.05em;
}

.event-card {
  background: #fff;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-2);
  display: flex; gap: var(--space-4); align-items: center;
}
.event-card .time-badge {
  background: var(--green-900);
  color: var(--gold-300);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  min-width: 72px;
}
.event-card .time-badge .ampm {
  display: block;
  font-size: 0.7rem;
  color: var(--cream-100);
  letter-spacing: 0.1em;
  font-weight: 500;
}
.event-card .info { flex: 1; min-width: 0; }
.event-card .info .name {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 700; color: var(--green-900);
  line-height: 1.2;
}
.event-card .info .sub {
  font-size: 0.85rem; color: var(--ink-500); margin-top: 2px;
}
.event-card.dinner .time-badge { background: var(--gold-500); color: var(--green-900); }

/* ============================================
   Players / Roster
   ============================================ */
.player-card {
  background: #fff;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-2);
  display: flex; align-items: center; gap: var(--space-4);
}
.player-card .avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-700), var(--green-900));
  color: var(--gold-300);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  border: 1.5px solid var(--gold-500);
  flex-shrink: 0;
}
.player-card .pinfo { flex: 1; min-width: 0; }
.player-card .pname {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green-900);
  line-height: 1.2;
}
.player-card .pmeta {
  font-size: 0.8rem;
  color: var(--ink-500);
  margin-top: 2px;
}
.player-card .hcp-block {
  text-align: right;
  flex-shrink: 0;
}
.player-card .hcp-block .hcp-val {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green-800);
  line-height: 1;
}
.player-card .hcp-block .hcp-lbl {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-top: 2px;
}

/* ============================================
   Teams
   ============================================ */
.match-card {
  background: #fff;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-4);
}
.match-card .match-head {
  padding: var(--space-3) var(--space-4);
  background: var(--green-900);
  color: var(--gold-300);
  display: flex; justify-content: space-between; align-items: center;
}
.match-card .match-title {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 700;
}
.match-card .match-stake {
  font-size: 0.85rem;
  color: var(--gold-300);
}
.match-card .vs {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: var(--space-3);
  padding: var(--space-4);
}
.match-card .team {
  text-align: center;
}
.match-card .team .tname {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 700;
  color: var(--green-900);
  margin-bottom: var(--space-2);
}
.match-card .team.winning .tname { color: var(--gold-700); }
.match-card .team .roster {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 0.85rem; color: var(--ink-700);
}
.match-card .team .pts-box {
  margin-top: var(--space-3);
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 700;
  color: var(--green-800);
}
.match-card .team.winning .pts-box {
  color: var(--gold-700);
}
.match-card .vs-divider {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-300);
  font-size: 1.2rem;
}

/* ============================================
   Prizes
   ============================================ */
.prize-section {
  margin-bottom: var(--space-5);
}
.prize-row {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: #fff;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
}
.prize-row .medal {
  font-family: var(--font-display);
  font-weight: 700;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}
.prize-row .medal.gold { background: linear-gradient(135deg, var(--gold-300), var(--gold-500)); color: var(--green-900); }
.prize-row .medal.silver { background: linear-gradient(135deg, #e8e8e8, #b0b0b0); color: var(--ink-900); }
.prize-row .medal.bronze { background: linear-gradient(135deg, #d4a574, #a87440); color: #fff; }
.prize-row .medal.last { background: var(--cream-100); color: var(--ink-700); border: 1px solid var(--cream-200); }
.prize-row .info { flex: 1; }
.prize-row .info .what { font-weight: 500; color: var(--green-900); }
.prize-row .info .who { font-size: 0.85rem; color: var(--ink-500); margin-top: 2px; }
.prize-row .amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--green-800);
}

.payout-summary {
  background: linear-gradient(135deg, var(--green-900), var(--green-800));
  color: var(--cream-50);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  margin-top: var(--space-4);
  border: 1px solid var(--gold-700);
}
.payout-summary .label {
  font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--gold-300); margin-bottom: var(--space-2);
}
.payout-summary .total {
  font-family: var(--font-display);
  font-size: 2.4rem; font-weight: 700;
  color: var(--cream-50);
  line-height: 1;
}
.payout-summary .breakdown {
  font-size: 0.85rem;
  color: var(--gold-100);
  margin-top: var(--space-2);
  opacity: 0.85;
}

/* ============================================
   Rules
   ============================================ */
.rules-list { display: flex; flex-direction: column; gap: var(--space-2); }
.points-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-3) 0;
}
.points-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--cream-100);
}
.points-table tr:last-child td { border-bottom: 0; }
.points-table .pts-cell {
  text-align: right;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--green-800);
}

.rule-item {
  padding: var(--space-3);
  background: var(--cream-50);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--gold-500);
  font-size: 0.95rem;
}
.rule-item .rule-title {
  font-weight: 600; color: var(--green-900);
  margin-bottom: 2px;
}

/* ============================================
   Tab bar (bottom nav)
   ============================================ */
.tabbar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--maxw);
  height: var(--tabbar-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--cream-200);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0));
  z-index: 40;
  box-shadow: 0 -2px 12px rgba(15, 51, 36, 0.06);
}
.tabbar button {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: var(--ink-500);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.15s ease;
  padding-top: 8px;
}
.tabbar button svg { width: 22px; height: 22px; transition: transform 0.15s ease; }
.tabbar button.active {
  color: var(--green-900);
}
.tabbar button.active svg { color: var(--green-800); }
.tabbar button.active::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 3px;
  background: var(--gold-500);
  border-radius: 0 0 4px 4px;
}
.tabbar button { position: relative; }

/* ============================================
   Modal / sheet
   ============================================ */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 51, 36, 0.4);
  backdrop-filter: blur(2px);
  z-index: 50;
  display: none;
  animation: fadeIn 0.2s ease;
}
.sheet-backdrop.open { display: block; }
.sheet {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--maxw);
  background: var(--cream-50);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 60;
  display: none;
  max-height: 85vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 0);
  animation: slideUp 0.25s ease;
}
.sheet.open { display: block; }
@keyframes slideUp {
  from { transform: translate(-50%, 100%); }
  to { transform: translate(-50%, 0); }
}
.sheet-handle {
  width: 36px; height: 4px;
  background: var(--cream-200);
  border-radius: 2px;
  margin: var(--space-2) auto var(--space-3);
}
.sheet-pad { padding: 0 var(--space-5) var(--space-5); }
.sheet h2 { margin-bottom: var(--space-3); }

.field { margin-bottom: var(--space-4); }
.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-700);
  font-weight: 500;
  margin-bottom: var(--space-2);
}
.field input, .field select {
  width: 100%;
  height: var(--tap);
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--cream-200);
  background: #fff;
  font-size: 0.95rem;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.2);
}

.toast {
  position: fixed;
  bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0));
  left: 50%;
  transform: translateX(-50%);
  background: var(--green-900);
  color: var(--cream-50);
  padding: var(--space-3) var(--space-5);
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  z-index: 70;
  display: none;
  animation: toastIn 0.2s ease;
}
.toast.show { display: block; }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================
   Empty states
   ============================================ */
.empty {
  text-align: center;
  padding: var(--space-7) var(--space-4);
  color: var(--ink-500);
}
.empty .emoji { font-size: 2.5rem; margin-bottom: var(--space-3); display: block; }
.empty h3 { color: var(--green-900); margin-bottom: var(--space-2); }

/* ============================================
   Responsive tweaks
   ============================================ */
@media (min-width: 600px) {
  .holes-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 720px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-tournament .name { font-size: 3rem; }
}

/* Print styles for round summary */
@media print {
  .app-header, .tabbar { display: none; }
  body { background: #fff; }
}

/* ============================================
   V2 — Auth, Profile, Admin, Sheets
   ============================================ */

.hidden { display: none !important; }

/* ----- Splash ----- */
.splash {
  position: fixed; inset: 0; z-index: 1000;
  background:
    radial-gradient(at 50% 30%, rgba(247, 241, 227, 1) 0%, rgba(235, 227, 207, 1) 100%);
  display: flex; align-items: center; justify-content: center;
}
.splash-inner { text-align: center; }
.splash-logo {
  width: 220px; height: auto; max-width: 70vw;
  filter: drop-shadow(0 8px 24px rgba(15, 51, 36, 0.18));
}
.splash-sub {
  font-family: var(--font-display);
  font-size: 0.85rem; letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--burgundy-700);
  margin: var(--space-3) 0 var(--space-5);
}
.splash-spin {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid rgba(122, 46, 42, 0.15);
  border-top-color: var(--gold-700);
  margin: 0 auto;
  animation: splashspin 0.9s linear infinite;
}
@keyframes splashspin { to { transform: rotate(360deg); } }

/* ----- Auth screen ----- */
.auth-screen {
  position: fixed; inset: 0; z-index: 900;
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-5); overflow-y: auto;
}
.auth-card {
  background: var(--cream-50); border-radius: var(--radius-lg);
  width: 100%; max-width: 420px;
  padding: var(--space-6) var(--space-5);
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--gold-500);
}
.auth-brand { text-align: center; margin-bottom: var(--space-5); }
.auth-logo {
  width: 180px; height: auto; max-width: 60vw;
  margin: 0 auto var(--space-2);
  display: block;
}
.auth-sub {
  color: var(--burgundy-700); font-size: 0.78rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  font-family: var(--font-display); font-weight: 700;
  margin-top: 2px;
}

.auth-form { display: flex; flex-direction: column; gap: var(--space-3); }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--ink-700); font-weight: 500; }
.auth-form input {
  padding: var(--space-3); font-size: 1rem;
  border: 1px solid var(--ink-100); border-radius: var(--radius-md);
  background: white; min-height: var(--tap);
}
.auth-form input:focus { outline: none; border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(45,106,79,0.15); }
.auth-help { color: var(--ink-500); font-size: 0.9rem; }
.auth-error {
  background: #fff4d6; border: 1px solid var(--gold-300);
  color: var(--green-900); padding: var(--space-4);
  border-radius: var(--radius-md); font-size: 0.9rem;
}
.auth-error code { background: rgba(0,0,0,0.06); padding: 1px 6px; border-radius: 4px; }
.auth-links { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-2); }
.link {
  background: none; border: none; color: var(--green-700);
  font-size: 0.85rem; cursor: pointer; padding: var(--space-2);
  font-family: inherit; text-decoration: underline; text-underline-offset: 3px;
}

/* ----- Header profile button ----- */
.profile-btn {
  margin-left: auto; background: none; border: none;
  padding: 0; cursor: pointer; min-width: var(--tap); min-height: var(--tap);
  display: flex; align-items: center; justify-content: center;
}
.profile-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background-color: var(--gold-500); color: var(--green-900);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
  background-size: cover; background-position: center;
  border: 2px solid rgba(255,255,255,0.4);
}
.profile-avatar.has-photo { color: transparent; }

/* ----- Avatars ----- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  background-color: var(--green-700); color: white;
  font-weight: 700; border-radius: 50%;
  background-size: cover; background-position: center;
  flex-shrink: 0;
}
.avatar-xs { width: 20px; height: 20px; font-size: 0.65rem; margin-right: 4px; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 2rem; }

/* ----- Welcome card ----- */
.welcome-card { padding: var(--space-4) var(--space-5); }
.welcome-row { display: flex; align-items: center; gap: var(--space-3); }
.welcome-hi { font-family: var(--font-display); font-size: 1.3rem; color: var(--green-900); }
.welcome-meta { color: var(--ink-500); font-size: 0.9rem; display: flex; align-items: center; gap: var(--space-2); }
.role-pill {
  display: inline-block; background: var(--gold-500); color: var(--green-900);
  padding: 2px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.welcome-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3); margin-top: var(--space-4);
  padding-top: var(--space-4); border-top: 1px solid var(--ink-100);
}
.welcome-stats > div { text-align: center; }
.welcome-stats .num { font-family: var(--font-display); font-size: 1.6rem; color: var(--green-800); }
.welcome-stats .lbl { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-500); }

/* ----- Next round card ----- */
.next-round { cursor: pointer; transition: transform 0.15s; }
.next-round:active { transform: scale(0.99); }

/* ----- Page heads ----- */
.page-head {
  display: flex; align-items: center; gap: var(--space-3);
  flex-wrap: wrap; margin: var(--space-4) 0 var(--space-3);
}
.page-head h1 {
  font-family: var(--font-display); font-size: 1.6rem;
  margin: 0; color: var(--green-900); flex: 1;
}
.back-btn {
  background: none; border: none; color: var(--green-700);
  font-size: 1rem; cursor: pointer; padding: var(--space-2);
  font-family: inherit;
}
.select {
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  border: 1px solid var(--ink-100); background: white;
  font-family: inherit; font-size: 0.9rem; min-height: var(--tap);
}

/* ----- Segmented control ----- */
.seg {
  display: flex; gap: 4px; background: var(--ink-100);
  padding: 4px; border-radius: var(--radius-md);
  overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  background: none; border: none; padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 500;
  color: var(--ink-700); cursor: pointer; white-space: nowrap;
  font-family: inherit;
}
.seg button.active { background: white; color: var(--green-900); box-shadow: var(--shadow-sm); }

/* ----- LB mini (home top-3) ----- */
.lb-mini {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) 0; border-bottom: 1px solid var(--ink-100);
}
.lb-mini:last-of-type { border-bottom: none; }
.lb-mini-rank {
  width: 24px; text-align: center; font-weight: 700;
  color: var(--green-800);
}
.lb-mini-name { flex: 1; font-weight: 500; }
.lb-mini-pts { color: var(--gold-700); font-weight: 600; }

/* ----- LB table ----- */
.lb-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
.lb-table th, .lb-table td {
  padding: var(--space-3) var(--space-3); text-align: left;
  border-bottom: 1px solid var(--ink-100);
}
.lb-table thead th {
  background: var(--cream-100); color: var(--ink-700);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.lb-table .num { text-align: right; }
.lb-table .rk { width: 32px; color: var(--ink-500); font-weight: 600; }
.lb-table .bold { font-weight: 700; color: var(--green-900); }
.name-cell { display: flex; align-items: center; gap: var(--space-2); }

/* ----- Scorecard ----- */
.scorecard-meta { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.scorecard-totals { display: flex; gap: var(--space-4); margin-left: auto; }
.scorecard-totals .num { font-family: var(--font-display); font-size: 1.5rem; color: var(--green-800); }
.scorecard-totals .lbl { font-size: 0.7rem; color: var(--ink-500); text-transform: uppercase; }

.player-pick { padding: var(--space-3) var(--space-4); }

.scorecard-grid { padding: 0; }
.sc-block { padding: var(--space-3) 0; }
.sc-block-head {
  padding: var(--space-3) var(--space-4) var(--space-2);
  font-weight: 700; color: var(--green-800); font-family: var(--font-display);
}
.sc-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.sc-table th, .sc-table td {
  padding: var(--space-2) var(--space-3); text-align: center;
  border-bottom: 1px solid var(--ink-100);
}
.sc-table thead th {
  background: var(--cream-100); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-500);
}
.sc-table input[type="number"] {
  width: 50px; padding: var(--space-2); text-align: center;
  border: 1px solid var(--ink-100); border-radius: var(--radius-sm);
  font-size: 1rem; font-family: inherit;
  -moz-appearance: textfield;
}
.sc-table input::-webkit-outer-spin-button, .sc-table input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sc-table input:focus { outline: none; border-color: var(--green-700); box-shadow: 0 0 0 2px rgba(45,106,79,0.15); }
.sc-table .pts { font-weight: 700; }
.sc-table .pts-0 { color: var(--ink-300); }
.sc-table .pts-1 { color: var(--ink-700); }
.sc-table .pts-2 { color: var(--green-700); }
.sc-table .pts-4 { color: var(--green-600); background: var(--green-100); }
.sc-table .pts-6 { color: white; background: var(--green-700); }
.sc-table .pts-8, .sc-table .pts-10 { color: var(--green-900); background: var(--gold-300); }
.sc-table .sub { background: var(--cream-100); font-weight: 700; }
.sc-table .dot {
  display: inline-block; width: 4px; height: 4px; background: var(--gold-500);
  border-radius: 50%; vertical-align: middle; margin-left: 3px;
}
.sc-table .dot2 {
  display: inline-block; width: 10px; height: 4px; background: var(--gold-500);
  border-radius: 4px; vertical-align: middle; margin-left: 3px;
}

/* ----- Schedule ----- */
.sched-card { display: flex; gap: var(--space-4); align-items: flex-start; padding: var(--space-4); }
.sched-day {
  flex-shrink: 0; text-align: center; width: 70px;
  padding: var(--space-2); background: var(--green-900); color: var(--cream-50);
  border-radius: var(--radius-md);
}
.sched-day-name { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.85; }
.sched-day-date { font-family: var(--font-display); font-size: 1rem; }
.sched-body { flex: 1; min-width: 0; }
.sched-course .link {
  font-family: var(--font-display); font-size: 1.15rem; color: var(--green-900);
  text-decoration: none; padding: 0; text-align: left;
}
.sched-course .link:hover { text-decoration: underline; }
.sched-conf { font-size: 0.75rem; color: var(--ink-500); margin-top: var(--space-2); }
.sched-fours { margin-top: var(--space-3); display: flex; flex-direction: column; gap: var(--space-3); }
.sched-four-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-500); margin-bottom: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--cream-100); padding: 4px 10px;
  border-radius: 999px; font-size: 0.85rem;
  margin: 2px;
}

/* ----- More / row buttons ----- */
.row-btn {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3); width: 100%;
  background: none; border: none; cursor: pointer;
  text-align: left; font-family: inherit; font-size: 1rem;
  border-bottom: 1px solid var(--ink-100);
}
.row-btn:last-child { border-bottom: none; }
.row-btn:hover { background: var(--cream-100); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; color: var(--ink-900); }
.row-sub { font-size: 0.8rem; color: var(--ink-500); margin-top: 2px; }
.icon-tile {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--cream-100); display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.icon-tile.gold { background: var(--gold-100); color: var(--gold-900); }
.chev { color: var(--ink-300); font-size: 1.5rem; }

/* ----- Profile view ----- */
.profile-photo {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--space-3); padding: var(--space-5);
}
.profile-photo .avatar-xl {
  box-shadow: 0 6px 18px rgba(15, 51, 36, 0.15);
  border: 3px solid var(--cream-50);
}
.profile-photo-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--green-900);
  text-align: center;
  margin-top: var(--space-1);
}

/* ----- Course detail table ----- */
.course-table {
  width: 100%; border-collapse: collapse; font-size: 0.75rem;
  display: block; overflow-x: auto;
}
.course-table th, .course-table td {
  padding: var(--space-2); text-align: center; white-space: nowrap;
  border-bottom: 1px solid var(--ink-100); border-right: 1px solid var(--ink-100);
}
.course-table thead th {
  background: var(--green-900); color: var(--cream-50);
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
  position: sticky; top: 0;
}
.course-table tbody th {
  background: var(--cream-100); text-align: left;
  position: sticky; left: 0; min-width: 80px;
}
.course-table .bold { font-weight: 700; color: var(--green-800); }

/* ----- Sheet (modal) ----- */
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--ink-100);
}
.sheet-head h2 { font-family: var(--font-display); margin: 0; font-size: 1.3rem; color: var(--green-900); }
.sheet-head .x {
  background: none; border: none; font-size: 1.4rem;
  cursor: pointer; color: var(--ink-500);
  width: var(--tap); height: var(--tap);
}
.sheet-body {
  padding: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-3);
}
.sheet-body label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--ink-700); font-weight: 500; }
.sheet-body input, .sheet-body select, .sheet-body textarea {
  padding: var(--space-3); font-size: 1rem; font-family: inherit;
  border: 1px solid var(--ink-100); border-radius: var(--radius-md);
  background: white; min-height: var(--tap); width: 100%;
}
.sheet-body textarea { min-height: 80px; resize: vertical; }
.sheet-actions {
  display: flex; gap: var(--space-3); justify-content: flex-end;
  margin-top: var(--space-3);
}

/* ----- Form rows ----- */
.row-form {
  display: flex; gap: var(--space-2); align-items: center;
  flex-wrap: wrap;
}
.row-form > * { flex: 1; min-width: 100px; }
.row-form button { flex: 0 0 auto; }

.hole-grid {
  display: grid; grid-template-columns: repeat(9, 1fr);
  gap: 4px;
}
.hole-grid input {
  padding: var(--space-2); text-align: center; font-size: 0.85rem;
  border: 1px solid var(--ink-100); border-radius: var(--radius-sm);
  width: 100%; min-height: 36px;
}
@media (max-width: 380px) {
  .hole-grid { grid-template-columns: repeat(6, 1fr); }
}

.tee-block {
  background: var(--cream-100); padding: var(--space-3);
  border-radius: var(--radius-md); margin-bottom: var(--space-3);
  display: flex; flex-direction: column; gap: var(--space-2);
}

.member-pick {
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  padding: var(--space-2);
  background: var(--cream-100); border-radius: var(--radius-md);
}
.chip-pick {
  display: inline-flex; align-items: center; gap: 4px;
  background: white; padding: 6px 10px; border-radius: 999px;
  font-size: 0.85rem; cursor: pointer; border: 1px solid var(--ink-100);
}
.chip-pick input { margin-right: 2px; }

.toggle { display: flex; flex-direction: row !important; align-items: center; gap: var(--space-2); }
.toggle input { margin: 0; min-height: auto; width: auto; }

/* ----- Buttons (extras) ----- */
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; min-height: 32px; }
.btn-danger {
  background: var(--red-600); color: white; border: none;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  font-family: inherit; font-weight: 600; cursor: pointer; min-height: var(--tap);
}
.btn-danger.btn-sm { min-height: 32px; padding: 6px 12px; }

.card-row {
  display: flex; gap: var(--space-2); justify-content: flex-end;
  padding-top: var(--space-2);
}
.card-row .btn-primary { margin-right: auto; }

.row {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--ink-100);
}
.inv-row:last-child { border-bottom: none; }

/* ----- Sync dot ----- */
.sync-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 4px; vertical-align: middle;
}
.sync-dot.online { background: var(--green-500); box-shadow: 0 0 6px var(--green-500); }
.sync-dot.offline { background: var(--ink-300); }

/* ----- Toast (kinds) ----- */
.toast.ok { background: var(--green-700); color: white; }
.toast.err { background: var(--red-600); color: white; }

.muted { color: var(--ink-500); }
.small { font-size: 0.85rem; }
.bold { font-weight: 700; }
.no-pad { padding: 0; overflow: hidden; }

/* ============================================
   Tournament countdown + pre-tournament banner
   ============================================ */
.countdown-banner {
  display: flex; align-items: center; gap: var(--space-3);
  margin: 0 var(--space-4) var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(135deg, var(--green-900), var(--green-800));
  color: var(--cream-50);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.countdown-banner .cb-icon {
  font-size: 1.6rem; line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}
.countdown-banner .cb-text { flex: 1; }
.countdown-banner .cb-title {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.05rem;
  color: var(--gold-300);
}
.countdown-banner .cb-sub {
  font-size: 0.82rem; color: rgba(255,255,255,0.78);
  margin-top: 2px;
}

.lb-pretourney {
  margin: 0 var(--space-4) var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--cream-100);
  border-left: 3px solid var(--gold-500);
  border-radius: var(--radius-sm);
  color: var(--ink-700); font-size: 0.9rem;
}
.lb-pretourney strong { color: var(--green-900); display: block; margin-bottom: 2px; }

/* ============================================
   Welcome stats — 4 tiles now (added Prize)
   ============================================ */
.welcome-stats { grid-template-columns: repeat(4, 1fr); }

.role-pill.paid-pill {
  background: var(--green-100); color: var(--green-800);
  border: 1px solid var(--green-500);
}
.role-pill.unpaid-pill {
  background: rgba(192, 57, 43, 0.08); color: var(--red-600);
  border: 1px solid rgba(192, 57, 43, 0.3);
}

/* ============================================
   Masters-style leaderboard
   ============================================ */
.lb-today-strip {
  display: flex; align-items: center; gap: var(--space-3);
  margin: 0 var(--space-4) var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--green-900);
  color: var(--cream-50);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.lb-today-strip .lts-label {
  font-family: var(--font-display); font-weight: 700;
  color: var(--gold-300); text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 0.72rem;
}
.lb-today-strip .lts-round { font-weight: 600; }
.lb-today-strip .lts-course { color: rgba(255,255,255,0.78); margin-left: auto; }

.lb-card { padding: 0; }
.lb-table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.lb-table-scroll::-webkit-scrollbar { height: 6px; }
.lb-table-scroll::-webkit-scrollbar-thumb {
  background: var(--ink-300); border-radius: 3px;
}

.lb-masters {
  width: 100%; border-collapse: collapse;
  font-size: 0.88rem;
  font-feature-settings: 'tnum' on, 'lnum' on;
}
.lb-masters thead th {
  background: var(--green-900);
  color: var(--gold-300);
  font-family: var(--font-display);
  font-weight: 700; font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: var(--space-3) var(--space-2);
  text-align: right;
  position: sticky; top: 0; z-index: 1;
  white-space: nowrap;
}
.lb-masters thead th .ampm {
  display: block; font-size: 0.6rem; opacity: 0.7;
  font-weight: 500; letter-spacing: 0.04em;
}
.lb-masters thead th.pos { text-align: center; width: 44px; }
.lb-masters thead th.who { text-align: left; padding-left: var(--space-4); }
.lb-masters thead th.money { color: var(--gold-300); }

.lb-masters tbody td {
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--ink-100);
  text-align: right;
  white-space: nowrap;
}
.lb-masters tbody tr {
  cursor: pointer;
  transition: background-color 0.12s;
}
.lb-masters tbody tr:hover { background: var(--cream-50); }
.lb-masters tbody tr.me {
  background: linear-gradient(90deg, rgba(201, 161, 74, 0.10), rgba(201, 161, 74, 0.02));
}
.lb-masters tbody tr.me:hover {
  background: linear-gradient(90deg, rgba(201, 161, 74, 0.16), rgba(201, 161, 74, 0.05));
}
.lb-masters tbody tr.leader td.pos {
  color: var(--gold-700); font-weight: 800;
}
.lb-masters tbody tr.leader td.pts-cell {
  color: var(--green-900);
}
.lb-masters tbody tr.leader td.who::before {
  content: '★'; color: var(--gold-500);
  margin-right: 4px; font-size: 0.85rem;
}

.lb-masters td.pos {
  text-align: center; width: 44px;
  font-family: var(--font-display); font-weight: 700;
  color: var(--ink-700); font-size: 0.95rem;
}
.lb-masters td.who {
  text-align: left; padding-left: var(--space-4);
  min-width: 180px;
}
.lb-masters .who-block {
  display: flex; flex-direction: column; gap: 1px;
}
.lb-masters .who-name {
  font-weight: 600; color: var(--ink-900);
  font-size: 0.93rem;
}
.lb-masters .who-meta {
  font-size: 0.7rem; color: var(--ink-500);
  letter-spacing: 0.02em;
}
.lb-masters .you-tag {
  display: inline-block; margin-left: 4px;
  background: var(--gold-500); color: var(--green-900);
  font-size: 0.6rem; font-weight: 700;
  padding: 1px 5px; border-radius: 3px;
  letter-spacing: 0.05em; vertical-align: middle;
}
.lb-masters .paid-dot {
  color: var(--green-600); font-size: 0.75rem;
}

.lb-masters td.pts-cell {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.15rem;
  color: var(--green-800);
  width: 50px;
}
.lb-masters td.today-cell { color: var(--green-700); font-weight: 600; }
.lb-masters td.muted { color: var(--ink-300); font-weight: 400; }
.lb-masters td.round-col { color: var(--ink-700); width: 44px; }
.lb-masters td.round-col.today, .lb-masters th.round-col.today {
  background: rgba(201, 161, 74, 0.08);
}
.lb-masters td.money {
  color: var(--gold-700); font-weight: 600;
  font-family: var(--font-display);
  width: 64px;
}

/* Summary tiles below leaderboard */
.lb-summary {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin: var(--space-4) var(--space-4) var(--space-5);
}
.lbs-tile {
  padding: var(--space-3);
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.lbs-tile .lbs-num {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.25rem; color: var(--green-800);
  line-height: 1.1;
}
.lbs-tile .lbs-lbl {
  font-size: 0.68rem; color: var(--ink-500);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-top: 4px;
}

/* Compact home leaderboard preview */
.lb-mini-wrap { padding: 0; }
.lb-mini-tbl {
  width: 100%; border-collapse: collapse; font-size: 0.88rem;
  font-feature-settings: 'tnum' on, 'lnum' on;
}
.lb-mini-tbl thead th {
  background: var(--cream-100);
  color: var(--ink-700);
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: var(--space-2) var(--space-3);
  text-align: right;
  font-family: var(--font-display);
}
.lb-mini-tbl thead th.pos { width: 40px; text-align: center; color: var(--ink-500); }
.lb-mini-tbl thead th.who { text-align: left; padding-left: var(--space-4); }
.lb-mini-tbl tbody td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--ink-100);
  text-align: right;
}
.lb-mini-tbl tbody td.pos {
  width: 40px; text-align: center;
  font-family: var(--font-display); font-weight: 700;
  color: var(--ink-700);
}
.lb-mini-tbl tbody td.who {
  text-align: left; padding-left: var(--space-4);
  font-weight: 500;
}
.lb-mini-tbl tbody td.pts-cell {
  font-family: var(--font-display);
  font-weight: 700; color: var(--green-800);
}
.lb-mini-tbl tbody tr { cursor: pointer; }
.lb-mini-tbl tbody tr:hover { background: var(--cream-50); }
.lb-mini-tbl tbody tr.me {
  background: linear-gradient(90deg, rgba(201, 161, 74, 0.10), rgba(201, 161, 74, 0.02));
}

/* ============================================
   Admin: entry-fee tracking
   ============================================ */
.entry-fee-summary {
  background: linear-gradient(135deg, var(--cream-100), var(--cream-50));
  border-left: 3px solid var(--gold-500);
}
.entry-fee-summary .efs-row {
  font-size: 0.92rem; color: var(--ink-700); margin-top: 4px;
}
.entry-fee-summary .efs-row b {
  color: var(--green-800);
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.admin-players-tbl .paid-col { width: 92px; text-align: center; }
.paid-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; user-select: none;
  padding: 4px 8px; border-radius: var(--radius-sm);
}
.paid-toggle input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--ink-300);
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  flex-shrink: 0;
}
.paid-toggle input[type="checkbox"]:checked {
  background: var(--green-600);
  border-color: var(--green-700);
}
.paid-toggle input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  color: white; font-size: 13px; font-weight: 700;
  top: 50%; left: 50%;
  transform: translate(-50%, -55%);
  line-height: 1;
}
.paid-toggle .paid-label {
  font-size: 0.82rem; color: var(--ink-500); font-weight: 500;
}
.paid-toggle input:checked ~ .paid-label {
  color: var(--green-700); font-weight: 600;
}

/* ============================================
   Home page hero — featured Miller Cup logo
   ============================================ */
.home-hero {
  text-align: center;
  padding: var(--space-3) var(--space-3) var(--space-3);
  margin-bottom: var(--space-3);
  /* Cream-on-cream surface that matches the printed logo's natural background.
     The faint vignette pulls the eye toward the center. */
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255, 252, 240, 1) 0%, rgba(247, 241, 227, 1) 70%, rgba(235, 227, 207, 0.7) 100%);
  border-radius: var(--radius-xl);
  border: 1px solid var(--cream-200);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.home-hero::before, .home-hero::after {
  /* Subtle gold corner ornaments — like an antique trophy plaque */
  content: '';
  position: absolute;
  width: 60px; height: 60px;
  border: 2px solid var(--gold-500);
  opacity: 0.35;
  pointer-events: none;
}
.home-hero::before {
  top: 12px; left: 12px;
  border-right: none; border-bottom: none;
  border-top-left-radius: var(--radius-md);
}
.home-hero::after {
  bottom: 12px; right: 12px;
  border-left: none; border-top: none;
  border-bottom-right-radius: var(--radius-md);
}
.home-hero-logo {
  width: 340px; max-width: 92%; height: auto;
  margin: 0 auto var(--space-2);
  display: block;
  filter: drop-shadow(0 4px 14px rgba(15, 51, 36, 0.10));
}
.home-hero-tagline {
  font-family: var(--font-script);
  font-style: italic;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--burgundy-700);
  line-height: 1.3;
  margin: 0 auto;
  max-width: 320px;
}
.home-hero-divider {
  width: 80px; height: 1px;
  background: var(--gold-500);
  margin: var(--space-2) auto;
  position: relative;
}
.home-hero-divider::before, .home-hero-divider::after {
  content: '';
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold-500);
}
.home-hero-divider::before { left: -10px; }
.home-hero-divider::after  { right: -10px; }
.home-hero-meta {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-500);
  font-weight: 700;
}

/* ============================================
   Welcome card — burgundy-tinted "hi" text
   ============================================ */
.welcome-hi {
  font-family: var(--font-script) !important;
  font-style: italic;
  color: var(--burgundy-700) !important;
  font-size: 1.5rem !important;
  font-weight: 600;
}

/* ============================================
   Tagline — wraps on narrow screens, slightly smaller
   so it never gets ellipsis-truncated
   ============================================ */
.home-hero-tagline {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  font-size: clamp(0.85rem, 3.4vw, 1.1rem);
  letter-spacing: 0.005em;
  max-width: 28ch;
  margin: 0 auto;
  line-height: 1.3;
}

/* ============================================
   Profile — Tournament Handicap preview
   ============================================ */
.hcp-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-top: -4px;
  background: var(--cream-50);
  border: 1px solid rgba(45, 106, 79, 0.18);
  border-radius: 8px;
}
.hcp-preview.hidden { display: none; }
.hcp-preview-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-500);
  font-weight: 700;
}
.hcp-preview-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--green-700);
  line-height: 1;
}
.hcp-preview-note {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--ink-500);
  flex-basis: 100%;
}

/* Two-column form row */
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 420px) { .row-2 { grid-template-columns: 1fr; } }

/* ============================================
   Itinerary (Plans) — Cvent-style date-grouped agenda
   ============================================ */
.itin-intro {
  padding: 14px 16px;
  margin-bottom: 12px;
}
.itin-intro-meta {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--burgundy-700);
  font-size: 1.05rem;
  margin: 4px 0 6px;
}

.itin-day { margin-bottom: 18px; }
.itin-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 4px 10px;
  border-bottom: 1px solid rgba(45, 106, 79, 0.14);
  margin-bottom: 8px;
}
.itin-day-date {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--green-700);
  letter-spacing: 0.01em;
}
.itin-day-count {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.itin-day-list { display: flex; flex-direction: column; gap: 8px; }

.itin-card {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 10px;
  text-align: left;
  width: 100%;
  cursor: pointer;
  font-family: var(--font-display);
  color: inherit;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: transform 0.08s, box-shadow 0.08s;
}
.itin-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.itin-card:active { transform: scale(0.99); }
.itin-card-event { cursor: default; }

.itin-time {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green-700);
  text-align: right;
  padding-top: 4px;
  letter-spacing: 0.02em;
}
.itin-body {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.itin-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.itin-thumb-icon {
  background: var(--cream-50);
  border-radius: 50%;
  font-size: 1.3rem;
  border: 1px solid rgba(45,106,79,0.12);
}
.itin-text { flex: 1; min-width: 0; }
.itin-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--green-900, #1a3d2e);
  line-height: 1.2;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.itin-sub {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--ink-500);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.itin-meta {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--ink-500);
  margin-top: 2px;
}
.itin-notes {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--ink-500);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dotted rgba(0,0,0,0.08);
}
.itin-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
}
.itin-tag-golf { background: rgba(45, 106, 79, 0.12); color: var(--green-700); }
.itin-tag-event { background: rgba(201, 161, 74, 0.18); color: #7d5e1f; }
.itin-edit-btn {
  background: transparent;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 6px;
  padding: 4px 8px;
  margin-left: auto;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--ink-500);
  align-self: flex-start;
}
.itin-edit-btn:hover { background: var(--cream-50); }

/* ============================================
   Round Detail screen
   ============================================ */
.rd-hero { padding: 16px; }
.rd-hero-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}
.rd-hero-text { flex: 1; min-width: 0; }
.rd-hero-course {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green-700);
  margin: 4px 0;
  line-height: 1.15;
}
.rd-hero-meta {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--ink-500);
  margin-bottom: 6px;
}
.rd-hero-tee {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--ink-500);
}
.tee-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
}
.rd-hero-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px dashed rgba(0,0,0,0.1);
}
.rd-time-block { padding: 4px 0; }
.rd-time-label {
  font-family: var(--font-sans);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-500);
  font-weight: 700;
}
.rd-time-val {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-700);
  margin-top: 2px;
}
.rd-time-val.small { font-size: 0.85rem; font-weight: 400; color: var(--ink-500); }

.rd-group {
  padding: 12px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.rd-group:first-of-type { border-top: none; }
.rd-group-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.rd-group-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--green-700);
}
.rd-group-time {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--burgundy-700);
}
.rd-group-players {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rd-player-chip {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: var(--cream-50);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 8px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-display);
  color: inherit;
}
.rd-player-chip:hover { background: #fff; }
.rd-player-text { flex: 1; min-width: 0; }
.rd-player-name { font-weight: 700; font-size: 0.95rem; }
.rd-player-sub {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--ink-500);
  margin-top: 1px;
}

.rd-stats-empty {
  text-align: center;
  padding: 24px 16px;
}
.rd-stats-icon { font-size: 2rem; margin-bottom: 6px; }
.rd-stats-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--green-700);
  margin-bottom: 4px;
}
.rd-stats-sub {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--ink-500);
}

.rd-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

/* ============================================
   Champion banner + Podium
   ============================================ */
.champ-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--gold-500) 0%, #b88b3a 60%, #8a6520 100%);
  color: var(--cream-50);
  border: 1px solid #8a6520;
  box-shadow: 0 4px 16px rgba(138, 101, 32, 0.25);
}
.home-champ-banner { margin-bottom: 16px; }
.champ-trophy {
  font-size: 2.6rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.champ-text { flex: 1; min-width: 0; }
.champ-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(253, 251, 245, 0.85);
  font-weight: 700;
}
.champ-name {
  font-family: var(--font-script);
  font-style: italic;
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.1;
  margin-top: 2px;
  color: var(--cream-50);
}
.champ-date {
  margin-top: 4px;
  color: rgba(253, 251, 245, 0.8);
}
.champ-podium-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.champ-podium-pill {
  background: rgba(0,0,0,0.18);
  color: var(--cream-50);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  padding: 3px 9px;
  border-radius: 999px;
}

.podium-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.podium-spot {
  text-align: center;
  padding: 12px 8px;
  background: var(--cream-50);
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.06);
}
.podium-1 { border-color: var(--gold-500); }
.podium-medal { font-size: 1.8rem; }
.podium-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 4px;
  color: var(--green-700);
}
.podium-pts {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--ink-500);
  margin-top: 2px;
}

/* ============================================
   Past Years
   ============================================ */
.py-list { display: flex; flex-direction: column; gap: 8px; }
.py-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 10px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-display);
  color: inherit;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.py-card:hover { background: var(--cream-50); }
.py-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}
.py-text { flex: 1; min-width: 0; }
.py-tid {
  font-weight: 700;
  font-size: 1rem;
  color: var(--green-700);
}
.py-sub {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--ink-500);
  margin-top: 2px;
}
.py-round-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px dotted rgba(0,0,0,0.1);
  font-family: var(--font-display);
}
.py-round-row:first-of-type { border-top: none; }
.py-round-day { font-weight: 700; color: var(--green-700); flex: 1; }
.py-round-course { color: var(--ink-500); flex: 2; text-align: right; }
.py-round-date { flex-basis: 100%; text-align: right; margin-top: 2px; }

/* ============================================
   Admin — End Tournament + Archive cards
   ============================================ */
.admin-end-card {
  border: 2px dashed var(--gold-500);
  background: rgba(201, 161, 74, 0.06);
}
.admin-end-card-done {
  border-style: solid;
  background: linear-gradient(135deg, rgba(201, 161, 74, 0.12), rgba(201, 161, 74, 0.04));
}
.admin-end-done {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 8px 0;
}
.admin-projected {
  background: var(--cream-50);
  padding: 10px 12px;
  border-radius: 8px;
  margin: 8px 0 12px;
}
.admin-projected-name {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--green-700);
  margin-top: 2px;
}
.admin-archive-card {
  border: 1px solid rgba(45, 106, 79, 0.18);
}
.admin-archive-card code {
  font-family: 'JetBrains Mono', Menlo, Monaco, monospace;
  background: rgba(0,0,0,0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.85em;
}

/* ============================================
   Auth forms (used by code gate as well)
   ============================================ */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-form input {
  padding: 12px 14px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  background: #fff;
  text-align: center;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}
.auth-form input:focus {
  outline: none;
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.2);
}
.auth-err {
  background: rgba(122, 46, 42, 0.1);
  color: var(--burgundy-700);
  border: 1px solid rgba(122, 46, 42, 0.25);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  text-align: center;
}
.auth-err.hidden { display: none; }
.auth-hint {
  text-align: center;
  margin-top: 8px;
  line-height: 1.4;
}

/* ============================================
   Handicap-lock status (admin Tournament tab)
   ============================================ */
.hcp-lock-status {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.45;
}
.hcp-lock-status.locked {
  background: rgba(122, 46, 42, 0.08);
  border: 1px solid rgba(122, 46, 42, 0.3);
  color: var(--burgundy-700);
}
.hcp-lock-status.unlocked {
  background: rgba(45, 106, 79, 0.08);
  border: 1px solid rgba(45, 106, 79, 0.25);
  color: var(--ink-900);
}

/* ============================================
   Admin players table — admin toggle column
   ============================================ */
.admin-players-tbl .admin-col { text-align: center; }

/* ============================================
   Team Matches view
   ============================================ */
.team-summary-card { padding: 14px; }
.tm-summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  text-align: center;
  margin-top: 8px;
}
.tm-summary-row .num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green-700);
}
.tm-summary-row .lbl {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-top: 2px;
}
.team-match-card { padding: 14px; }
.team-match-card .tm-meta {
  font-size: 0.82rem;
  color: var(--ink-500);
  margin: 4px 0 8px;
}
.team-match-card .tm-status {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--burgundy-700);
  margin-bottom: 12px;
}
.tm-status .tm-tie { color: var(--ink-500); font-style: italic; }
.tm-teams { display: grid; gap: 10px; }
.tm-team {
  border: 1px solid var(--cream-200);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--cream-50);
}
.tm-team.tm-winner {
  background: linear-gradient(135deg, rgba(201, 161, 74, 0.15) 0%, rgba(201, 161, 74, 0.05) 100%);
  border-color: var(--gold-500);
  box-shadow: 0 2px 8px rgba(201, 161, 74, 0.2);
}
.tm-team-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.tm-team-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink-900);
}
.tm-team-pts {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--green-700);
}
.tm-team.tm-winner .tm-team-pts { color: var(--burgundy-700); }
.tm-pts-lbl {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-500);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tm-team-players {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tm-standings .me { background: rgba(45, 106, 79, 0.06); }

/* ============================================
   "Round in progress" leaderboard banner
   ============================================ */
.lb-pending {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(201, 161, 74, 0.08) 0%, rgba(201, 161, 74, 0.18) 100%);
  border-bottom: 1px solid rgba(201, 161, 74, 0.35);
  font-size: 0.82rem;
  color: var(--ink-900);
  line-height: 1.45;
}
.lb-pending-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(201, 161, 74, 0.25);
  margin-top: 6px;
  flex-shrink: 0;
  animation: lb-pulse 1.6s ease-in-out infinite;
}
@keyframes lb-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.18); }
}

/* ============================================
   Course logo (img + graceful chip fallback)
   ============================================ */
.course-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.course-logo {
  display: inline-block;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  flex-shrink: 0;
}
.course-logo-sm { width: 24px;  height: 24px; }
.course-logo-md { width: 40px;  height: 40px; }
.course-logo-lg { width: 56px;  height: 56px; }
.course-logo-xl { width: 88px;  height: 88px; }
.course-logo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green-700);
  color: var(--gold-500);
  font-family: var(--font-display);
  font-weight: 700;
}
.course-logo-md.course-logo-placeholder { font-size: 1.1rem; }
.course-logo-lg.course-logo-placeholder { font-size: 1.5rem; }
.course-logo-xl.course-logo-placeholder { font-size: 2rem;   }
/* The fallback chip is rendered next to the <img> but hidden until the
   image's onerror handler removes the .course-logo-fallback class. */
.course-logo-wrap > .course-logo-fallback { display: none; }

/* ============================================
   Home rounds strip — 4 round cards in a row
   ============================================ */
.rounds-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: var(--space-3) 0 var(--space-4);
}
@media (min-width: 560px) {
  .rounds-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .rounds-strip { grid-template-columns: repeat(4, 1fr); }
}
.round-card {
  appearance: none;
  text-align: left;
  background: #fff;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  font-family: inherit;
  color: inherit;
  width: 100%;
  display: block;
}
.round-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.round-card:active { transform: translateY(0); }
.rc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.rc-head-text { line-height: 1.2; flex: 1; min-width: 0; }
.rc-day {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-700);
  font-weight: 700;
}
.rc-course {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rc-meta {
  font-size: 0.78rem;
  color: var(--ink-500);
  margin-bottom: 8px;
}
.rc-foursomes {
  display: grid;
  gap: 6px;
  margin: 8px 0 6px;
}
.rc-four {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 8px;
  background: var(--cream-50);
  border-radius: 6px;
  border: 1px solid var(--cream-200);
}
.rc-four-time {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green-700);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 44px;
}
.rc-four-names {
  font-size: 0.82rem;
  color: var(--ink-900);
  line-height: 1.3;
}
.rc-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--cream-200);
  font-size: 0.78rem;
}
.rc-pts {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--burgundy-700);
}
.rc-thru { color: var(--ink-500); }

/* Empty foursomes state — when admin hasn't assigned groups yet */
.rc-empty {
  background: var(--cream-50);
  border: 1px dashed var(--cream-200);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0 6px;
  text-align: center;
}
.rc-empty-meta {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green-700);
  letter-spacing: 0.04em;
}
.rc-empty-msg {
  font-size: 0.78rem;
  color: var(--ink-500);
  margin-top: 2px;
  font-style: italic;
}

/* Admin "Edit groups" inline link inside round card */
.rc-admin-link {
  appearance: none;
  background: transparent;
  border: 1px solid var(--gold-500);
  color: var(--burgundy-700);
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  margin: 4px 0 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.12s ease, color 0.12s ease;
}
.rc-admin-link:hover {
  background: var(--gold-500);
  color: #fff;
}

/* Make round card focus-visible since it's a div with role="button" */
.round-card:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

/* ============================================
   Home quick tiles — Tournament Rules / Full Schedule
   Bigger, richer tiles with course-aware accent
   ============================================ */
.quick-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: var(--space-4) 0;
}
.quick-tile {
  appearance: none;
  text-align: left;
  background: linear-gradient(135deg, #ffffff 0%, var(--cream-50) 100%);
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  font-family: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.quick-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(201, 161, 74, 0.08) 100%);
  pointer-events: none;
}
.quick-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold-500);
}
.quick-tile:active { transform: translateY(0); }
.qt-icon {
  font-size: 1.6rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--green-700);
  color: var(--gold-500);
  margin-bottom: 4px;
}
.qt-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink-900);
  line-height: 1.2;
}
.qt-sub {
  font-size: 0.8rem;
  color: var(--ink-500);
  line-height: 1.3;
}

/* ============================================
   Scorecard — net-score column + clearer stroke indicator on each row
   ============================================ */
.sc-table tr.sc-stroke-1 td:first-child,
.sc-table tr.sc-stroke-2 td:first-child {
  border-left: 4px solid var(--gold-500);
}
.sc-table tr.sc-stroke-2 td:first-child {
  border-left-color: var(--burgundy-700);
}
.sc-stroke-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 1px 6px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--gold-500);
  color: #fff;
  margin-left: 4px;
  vertical-align: middle;
}
.sc-stroke-badge.sc-stroke-2x {
  background: var(--burgundy-700);
}
.sc-net {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--green-700);
}
.sc-net-saved {
  color: var(--burgundy-700);
}

/* ============================================
   Strokes-on-these-holes badge (Stroke Allocation)
   Used on scorecard + round detail
   ============================================ */
.stroke-allocation {
  background: linear-gradient(135deg, #f5efde 0%, #ece2c4 100%);
  border: 1px solid var(--gold-500);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 0;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--ink-900);
  line-height: 1.45;
}
.stroke-allocation .sa-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-700);
  font-weight: 700;
  margin-bottom: 4px;
}
.stroke-allocation .sa-hole-pill {
  display: inline-block;
  background: var(--green-700);
  color: var(--gold-500);
  border-radius: 999px;
  padding: 2px 9px;
  margin: 2px 3px 2px 0;
  font-weight: 700;
  font-size: 0.78rem;
}
.stroke-allocation .sa-hole-pill.sa-double {
  background: var(--burgundy-700);
}
.stroke-allocation .sa-empty {
  color: var(--ink-500);
  font-style: italic;
}

/* ============================================
   Scorecard 18-hole grand total card
   ============================================ */
.sc-round-total {
  margin-top: var(--space-3);
  padding: 14px 16px;
}
.sc-rt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.sc-rt-cell {
  text-align: center;
  padding: 12px 6px;
  background: var(--cream-50);
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-md);
}
.sc-rt-cell.sc-rt-net { background: linear-gradient(135deg, #f4ead0 0%, #e9dfb9 100%); border-color: var(--gold-500); }
.sc-rt-cell.sc-rt-pts { background: linear-gradient(135deg, #f3dedb 0%, #e7c8c4 100%); border-color: var(--burgundy-700); }
.sc-rt-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1;
}
.sc-rt-cell.sc-rt-pts .sc-rt-num { color: var(--burgundy-800); }
.sc-rt-lbl {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 6px;
  color: var(--green-700);
  font-weight: 700;
}
.sc-rt-sub {
  font-size: 0.7rem;
  color: var(--ink-500);
  margin-top: 4px;
  min-height: 1em;
}
.sc-rt-progress {
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-500);
  margin-top: 10px;
  font-style: italic;
}

/* ============================================
   Hole-by-hole grid on the round detail page
   ============================================ */
.hbh-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--cream-200);
}
.hbh-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
  width: max-content;
  min-width: 100%;
}
.hbh-table th, .hbh-table td {
  padding: 6px 4px;
  text-align: center;
  border-bottom: 1px solid var(--cream-200);
}
.hbh-table th.hbh-name, .hbh-table td.hbh-name {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
  text-align: left;
  padding: 6px 10px;
  border-right: 1px solid var(--cream-200);
  min-width: 130px;
  max-width: 160px;
}
.hbh-row.hbh-leader td.hbh-name { background: linear-gradient(90deg, #f4ead0 0%, #fff 80%); }
.hbh-name-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hbh-table thead th {
  background: var(--cream-50);
  border-bottom: 2px solid var(--gold-500);
  font-family: var(--font-display);
}
.hbh-h {
  font-weight: 700;
  color: var(--ink-900);
  font-size: 0.85rem;
}
.hbh-par {
  font-size: 0.65rem;
  color: var(--ink-500);
  margin-top: 2px;
}
.hbh-cell {
  min-width: 36px;
  font-family: var(--font-display);
  vertical-align: middle;
}
.hbh-gross {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1.05;
}
.hbh-net {
  font-size: 0.65rem;
  color: var(--green-700);
  font-weight: 700;
  margin-top: 1px;
}
.hbh-cell.hbh-strokehole { background: rgba(201, 161, 74, 0.12); }
.hbh-cell.hbh-pts-0 { background: rgba(122, 46, 42, 0.18); }
.hbh-cell.hbh-pts-1 { background: rgba(122, 46, 42, 0.06); }
.hbh-cell.hbh-pts-2 { background: rgba(45, 106, 79, 0.08); }
.hbh-cell.hbh-pts-4 { background: rgba(45, 106, 79, 0.22); color: var(--green-900); }
.hbh-cell.hbh-pts-6 { background: rgba(201, 161, 74, 0.35); }
.hbh-cell.hbh-pts-8 { background: linear-gradient(135deg, #f4ead0 0%, #c9a14a 100%); }
.hbh-cell.hbh-strokehole.hbh-pts-0,
.hbh-cell.hbh-strokehole.hbh-pts-1,
.hbh-cell.hbh-strokehole.hbh-pts-2,
.hbh-cell.hbh-strokehole.hbh-pts-4 {
  border-left: 3px solid var(--gold-500);
}
.hbh-table th.hbh-total, .hbh-table td.hbh-total {
  background: var(--cream-50);
  font-family: var(--font-display);
  font-weight: 700;
  border-left: 1px solid var(--cream-200);
  min-width: 44px;
}
.hbh-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  font-size: 0.72rem;
  color: var(--ink-500);
  border-top: 1px solid var(--cream-200);
}
.hbh-legend-pill {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.hbh-legend-pill.hbh-pts-0 { background: rgba(122, 46, 42, 0.18); color: var(--burgundy-800); }
.hbh-legend-pill.hbh-pts-1 { background: rgba(122, 46, 42, 0.06); color: var(--burgundy-700); }
.hbh-legend-pill.hbh-pts-2 { background: rgba(45, 106, 79, 0.08); color: var(--green-700); }
.hbh-legend-pill.hbh-pts-4 { background: rgba(45, 106, 79, 0.22); color: var(--green-900); }
.hbh-legend-strokehole {
  font-style: italic;
  color: var(--ink-500);
}
.hbh-legend-strokehole::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  background: rgba(201, 161, 74, 0.5);
  border: 1px solid var(--gold-500);
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

/* ============================================
   Desktop layout — widen the app shell on bigger
   screens so it doesn't feel like a phone-only app.
   We keep mobile single-column behavior intact and
   only opt into wider layouts above 900px.
   ============================================ */
@media (min-width: 900px) {
  :root {
    --maxw: 1080px;
  }
  /* Hero stays comfortably narrow even when the shell widens,
     so the logo + title don't stretch awkwardly. */
  .home-hero {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }
  /* Two-column home layout: leaderboard / quick tiles on the left,
     round cards stack on the right. The rounds-strip already has its
     own breakpoint to go to 4-up; we override it here so on desktop
     widths the round cards stack 2x2 inside the right column. */
  .home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: var(--space-5);
    align-items: start;
  }
  .home-grid > .home-col-main,
  .home-grid > .home-col-side {
    min-width: 0;
  }
  /* On desktop we let quick tiles use 4-up so they read as a strip. */
  .quick-tiles {
    grid-template-columns: repeat(4, 1fr);
  }
  /* Hole-by-hole grid no longer needs to scroll horizontally on desktop */
  .hbh-scroll {
    overflow-x: auto;
  }
  /* Sheets / modals can be wider too, but cap them so forms stay readable */
  .sheet {
    max-width: 720px;
  }
  /* Bottom tabbar stays phone-shaped & centered for consistency */
  .tabbar {
    max-width: 560px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
}

@media (min-width: 1200px) {
  :root {
    --maxw: 1180px;
  }
}

/* ============================================
   Helper-class polish — these classes were used
   throughout the markup but never had visual styles
   defined, so headings and meta lines rendered
   as plain body text. Add the proper styling here.
   ============================================ */
.card-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-700);
  margin-bottom: var(--space-2);
  display: block;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green-900);
  line-height: 1.25;
  margin: 0 0 4px;
}
.card-meta {
  font-family: var(--font-display);
  font-size: 0.92rem;
  color: var(--ink-700);
  line-height: 1.35;
  margin-bottom: var(--space-2);
}
.card-meta + .card-row {
  margin-top: var(--space-2);
}
.card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4) var(--space-2);
  border-bottom: 1px solid var(--cream-100);
}
.card-head-row .card-eyebrow {
  margin-bottom: 0;
}
.card-head-row .link {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green-700);
  padding: 4px 8px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.12s ease, color 0.12s ease;
}
.card-head-row .link:hover {
  background: var(--cream-100);
  color: var(--green-900);
}

/* When the leaderboard mini card has the no-pad modifier, the
   wrapper around its leaderboard table already has its own padding.
   Make sure the head row doesn't double-pad. */
.card.no-pad > .card-head-row {
  margin-top: 0;
}

/* In-progress / pre-tournament strips above the main leaderboard */
.lb-pretourney {
  background: linear-gradient(180deg, rgba(245, 230, 192, 0.55), rgba(245, 230, 192, 0.25));
  border: 1px solid var(--gold-300);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 0.92rem;
  color: var(--burgundy-800);
  margin-bottom: var(--space-3);
}
.lb-pending {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(192, 57, 43, 0.06);
  border: 1px solid rgba(192, 57, 43, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: 0.85rem;
  color: var(--ink-700);
  margin: var(--space-2);
}
.lb-pending-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red-600);
  box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.6);
  animation: pulse 1.6s ease-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(192, 57, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0); }
}

/* Today strip on the leaderboard */
.lb-today-strip {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: linear-gradient(90deg, var(--green-900), var(--green-800));
  color: var(--cream-50);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  font-size: 0.85rem;
}
.lts-label {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-300);
}
.lts-round { font-weight: 700; }
.lts-course { color: var(--cream-100); opacity: 0.85; }

/* Padding helper used for empty states inside no-pad cards */
.pad { padding: var(--space-4); }
.muted.pad { padding: var(--space-4); }

/* Round detail page: hero meta line styling */
.rd-hero-row .card-eyebrow {
  color: var(--gold-700);
  margin-bottom: 4px;
}

/* Admin round-row: the .card wrapper around each round in
   Admin → Rounds was unstyled because card-title and card-meta
   didn't exist. They now do. We also give the Edit/Delete button
   row a tighter, right-aligned feel. */
.card .card-row {
  margin-top: var(--space-2);
}

/* Default vertical rhythm for stacked cards on admin tabs */
section.view .card + .card,
section.view .card-row + .card {
  margin-top: var(--space-3);
}

/* Team Matches placeholder card on the More tab when no
   matches have been created yet. Gives admins a clear CTA. */
.team-empty-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  background: linear-gradient(180deg, rgba(245, 230, 192, 0.35), rgba(253, 251, 245, 1));
  border: 1px dashed var(--gold-300);
}
.team-empty-card .icon-tile {
  flex-shrink: 0;
}
.team-empty-card .row-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--green-900);
  font-size: 1rem;
}
.team-empty-card .row-sub {
  font-size: 0.88rem;
  color: var(--ink-700);
  line-height: 1.4;
  margin-top: 4px;
}

/* ============================================
   Round-edit form: each group is now a block
   with its own Tee Time field above the player
   picker, so admins can set per-group tee times.
   ============================================ */
.group-block {
  background: var(--cream-50);
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-3) 0;
}
.group-block .card-eyebrow {
  margin-bottom: var(--space-2);
}
.tee-time-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: var(--space-3);
}
.tee-time-label input {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-900);
  text-transform: none;
  letter-spacing: normal;
  padding: 8px 10px;
  border: 1px solid var(--cream-200);
  border-radius: var(--radius-sm);
  background: white;
  max-width: 200px;
}
.tee-time-label input:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(201, 161, 74, 0.18);
}
