/* ================================================================
   LEADERBOARD — styles.css
   Design tokens, components, screens.
   Dark mode default. Light mode via html.light class.
   ================================================================ */

/* ── DESIGN TOKENS ─────────────────────────────────────────────── */
:root {
  /* Typography (Stitch refresh) */
  --font-ui:      'Plus Jakarta Sans', 'Lato', system-ui, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  /* Backgrounds */
  --bg:        #0e1a12;
  --surface:   #162019;
  --surface2:  #1e2d22;
  --surface3:  #243328;

  /* Borders */
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.12);

  /* Brand colours */
  --gold:         #d4a843;
  --gold-dim:     rgba(212,168,67,0.12);
  --gold-border:  rgba(212,168,67,0.28);

  --green:        #4caf76;
  --green-dim:    rgba(76,175,118,0.1);
  --green-border: rgba(76,175,118,0.25);

  --blue:         #5ba3d9;
  --blue-dim:     rgba(91,163,217,0.1);
  --blue-border:  rgba(91,163,217,0.25);

  --red:          #d96b4a;
  --red-dim:      rgba(217,107,74,0.1);
  --red-border:   rgba(217,107,74,0.25);

  --purple:       #9b7fd4;
  --purple-dim:   rgba(155,127,212,0.1);
  --purple-border:rgba(155,127,212,0.25);

  /* Text */
  --white:  #ffffff;
  --muted:  #8aab8e;
  --muted2: #b0c4b2;

  /* Player colours */
  --p0: #d4a843;
  --p1: #5ba3d9;
  --p2: #d96b4a;
  --p3: #e8c96a;

  /* Radii — tighter, more confident */
  --radius:    10px;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Shadow */
  --shadow:    0 3px 16px rgba(0,0,0,0.35);
  --shadow-sm: 0 1px 6px rgba(0,0,0,0.25);
  --shadow-cta: 0 3px 16px rgba(76,175,118,0.28);
}

/* ── LIGHT MODE (cream/forest-green — primary design identity) ──── */
html.light {
  /* Page + surface backgrounds — warm cream hierarchy */
  --bg:        #f2ece0;   /* warm parchment page */
  --surface:   #ffffff;   /* white card surface (Stitch refresh) */
  --surface2:  #edeae2;   /* slightly recessed cream */
  --surface3:  #e3dfd6;   /* deepest cream inset */

  /* Borders — ink on cream, calibrated contrast */
  --border:    rgba(0,0,0,0.09);
  --border2:   rgba(0,0,0,0.16);

  /* Brand — richer amber gold on cream */
  --gold:         #7a5610;
  --gold-dim:     rgba(122,86,16,0.1);
  --gold-border:  rgba(122,86,16,0.28);

  /* Forest green — primary brand colour */
  --green:        #1d6b3a;
  --green-dim:    rgba(29,107,58,0.1);
  --green-border: rgba(29,107,58,0.28);

  --blue:         #1a4f80;
  --blue-dim:     rgba(26,79,128,0.1);
  --blue-border:  rgba(26,79,128,0.28);

  --red:          #8a2a18;
  --red-dim:      rgba(138,42,24,0.1);
  --red-border:   rgba(138,42,24,0.28);

  --purple:       #5b3fa0;
  --purple-dim:   rgba(91,63,160,0.1);
  --purple-border:rgba(91,63,160,0.28);

  /* Text hierarchy on cream — dark forest green primary */
  --white:  #152011;    /* primary text: very dark forest green */
  --muted:  #3d5c42;    /* secondary text: medium forest green */
  --muted2: #5a7860;    /* tertiary text: lighter green-grey */

  /* Player colours — darkened for contrast on cream */
  --p0: #7a5610;
  --p1: #1a4f80;
  --p2: #8a2a18;
  --p3: #5c4408;

  /* Shadows — deeper on cream */
  --shadow:    0 3px 16px rgba(0,0,0,0.14);
  --shadow-sm: 0 1px 6px rgba(0,0,0,0.1);
  --shadow-cta: 0 3px 16px rgba(29,107,58,0.3);
}

/* ── RESET ──────────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--white);
  min-height: 100vh;
  font-weight: 300;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  border: 2.5px solid #145229;
  box-sizing: border-box;
}

input, select, button, textarea {
  font-family: 'Lato', sans-serif;
}

button { cursor: pointer; }

a { color: inherit; text-decoration: none; }

/* ── SCREENS ────────────────────────────────────────────────────── */
.screen {
  display: none;
  background: var(--bg);
}

.screen.active { display: block; }

.screen-pencil-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0 1.25rem;
}

/* ── TYPOGRAPHY ─────────────────────────────────────────────────── */
.bc {
  font-family: 'Plus Jakarta Sans',sans-serif;
}

.text-gold   { color: var(--gold); }
.text-green  { color: var(--green); }
.text-muted  { color: var(--muted); }
.text-muted2 { color: var(--muted2); }
.text-red    { color: var(--red); }

.label {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
}

.eyebrow {
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── LOGO ───────────────────────────────────────────────────────── */
.logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.logo-wrap svg {
  max-width: 260px;
  width: 100%;
  display: block;
}

/* ── LAYOUT ─────────────────────────────────────────────────────── */
.page-pad {
  padding: 0 1rem 3rem;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.page-pad-sm {
  padding: 0 1rem 2rem;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

/* ── STICKY HEADER ──────────────────────────────────────────────── */
.sticky-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.sticky-header h2 {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold);
  flex: 1;
}

/* ── CARDS ──────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  width: 100%;
}

html.light .card {
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.card-title {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-sub {
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

/* ── FORM FIELDS ────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.field:last-child { margin-bottom: 0; }

.field > label {
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--muted2);
  font-weight: 800;
}

html.light .field > label { color: var(--muted); }

input:not([type="checkbox"]):not([type="radio"]),
select, textarea {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 300;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

input[type="checkbox"], input[type="radio"] {
  width: auto;
  -webkit-appearance: checkbox;
  appearance: checkbox;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
}

input::placeholder, textarea::placeholder {
  color: rgba(255,255,255,0.2);
}

html.light input:not([type="checkbox"]):not([type="radio"]),
html.light select,
html.light textarea {
  background: rgba(255,255,255,0.7);
  border-color: rgba(0,0,0,0.14);
  color: var(--white);
}

html.light input::placeholder { color: rgba(0,0,0,0.28); }
html.light input:focus,
html.light select:focus,
html.light textarea:focus { border-color: var(--green); }

select option { background: var(--surface); }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}

.hint {
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 0.25rem;
  line-height: 1.5;
}

/* ── BUTTONS ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  transition: opacity 0.15s, transform 0.1s;
  cursor: pointer;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-full { width: 100%; }

.btn-primary {
  background: var(--gold);
  color: #0e1a13;
}

.btn-green {
  background: var(--green);
  color: #0a160e;
}

.btn-blue {
  background: var(--blue);
  color: #fff;
}

.btn-ghost {
  background: none;
  border: 1px solid var(--border2);
  color: var(--muted);
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-outline {
  background: none;
  border: 1px solid var(--border2);
  color: var(--muted2);
  width: 100%;
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

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

.btn-play {
  background: var(--green);
  color: #0a160e;
  width: 100%;
  padding: 1.05rem;
  font-size: 1.35rem;
  letter-spacing: 0.1em;
  box-shadow: var(--shadow-cta);
  border-radius: var(--radius-sm);
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn-play:active {
  transform: scale(0.98);
  box-shadow: 0 1px 6px rgba(76,175,118,0.15);
}

/* Setup NEXT buttons — same weight as btn-play */
.btn-setup-next {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1.05rem;
  background: var(--green);
  color: #0a160e;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  box-shadow: var(--shadow-cta);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  margin-top: 0.75rem;
}
.btn-setup-next:active {
  transform: scale(0.98);
  box-shadow: 0 1px 6px rgba(76,175,118,0.15);
}
html.light .btn-setup-next {
  background: #1a3a22;
  color: #fff;
  box-shadow: 0 3px 16px rgba(26,58,34,0.3);
}

html.light .btn-primary { background: #1a3a22 !important; color: #fff !important; }
html.light .btn-green   { background: #1a3a22 !important; color: #fff !important; }
html.light .btn-play    { background: #1a3a22 !important; color: #fff !important; }

/* ── FORMAT BUTTONS (home screen) ───────────────────────────────── */
.format-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.format-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 0.85rem;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.format-btn:active { transform: scale(0.97); }

.format-btn:hover {
  border-color: var(--gold-border);
  background: var(--surface2);
}

.format-btn .fmt-icon {
  font-size: 1.3rem;
  line-height: 1;
  margin-bottom: 0.2rem;
  opacity: 0.85;
}

.format-btn .fmt-name {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--white);
  line-height: 1.1;
}

.format-btn .fmt-desc {
  font-size: 0.58rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.4;
}

.format-btn.tournament {
  grid-column: 1 / -1;
  border-color: var(--purple-border);
  background: var(--purple-dim);
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
}

.format-btn.tournament:hover {
  border-color: var(--purple);
  background: rgba(155,127,212,0.18);
}

.format-btn.tournament .fmt-name {
  color: var(--purple);
}

/* ── HOME SCREEN BOTTOM NAV ─────────────────────────────────────── */
.home-nav {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.home-nav-btn {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.4rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.home-nav-btn:hover { border-color: var(--gold-border); }

.home-nav-btn .nav-icon { font-size: 1.1rem; line-height: 1; }

.home-nav-btn .nav-label {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ── RESUME BANNER ──────────────────────────────────────────────── */
.resume-banner {
  background: rgba(76,175,118,0.08);
  border: 1px solid var(--green-border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  width: 100%;
  max-width: 480px;
  margin: 0 auto 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}

.resume-banner:hover { background: rgba(76,175,118,0.12); }

.resume-banner-label {
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.resume-banner-title {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.resume-banner-sub {
  font-size: 0.68rem;
  color: var(--muted);
}

.resume-banner-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

/* ── BADGES & DOTS ──────────────────────────────────────────────── */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  vertical-align: middle;
}

.badge {
  display: inline-block;
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  letter-spacing: 0.06em;
}

.badge-gold   { background: var(--gold-dim);   color: var(--gold);   border: 1px solid var(--gold-border); }
.badge-green  { background: var(--green-dim);  color: var(--green);  border: 1px solid var(--green-border); }
.badge-red    { background: var(--red-dim);    color: var(--red);    border: 1px solid var(--red-border); }
.badge-blue   { background: var(--blue-dim);   color: var(--blue);   border: 1px solid var(--blue-border); }
.badge-purple { background: var(--purple-dim); color: var(--purple); border: 1px solid var(--purple-border); }

.stroke-badge {
  background: var(--gold);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: 0.04em;
  font-family: 'Plus Jakarta Sans',sans-serif;
}

/* ── SYNC STATUS ────────────────────────────────────────────────── */
.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: 'Plus Jakarta Sans',sans-serif;
}

.sync-badge.synced  { background: var(--green-dim); color: var(--green); }
.sync-badge.syncing { background: var(--gold-dim);  color: var(--gold); }
.sync-badge.offline { background: rgba(255,255,255,0.05); color: var(--muted); }

.sync-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* ── ANIMATIONS ─────────────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.pulse { animation: pulse 1.2s infinite; }
.fade-in { animation: fadeIn 0.25s ease; }
.slide-up { animation: slideUp 0.25s ease; }

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1.2s infinite;
  margin-right: 4px;
}

/* ── AUTH SCREEN ────────────────────────────────────────────────── */
#auth {
  padding: 2rem 1rem 3rem;
  background: radial-gradient(ellipse at 30% 0%, rgba(76,175,118,0.15) 0%, transparent 55%), var(--bg);
}


/* ── PROFILE SCREEN ─────────────────────────────────────────────── */
.profile-hero {
  text-align: center;
  padding: 2rem 0 1.25rem;
  width: 100%;
  max-width: 480px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: #0e1a13;
  margin: 0 auto 0.65rem;
}

.profile-name {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.profile-hcp {
  display: inline-block;
  margin-top: 0.4rem;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  border-radius: 20px;
  padding: 0.2rem 0.85rem;
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 0.9rem;
  color: var(--gold);
}

/* ── GAME SETUP SCREEN ──────────────────────────────────────────── */
.setup-step {
  display: none;
  animation: fadeIn 0.2s ease;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.setup-step.active { display: block; }

.step-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 480px;
}

.step-dot {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border2);
  transition: background 0.3s;
}

html.light .step-dot { background: rgba(0,0,0,0.12); }

.step-dot.done    { background: var(--green); }
.step-dot.current { background: var(--gold); }

/* ── PLAYER ROWS (setup) ────────────────────────────────────────── */
.group-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem 0.85rem;
  margin-bottom: 0.65rem;
}

html.light .group-block {
  border-color: var(--border2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.group-label {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.player-row {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

html.light .player-row {
  background: var(--surface);
  border-color: var(--border2);
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.player-row:last-child { margin-bottom: 0; }

.player-row-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-row-top input[type="text"] {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 0.2rem 0;
  font-size: 0.88rem;
  color: var(--white);
}

.player-row-top input[type="text"]:focus {
  border-bottom-color: var(--gold);
}

.player-row-bottom {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.player-row-bottom input[type="number"] {
  width: 80px;
  flex-shrink: 0;
}

.scorer-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  color: var(--muted);
  cursor: pointer;
}

.scorer-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}

/* ── GAME SCREEN ────────────────────────────────────────────────── */
.game-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 50;
}

.game-course {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--gold);
}

.game-sub {
  font-size: 0.54rem;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* Score header bars */
.score-bar {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

/* Match bar always dark — readable in both light and dark mode */
#game-match-bar {
  background: #1f4028;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
#game-match-bar .total-cell {
  background: transparent;
  border-right-color: rgba(255,255,255,0.12);
}
#game-match-bar .tc-name {
  color: rgba(255,255,255,0.75);
}
#game-match-bar .tc-pts,
#game-match-bar #mb-label-a,
#game-match-bar #mb-label-b {
  color: #fff;
}

.totals-bar {
  display: grid;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.total-cell {
  padding: 0.65rem 0.4rem;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
}

.total-cell:last-child { border-right: none; }

.tc-name {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1;
}

.tc-pts {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
}

.tc-sub {
  font-size: 0.6rem;
  font-weight: 300;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
  letter-spacing: 0.06em;
}

/* Match play bar */
.match-bar {
  display: flex;
  align-items: center;
  padding: 0.65rem 1rem;
  gap: 0.5rem;
}

.mb-pair     { flex: 1; }
.mb-pair-b   { text-align: right; }

.mb-names {
  font-size: 0.54rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.mb-score {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}

.mb-status-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 90px;
}

.mb-status {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 3px 10px;
  border-radius: 20px;
  line-height: 1.25;
}

.mb-status.lead-a  { background: rgba(212,168,67,0.15); color: var(--p0); }
.mb-status.lead-b  { background: rgba(91,163,217,0.15); color: var(--p1); }
.mb-status.all-sq  { background: rgba(76,175,118,0.15); color: var(--green); }
.mb-holes-left     { font-size: 0.52rem; color: var(--muted); }

/* Skins bar */
.skins-bar {
  display: grid;
  border-bottom: 1px solid var(--border);
}

/* Skins bar — cells now use .total-cell style */
.skins-cell { flex:1; } /* kept for compat */
.sk-name  { font-size: 0.5rem; }
.sk-pts   { font-family: 'Plus Jakarta Sans',sans-serif; font-size: 1.8rem; font-weight: 700; }
.sk-label { font-size: 0.48rem; }

/* Pot banner */
.pot-banner {
  background: var(--gold-dim);
  border-bottom: 1px solid var(--gold-border);
  padding: 0.35rem 1rem;
  text-align: center;
  display: none;
}

.pot-banner.show { display: block; }

.pot-banner span {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
}

/* ITC bar */
.itc-bar {
  display: grid;
  border-bottom: 1px solid var(--border);
}

/* ITC bar — cells now use .total-cell style */
.itc-in-chair { background: rgba(212,168,67,0.12) !important; }
/* kept for compat */
.itc-cell { flex:1; }
.itc-cell.in-chair { background: rgba(212,168,67,0.1); }
.itc-pname { font-size: 0.5rem; }
.itc-pts   { font-family: 'Plus Jakarta Sans',sans-serif; font-size: 1.8rem; font-weight: 700; }

/* Result flash */
.result-flash {
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  text-align: center;
  display: none;
  animation: fadeIn 0.25s ease;
  line-height: 1.4;
}

.result-flash.show { display: block; }

/* ── HOLE ENTRY PANEL ───────────────────────────────────────────── */
.hole-panel {
  padding: 0.85rem 1rem 0.75rem;
}

.hole-hdr {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.hole-num {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
  color: var(--gold);
}

.hole-lbl {
  font-size: 0.52rem;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.8;
}

.hole-si-info { text-align: right; }

.si-big {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  display: block;
}

.si-lbl {
  font-size: 0.48rem;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
}

/* Player input rows */
.gi-row {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.gi-row:last-child { margin-bottom: 0; }
.gi-row.in-chair   { border-color: var(--gold-border); background: rgba(212,168,67,0.06); }

/* Foursomes/Greensomes pair row — names stack vertically, score button
   stays pinned to the right regardless of name length, no wrapping. */
.gi-row-pair {
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
}

.gi-name {
  font-size: 1.2rem;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans',sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.gi-hcp {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}

/* Inline live score control (replaces popup picker for individual players) */
.gi-score-ctrl {
  flex-shrink: 0;
}

.gi-arr {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  user-select: none;
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.gi-arr-dn {
  border: 1px solid var(--border2);
  background: rgba(255,255,255,0.05);
  color: var(--white);
  font-size: 1.1rem;
}

.gi-arr-up {
  border: 1px solid rgba(56,161,105,0.5);
  background: rgba(56,161,105,0.12);
  color: #38a169;
  font-size: 1.1rem;
}

.gi-arr:active { opacity: 0.6; }

.gi-score-disc {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  touch-action: manipulation;
  user-select: none;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.gi-pickup-btn {
  height: 40px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  touch-action: manipulation;
  user-select: none;
  cursor: pointer;
  line-height: 1.2;
  min-width: 38px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, color 0.12s;
}

.gi-pickup-btn:active { opacity: 0.7; }

html.light .gi-arr-dn {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.2);
  color: #111;
}

html.light .gi-arr-up {
  background: rgba(56,161,105,0.12);
}

/* +/- counter */

/* Hole action buttons */
.hole-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem;
  padding-bottom: 0.25rem;
}

.btn-back-hole {
  padding: 0.85rem 1rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius-sm);
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}

.btn-back-hole:hover      { border-color: var(--gold); color: var(--gold); }
.btn-back-hole:disabled   { opacity: 0.2; cursor: default; pointer-events: none; }

.btn-record {
  width: 100%;
  padding: 1.05rem;
  background: var(--green);
  color: #0a160e;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  box-shadow: var(--shadow-cta);
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn-record:active {
  transform: scale(0.98);
  box-shadow: 0 1px 6px rgba(76,175,118,0.2);
}

html.light .btn-record { background: #1a3a22; color: #fff; box-shadow: 0 3px 16px rgba(26,58,34,0.3); }

/* 3-button action row at bottom of game screen */
.game-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.game-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.7rem 0.5rem;
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s;
}
.game-action-btn:last-child { border-right: none; }
.game-action-btn:active { background: rgba(255,255,255,0.04); }

.game-action-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.game-action-label {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-align: center;
  line-height: 1.2;
}
.counter {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.c-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: rgba(255,255,255,0.06);
  color: var(--white);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  user-select: none;
  transition: background 0.12s;
}

.c-btn:active { background: rgba(255,255,255,0.2); }

html.light .c-btn {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.2);
  color: var(--white);
}

.c-val {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 2rem;
  font-weight: 700;
  min-width: 2rem;
  text-align: center;
  line-height: 1;
}

/* Pair section labels */
.pair-section-label {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
  display: inline-block;
}

.psl-a { color: var(--p0); background: rgba(212,168,67,0.1); }
.psl-b { color: var(--p1); background: rgba(91,163,217,0.1); }

/* ── SCORECARD ──────────────────────────────────────────────────── */
.sc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.sc-table th {
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.35rem 0.25rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-weight: 400;
  white-space: nowrap;
}

.sc-table th:first-child { text-align: left; }

.sc-table td {
  padding: 0.38rem 0.25rem;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.sc-table td:first-child {
  text-align: left;
  color: var(--muted);
  font-size: 0.62rem;
}

.sc-table tr:last-child td { border-bottom: none; }

.sc-total-row td {
  border-top: 2px solid var(--border);
  font-weight: 700;
  color: var(--gold);
}

.sc-net   { color: var(--green); font-size: 0.62rem; }
.sc-pts   { color: var(--gold); }
.sc-match { color: var(--blue); }

/* Scorecard overlay */
.sc-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg);
  display: none;
  flex-direction: column;
}

.sc-overlay.open { display: flex; }

.sc-overlay-head {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 10;
}

.sc-overlay-title {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.sc-overlay-body {
  flex: 1;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── END ROUND SCREEN ───────────────────────────────────────────── */
.end-round-head {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  text-align: center;
}

.er-format {
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.er-result {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.06em;
  line-height: 1.1;
}

.er-sub {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Podium cards */
.podium-card {
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid var(--border);
  margin-bottom: 0.4rem;
}

.podium-card.rank-1 {
  background: rgba(212,168,67,0.08);
  border-color: var(--gold-border);
}

.podium-rank {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: rgba(255,255,255,0.1);
  min-width: 2.25rem;
  text-align: center;
  line-height: 1;
}

.podium-card.rank-1 .podium-rank { color: var(--gold); opacity: 0.6; }

.podium-info { flex: 1; }

.podium-name {
  font-size: 0.88rem;
  font-weight: 400;
  margin-bottom: 2px;
}

.podium-detail { font-size: 0.6rem; font-weight: 300; color: var(--muted); }

.podium-score {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

/* ── HISTORY ────────────────────────────────────────────────────── */
.history-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.history-item:hover { border-color: var(--gold-border); }

.hi-icon  { font-size: 1.3rem; flex-shrink: 0; }
.hi-body  { flex: 1; min-width: 0; }

.hi-date {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1px;
}

.hi-title {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 1px;
}

.hi-winner { font-size: 0.68rem; color: var(--gold); }
.hi-arrow  { color: var(--muted); font-size: 0.9rem; flex-shrink: 0; }

.filter-bar {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-btn {
  flex-shrink: 0;
  padding: 0.25rem 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 15px;
  color: var(--muted);
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: all 0.15s;
  cursor: pointer;
}

.filter-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #0e1a13;
}

.history-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ── FRIENDS ────────────────────────────────────────────────────── */
.friend-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.05rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 0;
}

.friend-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--gold);
  flex-shrink: 0;
}

.friend-info  { flex: 1; min-width: 0; }
.friend-name  { font-family: 'Plus Jakarta Sans',sans-serif; font-weight: 800; font-size: 1.35rem; line-height: 1.15; }
.friend-sub   { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }

.friend-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4px 10px 4px 8px;
  cursor: pointer;
  font-size: 0.75rem;
  margin: 2px;
  transition: border-color 0.15s;
}

.friend-chip:hover { border-color: var(--gold-border); }

.fc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

/* ── MODALS ─────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,0.75);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
}

.modal-box.gold-border { border-color: var(--gold-border); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-title {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.modal-sub {
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.btn-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
}

/* ── COURSE WIZARD ──────────────────────────────────────────────── */
.si-picker {
  display: grid;
  grid-template-columns: repeat(6,1fr);
  gap: 4px;
  margin-bottom: 0.85rem;
}

.si-btn {
  border-radius: 6px;
  padding: 0.5rem 0;
  text-align: center;
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--white);
  transition: all 0.12s;
  cursor: pointer;
}

.si-btn:active   { transform: scale(0.9); }
.si-btn.used     { opacity: 0.15; pointer-events: none; text-decoration: line-through; }
.si-btn.selected { background: var(--gold); border-color: var(--gold); color: #0e1a13; }

html.light .si-btn          { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.15); color: var(--white); }
html.light .si-btn.selected { background: var(--gold); color: #0e1a13; }

.par-btns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 0.85rem;
}

/* ── ABANDON CONFIRM ────────────────────────────────────────────── */
.abandon-modal .modal-box {
  border-color: var(--red-border);
  text-align: center;
}

/* ── COMING SOON MODAL ──────────────────────────────────────────── */
.coming-soon-modal .modal-box {
  border-color: var(--purple-border);
  text-align: center;
}

/* ── ACTIVE ROUND CARDS ─────────────────────────────────────────── */
.active-round-card {
  background: var(--surface);
  border: 1px solid var(--green-border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.4rem;
  cursor: pointer;
  transition: border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.active-round-card:hover { border-color: var(--gold-border); }

.arc-icon     { font-size: 1.3rem; flex-shrink: 0; }
.arc-body     { flex: 1; min-width: 0; }
.arc-title    { font-family: 'Plus Jakarta Sans',sans-serif; font-size: 1rem; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arc-sub      { font-size: 0.62rem; color: var(--muted); margin-top: 1px; }
.arc-progress { text-align: right; flex-shrink: 0; }
.arc-hole     { font-family: 'Plus Jakarta Sans',sans-serif; font-size: 1.4rem; font-weight: 700; color: var(--gold); line-height: 1; }
.arc-hole-lbl { font-size: 0.5rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.arc-abandon  { background: none; border: none; color: rgba(255,255,255,0.2); font-size: 0.9rem; padding: 4px; cursor: pointer; flex-shrink: 0; transition: color 0.15s; }
.arc-abandon:hover { color: var(--red); }

/* ── THEME TOGGLE ───────────────────────────────────────────────── */
.theme-btn {
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
}

.theme-btn.active { border-color: var(--gold); }

/* ── INVITE / JOIN SCREEN ───────────────────────────────────────── */
.join-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(ellipse at 50% 30%, rgba(76,175,118,0.12) 0%, transparent 60%), var(--bg);
}

/* ── LIGHT MODE OVERRIDES ───────────────────────────────────────── */
html.light .gi-row          { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.12); }
html.light .gi-row.in-chair { background: rgba(138,100,18,0.08); border-color: rgba(138,100,18,0.3); }
html.light .history-item    { background: var(--surface); }
html.light .friend-item     { background: var(--surface2); }
html.light .modal-box       { background: var(--surface); }
html.light .sc-overlay      { background: var(--bg); }
html.light .active-round-card { background: var(--surface); }
html.light .format-btn      { background: var(--surface); }
html.light .format-btn:hover { background: var(--surface2); }
html.light .sc-table td     { color: var(--white); }

/* ── UTILITY ────────────────────────────────────────────────────── */
.hidden   { display: none !important; }
.sr-only  { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.mt-sm    { margin-top: 0.5rem; }
.mt-md    { margin-top: 1rem; }
.mt-lg    { margin-top: 1.5rem; }
.mb-sm    { margin-bottom: 0.5rem; }
.mb-md    { margin-bottom: 1rem; }
.gap-sm   { gap: 0.5rem; }
.gap-md   { gap: 0.75rem; }
.w-full   { width: 100%; }
.text-center { text-align: center; }
.flex     { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1   { flex: 1; }

/* ================================================================
   NEW HOME SCREEN — hero card, mode cards, recent rounds, bottom nav
   ================================================================ */

.home-hero {
  background: linear-gradient(160deg, #1e4a2e 0%, #0d2016 55%, #091a11 100%);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  padding: 1.25rem 1.3rem 1.6rem;
  margin-bottom: 1rem;
  color: #fff;
  box-shadow: 0 6px 24px rgba(0,0,0,0.28);
}

/* Leaderboard screen hero — consistent green across all formats */
.lb-hero {
  background: #2d5c3a;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  padding: 1.25rem 1.25rem 1.5rem;
  margin-bottom: 0;
  color: #fff;
}
.lb-hero-names {
  background: #1f4028;
  padding: 0.65rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.lb-hero-name-a {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: clamp(0.85rem, 4vw, 1.3rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  line-height: 1.2;
}
.lb-hero-name-b {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: clamp(0.85rem, 4vw, 1.3rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5ba8d8;
  text-align: right;
  line-height: 1.2;
}
.lb-hero-vs {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.1em;
  flex-shrink: 0;
}
html.light .home-hero {
  background: linear-gradient(160deg, #2a4a32 0%, #1a3322 100%);
}

.home-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.home-hero-club {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  font-weight: 400;
  font-family: 'Plus Jakarta Sans',sans-serif;
}
.home-hero-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(212,168,67,0.2);
  border: 1.5px solid rgba(212,168,67,0.5);
  color: #d4a843;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Hero identity row: avatar + title side by side */
.home-hero-identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.1rem;
}
.home-hero-title {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-weight: 800;
  font-size: 2.6rem;
  line-height: 1;
  letter-spacing: 0.01em;
  color: #fff;
}
/* Thin rule under identity */
.home-hero-rule {
  height: 1px;
  background: rgba(255,255,255,0.12);
  margin: 0.85rem 0 0.85rem;
}
/* Stats band — no individual borders */
.home-hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1rem;
}
.home-hero-stat {
  padding: 0.6rem 0.7rem;
  text-align: left;
  border-right: 1px solid rgba(255,255,255,0.08);
}
.home-hero-stat:last-child { border-right: none; }
.home-hero-stat-label {
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.48);
  margin-bottom: 0.2rem;
  font-family: 'Plus Jakarta Sans',sans-serif;
}
.home-hero-stat-value {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-weight: 700;
  font-size: 1.65rem;
  color: #fff;
  line-height: 1;
}

/* Active Games button — solid gold, primary action */
.home-hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.8rem 1rem;
  background: #d4a843;
  color: #0e1a13;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  position: relative;
}
.home-hero-cta:active { transform: scale(0.98); opacity: 0.9; }
.home-hero-cta-badge {
  position: absolute;
  right: 0.85rem;
  background: #0e1a13;
  color: #d4a843;
  border-radius: 50%;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
}

/* Two-column outer grid: Solo left, Pairs & Teams right */
.fmt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  align-items: start;
}

/* Each column: flex stack with gap between individual cards */
.fmt-stack {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Individual format card — one button per card, fixed height for uniformity */
.fmt-col {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
  height: 4.5rem;
  display: flex;
  align-items: stretch;
}
html.light .fmt-col {
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

/* Individual format button — fills its card, no internal separator needed */
.fmt-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.77rem;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 0 0.8rem;
  height: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
  line-height: 1.15;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s;
}
.fmt-btn:active { background: var(--surface2); }
.fmt-btn:hover  { background: var(--surface2); }
html.light .fmt-btn { color: var(--white); }
html.light .fmt-btn:active,
html.light .fmt-btn:hover { background: var(--surface2); }

/* SVG icon inside format button */
.fmt-btn svg {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  stroke: var(--muted);
  transition: stroke 0.1s;
}
.fmt-btn:hover svg,
.fmt-btn:active svg { stroke: var(--green); }
html.light .fmt-btn svg { stroke: var(--muted); }
html.light .fmt-btn:hover svg,
html.light .fmt-btn:active svg { stroke: var(--green); }

.home-section-label {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  font-family: 'Plus Jakarta Sans',sans-serif;
  margin: 0 0.1rem 0.5rem;
  padding-left: 0.1rem;
}
/* Cream (light) version — slightly deeper */
html.light .home-section-label {
  color: var(--muted2);
}

.mode-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 1.25rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s, transform 0.1s;
}
.mode-card:active { transform: scale(0.99); }
.mode-card-icon {
  width: 52px; height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
  color: var(--white);
}
.mode-card-icon svg { display: block; }
.mode-card-body { flex: 1; min-width: 0; }
.mode-card-title {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-weight: 800;
  font-size: 1.9rem;
  color: var(--white);
  margin-bottom: 0.15rem;
  letter-spacing: 0.01em;
  line-height: 1.05;
}
.mode-card-sub {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--muted2);
  line-height: 1.35;
}
.mode-card-sub2 {
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.35;
}
.mode-card-chevron {
  font-size: 1.5rem;
  color: var(--muted);
  flex-shrink: 0;
  opacity: 0.5;
}

/* Active games / tournaments shown inside the hero card */
.home-active-list {
  margin-top: 0.85rem;
}
.home-active-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  margin-top: 0.45rem;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid rgba(255,255,255,0.07);
}
.home-active-row:active { background: rgba(255,255,255,0.12); }
.home-active-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}
.home-active-body { flex: 1; min-width: 0; }
.home-active-title {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: rgba(255,255,255,0.95);
  line-height: 1.2;
}
.home-active-sub {
  font-size: 0.68rem;
  font-weight: 300;
  color: rgba(255,255,255,0.55);
  margin-top: 0.1rem;
}
.home-active-chevron {
  font-size: 1.4rem;
  color: rgba(255,255,255,0.5);
  flex-shrink: 0;
}

/* Bottom tab bar */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: #145229;
  border-top: none;
  padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  box-shadow: 0 -4px 20px rgba(10,30,18,0.25);
}
html.light .bottom-nav {
  background: #145229;
  border-top: none;
  box-shadow: 0 -4px 20px rgba(10,30,18,0.25);
}
.bottom-nav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  background: none; border: none; cursor: pointer;
  padding: 0.45rem 0;
  color: rgba(255,255,255,0.6);
  margin: 0;
  border-radius: 0;
  transition: color 0.15s;
  position: relative;
}
.bottom-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.bottom-nav-icon svg {
  width: 22px; height: 22px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.15s;
}
.bottom-nav-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: 'Plus Jakarta Sans',sans-serif;
}
.bottom-nav-btn.active {
  color: #fff;
  background: none;
  border: none;
}
.bottom-nav-btn.active::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2.5px;
  background: var(--gold);
  border-radius: 0 0 3px 3px;
}
html.light .bottom-nav-btn { color: rgba(255,255,255,0.6); }
html.light .bottom-nav-btn.active { color: #fff; }

/* Ensure content isn't hidden behind the fixed bottom tab bar */
#screen-history.active .page-pad,
#screen-history.active .page-pad-sm,
#screen-friends.active .page-pad,
#screen-friends.active .page-pad-sm,
#screen-profile.active .page-pad,
#screen-profile.active .page-pad-sm {
  padding-bottom: 5.5rem;
}

/* ── HISTORY (redesigned to match home) ────────────────────────── */
.history-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s, transform 0.1s;
}
.history-card:active { transform: scale(0.99); }
.history-card-icon {
  width: 48px; height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.history-card-body { flex: 1; min-width: 0; }
.history-card-date {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.history-card-title {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 0.15rem;
}
.history-card-winner {
  font-size: 0.9rem;
  color: var(--gold);
  font-weight: 400;
}
.history-card-chevron {
  font-size: 1.8rem;
  color: var(--muted);
  flex-shrink: 0;
}

/* Friends screen: bigger, bolder labels/text */
#screen-friends .card-title {
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  font-weight: 800;
}
#screen-friends .card-sub {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted2);
  line-height: 1.35;
}
#screen-friends .field > label {
  font-size: 1rem;
  letter-spacing: 0.01em;
  font-weight: 800;
  color: var(--muted2);
  text-transform: none;
}
#screen-friends .friend-sub {
  font-weight: 800;
  font-size: 0.95rem;
}
#screen-friends input {
  font-size: 1.1rem;
}

/* Profile screen: bigger, bolder labels/text (matches Friends) */
#screen-profile .card-title {
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  font-weight: 800;
}
#screen-profile .field > label {
  font-size: 1rem;
  letter-spacing: 0.02em;
  font-weight: 800;
  color: var(--muted2);
  text-transform: none;
}
#screen-profile input,
#screen-profile select {
  font-size: 1.1rem;
}

/* Setup Course & Settings screen: bigger card titles, bold inputs */
#screen-setup-course .card-title {
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  font-weight: 800;
}
#screen-setup-course #setup-course-select,
#screen-setup-course #setup-tee-select,
#screen-setup-course #setup-hcp-pct {
  font-weight: 700;
  font-size: 1.05rem;
}

/* Setup Review screen: bigger, bolder card title */
#screen-setup-review .card-title {
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  font-weight: 800;
}

/* Toggle button groups (e.g. 18 / Front 9 / Back 9): make the selected
   option unmistakably obvious */
.holes-btn {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  padding: 0.7rem 0.5rem;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--muted2);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  width: 100%;
}
html.light .holes-btn {
  background: var(--surface2);
  border-color: var(--border2);
  color: var(--muted);
}
.holes-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #0e1a13;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(212,168,67,0.3);
}
html.light .holes-btn.active {
  background: var(--gold);
  color: #fff;
  box-shadow: 0 2px 8px rgba(122,86,16,0.25);
}

/* ── NEW VERTICAL SCORECARD ─────────────────────────────────────── */
.sc-mode-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sc-mode-btn {
  flex: 1;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: none;
  color: var(--muted2);
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.sc-mode-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #0e1a13;
}

.sc-group-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.sc-group-btn {
  padding: 0.45rem 1.1rem;
  border-radius: 20px;
  border: 1.5px solid var(--border2);
  background: var(--surface2);
  color: var(--muted2);
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.03em;
}
.sc-group-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.sc-pages {
  display: flex;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  scroll-snap-type: x mandatory;
}
.sc-page {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sc-table {
  width: 100%;
  border-collapse: collapse;
}
.sc-table th, .sc-table td {
  text-align: center;
  padding: 0.5rem 0.35rem;
  font-family: 'Plus Jakarta Sans',sans-serif;
}
.sc-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 5;
  border-bottom: 2px solid var(--border2);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--muted2);
  letter-spacing: 0.03em;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}
.sc-table thead th:first-child { text-align: left; padding-left: 0.75rem; }
.sc-table tbody td:first-child { text-align: left; padding-left: 0.75rem; }

.sc-hole-cell {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--white);
}
.sc-meta-cell {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}
.sc-score-cell {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--white);
}
.sc-row-current { background: rgba(212,168,67,0.08); }

.sc-subtotal-row td {
  background: var(--surface2);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--gold);
  border-top: 1px solid var(--border2);
  border-bottom: 1px solid var(--border2);
}
.sc-total-row td {
  background: var(--surface3);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--gold);
  border-top: 2px solid var(--gold-border);
}

.sc-player-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.sc-player-header .dot { width: 8px; height: 8px; }

/* Detail mode — stacked cell */
.sc-detail-cell {
  vertical-align: top;
  line-height: 1.25;
}
.sc-detail-net {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted2);
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.sc-detail-pts {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold);
  margin-top: 1px;
}
.sc-shot-dot {
  font-size: 0.65rem;
  color: var(--gold);
  letter-spacing: -1px;
  font-weight: 900;
  margin-right: 1px;
}

/* ── Amend Scorecard Edit table ──────────────────── */
.asc-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
}
.asc-table th {
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 2px solid var(--border2);
  font-family: 'Plus Jakarta Sans',sans-serif;
  padding: 0.4rem 0.25rem;
  text-align: center;
}
.asc-hole-cell {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 2;
  padding: 0.35rem 0.5rem;
  border-right: 1px solid var(--border2);
  vertical-align: middle;
  min-width: 56px;
}
.asc-score-cell {
  text-align: center;
  vertical-align: middle;
  padding: 0.3rem 0.2rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.asc-score-cell:active { background: rgba(212,168,67,0.12); }
/* Live totals footer */
.asc-tot-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-right: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  min-width: 72px;
}
.asc-tot-cell:first-child { border-left-width: 3px; }
.asc-tot-name {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}
.asc-tot-score {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}
.asc-tot-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  margin-top: 1px;
}


/* ── Screen pencil footer ─────────────────────────────────────── */
.screen-pencil svg {
  display: block;
}

/* Game screen layout — flex only when active so it doesn't bleed into other screens */
.screen-game {
  display: none;
}
.screen-game.active {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Tournament list buttons (active + history) ──────────────────── */
.tourn-list-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.tourn-list-btn:active { background: var(--surface3, rgba(255,255,255,0.06)); }

.tourn-list-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.tourn-list-body { flex: 1; min-width: 0; }

.tourn-list-name {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--white);
  line-height: 1.15;
}

.tourn-list-courses {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted2);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tourn-list-winner {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  margin-top: 3px;
}

.tourn-list-chevron {
  font-size: 1.4rem;
  color: var(--muted);
  flex-shrink: 0;
}

/* ── Tournament Game Type buttons ─────────────────────────────────── */
.tourn-mode-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.tourn-mode-btn.active {
  border-color: var(--gold-border);
  background: rgba(212,168,67,0.08);
}
.tourn-mode-btn-title {
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--white);
  line-height: 1.15;
}
.tourn-mode-btn.active .tourn-mode-btn-title { color: var(--gold); }
.tourn-mode-btn-sub {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted2);
  margin-top: 2px;
  line-height: 1.3;
}

/* ── Team name field on groups screen ─────────────────────────────── */
.sg-team-name-input {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--gold-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  color: var(--gold);
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}
.sg-team-name-input::placeholder { color: var(--muted); font-weight: 600; }

/* ── Toggle switch (LD / NTP enable) ──────────────────────────────── */
.lb-toggle {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.lb-toggle input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.lb-toggle-track {
  display: block;
  width: 46px;
  height: 26px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 13px;
  transition: background 0.15s, border-color 0.15s;
}
.lb-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 19px;
  height: 19px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform 0.15s, background 0.15s;
}
.lb-toggle input:checked + .lb-toggle-track {
  background: var(--green-dim);
  border-color: var(--green-border);
}
.lb-toggle input:checked + .lb-toggle-track .lb-toggle-thumb {
  transform: translateX(20px);
  background: var(--green);
}

/* ── LD / NTP hole picker grid ────────────────────────────────────── */
.ld-ntp-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem;
}
.ld-ntp-hole-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.2rem;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'Plus Jakarta Sans',sans-serif;
}
.ld-ntp-hole-btn .h-num {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--white);
  line-height: 1;
}
.ld-ntp-hole-btn .h-par {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 1px;
}
.ld-ntp-hole-btn.selected {
  background: var(--gold-dim);
  border-color: var(--gold-border);
}
.ld-ntp-hole-btn.selected .h-num { color: var(--gold); }
.ld-ntp-hole-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── In-game LD/NTP badge ─────────────────────────────────────────── */
.ld-ntp-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-family: 'Plus Jakarta Sans',sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  animation: ldNtpPulse 2s ease-in-out infinite;
}
.ld-ntp-badge.ld-badge {
  background: linear-gradient(135deg, #d4a843, #e8c96a);
  color: #2a1f08;
}
.ld-ntp-badge.ntp-badge {
  background: linear-gradient(135deg, #5ba3d9, #7cc4f0);
  color: #08233a;
}
@keyframes ldNtpPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,168,67,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(212,168,67,0); }
}
.ntp-badge { animation-name: ntpPulse; }
@keyframes ntpPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91,163,217,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(91,163,217,0); }
}


/* ================================================================
   SCORING SCREEN POLISH — build 20261010g
   ================================================================ */

/* ── Game bottom bar — SVG icon buttons ─────────────────────────── */
.game-bar-btn {
  padding: 0.45rem 0.1rem;
  font-size: 0.65rem;
  font-weight: 800;
  font-family: 'Plus Jakarta Sans',sans-serif;
  letter-spacing: 0.04em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  line-height: 1.1;
  background: none;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--muted2);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  width: 100%;
}

.game-bar-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
}

.game-bar-btn:active {
  background: var(--surface2);
  color: var(--gold);
  border-color: var(--gold-border);
}

html.light .game-bar-btn {
  color: var(--muted);
  border-color: rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.6);
}

html.light .game-bar-btn:active {
  background: var(--surface2);
  color: var(--gold);
  border-color: var(--gold-border);
}

/* ── Scoring player rows — light mode lift ───────────────────────── */
html.light .gi-row {
  background: var(--surface);
  border-color: rgba(0,0,0,0.12);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ── Score down arrow — cleaner look ────────────────────────────── */
html.light .gi-arr-dn {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.18);
  color: var(--white);
}

html.light .gi-arr-up {
  background: rgba(29,107,58,0.1);
  border-color: rgba(29,107,58,0.3);
  color: var(--green);
}

/* ── Pickup button — light mode ─────────────────────────────────── */
html.light .gi-pickup-btn {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.15);
  color: var(--muted);
}

/* ── Score disc — light mode shadow ─────────────────────────────── */
html.light .gi-score-disc {
  box-shadow: 0 1px 6px rgba(0,0,0,0.12);
}

/* ── Hole header label ───────────────────────────────────────────── */
html.light .hole-lbl {
  color: var(--muted);
  opacity: 1;
}

/* ── Scorecard Edit button — light mode ─────────────────────────── */
html.light .btn-back-hole {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.14);
  color: var(--muted);
}

html.light .btn-back-hole:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(122,86,16,0.06);
}

/* ── Hole panel — light mode background ─────────────────────────── */
html.light .hole-panel {
  background: var(--bg);
}

/* ── Game bottom bar container — light mode border ───────────────── */
html.light #game-bottom-bar {
  background: var(--surface);
  border-top-color: rgba(0,0,0,0.1);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

/* ================================================================
   SCORECARD EDIT / LEADERBOARD / HOLES NAV POLISH — build 20261010h
   ================================================================ */

/* ── Scorecard Edit overlay — light mode ─────────────────────────── */
html.light #amend-overlay { background: var(--bg); }

html.light #amend-overlay-head {
  background: var(--surface);
  border-bottom-color: rgba(0,0,0,0.14);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

html.light #btn-amend-cancel {
  border-color: rgba(0,0,0,0.18);
  color: var(--muted);
}

/* ── Amend scorecard table — light mode ──────────────────────────── */
html.light .asc-table th {
  background: var(--surface) !important;
  border-bottom-color: rgba(0,0,0,0.14);
  color: var(--muted);
}

html.light .asc-hole-cell {
  background: var(--surface) !important;
  border-right-color: rgba(0,0,0,0.14);
  color: var(--muted);
}

html.light .asc-score-cell {
  border-bottom-color: rgba(0,0,0,0.08);
}

html.light .asc-score-cell:active {
  background: rgba(122,86,16,0.08);
}

html.light .asc-tot-cell {
  border-right-color: rgba(0,0,0,0.1);
  border-left-color: var(--gold);
}

html.light .sc-subtotal-row td,
html.light .sc-subtotal-row th {
  background: rgba(0,0,0,0.03) !important;
}

html.light .sc-total-row td,
html.light .sc-total-row th {
  background: rgba(0,0,0,0.05) !important;
}

/* ── Scorecard view overlay — light mode ─────────────────────────── */
html.light .sc-overlay { background: var(--bg); }

html.light .sc-overlay-head {
  background: var(--surface);
  border-bottom-color: rgba(0,0,0,0.14);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

html.light .sc-mode-row {
  background: var(--surface);
  border-bottom-color: rgba(0,0,0,0.1);
}

html.light .sc-mode-btn {
  border-color: rgba(0,0,0,0.14);
  color: var(--muted);
  background: var(--bg);
}

html.light .sc-mode-btn.active {
  border-color: var(--gold-border);
  color: var(--gold);
  background: rgba(122,86,16,0.07);
}

html.light .sc-group-btn {
  border-color: rgba(0,0,0,0.14);
  color: var(--muted);
  background: var(--bg);
}

html.light .sc-group-btn.active {
  border-color: var(--gold-border);
  color: var(--gold);
  background: rgba(122,86,16,0.07);
}

html.light .sc-table thead th {
  background: var(--surface) !important;
  border-bottom-color: rgba(0,0,0,0.12);
  color: var(--muted);
}

html.light .sc-table tbody tr:nth-child(even) td {
  background: rgba(0,0,0,0.02);
}

html.light .sc-table td {
  border-bottom-color: rgba(0,0,0,0.07);
}

/* ── Holes nav panel — light mode ────────────────────────────────── */
html.light #hole-nav-panel {
  background: var(--surface);
  border-top-color: rgba(0,0,0,0.14);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.10);
}

html.light #btn-hole-nav-close {
  border-color: rgba(0,0,0,0.18);
  color: var(--muted);
}

/* ================================================================
   SCRAMBLE SETUP POLISH — build 20261010i
   ================================================================ */

/* SVG icons inside toggle/outline buttons inherit color correctly */
.holes-btn svg,
.btn-outline svg {
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
}

/* Active state: star icon filled gold on Stableford button */
.holes-btn.active svg,
.btn-outline.scoring-mode-btn.active svg {
  stroke: #fff;
}


/* ================================================================
   STITCH REFRESH (build 20261010n)
   Green + gold hero with halos, serif display type, Plus Jakarta Sans UI,
   "Round in progress" card, stacked per-player scoring cards.
   ================================================================ */

/* ── Home hero ─────────────────────────────────────────────────── */
.home-hero,
html.light .home-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 70% at 100% 0%, rgba(212,168,67,0.16) 0%, rgba(212,168,67,0) 55%),
    radial-gradient(90% 60% at 0% 100%, rgba(76,175,118,0.18) 0%, rgba(76,175,118,0) 60%),
    linear-gradient(165deg, #24503a 0%, #163a28 45%, #0f2a1c 100%);
  border-radius: 0 0 28px 28px;
  padding: calc(1.1rem + env(safe-area-inset-top, 0px)) 1.25rem 1.4rem;
  box-shadow: 0 14px 34px rgba(15,42,28,0.32);
}
/* faint gold halo rings */
.home-hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: 340px; height: 340px;
  right: -120px; top: -150px;
  border-radius: 50%;
  border: 1px solid rgba(212,168,67,0.14);
  box-shadow: 0 0 0 38px rgba(212,168,67,0.035), 0 0 0 80px rgba(212,168,67,0.025);
  pointer-events: none;
}

.home-hero-identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}
.home-hero-avatar {
  position: relative;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: #0d2117;
  border: 2px solid #d4a843;
  box-shadow: 0 0 0 4px rgba(212,168,67,0.14), 0 0 22px rgba(212,168,67,0.35);
  color: #e8c46a;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}
.home-hero-avatar::after {
  content: '';
  position: absolute;
  right: -1px; bottom: 1px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #4caf76;
  border: 2px solid #163a28;
}
.home-hero-who { min-width: 0; }
.home-hero-name {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-hero-subline {
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 500;
  color: rgba(255,255,255,0.72);
  margin-top: 2px;
}
.home-hero-subline:empty { display: none; }

.home-hero-eyebrow {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #d4a843;
  margin-bottom: 0.2rem;
}
.home-hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.35rem;
  line-height: 1.05;
  letter-spacing: -0.005em;
  color: #fff;
  margin-bottom: 1rem;
}
.home-hero-rule { display: none; }

.home-hero-stats {
  background: rgba(6,20,13,0.55);
  border: 1px solid rgba(212,168,67,0.16);
  border-radius: 18px;
  padding: 0.85rem 0.25rem;
  margin-bottom: 0.9rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.home-hero-stat {
  padding: 0 0.75rem;
  border-right: 1px solid rgba(255,255,255,0.09);
}
.home-hero-stat-label {
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #d4a843;
  margin-bottom: 0.3rem;
}
.home-hero-stat-value {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.home-hero-stat-sub {
  font-family: var(--font-ui);
  font-size: 0.66rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  margin-top: 0.25rem;
}

/* ── Round in progress card ────────────────────────────────────── */
.home-round-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.8rem 0.8rem 0.8rem 0.85rem;
  background: linear-gradient(180deg, rgba(8,22,14,0.82), rgba(6,16,10,0.9));
  border: 1.5px solid rgba(212,168,67,0.7);
  border-radius: 18px;
  box-shadow: 0 0 0 3px rgba(212,168,67,0.08), 0 8px 22px rgba(0,0,0,0.25);
  color: #fff;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: transform 0.1s;
}
.home-round-card:active { transform: scale(0.985); }
.home-round-card.is-idle { border-color: rgba(212,168,67,0.3); box-shadow: none; }

.home-round-icon {
  position: relative;
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(212,168,67,0.12);
  border: 1px solid rgba(212,168,67,0.35);
  color: #e8c46a;
  display: flex; align-items: center; justify-content: center;
}
.home-round-icon svg { width: 22px; height: 22px; }
.home-round-live {
  position: absolute;
  top: -4px; right: -4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #4caf76;
  border: 2px solid #0b1a11;
  display: none;
}
.home-round-card.is-live .home-round-live { display: block; animation: hr-pulse 2s ease-in-out infinite; }
.home-round-card.is-paused .home-round-live { display: block; background: #d4a843; }
@keyframes hr-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(76,175,118,0.55); }
  50%      { box-shadow: 0 0 0 5px rgba(76,175,118,0); }
}

.home-round-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.home-round-status {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-round-status b { font-weight: 800; color: #4caf76; }
.home-round-card.is-paused .home-round-status b,
.home-round-card.is-draft  .home-round-status b { color: #e8c46a; }
.home-round-status i {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  vertical-align: middle;
  margin: 0 0.45rem;
}
.home-round-course {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-round-course em { font-style: normal; font-weight: 600; color: #d4a843; }
.home-round-card.is-idle .home-round-course { font-size: 0.86rem; font-weight: 500; color: rgba(255,255,255,0.6); }
.home-round-card.is-idle .home-round-status { color: #fff; font-weight: 700; text-transform: none; letter-spacing: 0; font-size: 0.95rem; }

.home-round-btn {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 0.15rem;
  padding: 0.6rem 0.75rem 0.6rem 0.95rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #e2bb5e, #c9993a);
  color: #1a1206;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(212,168,67,0.35);
}
.home-round-card.is-idle .home-round-btn {
  background: rgba(212,168,67,0.14);
  color: #e8c46a;
  box-shadow: none;
}
.home-round-card .home-hero-cta-badge {
  top: -8px; right: -6px;
  background: #d4a843; color: #0e1a13;
  border: 2px solid #0f2a1c;
}

/* ── Home format grid ──────────────────────────────────────────── */
.home-section-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--white);
  margin: 0.35rem 0.1rem 0.6rem;
}
.home-section-label::before {
  content: '';
  width: 4px; height: 16px;
  border-radius: 3px;
  background: linear-gradient(180deg, #e2bb5e, #b8892f);
  flex-shrink: 0;
}
.fmt-stack { gap: 0.55rem; }
.fmt-col,
html.light .fmt-col {
  height: 4.4rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 6px 16px rgba(20,40,28,0.06);
}
html.light .fmt-col { background: #fff; }
.fmt-btn {
  font-family: var(--font-ui);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  gap: 0.6rem;
  padding: 0 0.7rem;
  white-space: normal;
  line-height: 1.2;
}
.fmt-btn svg {
  width: 36px; height: 36px;
  padding: 6px;
  border-radius: 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
html.light .fmt-btn svg { background: #f6f3ec; }

/* ── In-game hero: same green + gold halo ──────────────────────── */
.game-hero {
  background:
    radial-gradient(110% 80% at 100% 0%, rgba(212,168,67,0.16) 0%, rgba(212,168,67,0) 55%),
    linear-gradient(165deg, #24503a 0%, #163a28 50%, #0f2a1c 100%);
  border-radius: 0 0 24px 24px;
  box-shadow: 0 10px 26px rgba(15,42,28,0.28);
  z-index: 2;
}

/* ── Hole header ───────────────────────────────────────────────── */
.hole-panel { padding: 0.9rem 0.85rem 0.75rem; }
.hole-hdr {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0.1rem 0.9rem;
}
.hole-badge {
  flex-shrink: 0;
  width: 58px; height: 62px;
  border-radius: 16px;
  background: linear-gradient(170deg, #24503a, #163a28);
  box-shadow: 0 4px 12px rgba(22,58,40,0.3), inset 0 0 0 1px rgba(212,168,67,0.25);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff;
}
.hole-badge .hole-lbl,
html.light .hole-badge .hole-lbl {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.75);
  opacity: 1;
}
.hole-badge .hole-num {
  font-family: var(--font-ui);
  font-size: 1.85rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.hole-meta { flex: 1; min-width: 0; }
.hole-meta .hole-si-info { display: flex; align-items: center; gap: 0.5rem; text-align: left; }
.hole-meta .si-big {
  font-family: var(--font-ui);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.01em;
  display: inline;
}
.si-pill {
  display: inline-flex; align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(212,168,67,0.55);
  background: rgba(212,168,67,0.12);
  color: #9a6d18;
  font-size: 0.8rem;
  font-weight: 800;
}
:root:not(.light) .si-pill { color: #e8c46a; }
.hole-sub {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 0.2rem;
}
.hole-sub:empty { display: none; }
.hole-pager {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 0.2rem;
  padding: 0.55rem 0.6rem 0.55rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--white);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}

/* ── Player scoring cards ──────────────────────────────────────── */
.gi-row,
html.light .gi-row {
  border-radius: 20px;
  margin-bottom: 0.75rem;
}
.gi-card,
html.light .gi-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.95rem 0.95rem 0.85rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 22px rgba(20,40,28,0.07);
  font-family: var(--font-ui);
}
html.light .gi-card { background: #fff; }
.gi-card.in-chair { border-color: var(--gold-border); box-shadow: 0 0 0 2px var(--gold-dim), 0 8px 22px rgba(20,40,28,0.07); }

.gi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.gi-id { min-width: 0; flex: 1; }
.gi-card .gi-name {
  font-family: var(--font-ui);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.gi-card .gi-name .dot { width: 10px; height: 10px; }
.gi-name-txt { white-space: nowrap; }
.gi-pill {
  display: inline-flex; align-items: center;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.gi-pill-shot { background: rgba(212,168,67,0.14); color: #9a6d18; border: 1px solid rgba(212,168,67,0.4); }
.gi-pill-plus { background: var(--blue-dim); color: var(--blue); border: 1px solid var(--blue-border); }
:root:not(.light) .gi-pill-shot { color: #e8c46a; }
.gi-chair { font-size: 1rem; }
.gi-card .gi-hcp { font-size: 0.84rem; font-weight: 500; color: var(--muted); margin-top: 3px; }
.gi-card .gi-prev { font-size: 0.7rem; color: var(--muted2); margin-top: 2px; min-height: 0; }
.gi-card .gi-prev:empty { display: none; }

.gi-calc { flex-shrink: 0; text-align: right; }
.gi-calc-lbl {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: 0.3rem;
}
.gi-calc-val {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
}
.gi-calc-val[data-tone="ok"],
.gi-calc-val[data-tone="good"] { background: var(--green-dim); color: var(--green); }
.gi-calc-val[data-tone="good"] { box-shadow: inset 0 0 0 1px var(--green-border); }
:root:not(.light) .gi-calc-val[data-tone="ok"],
:root:not(.light) .gi-calc-val[data-tone="good"] { color: #6fcf97; }

/* Stepper row */
.gi-card .gi-score-ctrl {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.85rem;
}
.gi-card .gi-arr {
  width: auto;
  height: 58px;
  border-radius: 18px;
  font-size: 1.6rem;
  transition: transform 0.08s, box-shadow 0.08s;
}
.gi-card .gi-arr:active { transform: translateY(2px); opacity: 1; }
.gi-card .gi-arr-dn,
html.light .gi-card .gi-arr-dn {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--white);
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}
html.light .gi-card .gi-arr-dn { background: #f1f3f2; }
.gi-card .gi-arr-up,
html.light .gi-card .gi-arr-up {
  background: linear-gradient(180deg, #24503a, #163a28);
  border: 1px solid #12301f;
  color: #fff;
  box-shadow: 0 3px 0 #0c2116, 0 6px 14px rgba(22,58,40,0.25);
}

.gi-disc-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.gi-card .gi-score-disc {
  --sc: var(--border2);
  width: 76px; height: 76px;
  border-radius: 50%;
  border: 4px solid var(--sc);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  transition: border-color 0.12s, color 0.12s;
}
html.light .gi-card .gi-score-disc { background: #fff; }
.gi-card .gi-score-disc.has-score { color: var(--sc); }
.gi-card .gi-score-disc.is-pickup { font-size: 1rem; }
.gi-pu-lbl { display: block; font-size: 0.8rem; font-weight: 800; line-height: 1.1; }
.gi-pu-val { font-size: 0.95rem; font-weight: 700; opacity: 0.85; }
.gi-rel {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.gi-card .gi-pickup-btn,
html.light .gi-card .gi-pickup-btn {
  height: 58px;
  min-width: 60px;
  padding: 0 0.55rem;
  border-radius: 16px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.15;
}
html.light .gi-card .gi-pickup-btn { background: #f6f7f6; }
.gi-card .gi-pickup-btn.is-on,
html.light .gi-card .gi-pickup-btn.is-on {
  background: #d4a843;
  border-color: #c9993a;
  color: #1a1206;
}

/* ── Confirm & Next / Scorecard Edit ───────────────────────────── */
.hole-actions { gap: 0.6rem; margin-top: 0.25rem; }
.btn-record,
html.light .btn-record {
  border-radius: 18px;
  padding: 1.05rem 1rem;
  background: linear-gradient(180deg, #24503a, #163a28);
  color: #fff;
  border: 1px solid rgba(212,168,67,0.45);
  font-family: var(--font-ui);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 0 0 3px rgba(212,168,67,0.1), 0 8px 20px rgba(22,58,40,0.3);
}
.btn-back-hole,
html.light .btn-back-hole {
  border-radius: 18px;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--white);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.15;
  padding: 0.7rem 0.95rem;
}

@media (max-width: 360px) {
  .gi-card .gi-score-ctrl { gap: 0.4rem; }
  .gi-card .gi-score-disc { width: 66px; height: 66px; font-size: 1.85rem; }
  .gi-card .gi-pickup-btn { min-width: 52px; }
}

/* Round card — give text room on narrow phones */
.home-round-card { gap: 0.7rem; }
.home-round-status { font-size: 0.64rem; letter-spacing: 0.04em; }
.home-round-status i { margin: 0 0.35rem; }
.home-round-course {
  font-size: 0.95rem;
  line-height: 1.25;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.home-round-btn { padding: 0.55rem 0.55rem 0.55rem 0.8rem; font-size: 0.9rem; }

/* ================================================================
   ONE-SCREEN FIT (build 20261010o)
   Home and the scoring screen sized to fit a phone without scrolling.
   ================================================================ */

/* ── Home ──────────────────────────────────────────────────────── */
/* Hard top edge: green strip behind status bar; wrapper restores cream */
#screen-home { background: #0f3d22; }
#screen-home > div { background: var(--bg); }
#screen-home .home-hero {
  padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 1rem 0.9rem;
  margin-bottom: 0.7rem;
  border-radius: 0 0 24px 24px;
}
#screen-home .home-hero-identity { gap: 0.75rem; margin-bottom: 0.7rem; }
#screen-home .home-hero-avatar { width: 44px; height: 44px; font-size: 1.05rem; }
#screen-home .home-hero-avatar::after { width: 10px; height: 10px; }
#screen-home .home-hero-title {
  font-size: 1.75rem;
  line-height: 1.05;
  margin: 0;
}
#screen-home .home-hero-subline { font-size: 0.8rem; margin-top: 3px; }
#screen-home .home-hero-stats {
  padding: 0.55rem 0.15rem;
  border-radius: 14px;
  margin-bottom: 0.6rem;
}
#screen-home .home-hero-stat { padding: 0 0.65rem; }
#screen-home .home-hero-stat-label { font-size: 0.6rem; margin-bottom: 0.15rem; }
#screen-home .home-hero-stat-value { font-size: 1.3rem; }
#screen-home .home-hero-stat-sub { display: none; }
#screen-home .home-round-card { padding: 0.55rem 0.6rem; border-radius: 15px; gap: 0.6rem; }
#screen-home .home-round-icon { width: 36px; height: 36px; border-radius: 10px; }
#screen-home .home-round-icon svg { width: 19px; height: 19px; }
#screen-home .home-round-course { font-size: 0.9rem; }
#screen-home .home-round-btn { padding: 0.45rem 0.5rem 0.45rem 0.75rem; border-radius: 10px; font-size: 0.85rem; }
#screen-home .home-section-label { margin: 0 0.1rem 0.4rem; font-size: 0.72rem; }
#screen-home .home-section-label::before { height: 13px; }
#screen-home .fmt-stack { gap: 0.4rem; }
#screen-home .fmt-grid { gap: 0.5rem; }
#screen-home .fmt-col { height: 3.15rem; border-radius: 14px; }
#screen-home .fmt-btn { font-size: 0.9rem; gap: 0.5rem; padding: 0 0.55rem; line-height: 1.12; }
#screen-home .fmt-btn svg { width: 30px; height: 30px; padding: 5px; border-radius: 9px; }

/* ── Scoring screen: hero + hole header ───────────────────────── */
.game-hero { padding: 0.6rem 0.9rem 0.7rem !important; border-radius: 0 0 20px 20px; }
.game-hero #game-sub { margin-bottom: 0.45rem !important; font-size: 0.7rem !important; }
.game-hero .total-cell { padding: 0.4rem 0.3rem; }
.game-hero .tc-name { font-size: 1.15rem; margin-bottom: 0.05rem; }
.game-hero .tc-pts { font-size: 1.9rem; }
.game-hero #result-flash.result-flash-permanent { padding: 0.35rem 0.8rem; margin-top: 0.35rem !important; }

.hole-panel { padding: 0.6rem 0.75rem 0.5rem; }
.hole-hdr { margin: 0 0.05rem 0.55rem; gap: 0.65rem; }
.hole-badge { width: 46px; height: 48px; border-radius: 13px; }
.hole-badge .hole-lbl { font-size: 0.54rem; }
.hole-badge .hole-num { font-size: 1.45rem; }
.hole-meta .si-big { font-size: 1.2rem; }
.si-pill { font-size: 0.72rem; padding: 0.1rem 0.5rem; }
.hole-sub { font-size: 0.76rem; margin-top: 0.1rem; }
.hole-pager { padding: 0.45rem 0.5rem 0.45rem 0.75rem; border-radius: 12px; font-size: 0.88rem; }

.hole-actions { margin-top: 0.1rem !important; }
.btn-record, html.light .btn-record { padding: 0.8rem 1rem; font-size: 1.05rem; border-radius: 16px; }
.btn-back-hole, html.light .btn-back-hole { padding: 0.5rem 0.85rem; border-radius: 16px; font-size: 0.78rem; }

/* ── Compact player card (3–4 players): one row, stepper on the right ── */
#game-inputs:not(.gi-roomy) .gi-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.6rem 0.55rem 0.75rem;
  margin-bottom: 0.45rem;
  border-radius: 16px;
}
#game-inputs:not(.gi-roomy) .gi-top {
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  padding: 0;
  border: none;
}
#game-inputs:not(.gi-roomy) .gi-id { width: 100%; }
#game-inputs:not(.gi-roomy) .gi-name {
  font-size: 1rem;
  gap: 0.3rem;
  flex-wrap: nowrap;
  min-width: 0;
}
#game-inputs:not(.gi-roomy) .gi-name-txt { overflow: hidden; text-overflow: ellipsis; }
#game-inputs:not(.gi-roomy) .gi-name .dot { width: 8px; height: 8px; flex-shrink: 0; }
#game-inputs:not(.gi-roomy) .gi-pill { font-size: 0.64rem; padding: 0.05rem 0.38rem; flex-shrink: 0; }
#game-inputs:not(.gi-roomy) .gi-pill-long,
#game-inputs:not(.gi-roomy) .gi-pill-none,
#game-inputs:not(.gi-roomy) .gi-hcp-long,
#game-inputs:not(.gi-roomy) .gi-prev { display: none; }
#game-inputs:not(.gi-roomy) .gi-hcp { font-size: 0.74rem; margin-top: 1px; white-space: nowrap; }
#game-inputs:not(.gi-roomy) .gi-hcp b { font-weight: 700; color: var(--white); }
#game-inputs:not(.gi-roomy) .gi-calc { text-align: left; }
#game-inputs:not(.gi-roomy) .gi-calc-lbl { display: none; }
#game-inputs:not(.gi-roomy) .gi-calc-val { font-size: 0.72rem; padding: 0.18rem 0.5rem; }

#game-inputs:not(.gi-roomy) .gi-score-ctrl {
  display: flex;
  gap: 0.35rem;
  padding: 0;
  flex-shrink: 0;
}
#game-inputs:not(.gi-roomy) .gi-arr { width: 44px; height: 50px; border-radius: 14px; }
#game-inputs:not(.gi-roomy) .gi-arr svg { width: 20px; height: 20px; }
#game-inputs:not(.gi-roomy) .gi-disc-wrap { position: relative; }
#game-inputs:not(.gi-roomy) .gi-score-disc {
  width: 58px; height: 58px;
  border-width: 3.5px;
  font-size: 1.55rem;
  padding-bottom: 9px;
}
#game-inputs:not(.gi-roomy) .gi-score-disc.is-pickup { font-size: 0.8rem; padding-bottom: 8px; }
#game-inputs:not(.gi-roomy) .gi-pu-lbl { font-size: 0.66rem; }
#game-inputs:not(.gi-roomy) .gi-pu-val { font-size: 0.74rem; }
#game-inputs:not(.gi-roomy) .gi-rel {
  position: absolute;
  left: 0; right: 0; bottom: 9px;
  text-align: center;
  font-size: 0.48rem;
  letter-spacing: 0.06em;
  pointer-events: none;
}
#game-inputs:not(.gi-roomy) .gi-pickup-btn {
  min-width: 0;
  width: 44px;
  height: 50px;
  padding: 0;
  border-radius: 14px;
  font-size: 0.58rem;
  letter-spacing: 0.03em;
}

/* Roomy (1–2 players): tighten the big cards a touch */
#game-inputs.gi-roomy .gi-card { padding: 0.8rem 0.85rem 0.75rem; }
#game-inputs.gi-roomy .gi-top { padding-bottom: 0.6rem; }
#game-inputs.gi-roomy .gi-score-ctrl { padding-top: 0.7rem; }

@media (max-width: 370px) {
  #game-inputs:not(.gi-roomy) .gi-arr,
  #game-inputs:not(.gi-roomy) .gi-pickup-btn { width: 40px; }
  #game-inputs:not(.gi-roomy) .gi-score-disc { width: 54px; height: 54px; font-size: 1.4rem; }
}

/* Use spare height on taller phones; squeeze on short ones (iPhone SE etc.) */
#screen-home .fmt-col { height: 3.4rem; }
#game-inputs:not(.gi-roomy) .gi-arr,
#game-inputs:not(.gi-roomy) .gi-pickup-btn { height: 54px; }
#game-inputs:not(.gi-roomy) .gi-score-disc { width: 62px; height: 62px; }

@media (max-height: 760px) {
  #screen-home .fmt-col { height: 2.85rem; }
  #screen-home .fmt-btn svg { width: 26px; height: 26px; padding: 4px; }
  #screen-home .home-hero-identity { margin-bottom: 0.5rem; }
  #screen-home .home-hero-title { font-size: 1.5rem; }
  .game-hero .tc-pts { font-size: 1.55rem; }
  .game-hero .tc-name { font-size: 1rem; }
  .hole-hdr { margin-bottom: 0.4rem; }
  #game-inputs:not(.gi-roomy) .gi-card { padding-top: 0.4rem; padding-bottom: 0.4rem; margin-bottom: 0.35rem; }
  #game-inputs:not(.gi-roomy) .gi-arr,
  #game-inputs:not(.gi-roomy) .gi-pickup-btn { height: 48px; }
  #game-inputs:not(.gi-roomy) .gi-score-disc { width: 54px; height: 54px; font-size: 1.4rem; }
  .btn-record, html.light .btn-record { padding: 0.7rem 1rem; }
}
.game-hero .tc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) { .game-hero .tc-name { font-size: 0.95rem; letter-spacing: 0.01em; } }

/* ================================================================
   SIZE BUMP (build 20261010p) — use the spare height
   Home ≈ +30%. Scoring: 3 players get stacked cards (≈ +60%),
   4 players stay one-row but larger, 1–2 players keep the big cards.
   ================================================================ */

/* ── Home ──────────────────────────────────────────────────────── */
#screen-home .home-hero { padding-bottom: 1.1rem; margin-bottom: 0.9rem; }
#screen-home .home-hero-identity { gap: 0.9rem; margin-bottom: 0.85rem; }
#screen-home .home-hero-avatar { width: 56px; height: 56px; font-size: 1.3rem; }
#screen-home .home-hero-avatar::after { width: 12px; height: 12px; }
#screen-home .home-hero-title { font-size: 2.15rem; }
#screen-home .home-hero-subline { font-size: 0.95rem; }
#screen-home .home-hero-stats { padding: 0.75rem 0.2rem; margin-bottom: 0.75rem; }
#screen-home .home-hero-stat-label { font-size: 0.68rem; margin-bottom: 0.25rem; }
#screen-home .home-hero-stat-value { font-size: 1.65rem; }
#screen-home .home-round-card { padding: 0.7rem 0.75rem; border-radius: 17px; gap: 0.75rem; }
#screen-home .home-round-icon { width: 44px; height: 44px; border-radius: 12px; }
#screen-home .home-round-icon svg { width: 22px; height: 22px; }
#screen-home .home-round-status { font-size: 0.72rem; }
#screen-home .home-round-course { font-size: 1.05rem; }
#screen-home .home-round-btn { padding: 0.6rem 0.6rem 0.6rem 0.95rem; border-radius: 12px; font-size: 1rem; }
#screen-home .home-section-label { font-size: 0.82rem; margin: 0.1rem 0.1rem 0.55rem; }
#screen-home .home-section-label::before { height: 16px; }
#screen-home .fmt-stack { gap: 0.55rem; }
#screen-home .fmt-grid { gap: 0.6rem; }
#screen-home .fmt-col { height: 4.25rem; border-radius: 17px; }
#screen-home .fmt-btn { font-size: 1.08rem; gap: 0.65rem; padding: 0 0.7rem; }
#screen-home .fmt-btn svg { width: 38px; height: 38px; padding: 6px; border-radius: 11px; }

/* ── Scoring: hole header a bit bigger ─────────────────────────── */
.hole-hdr { margin-bottom: 0.75rem; gap: 0.75rem; }
.hole-badge { width: 56px; height: 60px; border-radius: 15px; }
.hole-badge .hole-lbl { font-size: 0.62rem; }
.hole-badge .hole-num { font-size: 1.8rem; }
.hole-meta .si-big { font-size: 1.45rem; }
.si-pill { font-size: 0.8rem; padding: 0.15rem 0.6rem; }
.hole-sub { font-size: 0.86rem; }
.hole-pager { padding: 0.55rem 0.6rem 0.55rem 0.85rem; font-size: 0.95rem; }
.btn-record, html.light .btn-record { padding: 1rem 1rem; font-size: 1.15rem; border-radius: 18px; }
.btn-back-hole, html.light .btn-back-hole { padding: 0.65rem 0.95rem; font-size: 0.85rem; }

/* ── 3 players: stacked cards, ~60% bigger than the one-row cards ── */
#game-inputs.gi-n3 .gi-card { padding: 0.75rem 0.85rem 0.75rem; margin-bottom: 0.6rem; border-radius: 20px; }
#game-inputs.gi-n3 .gi-top { padding-bottom: 0.55rem; align-items: center; }
#game-inputs.gi-n3 .gi-name { font-size: 1.2rem; }
#game-inputs.gi-n3 .gi-hcp { font-size: 0.86rem; }
#game-inputs.gi-n3 .gi-hcp b { color: var(--white); }
#game-inputs.gi-n3 .gi-hcp-short,
#game-inputs.gi-n3 .gi-prev,
#game-inputs.gi-n3 .gi-calc-lbl { display: none; }
#game-inputs.gi-n3 .gi-calc-val { font-size: 0.92rem; padding: 0.35rem 0.75rem; }
#game-inputs.gi-n3 .gi-score-ctrl { padding-top: 0.6rem; gap: 0.55rem; }
#game-inputs.gi-n3 .gi-arr,
#game-inputs.gi-n3 .gi-pickup-btn { height: 66px; border-radius: 18px; }
#game-inputs.gi-n3 .gi-disc-wrap { position: relative; }
#game-inputs.gi-n3 .gi-score-disc { width: 78px; height: 78px; font-size: 2.1rem; padding-bottom: 12px; }
#game-inputs.gi-n3 .gi-score-disc.is-pickup { font-size: 0.95rem; padding-bottom: 10px; }
#game-inputs.gi-n3 .gi-rel {
  position: absolute;
  left: 0; right: 0; bottom: 11px;
  text-align: center;
  font-size: 0.56rem;
  pointer-events: none;
}

/* Long handicap line only where there's room */
#game-inputs.gi-roomy .gi-hcp-short { display: none; }

/* ── 4 players: one-row cards, ~25% bigger ─────────────────────── */
#game-inputs:not(.gi-roomy) .gi-card { padding: 0.7rem 0.65rem 0.7rem 0.8rem; margin-bottom: 0.55rem; border-radius: 18px; }
#game-inputs:not(.gi-roomy) .gi-name { font-size: 1.12rem; }
#game-inputs:not(.gi-roomy) .gi-hcp { font-size: 0.8rem; }
#game-inputs:not(.gi-roomy) .gi-calc-val { font-size: 0.78rem; padding: 0.22rem 0.55rem; }
#game-inputs:not(.gi-roomy) .gi-score-ctrl { gap: 0.4rem; }
#game-inputs:not(.gi-roomy) .gi-arr,
#game-inputs:not(.gi-roomy) .gi-pickup-btn { width: 46px; height: 62px; border-radius: 16px; }
#game-inputs:not(.gi-roomy) .gi-score-disc { width: 70px; height: 70px; font-size: 1.8rem; padding-bottom: 10px; }
#game-inputs:not(.gi-roomy) .gi-rel { font-size: 0.52rem; bottom: 10px; }

/* Short phones (iPhone SE etc.) — fall back toward the compact sizes */
@media (max-height: 760px) {
  #screen-home .fmt-col { height: 3.05rem; }
  #screen-home .fmt-btn { font-size: 0.92rem; }
  #screen-home .fmt-btn svg { width: 28px; height: 28px; padding: 4px; }
  #screen-home .home-hero-avatar { width: 44px; height: 44px; font-size: 1.05rem; }
  #screen-home .home-hero-title { font-size: 1.6rem; }
  #screen-home .home-hero-identity { margin-bottom: 0.55rem; }
  #screen-home .home-hero-stats { padding: 0.5rem 0.15rem; margin-bottom: 0.55rem; }
  #screen-home .home-hero-stat-value { font-size: 1.3rem; }
  #screen-home .home-round-card { padding: 0.5rem 0.6rem; }
  #screen-home .home-round-icon { width: 36px; height: 36px; }
  .hole-badge { width: 46px; height: 48px; }
  .hole-badge .hole-num { font-size: 1.45rem; }
  .hole-hdr { margin-bottom: 0.45rem; }
  .btn-record, html.light .btn-record { padding: 0.7rem 1rem; }
  #game-inputs.gi-n3 .gi-card { padding: 0.5rem 0.7rem; margin-bottom: 0.4rem; }
  #game-inputs.gi-n3 .gi-arr,
  #game-inputs.gi-n3 .gi-pickup-btn { height: 52px; }
  #game-inputs.gi-n3 .gi-score-disc { width: 62px; height: 62px; font-size: 1.6rem; padding-bottom: 9px; }
  #game-inputs.gi-n3 .gi-rel { bottom: 8px; font-size: 0.48rem; }
  #game-inputs:not(.gi-roomy) .gi-card { padding-top: 0.4rem; padding-bottom: 0.4rem; margin-bottom: 0.35rem; }
  #game-inputs:not(.gi-roomy) .gi-arr,
  #game-inputs:not(.gi-roomy) .gi-pickup-btn { width: 42px; height: 48px; }
  #game-inputs:not(.gi-roomy) .gi-score-disc { width: 54px; height: 54px; font-size: 1.4rem; padding-bottom: 9px; }
  #game-inputs:not(.gi-roomy) .gi-rel { bottom: 8px; font-size: 0.46rem; }
}

/* Fit tuning (20261010p) */
#screen-home .fmt-col { height: 3.85rem; }
#screen-home .fmt-stack { gap: 0.5rem; }
#screen-home .home-hero-identity { margin-bottom: 0.7rem; }
#screen-home .home-hero-avatar { width: 52px; height: 52px; }
#screen-home .home-hero-title { font-size: 2rem; }
#screen-home .home-hero-stats { padding: 0.6rem 0.2rem; margin-bottom: 0.65rem; }
#screen-home .home-hero-stat-value { font-size: 1.55rem; }
#screen-home .home-round-card { padding: 0.6rem 0.7rem; }
#screen-home .home-hero { padding-bottom: 0.95rem; margin-bottom: 0.75rem; }

#game-inputs.gi-n3 .gi-card { padding: 0.6rem 0.8rem; margin-bottom: 0.5rem; }
#game-inputs.gi-n3 .gi-top { padding-bottom: 0.4rem; }
#game-inputs.gi-n3 .gi-score-ctrl { padding-top: 0.45rem; }
#game-inputs.gi-n3 .gi-arr,
#game-inputs.gi-n3 .gi-pickup-btn { height: 58px; }
#game-inputs.gi-n3 .gi-score-disc { width: 70px; height: 70px; font-size: 1.95rem; padding-bottom: 11px; }
#game-inputs.gi-n3 .gi-rel { bottom: 10px; }
.hole-hdr { margin-bottom: 0.6rem; }
.btn-record, html.light .btn-record { padding: 0.9rem 1rem; }

@media (max-height: 760px) {
  #screen-home .fmt-col { height: 2.85rem; }
  #screen-home .home-hero-title { font-size: 1.5rem; }
  #screen-home .home-hero-avatar { width: 42px; height: 42px; }
  #screen-home .home-hero-stat-value { font-size: 1.2rem; }
  #screen-home .home-round-course { font-size: 0.92rem; }
  #screen-home .home-section-label { margin-bottom: 0.4rem; }
  #screen-home .fmt-stack { gap: 0.4rem; }
}
#screen-home .fmt-col { height: 4.1rem; }
#game-inputs:not(.gi-roomy) .gi-card { padding-top: 0.8rem; padding-bottom: 0.8rem; }
#game-inputs:not(.gi-roomy) .gi-arr,
#game-inputs:not(.gi-roomy) .gi-pickup-btn { height: 74px; width: 50px; }
#game-inputs:not(.gi-roomy) .gi-score-disc { width: 80px; height: 80px; font-size: 2rem; padding-bottom: 12px; }
#game-inputs:not(.gi-roomy) .gi-rel { font-size: 0.56rem; bottom: 11px; }
#game-inputs:not(.gi-roomy) .gi-name { font-size: 1.18rem; }
#game-inputs:not(.gi-roomy) .gi-hcp { font-size: 0.84rem; }
#game-inputs:not(.gi-roomy) .gi-calc-val { font-size: 0.82rem; }
@media (max-height: 760px) {
  #screen-home .fmt-col { height: 2.85rem; }
  #game-inputs:not(.gi-roomy) .gi-card { padding-top: 0.3rem; padding-bottom: 0.3rem; margin-bottom: 0.3rem; }
  #game-inputs:not(.gi-roomy) .gi-arr,
  #game-inputs:not(.gi-roomy) .gi-pickup-btn { width: 42px; height: 48px; }
  #game-inputs:not(.gi-roomy) .gi-score-disc { width: 54px; height: 54px; font-size: 1.4rem; }
  #game-inputs:not(.gi-roomy) .gi-name { font-size: 1rem; }
  #game-inputs:not(.gi-roomy) .gi-hcp { font-size: 0.74rem; }
  #game-inputs:not(.gi-roomy) .gi-calc-val { font-size: 0.72rem; }
}
/* 4 players: narrower stepper so names and the net pill have room */
#game-inputs:not(.gi-roomy) .gi-score-ctrl { gap: 0.3rem; }
#game-inputs:not(.gi-roomy) .gi-arr { width: 44px; height: 70px; }
#game-inputs:not(.gi-roomy) .gi-pickup-btn { width: 46px; height: 70px; font-size: 0.56rem; }
#game-inputs:not(.gi-roomy) .gi-score-disc { width: 72px; height: 72px; font-size: 1.85rem; padding-bottom: 11px; }
#game-inputs:not(.gi-roomy) .gi-rel { font-size: 0.52rem; bottom: 10px; }
#game-inputs:not(.gi-roomy) .gi-card { padding-left: 0.7rem; padding-right: 0.55rem; gap: 0.4rem; }
#game-inputs:not(.gi-roomy) .gi-name { font-size: 1.08rem; }
#game-inputs:not(.gi-roomy) .gi-calc-val { font-size: 0.76rem; padding: 0.2rem 0.45rem; }
@media (max-height: 760px) {
  #game-inputs:not(.gi-roomy) .gi-arr,
  #game-inputs:not(.gi-roomy) .gi-pickup-btn { width: 42px; height: 48px; }
  #game-inputs:not(.gi-roomy) .gi-score-disc { width: 54px; height: 54px; font-size: 1.4rem; padding-bottom: 9px; }
  #game-inputs:not(.gi-roomy) .gi-rel { font-size: 0.46rem; bottom: 8px; }
}
/* Idle round card text */
#screen-home .home-round-card.is-idle .home-round-status { font-size: 1rem; }
#screen-home .home-round-card.is-idle .home-round-course { font-size: 0.86rem; -webkit-line-clamp: 1; }

/* ================================================================
   STITCH STYLE — APP-WIDE (build 20261010q)
   Carries the home/scoring look to every screen: Plus Jakarta Sans,
   Playfair headings, white rounded cards, green+gold buttons.
   ================================================================ */

/* Uppercase labels: Jakarta is wider than the old condensed face */
.btn, .btn-setup-next, .btn-play, .bottom-nav-label, .holes-btn, .tab-btn {
  letter-spacing: 0.03em;
}

/* ── Screen heroes (setup, history, friends, profile, etc.) ────── */
.home-hero-title {
  font-family: var(--font-display);
  letter-spacing: -0.005em;
}
.home-hero-club {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: #d4a843;
}
.home-hero-top .btn,
.home-hero-top button {
  border-radius: 12px;
  font-family: var(--font-ui);
}

/* Game code pill — shown in hero banners when a code is active */
.hero-game-code-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(72,187,120,0.25);
  border: 1px solid rgba(72,187,120,0.55);
  border-radius: 0.4rem;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  line-height: 1.4;
  white-space: nowrap;
}

/* Leaderboard screen hero — same green + gold glow */
.lb-hero {
  background:
    radial-gradient(110% 80% at 100% 0%, rgba(212,168,67,0.16) 0%, rgba(212,168,67,0) 55%),
    linear-gradient(165deg, #24503a 0%, #163a28 50%, #0f2a1c 100%);
  border-radius: 0 0 24px 24px;
  box-shadow: 0 10px 26px rgba(15,42,28,0.28);
}
.lb-hero .home-hero-title { color: #fff; }
.lb-hero-names { background: rgba(6,20,13,0.45); border-radius: 14px; margin: 0 0.75rem 0.75rem; }

/* ── Cards ─────────────────────────────────────────────────────── */
.card,
html.light .card {
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 22px rgba(20,40,28,0.07);
  padding: 1.1rem 1.1rem;
}
html.light .card { background: #fff; }

.card-title,
html.light .card-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--white);
  justify-content: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.card-title::before {
  content: '';
  width: 4px; height: 15px;
  border-radius: 3px;
  background: linear-gradient(180deg, #e2bb5e, #b8892f);
  flex-shrink: 0;
}

/* Form labels */
label, .form-label, .field-label {
  font-family: var(--font-ui);
}

/* ── Inputs ────────────────────────────────────────────────────── */
input:not([type="checkbox"]):not([type="radio"]),
select, textarea {
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.98rem;
}
html.light input:not([type="checkbox"]):not([type="radio"]),
html.light select,
html.light textarea {
  background: #fff;
  border-color: rgba(20,40,28,0.16);
}
input:focus, select:focus, textarea:focus {
  border-color: #c9993a !important;
  box-shadow: 0 0 0 3px rgba(212,168,67,0.18);
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn { border-radius: 14px; font-family: var(--font-ui); font-weight: 800; }
.btn-primary {
  background: linear-gradient(180deg, #e2bb5e, #c9993a);
  color: #1a1206;
  box-shadow: 0 2px 10px rgba(212,168,67,0.3);
}
.btn-green,
.btn-play,
.btn-setup-next,
html.light .btn-setup-next,
html.light .btn-play,
html.light .btn-green {
  background: linear-gradient(180deg, #24503a, #163a28);
  color: #fff;
  border: 1px solid rgba(212,168,67,0.45);
  border-radius: 18px;
  font-family: var(--font-ui);
  font-weight: 800;
  box-shadow: 0 0 0 3px rgba(212,168,67,0.1), 0 8px 20px rgba(22,58,40,0.28);
}
.btn-setup-next, .btn-play { font-size: 1.08rem; padding: 1rem; }
.btn-outline,
html.light .btn-outline {
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--white);
}
html.light .btn-outline { background: #fff; }
.btn-ghost { border-radius: 12px; }
.btn-danger { border-radius: 14px; }

/* ── Modals ────────────────────────────────────────────────────── */
.modal-box {
  border-radius: 24px;
  border-color: var(--border);
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
html.light .modal-box { background: #fff; }
.modal-box.gold-border { border-color: rgba(212,168,67,0.5); }
.modal-title { font-family: var(--font-display); font-weight: 700; letter-spacing: 0; }
.btn-close { border-radius: 12px; }

/* ── Bottom nav ────────────────────────────────────────────────── */
.bottom-nav { border-top: 1px solid var(--border); box-shadow: 0 -6px 20px rgba(20,40,28,0.06); }
.bottom-nav-label { font-family: var(--font-ui); font-weight: 700; font-size: 0.66rem; }

/* In-game bottom bar buttons */
.game-bar-btn { font-family: var(--font-ui); border-radius: 14px; }

/* Uniform card titles on every screen */
#screen-friends .card-title, #screen-profile .card-title,
#screen-setup-course .card-title, #screen-setup-review .card-title,
.screen .card-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  font-weight: 700;
}

/* Toggle groups (18 / Front 9 / Back 9 etc.) — green selected, white others */
.holes-btn, html.light .holes-btn { border-radius: 14px; font-family: var(--font-ui); }
html.light .holes-btn { background: #fff; }
.holes-btn.active,
html.light .holes-btn.active {
  background: linear-gradient(180deg, #24503a, #163a28);
  border-color: rgba(212,168,67,0.55);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(212,168,67,0.1), 0 4px 12px rgba(22,58,40,0.25);
}

/* Leaderboard table in a white card */
#leaderboard-table:not(:empty) {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 22px rgba(20,40,28,0.07);
  overflow: hidden;
  padding: 0.25rem 0.35rem;
}
#leaderboard-table table { width: 100%; }
#leaderboard-table:not(:empty) { margin-top: 0.85rem; }
