/* ============================================================
   Peel & Eat Golf Scorecards — Game Styles
   Light theme, loaded non-blocking after home renders
   ============================================================ */

/* ── Design Tokens (light theme) ───────────────────────────── */
:root {
  --coral: #FF6B6B;
  --seafoam: #6BCB9E;
  --navy: #1B2A4A;
  --gold: #C9A84C;
  --gold-light: #F5E6B8;
  --sand: #fdfdfd;
  --deep-green: #2D5016;
  --charcoal: #333333;
  --white: #FFFFFF;
  --red-danger: #D32F2F;

  /* Score colors */
  --c-eagle:       #7C3AED;
  --c-eagle-bg:    rgba(124,58,237,0.1);
  --c-birdie:      #2563EB;
  --c-birdie-bg:   rgba(37,99,235,0.1);
  --c-par:         #6B7280;
  --c-par-bg:      rgba(107,114,128,0.1);
  --c-bogey:       #D97706;
  --c-bogey-bg:    rgba(217,119,6,0.1);
  --c-double:      #DC2626;
  --c-double-bg:   rgba(220,38,38,0.1);
  --c-win:         #16A34A;
  --c-win-bg:      rgba(22,163,74,0.1);
  --c-loss:        #DC2626;
  --c-team-a:      #2563EB;
  --c-team-b:      #D97706;

  /* Surface */
  --c-surface:     #FFFFFF;
  --c-surface-2:   #F8F9FA;
  --c-surface-3:   #F1F3F5;
  --c-border:      rgba(27,42,74,0.12);
  --c-border-sm:   rgba(27,42,74,0.08);
  --c-text:        #1B2A4A;
  --c-text-2:      #4B5563;
  --c-text-3:      #9CA3AF;

  /* Gold variants for game UI */
  --c-gold:        #C9A84C;
  --c-gold-light:  #F5E6B8;
  --c-gold-dim:    rgba(201,168,76,0.15);

  /* Spacing */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* Typography */
  --font-body: Georgia, 'Palatino Linotype', 'Book Antiqua', serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-ui: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-score: 'SF Mono', 'Cascadia Mono', Consolas, monospace;

  /* Radii */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 24px; --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(27,42,74,0.08);
  --shadow-md: 0 4px 12px rgba(27,42,74,0.12);
  --shadow-lg: 0 8px 24px rgba(27,42,74,0.16);
  --shadow-gold: 0 0 16px rgba(201,168,76,0.25);

  /* Transitions */
  --t-fast: 120ms ease;
  --t-mid:  220ms ease;
  --t-slow: 350ms ease;

  /* Layout heights — used for sticky positioning */
  --header-h: 52px;
  --holenav-h: 46px;
}

/* High-contrast outdoor mode */
[data-contrast="high"] {
  --c-text:     #000000;
  --c-text-2:   #111111;
  --c-surface:  #FFFFFF;
  --c-surface-2: #F0F0F0;
  --c-gold:     #B8860B;
  --c-eagle:    #5B21B6;
  --c-birdie:   #1D4ED8;
  --c-bogey:    #B45309;
  --c-double:   #991B1B;
}
[data-contrast="high"] .score-btn { min-height: 60px; font-size: 1.1rem; font-weight: 700; }
[data-contrast="high"] .player-name { font-size: 1.1rem; font-weight: 700; }
[data-contrast="high"] .hole-title { font-size: 2rem; }

/* ── App View Container ─────────────────────────────────────── */
#app-view {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: #fdfdfd;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}
.app-view-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── App View Header (game header, shown only in game view) ─── */
.app-view-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  background: var(--navy);
  min-height: 52px;
  padding-top: max(var(--sp-3), env(safe-area-inset-top, 0px));
  box-shadow: 0 2px 8px rgba(27,42,74,0.15);
}

.app-view-header .header-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--c-gold);
  letter-spacing: 0.01em;
}

.app-view-header .header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

#save-indicator {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  padding: 2px 8px;
  border-radius: var(--r-full);
  transition: all var(--t-mid);
  white-space: nowrap;
}
#save-indicator.saved {
  background: rgba(22,163,74,0.2);
  color: #4ADE80;
}

/* ── Hole Navigation Strip ──────────────────────────────────── */
.hole-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: rgba(255,255,255,0.97);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  backdrop-filter: blur(8px);
}
.hole-nav::-webkit-scrollbar { display: none; }

.hole-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-surface-3);
  border: 1px solid var(--c-border);
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.hole-dot.done {
  background: var(--c-win);
  border-color: var(--c-win);
  width: 8px; height: 8px;
}
.hole-dot.active {
  background: var(--c-gold);
  border-color: var(--c-gold);
  width: 14px; height: 14px;
  box-shadow: 0 0 6px var(--c-gold-dim);
}
.hole-nav-divider {
  width: 1px;
  height: 20px;
  background: var(--c-gold);
  flex-shrink: 0;
  margin: 0 var(--sp-1);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 10px 20px;
  border: none;
  border-radius: var(--r-full);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  font-family: var(--font-ui);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--navy), #2D4A7A);
  color: var(--white);
  font-weight: 700;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { opacity: 0.9; }

.btn-gold {
  background: linear-gradient(135deg, var(--c-gold), #A8882C);
  color: var(--navy);
  font-weight: 700;
  box-shadow: var(--shadow-gold);
}
.btn-gold:hover { opacity: 0.9; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--c-border);
  color: var(--navy);
}
.btn-outline:hover { border-color: var(--c-gold); background: var(--c-gold-dim); }

.btn-ghost {
  background: transparent;
  color: var(--c-text-2);
  border: 1px solid var(--c-border-sm);
  padding: 8px 14px;
}
.btn-ghost:hover { color: var(--c-text); border-color: var(--c-text-2); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }

.back-btn { font-size: 0.85rem; }

/* Icon button (used in app-view header) */
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: all var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: rgba(255,255,255,0.2); color: var(--white); }
.icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Score Entry ────────────────────────────────────────────── */
.player-row {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
  transition: all var(--t-fast);
  box-shadow: var(--shadow-sm);
}
.player-row.active {
  border-color: var(--c-gold);
  background: #FFFBF0;
  box-shadow: 0 0 0 2px var(--c-gold-dim);
}
.player-row.active-player {
  background: var(--c-gold-dim);
  border: 2px solid var(--c-gold);
  border-radius: var(--r-md);
}
.player-row.dimmed {
  opacity: 0.45;
}

.player-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.player-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--c-text);
}

.score-display {
  min-width: 44px;
  text-align: right;
}

.score-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 700;
  background: var(--c-surface-3);
  color: var(--c-text-3);
  transition: all var(--t-fast);
}
.score-circle.eagle { background: var(--c-eagle-bg); color: var(--c-eagle); border: 2px solid var(--c-eagle); }
.score-circle.birdie { background: var(--c-birdie-bg); color: var(--c-birdie); border: 2px solid var(--c-birdie); }
.score-circle.par { background: var(--c-par-bg); color: var(--c-par); }
.score-circle.bogey { background: var(--c-bogey-bg); color: var(--c-bogey); }
.score-circle.double-bogey { background: var(--c-double-bg); color: var(--c-double); }
.score-circle.triple-plus { background: var(--c-double-bg); color: var(--c-double); }

.score-btns {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-1);
}

.score-btn {
  min-height: 56px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast);
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
  font-family: var(--font-ui);
}
.score-btn:active { transform: scale(0.93); }

.score-btn-eagle { background: var(--c-eagle-bg); color: var(--c-eagle); border-color: rgba(124,58,237,0.2); }
.score-btn-eagle:hover { background: rgba(124,58,237,0.2); }
.score-btn-birdie { background: var(--c-birdie-bg); color: var(--c-birdie); border-color: rgba(37,99,235,0.2); }
.score-btn-birdie:hover { background: rgba(37,99,235,0.2); }
.score-btn-par { background: var(--c-par-bg); color: var(--c-par); border-color: var(--c-border); }
.score-btn-par:hover { background: rgba(107,114,128,0.2); }
.score-btn-bogey { background: var(--c-bogey-bg); color: var(--c-bogey); border-color: rgba(217,119,6,0.2); }
.score-btn-bogey:hover { background: rgba(217,119,6,0.2); }
.score-btn-double { background: var(--c-double-bg); color: var(--c-double); border-color: rgba(220,38,38,0.2); }
.score-btn-double:hover { background: rgba(220,38,38,0.2); }
.score-btn-more { background: var(--c-surface-2); color: var(--c-text-3); border-color: var(--c-border); }
.score-btn-more:hover { color: var(--c-text-2); }

.score-btn .btn-label { font-size: 0.65rem; opacity: 0.7; }
.score-btn .btn-score { font-family: var(--font-score); font-size: 1.2rem; font-weight: 700; line-height: 1; }

/* ── Scorecard Body ─────────────────────────────────────────── */
.scorecard-body {
  padding: var(--sp-4);
  max-width: 520px;
  margin: 0 auto;
}

.hole-header {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.hole-title {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  color: var(--c-text);
}
.hole-par {
  font-size: 0.9rem;
  color: var(--c-text-2);
  background: var(--c-surface-2);
  padding: 2px 10px;
  border-radius: var(--r-full);
  border: 1px solid var(--c-border);
}

.hole-actions {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  flex-wrap: wrap;
}

/* ── Match Status Bar ───────────────────────────────────────── */
.match-status-bar {
  display: flex;
  gap: var(--sp-2);
  margin: var(--sp-4) 0;
}
.status-chip {
  flex: 1;
  text-align: center;
  padding: var(--sp-2);
  background: var(--c-surface-2);
  border-radius: var(--r-md);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-text-2);
  border: 1px solid var(--c-border);
}
.status-chip.chip-lead {
  border-color: var(--c-gold);
  color: var(--c-gold);
  background: var(--c-gold-dim);
}

.press-indicator {
  text-align: center;
  font-size: 0.8rem;
  color: var(--c-bogey);
  margin-bottom: var(--sp-2);
}

/* ── Carryover badge ────────────────────────────────────────── */
.carryover-badge {
  background: var(--c-gold-dim);
  border: 1px solid var(--c-gold);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  text-align: center;
  font-weight: 700;
  color: var(--c-gold);
  margin-bottom: var(--sp-4);
  font-size: 0.95rem;
}
.carryover-hot {
  background: linear-gradient(135deg, rgba(220,38,38,0.15), rgba(201,168,76,0.2));
  border-color: var(--c-double);
  color: var(--c-double);
  animation: pulse-hot 1.5s infinite;
}
@keyframes pulse-hot {
  0%, 100% { box-shadow: 0 0 8px rgba(220,38,38,0.2); }
  50% { box-shadow: 0 0 20px rgba(220,38,38,0.45); }
}

/* ── Skins ledger ───────────────────────────────────────────── */
.skins-ledger { margin: var(--sp-4) 0; }
.ledger-row {
  display: flex;
  justify-content: space-between;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.9rem;
}
.ledger-val { color: var(--c-gold); font-weight: 600; }

/* ── Wolf styles ────────────────────────────────────────────── */
.wolf-badge {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
  font-size: 0.9rem;
  color: var(--c-text-2);
}
.badge-blind {
  background: var(--c-eagle-bg);
  color: var(--c-eagle);
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 0.7rem;
}
.lone-wolf-badge {
  background: var(--c-eagle-bg);
  color: var(--c-eagle);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-full);
  font-size: 0.85rem;
  font-weight: 700;
}
.partner-badge {
  background: var(--c-win-bg);
  color: var(--c-win);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-full);
  font-size: 0.85rem;
  font-weight: 700;
}
.wolf-declare { text-align: center; margin: var(--sp-3) 0; }
.wolf-hint { font-size: 0.8rem; color: var(--c-text-3); margin-top: var(--sp-2); }
.wolf-status { margin-bottom: var(--sp-3); }

/* ── Vegas styles ───────────────────────────────────────────── */
.vegas-scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.vs-divider {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  color: var(--c-text-3);
  font-weight: 700;
}
.team-hdr {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-2);
}
.team-hdr.team-a { color: var(--c-team-a); }
.team-hdr.team-b { color: var(--c-team-b); }
.team-number {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: var(--sp-2);
}
.team-a-num { color: var(--c-team-a); }
.team-b-num { color: var(--c-team-b); }
.vegas-teams { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.team-col .team-label { font-size: 0.8rem; font-weight: 700; margin-bottom: var(--sp-2); }
.team-label.team-a { color: var(--c-team-a); }
.team-label.team-b { color: var(--c-team-b); }
.blowup-warning {
  background: var(--c-double-bg);
  border: 1px solid var(--c-double);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-4);
  color: var(--c-double);
  font-size: 0.85rem;
  margin-bottom: var(--sp-3);
  text-align: center;
}
.hole-result {
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  padding: var(--sp-2);
  border-radius: var(--r-md);
  margin: var(--sp-2) 0;
}
.team-a-win { background: rgba(37,99,235,0.08); color: var(--c-team-a); }
.team-b-win { background: rgba(217,119,6,0.08); color: var(--c-team-b); }
.tied { background: var(--c-par-bg); color: var(--c-text-2); }
.running-total { font-size: 0.85rem; color: var(--c-text-2); text-align: center; }

/* ── Bingo styles ───────────────────────────────────────────── */
.bingo-categories { margin-bottom: var(--sp-4); }
.bingo-cat { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-md); padding: var(--sp-3); margin-bottom: var(--sp-2); }
.bingo-cat-label { font-weight: 600; font-size: 0.9rem; margin-bottom: var(--sp-2); }
.bingo-cat-desc { font-size: 0.75rem; color: var(--c-text-3); font-weight: 400; }
.bingo-player-btns { display: flex; gap: var(--sp-1); flex-wrap: wrap; }
.bingo-player-btn {
  padding: var(--sp-1) var(--sp-3);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--c-text-2);
  transition: all var(--t-fast);
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-ui);
}
.bingo-player-btn.selected { background: var(--c-gold-dim); border-color: var(--c-gold); color: var(--c-gold); font-weight: 600; }
.bingo-player-btn.bingo-clear { color: var(--c-text-3); }
.bingo-totals { margin-bottom: var(--sp-4); }
.bingo-total-row { display: flex; justify-content: space-between; padding: var(--sp-2) 0; border-bottom: 1px solid var(--c-border); font-size: 0.9rem; }
.bingo-pts { color: var(--c-gold); font-weight: 600; }

/* ── Bloodsome styles ───────────────────────────────────────── */
.blood-selector { margin-bottom: var(--sp-4); }
.blood-label { font-size: 0.85rem; color: var(--c-text-2); margin-bottom: var(--sp-2); }
.blood-btns { display: flex; gap: var(--sp-2); }
.blood-btn {
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  cursor: pointer;
  color: var(--c-text-2);
  font-size: 0.9rem;
  transition: all var(--t-fast);
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-ui);
}
.blood-btn.blood-selected {
  background: var(--c-double-bg);
  border-color: var(--c-double);
  color: var(--c-double);
  font-weight: 700;
}
.bloodsome-teams, .team-rows { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.team-section-sm { background: var(--c-surface-2); border-radius: var(--r-md); padding: var(--sp-3); border: 1px solid var(--c-border); }

/* ── Banker styles ──────────────────────────────────────────── */
.banker-quotas { margin: var(--sp-4) 0; }
.quota-header { font-size: 0.8rem; color: var(--c-text-3); margin-bottom: var(--sp-2); text-transform: uppercase; letter-spacing: 0.05em; }
.quota-row { display: flex; justify-content: space-between; padding: var(--sp-2) 0; border-bottom: 1px solid var(--c-border); font-size: 0.9rem; }
.quota-pts { font-weight: 600; }
.above-quota { color: var(--c-win); }
.below-quota { color: var(--c-loss); }

/* ── Stableford styles ──────────────────────────────────────── */
.stableford-standings { margin: var(--sp-4) 0; }
.standings-header { font-size: 0.8rem; color: var(--c-text-3); margin-bottom: var(--sp-2); text-transform: uppercase; letter-spacing: 0.05em; }
.standing-row { display: flex; justify-content: space-between; padding: var(--sp-2) 0; border-bottom: 1px solid var(--c-border); font-size: 0.9rem; }
.standing-row.leader { background: var(--c-gold-dim); border-radius: var(--r-sm); padding-left: var(--sp-2); padding-right: var(--sp-2); margin: 0 -8px; }
.standing-pts { font-weight: 600; }
.above-par { color: var(--c-win); }
.below-par { color: var(--c-loss); }
.pts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }

/* ── Points summary (Wolf) ──────────────────────────────────── */
.points-summary { margin-bottom: var(--sp-4); }
.pts-row { display: flex; justify-content: space-between; padding: var(--sp-3); background: var(--c-surface-2); border-radius: var(--r-md); margin-bottom: var(--sp-2); border: 1px solid var(--c-border); }
.pts-val { font-weight: 700; color: var(--c-gold); }

/* ── Setup Card ─────────────────────────────────────────────── */
.setup-card {
  max-width: 480px;
  margin: var(--sp-6) auto;
  padding: var(--sp-4);
}

.setup-header {
  text-align: center;
  margin-bottom: var(--sp-6);
}
.game-emoji { font-size: 3rem; display: block; margin-bottom: var(--sp-3); }
.setup-header h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--navy);
  margin-bottom: var(--sp-2);
}
.game-tagline { color: var(--c-text-2); font-size: 0.9rem; line-height: 1.6; }

.setup-form { display: flex; flex-direction: column; gap: var(--sp-4); }

.form-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.form-group label { font-size: 0.85rem; color: var(--c-text-2); font-weight: 600; font-family: var(--font-ui); }
.form-label { font-size: 0.85rem; color: var(--c-text-2); font-weight: 600; font-family: var(--font-ui); }
.input-hint { font-size: 0.75rem; color: var(--c-text-3); margin-top: -4px; }

.text-input, .form-input {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  color: var(--c-text);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--t-fast);
  width: 100%;
  font-family: var(--font-ui);
}
.text-input:focus, .form-input:focus { border-color: var(--c-gold); box-shadow: 0 0 0 3px var(--c-gold-dim); }
.text-input::placeholder, .form-input::placeholder { color: var(--c-text-3); }
.textarea { resize: vertical; min-height: 100px; }

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-2) 0;
  font-size: 0.9rem;
  color: var(--c-text-2);
  cursor: pointer;
}
.toggle-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--c-gold); cursor: pointer; }

.advanced-settings {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.advanced-settings summary {
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--c-text-2);
  list-style: none;
  user-select: none;
  font-family: var(--font-ui);
}
.advanced-settings summary::before { content: '▶ '; font-size: 0.7rem; }
.advanced-settings[open] summary::before { content: '▼ '; }
.adv-body { padding: 0 var(--sp-4) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }

.start-btn { width: 100%; padding: 14px; font-size: 1rem; }

/* ── Settlement ─────────────────────────────────────────────── */
.settlement-page { max-width: 480px; margin: 0 auto; padding: var(--sp-4); }
.settle-header { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.settle-header h2 { font-family: var(--font-serif); font-size: 1.5rem; color: var(--navy); }
.score-summary { margin-bottom: var(--sp-4); }
.seg-result { display: flex; justify-content: space-between; padding: var(--sp-3) 0; border-bottom: 1px solid var(--c-border); font-size: 0.9rem; }
.settlement-page .seg-result { opacity: 0; animation: fade-up-settle 0.3s ease forwards; }
.settlement-page .seg-result:nth-child(1) { animation-delay: 0.8s; }
.settlement-page .seg-result:nth-child(2) { animation-delay: 1.0s; }
.settlement-page .seg-result:nth-child(3) { animation-delay: 1.2s; }
@keyframes fade-up-settle {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.winner-tag { background: var(--c-win-bg); color: var(--c-win); padding: 2px 10px; border-radius: var(--r-full); font-size: 0.8rem; font-weight: 600; }
.as-tag { color: var(--c-text-3); font-size: 0.8rem; }

.settlement-wrap { display: flex; flex-direction: column; gap: var(--sp-3); }

.settlement-hero {
  text-align: center;
  padding: var(--sp-6);
  background: var(--c-surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-md);
}
.settlement-hero.all-square { border-color: var(--c-text-3); }
.hero-amount {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  color: var(--c-gold);
  line-height: 1;
  margin-bottom: var(--sp-2);
}
.hero-team { font-size: 1rem; color: var(--c-text-2); margin-bottom: var(--sp-2); }
.hero-pts { font-size: 0.9rem; color: var(--c-text-3); }
.hero-sub { font-size: 0.9rem; color: var(--c-text-3); }

.settlement-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
}

.transfer-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  font-size: 1rem;
  margin-bottom: var(--sp-3);
}
.transfer-from { color: var(--c-text-2); }
.transfer-to { font-weight: 700; color: var(--c-text); }
.transfer-amt { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 700; color: var(--c-win); }
.transfer-amt::before { content: '→ '; font-family: var(--font-ui); font-size: 1rem; color: var(--c-text-3); }

.transfer-btns { display: flex; flex-direction: column; gap: var(--sp-2); }
.venmo-btn, .cashapp-btn, .pay-link {
  display: block; width: 100%; padding: 14px;
  font-size: 1rem; font-weight: 700; text-align: center;
  border-radius: var(--r-md); margin-bottom: 0; border: none;
  cursor: pointer; text-decoration: none; font-family: var(--font-ui);
}
.pay-link.venmo, .venmo-btn { background: #3D95CE; color: #fff; }
.pay-link.cashapp, .cashapp-btn { background: #00C244; color: #000; }

.per-game-breakdown {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
}
.breakdown-title { font-size: 0.8rem; color: var(--c-text-3); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--sp-3); }
.breakdown-row { display: flex; justify-content: space-between; padding: var(--sp-2) 0; border-bottom: 1px solid var(--c-border); font-size: 0.85rem; }
.breakdown-row:last-child { border-bottom: none; }
.breakdown-value.win { color: var(--c-win); }
.breakdown-value.loss { color: var(--c-loss); }

.share-btn { width: 100%; margin-top: var(--sp-2); }
.vegas-total { margin-bottom: var(--sp-4); }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  padding: var(--sp-4);
}

.modal {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl) var(--r-xl) var(--r-lg) var(--r-lg);
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  animation: slide-up var(--t-mid) cubic-bezier(0.16,1,0.3,1);
  box-shadow: var(--shadow-lg);
}

@keyframes slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header { font-family: var(--font-serif); font-size: 1.3rem; color: var(--navy); margin-bottom: var(--sp-3); }
.modal-body { font-size: 1rem; color: var(--c-text); margin-bottom: var(--sp-2); }
.modal-sub { font-size: 0.85rem; color: var(--c-text-2); margin-bottom: var(--sp-4); }
.modal-btns { display: flex; gap: var(--sp-3); }
.modal-btns .btn { flex: 1; }
.score-modal-input { font-size: 1.4rem; text-align: center; letter-spacing: 0.05em; margin-bottom: 4px; }

/* ── Toast ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: var(--sp-2);
  pointer-events: none;
}
.toast {
  background: var(--navy);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-full);
  padding: 8px 18px;
  font-size: 0.85rem;
  color: #fff;
  white-space: nowrap;
  animation: toast-in var(--t-mid) ease, toast-out var(--t-mid) ease 2.8s forwards;
  box-shadow: var(--shadow-lg);
  font-family: var(--font-ui);
}
.toast.success { background: rgba(22,101,52,0.95); }
.toast.error { background: rgba(153,27,27,0.95); }
.toast.warning { background: rgba(120,53,15,0.95); }
.toast.info { background: rgba(29,78,216,0.95); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; } }

/* ── Book Page ──────────────────────────────────────────────── */
.book-page { max-width: 640px; margin: 0 auto; }

.book-hero {
  background: linear-gradient(160deg, var(--navy) 0%, #243459 100%);
  border-bottom: 1px solid rgba(201,168,76,0.2);
  padding: var(--sp-10) var(--sp-6) var(--sp-8);
  text-align: center;
}
.book-hero-inner { max-width: 480px; margin: 0 auto; }
.book-badge { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold); margin-bottom: var(--sp-3); font-family: var(--font-ui); }
.book-title {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  color: #fff;
  line-height: 1.05;
  margin-bottom: var(--sp-4);
}
.book-sub { font-size: 0.95rem; color: rgba(255,255,255,0.65); line-height: 1.6; margin-bottom: var(--sp-5); }
.book-btns { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

.book-section { padding: var(--sp-8) var(--sp-5); border-bottom: 1px solid var(--c-border); }
.book-section-inner { max-width: 540px; margin: 0 auto; }
.book-section h2 { font-family: var(--font-serif); font-size: 1.6rem; color: var(--navy); margin-bottom: var(--sp-4); }
.book-section p { color: var(--c-text-2); line-height: 1.7; margin-bottom: var(--sp-3); }

.book-game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.book-game-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  box-shadow: var(--shadow-sm);
}
.book-game-icon { font-size: 1.8rem; }
.book-game-name { font-weight: 700; font-size: 0.9rem; color: var(--c-text); }
.book-game-desc { font-size: 0.8rem; color: var(--c-text-2); flex: 1; line-height: 1.5; }

.features-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-3); }
.feature-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: var(--sp-4); box-shadow: var(--shadow-sm); }
.feature-icon { font-size: 1.8rem; margin-bottom: var(--sp-2); }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: var(--sp-2); color: var(--c-text); }
.feature-card p { font-size: 0.85rem; color: var(--c-text-2); line-height: 1.6; }

.book-cta { background: var(--sand); }
.book-cta-inner { text-align: center; max-width: 400px; margin: 0 auto; }
.book-cta-inner h2 { margin-bottom: var(--sp-3); }
.book-cta-inner p { margin-bottom: var(--sp-4); }
.cta-price { font-size: 0.8rem; color: var(--c-text-3); margin-top: var(--sp-2); font-family: var(--font-ui); }

.book-footer { background: var(--navy); padding: var(--sp-8) var(--sp-5); text-align: center; }
.footer-inner { max-width: 400px; margin: 0 auto; }
.footer-brand { font-family: var(--font-serif); font-size: 1.2rem; color: var(--gold); margin-bottom: var(--sp-2); }
.footer-sub { font-size: 0.8rem; color: rgba(255,255,255,0.5); margin-bottom: var(--sp-4); }
.footer-back-btn { border-color: rgba(255,255,255,0.2); color: rgba(255,255,255,0.8); }

/* ── Live Stakes Bar ────────────────────────────────────────── */
.stakes-bar {
  position: sticky;
  top: calc(var(--header-h) + var(--holenav-h));
  z-index: 85;
  background: var(--navy);
  border-bottom: 2px solid rgba(201,168,76,0.25);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.stakes-bar::-webkit-scrollbar { display: none; }

.stakes-label {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(74,222,128,0.6);
  flex-shrink: 0;
  white-space: nowrap;
}

.stakes-chips {
  display: flex;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.stakes-chips::-webkit-scrollbar { display: none; }

.stake-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  flex-shrink: 0;
  min-width: 64px;
}
.stake-chip.stake-up {
  background: rgba(22,163,74,0.2);
  border: 1px solid rgba(22,163,74,0.4);
}
.stake-chip.stake-down {
  background: rgba(220,38,38,0.2);
  border: 1px solid rgba(220,38,38,0.4);
}
.stake-chip.stake-even {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
}

.stake-name {
  font-family: var(--font-ui);
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  text-align: center;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stake-amt {
  font-family: var(--font-score);
  font-size: 14px;
  font-weight: 700;
}

.stakes-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  overflow-x: visible;
  flex: 1;
}
.stakes-grid-2x2 .stake-chip { border-radius: var(--r-sm); padding: 4px 8px; min-width: unset; }
.stake-chip.stake-up .stake-amt { color: #4ADE80; }
.stake-chip.stake-down .stake-amt { color: #F87171; }
.stake-chip.stake-even .stake-amt { color: rgba(255,255,255,0.5); }

/* ── Winner Banner (Settlement) ─────────────────────────────── */
@keyframes winner-pop {
  0% { transform: scale(0.7) translateY(20px); opacity: 0; }
  70% { transform: scale(1.05) translateY(-4px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes confetti-fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

.winner-banner {
  background: linear-gradient(135deg, #7A5C00, #C9A84C 40%, #F5E6B8 60%, #C9A84C 80%, #7A5C00);
  border-radius: var(--r-xl);
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 16px;
  animation: winner-pop 0.5s cubic-bezier(0.16,1,0.3,1) both;
  box-shadow: 0 8px 32px rgba(201,168,76,0.35);
  position: relative;
  overflow: hidden;
}

.winner-trophy {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 8px;
  display: block;
}

.winner-name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.winner-amount {
  font-family: var(--font-score);
  font-size: 32px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.winner-subtitle {
  font-family: var(--font-ui);
  font-size: 11px;
  color: rgba(27,42,74,0.6);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

.all-square-banner {
  background: var(--c-surface-2);
  border: 2px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 16px;
}
.all-square-banner .winner-trophy { color: #888; }
.all-square-banner .winner-name { color: var(--c-text-2); font-size: 20px; }

/* ── Confetti ────────────────────────────────────────────────── */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confetti-fall 3s ease-in forwards;
  pointer-events: none;
  z-index: 1000;
}

/* ── Settlement CTA buttons ─────────────────────────────────── */
.settlement-ctas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.pay-link.zelle {
  background: #6C1CD3;
  color: #fff;
}

.pay-link.cashapp {
  background: #00D632;
  color: #000;
}

/* ── History Page ────────────────────────────────────────────── */
.history-page {
  max-width: 540px;
  margin: 0 auto;
  padding: 16px;
}

.history-top-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.history-stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.history-stat-num {
  font-family: var(--font-score);
  font-size: 22px;
  font-weight: 700;
  color: var(--c-gold);
  line-height: 1;
  margin-bottom: 4px;
}

.history-stat-label {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--c-text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.history-section-header {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: 10px;
  padding-left: 2px;
}

.history-round-row {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 14px;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.history-round-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.history-round-row[data-game="nassau"]::before { background: linear-gradient(180deg, var(--coral), var(--c-gold)); }
.history-round-row[data-game="skins"]::before { background: linear-gradient(180deg, var(--c-gold), #E8B825); }
.history-round-row[data-game="wolf"]::before { background: linear-gradient(180deg, var(--seafoam), #3DAA78); }
.history-round-row[data-game="vegas"]::before { background: linear-gradient(180deg, #D4534B, var(--coral)); }
.history-round-row[data-game="bingo"]::before { background: linear-gradient(180deg, #5B8DEF, #3A6FDB); }
.history-round-row[data-game="bloodsome"]::before { background: linear-gradient(180deg, #8B0000, #C41E3A); }
.history-round-row[data-game="banker"]::before { background: linear-gradient(180deg, var(--deep-green), var(--seafoam)); }
.history-round-row[data-game="stableford"]::before { background: linear-gradient(180deg, var(--navy), #3A5A8C); }
.history-round-row[data-game="sixsixsix"]::before { background: linear-gradient(180deg, #FF6B35, #FF9A3C); }
.history-round-row:hover { border-color: var(--c-gold); transform: translateY(-1px); }

.history-round-icon { font-size: 24px; flex-shrink: 0; }
.history-round-info { flex: 1; }
.history-round-game { font-weight: 700; font-size: 0.9rem; color: var(--c-text); }
.history-round-meta { font-size: 0.75rem; color: var(--c-text-3); margin-top: 2px; }
.history-round-result { text-align: right; flex-shrink: 0; }

.amount-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-family: var(--font-score);
  font-size: 12px;
  font-weight: 700;
}
.amount-chip.win { background: rgba(22,163,74,0.12); color: var(--c-win); border: 1px solid rgba(22,163,74,0.2); }
.amount-chip.loss { background: rgba(220,38,38,0.1); color: var(--c-loss); border: 1px solid rgba(220,38,38,0.2); }
.amount-chip.even { background: var(--c-surface-3); color: var(--c-text-3); border: 1px solid var(--c-border); }

.history-leaderboard { margin-top: 20px; }
.leaderboard-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
}
.leaderboard-rank {
  font-family: var(--font-score);
  font-size: 13px;
  color: var(--c-text-3);
  width: 24px;
  flex-shrink: 0;
}
.leaderboard-rank.top { color: var(--c-gold); font-weight: 700; }
.leaderboard-name { flex: 1; font-weight: 600; font-size: 0.9rem; }
.leaderboard-net { font-family: var(--font-score); font-size: 13px; font-weight: 700; }
.leaderboard-net.pos { color: var(--c-win); }
.leaderboard-net.neg { color: var(--c-loss); }

.history-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--c-text-3);
}
.history-empty-emoji { font-size: 48px; margin-bottom: 12px; }
.history-empty-text { font-size: 0.9rem; line-height: 1.5; }

/* ── Six-Six-Six card accent ─────────────────────────────────── */
.game-card[data-game="sixsixsix"] .game-card-accent { background: linear-gradient(90deg, #FF6B35, #FF9A3C); }

/* ── Six-Six-Six scorecard styles ───────────────────────────── */
.sixsixsix-segment-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.segment-pill {
  flex: 1;
  text-align: center;
  padding: 6px 8px;
  border-radius: var(--r-md);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1.5px solid var(--c-border);
  background: var(--c-surface-2);
}
.segment-pill.active { border-color: #FF6B35; background: rgba(255,107,53,0.08); color: #FF6B35; }
.segment-pill.won { border-color: var(--c-win); background: rgba(22,163,74,0.1); color: var(--c-win); }
.segment-pill.lost { border-color: var(--c-loss); background: rgba(220,38,38,0.08); color: var(--c-loss); }
.segment-pill.tied { border-color: var(--c-gold); background: var(--c-gold-dim); color: var(--c-gold); }

.sixsixsix-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.sixsixsix-team {
  background: var(--c-surface-2);
  border-radius: var(--r-md);
  padding: 10px;
  border: 1px solid var(--c-border);
  text-align: center;
}
.sixsixsix-team-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  color: var(--c-text-3);
}
.sixsixsix-team-score {
  font-family: var(--font-score);
  font-size: 20px;
  font-weight: 700;
}

/* ── Dashboard Hero Stats ────────────────────────────────────── */
.dashboard-hero {
  padding: 20px 0 0;
}
.dashboard-greeting {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--c-text-2);
  margin-bottom: 8px;
  font-weight: 600;
}
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.dashboard-stat {
  background: var(--navy);
  border-radius: var(--r-lg);
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.dashboard-stat-num {
  font-family: var(--font-score);
  font-size: 22px;
  font-weight: 700;
  color: var(--c-gold);
  line-height: 1;
  margin-bottom: 4px;
}
.dashboard-stat-label {
  font-family: var(--font-ui);
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.recent-rounds-strip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.recent-round-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  color: var(--c-text);
  transition: all var(--t-fast);
  box-shadow: var(--shadow-sm);
}
.recent-round-card:hover { border-color: var(--c-gold); }
.recent-round-icon { font-size: 20px; }
.recent-round-info { flex: 1; }
.recent-round-game { font-size: 0.85rem; font-weight: 700; }
.recent-round-meta { font-size: 0.75rem; color: var(--c-text-3); }
.recent-round-result { font-family: var(--font-score); font-size: 12px; }

/* ── Misc ───────────────────────────────────────────────────── */
a { color: var(--c-gold); text-decoration: none; }

/* ── Focus rings (keyboard accessibility) ──────────────────── */
/* Remove browser default, apply themed ring via :focus-visible */
:focus { outline: none; }

.btn:focus-visible,
.btn-header:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px var(--c-gold-dim);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}

.game-card:focus-visible,
.book-promo:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
  box-shadow: var(--shadow-lg), 0 0 0 4px var(--c-gold-dim);
}

.score-btn:focus-visible,
.bingo-player-btn:focus-visible,
.blood-btn:focus-visible,
.dot-chip:focus-visible,
.chapman-adj:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}

.hole-dot:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 3px;
  border-radius: 50%;
}

.history-round-row:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}

.undo-btn:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Text inputs already use border + box-shadow for focus — keep as-is */
.text-input:focus-visible, .form-input:focus-visible { outline: none; }

/* ── prefers-reduced-motion (styles.css animations) ────────── */
@media (prefers-reduced-motion: reduce) {
  .winner-banner { animation: none; }
  .hole-result-overlay { animation: none; }
  .settlement-page .seg-result { animation: none; opacity: 1; }
  .carryover-hot { animation: none; }
  .confetti-piece { display: none; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (min-width: 480px) {
  .features-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 360px) {
  .score-btns { grid-template-columns: repeat(3, 1fr); }
  .score-btn { min-height: 48px; }
  .book-game-grid { grid-template-columns: 1fr; }
}

/* ── Modal quick score row ───────────────────────────────────── */
.modal-quick-scores {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-1);
  margin-bottom: var(--sp-3);
}
.modal-quick-btn { min-height: 52px; }

/* ── Hole Result Celebration Overlay ────────────────────────── */
.hole-result-overlay {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(27,42,74,0.88); backdrop-filter: blur(4px);
  animation: hole-result-in 0.3s cubic-bezier(0.16,1,0.3,1);
  pointer-events: auto;
}
.hole-result-content {
  text-align: center; font-family: var(--font-serif);
  font-size: clamp(20px, 5vw, 30px); font-weight: 700;
  color: white; padding: 32px 24px; max-width: 320px; line-height: 1.5;
}
.hole-result-win .hole-result-content { color: var(--c-gold); }
.hole-result-tie .hole-result-content { color: var(--c-text-3); }
.hole-result-neutral .hole-result-content { color: rgba(255,255,255,0.8); }
.hole-result-exit { animation: hole-result-out 0.4s ease forwards; }
.hole-result-content small { font-size: 0.65em; opacity: 0.75; display: block; margin-top: 8px; }
@keyframes hole-result-in {
  from { opacity: 0; transform: scale(1.08); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes hole-result-out {
  to { opacity: 0; transform: translateY(16px); }
}

/* ── Undo Toast ─────────────────────────────────────────────── */
.undo-toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  left: 50%; transform: translateX(-50%) translateY(120%);
  background: var(--navy); color: white;
  padding: 12px 16px; border-radius: var(--r-full);
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-lg); z-index: 250;
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
  font-family: var(--font-ui); font-size: 14px;
  max-width: calc(100vw - 32px); white-space: nowrap;
}
.undo-toast.visible { transform: translateX(-50%) translateY(0); }
.undo-btn {
  background: var(--coral); color: white; border: none;
  border-radius: var(--r-full); padding: 6px 16px;
  font-weight: 700; font-size: 13px; cursor: pointer;
  font-family: var(--font-ui);
  -webkit-tap-highlight-color: transparent;
}

/* ── Dots / Trash chip UI ───────────────────────────────────── */
.dot-chip {
  display: inline-flex; align-items: center; padding: 8px 14px;
  border-radius: var(--r-full); border: 1.5px solid transparent;
  font-size: 13px; font-weight: 600; min-height: 44px; cursor: pointer;
  transition: var(--t-fast); user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-ui);
}
.dot-chip-positive { background: rgba(107,203,158,0.12); border-color: rgba(107,203,158,0.4); color: #166534; }
.dot-chip-positive.active { background: #6BCB9E; border-color: #4aab7a; color: #fff; }
.dot-chip-negative { background: rgba(255,107,107,0.1); border-color: rgba(255,107,107,0.4); color: #b91c1c; }
.dot-chip-negative.active { background: #FF6B6B; border-color: #dc2626; color: #fff; }
.dot-chip-special { background: var(--c-gold-dim); border-color: rgba(201,168,76,0.4); color: #7a5c00; }
.dot-chip-special.active { background: var(--c-gold); border-color: var(--c-gold); color: var(--navy); }
.dots-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.dots-player-section {
  background: var(--c-surface-2); border: 1px solid var(--c-border);
  border-radius: var(--r-md); padding: 14px; margin-bottom: 12px;
}
.dots-player-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.dots-player-name { font-weight: 700; font-size: 0.95rem; }
.dots-tally { font-family: var(--font-score); font-size: 13px; font-weight: 700; color: var(--c-text-2); }

/* ── Nines scorecard styles ─────────────────────────────────── */
.game-card[data-game="nines"] .game-card-accent { background: linear-gradient(90deg, #7C3AED, #5B21B6); }
.game-card[data-game="dots"] .game-card-accent { background: linear-gradient(90deg, #059669, #10B981); }
.game-card[data-game="roundrobin"] .game-card-accent { background: linear-gradient(90deg, #2563EB, #0EA5E9); }
.game-card[data-game="chapman"] .game-card-accent { background: linear-gradient(90deg, #D97706, #F59E0B); }

.nines-pts-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: var(--c-gold-dim); border-radius: var(--r-md);
  padding: 10px; margin-bottom: 12px; text-align: center;
}
.nines-pts-cell { display: flex; flex-direction: column; gap: 2px; }
.nines-pts-name { font-size: 11px; color: var(--c-text-3); font-family: var(--font-ui); }
.nines-pts-val { font-family: var(--font-score); font-size: 16px; font-weight: 700; color: var(--c-gold); }

.nines-totals {
  background: var(--c-surface-2); border: 1px solid var(--c-border);
  border-radius: var(--r-md); padding: 12px; margin-bottom: 12px;
}
.nines-totals-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--c-text-3); margin-bottom: 8px;
  font-family: var(--font-ui);
}
.nines-total-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 0;
  border-bottom: 1px solid var(--c-border); font-size: 0.9rem;
}
.nines-total-row:last-child { border-bottom: none; }
.nines-total-name { flex: 1; }
.nines-total-pts { font-family: var(--font-score); font-weight: 700; color: var(--c-gold); }
.nines-total-net { font-family: var(--font-score); font-weight: 700; min-width: 52px; text-align: right; }
.nines-total-net.stake-up { color: #4ADE80; }
.nines-total-net.stake-down { color: #F87171; }
.nines-total-net.stake-even { color: var(--c-text-3); }

/* ── Chapman team card styles ───────────────────────────────── */
.chapman-match-status {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  padding: 12px;
  margin-bottom: 12px;
  border-radius: var(--r-md);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  letter-spacing: 0.02em;
}
.chapman-teams-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px;
}
.chapman-team-card {
  background: var(--c-surface-2); border: 2px solid var(--c-border);
  border-radius: var(--r-lg); padding: 16px; text-align: center;
}
.chapman-team-name { font-weight: 700; font-size: 0.9rem; margin-bottom: 8px; }
.chapman-score-row {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-bottom: 6px;
}
.chapman-score {
  font-family: var(--font-score); font-size: 2.4rem; font-weight: 700;
  color: var(--c-text); min-width: 48px;
}
.chapman-adj {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--c-surface); border: 1.5px solid var(--c-border);
  font-size: 1.3rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all var(--t-fast); color: var(--c-text);
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-ui);
}
.chapman-adj:active { background: var(--c-gold-dim); border-color: var(--c-gold); }
.chapman-rel {
  font-size: 0.75rem; color: var(--c-text-3); font-family: var(--font-ui); font-weight: 600;
}

/* ── History accents for new games ─────────────────────────── */
.history-round-row[data-game="nines"]::before { background: linear-gradient(180deg, #7C3AED, #5B21B6); }
.history-round-row[data-game="dots"]::before { background: linear-gradient(180deg, #059669, #10B981); }
.history-round-row[data-game="roundrobin"]::before { background: linear-gradient(180deg, #2563EB, #0EA5E9); }
.history-round-row[data-game="chapman"]::before { background: linear-gradient(180deg, #D97706, #F59E0B); }

/* ── Spinner ────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 32px auto;
}

/* ── Resume round links (home hero banner) ──────────────────── */
.resume-round-link {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.1);
  border-radius: 10px; padding: 10px 14px;
  text-decoration: none; color: #fff;
}
.resume-round-icon { font-size: 20px; }
.resume-round-name { flex: 1; text-align: left; font-size: 14px; font-weight: 600; }
.resume-round-time { font-size: 12px; color: rgba(255,255,255,0.5); }

/* ── History inline style extractions ──────────────────────── */
.history-winner-label { font-size: 10px; color: var(--c-text-3); margin-bottom: 2px; }
.history-section-header--spaced { margin-top: 20px; }
.leaderboard-rounds { font-size: 11px; color: var(--c-text-3); margin-right: 8px; }

/* ── App view header with phase subtitle ────────────────────── */
.header-title-group {
  display: flex; flex-direction: column; align-items: center;
}
.app-view-subtitle {
  font-size: 11px; color: var(--c-text-3);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-family: var(--font-ui);
}
