html, body {
  touch-action: manipulation;
  -ms-touch-action: manipulation;
  overscroll-behavior: none;
}

:root {
  --bg: #07140d;
  --bg-mid: #0f2418;
  --bg-elev: #173526;
  --card: #f4f6fa;
  --card-border: #d5dde8;
  --line: #2a5a40;
  --text: #f8fafc;
  --text-on-card: #0f172a;
  --muted: #a8c4b4;
  --muted-on-card: #475569;
  --red: #e11d2e;
  --red-dark: #b9101f;
  --blue: #1f7a45;
  --blue-bright: #2f9e5c;
  --white: #ffffff;
  --silver: #e2e8f0;
  --gold: #c9a227;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --tap: 52px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 100% 70% at 100% 0%, rgba(31, 122, 69, 0.38) 0%, transparent 50%),
    radial-gradient(ellipse 90% 60% at 0% 10%, rgba(201, 162, 39, 0.16) 0%, transparent 55%),
    linear-gradient(180deg, #0f2418 0%, var(--bg) 45%);
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(12px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
}

#screens {
  flex: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  font-size: 1.6rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.4));
}

.brand h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
  font-weight: 800;
  color: var(--white);
}

.screen h2 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--white);
}

.sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.course-meta {
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.hidden { display: none !important; }

.size-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.size-btn,
.choice-btn {
  min-height: var(--tap);
  border: 2px solid rgba(255,255,255,0.18);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text-on-card);
  font-size: 1.35rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.size-btn:active,
.choice-btn:active,
.btn:active,
.score-entry button:active {
  transform: scale(0.97);
}

.size-btn:hover,
.choice-btn:hover,
.size-btn.selected,
.choice-btn.selected {
  border-color: var(--blue);
  background: #e8f6ee;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.25);
}

.choice-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice-btn {
  font-size: 1.15rem;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

a.choice-btn { text-decoration: none; color: inherit; }

.choice-btn .choice-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-on-card);
}

.choice-btn .choice-note {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted-on-card);
}

#holes-choice .choice-btn,
#nine-side .choice-btn {
  align-items: center;
  text-align: center;
}

.nine-side { margin-top: 22px; }

.names-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.player-row {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 10px;
  align-items: end;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.name-field label,
.tee-field label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted-on-card);
  margin-bottom: 6px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.name-field input,
.tee-select {
  width: 100%;
  min-height: var(--tap);
  border-radius: 12px;
  border: 2px solid #cbd5e1;
  background: var(--white);
  color: var(--text-on-card);
  font-size: 1.05rem;
  padding: 0 12px;
  outline: none;
}

.name-field input:focus,
.tee-select:focus {
  border-color: var(--blue);
}

.tee-select {
  font-weight: 800;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

.nav-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  min-height: var(--tap);
  border-radius: 12px;
  border: none;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 0 18px;
  cursor: pointer;
  flex: 1;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
}

.btn-primary:hover { background: var(--red-dark); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid rgba(255,255,255,0.28);
  flex: 0 0 auto;
  min-width: 96px;
}

.btn-ghost {
  background: rgba(255,255,255,0.08);
  color: var(--muted);
  border: 1px solid rgba(255,255,255,0.2);
  flex: 0 0 auto;
  min-height: 40px;
  font-size: 0.9rem;
  padding: 0 12px;
}

.score-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.score-header-text { flex: 1; min-width: 0; }

.player-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.player-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  padding: 6px 10px 6px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--white);
}

.tee-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.55);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

.tee-dot.tee-Blue {
  background: var(--blue-bright);
  border-color: #93c5fd;
}
.tee-dot.tee-White {
  background: var(--white);
  border-color: #94a3b8;
}
.tee-dot.tee-Red {
  background: var(--red);
  border-color: #fecaca;
}
.tee-dot.tee-Gold {
  background: var(--gold);
  border-color: #fde68a;
}

.badge-name { color: var(--white); }
.badge-tee {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.total-pill {
  background: var(--card);
  border: 2px solid var(--red);
  border-radius: 14px;
  padding: 10px 14px;
  text-align: center;
  min-width: 88px;
  box-shadow: var(--shadow);
}

.total-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-on-card);
  font-weight: 800;
}

.total-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--blue);
  line-height: 1.1;
}

.vs-par {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--red);
  min-height: 1.1em;
}

.score-table-wrap {
  border-radius: var(--radius);
  overflow: hidden;
}

.score-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hole-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px 12px 10px;
  box-shadow: var(--shadow);
  color: var(--text-on-card);
}

.hole-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.hole-id {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hole-num {
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--blue);
}

.par-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-on-card);
  background: var(--silver);
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 10px;
  width: fit-content;
}

.yds-line {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #dbe3ee;
  color: var(--muted-on-card);
  font-size: 0.82rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.score-entry {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  justify-content: center;
}

.score-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.score-entry button {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 2px solid #cbd5e1;
  background: var(--white);
  color: var(--text-on-card);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.score-entry button.dec { border-color: var(--blue); color: var(--blue); }
.score-entry button.inc { border-color: var(--red); color: var(--red); }

.score-entry button:hover { background: #eef2ff; }

.score-input {
  width: 56px;
  height: 48px;
  text-align: center;
  border-radius: 12px;
  border: 2px solid #94a3b8;
  background: var(--white);
  color: var(--text-on-card);
  font-size: 1.3rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  outline: none;
}

.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.score-input:focus { border-color: var(--blue); }

.score-result {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-height: 1em;
  line-height: 1.1;
  color: var(--muted-on-card);
}

/* Under par — red circle (classic card) */
.score-mark-under .score-input {
  border-color: var(--red);
  background: #fee2e2;
  color: var(--red-dark);
  border-radius: 999px;
}
.score-mark-eagle .score-input,
.score-mark-albatross .score-input {
  border-color: var(--red-dark);
  box-shadow: inset 0 0 0 2px rgba(185, 16, 31, 0.35);
  background: #fecaca;
}
.score-mark-birdie .score-input {
  border-color: #f87171;
  background: #fee2e2;
}
.score-mark-under .score-result { color: var(--red-dark); }

/* Par — blue square */
.score-mark-par .score-input {
  border-color: var(--blue);
  background: #dbeafe;
  color: #1e3a8a;
  border-radius: 10px;
}
.score-mark-par .score-result { color: var(--blue); }

/* Over par — navy outline square */
.score-mark-over .score-input {
  border-color: #334155;
  background: #f1f5f9;
  color: #0f172a;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px #64748b;
}
.score-mark-bogey .score-input { border-color: #475569; }
.score-mark-double .score-input,
.score-mark-triple .score-input,
.score-mark-other .score-input {
  border-color: #1e293b;
  box-shadow: inset 0 0 0 2px #64748b;
}
.score-mark-over .score-result { color: #334155; }

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

@media (min-width: 420px) {
  .size-grid { grid-template-columns: repeat(5, 1fr); }
}


.app-footer {
  margin-top: auto;
  padding-top: 20px;
  text-align: center;
}

.app-footer a {
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  padding-bottom: 1px;
}

.app-footer a:hover {
  color: #e2e8f0;
  border-bottom-color: #e11d2e;
}

/* no-zoom */
button, a, input, select, textarea, .hole-row, .stepper {
  touch-action: manipulation;
}

.tee-dot.tee-Gold { background: #d4af37 !important; border: 1px solid #8a7010; }
.tee-dot.tee-Black { background: #111 !important; border: 1px solid #555; }
.tee-dot.tee-White { background: #f5f5f5 !important; border: 1px solid #999; }

/* Course search + logos + GPS + finish/email */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.course-search-wrap {
  margin-bottom: 14px;
}

#course-search {
  width: 100%;
  min-height: var(--tap);
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.08);
  color: var(--white);
  font-size: 1.05rem;
  padding: 0 14px;
  outline: none;
}

#course-search::placeholder { color: var(--muted); }
#course-search:focus { border-color: var(--blue-bright); background: rgba(255,255,255,0.12); }

.gps-status,
.course-status {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.gps-status.gps-ok { color: #86efac; }
.gps-status.gps-warn,
.course-status.error { color: #fca5a5; }

.course-btn {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px;
  text-align: left;
}

.course-btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.course-logo-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid #dbe3ef;
}

.course-logo-wrap.logo-fallback {
  background: #e8eef8;
  font-size: 1.25rem;
}

.course-logo,
.score-logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.choice-dist {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  margin-top: 2px;
}

.choice-dist.muted { color: var(--muted-on-card); font-weight: 600; }

.source-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  vertical-align: middle;
  margin-left: 4px;
}

.source-badge.local {
  background: #dcfce7;
  color: #166534;
}

.course-stub {
  opacity: 0.75;
  cursor: default;
}

.paste-scorecard {
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.paste-scorecard summary {
  cursor: pointer;
  color: var(--silver);
  font-weight: 700;
  margin-bottom: 8px;
}

.paste-scorecard textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.25);
  color: var(--white);
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  margin-bottom: 8px;
  resize: vertical;
}

.score-course-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.35);
  margin-right: 2px;
}

.tee-dot.tee-Black {
  background: #111;
  border-color: #94a3b8;
}

.finish-bar {
  margin-top: 18px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.22);
}

.finish-title {
  margin: 0 0 10px;
  font-weight: 800;
  color: #86efac;
}

.email-to-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 6px;
}

#email-to {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: var(--white);
  padding: 0 12px;
  font-size: 1rem;
  margin-bottom: 10px;
}

.finish-actions {
  display: flex;
  gap: 10px;
}

.finish-actions .btn { flex: 1; }

.build-tag{font-size:.7rem;font-weight:700;opacity:.75;margin-left:6px;color:#4a90e2}


.scorecard-share-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(5, 12, 24, 0.88);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: calc(12px + var(--safe-top)) 12px calc(12px + var(--safe-bottom));
  box-sizing: border-box;
}

.scorecard-share-sheet {
  width: min(720px, 100%);
  max-height: 100%;
  overflow: auto;
  background: #0f1c33;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scorecard-share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scorecard-share-head h3 {
  margin: 0;
  color: var(--white);
  font-size: 1.1rem;
}

.scorecard-share-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

.scorecard-share-img {
  width: 100%;
  border-radius: 12px;
  background: #fff;
  display: block;
}

.scorecard-share-actions {
  display: flex;
  gap: 10px;
}

.scorecard-share-actions .btn { flex: 1; }


/* --- v5: header links, team name, results flights --- */

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.team-name-row {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.team-name-row .name-field input {
  font-weight: 800;
}

.finish-actions-secondary {
  margin-top: 10px;
}

.post-status {
  margin: 10px 0 0;
  color: #86efac;
  font-size: 0.9rem;
  line-height: 1.35;
  min-height: 1.2em;
}

.post-results-link {
  color: #93c5fd;
  font-weight: 700;
}

.results-header h2 {
  margin: 0 0 6px;
}

.results-empty {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}

.results-empty-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--white);
}

.results-empty .btn {
  margin-top: 8px;
  display: inline-flex;
  width: auto;
  min-width: 180px;
}

.flight-card {
  margin: 0 0 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.flight-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background:
    linear-gradient(90deg, rgba(225,29,46,0.92) 0%, rgba(255,255,255,0.95) 48%, rgba(29,78,216,0.95) 100%);
}

.flight-card-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  color: #0a1628;
  letter-spacing: 0.02em;
}

.flight-count {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0a1628;
  background: rgba(255,255,255,0.7);
  border-radius: 999px;
  padding: 4px 10px;
}

.flight-empty {
  margin: 0;
  padding: 16px;
  color: var(--muted);
}

.flight-podium {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

.flight-also {
  padding: 0 14px 14px;
  border-top: 1px dashed rgba(255,255,255,0.14);
}

.also-label {
  margin: 12px 0 8px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.result-team {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--card);
  color: var(--text-on-card);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--card-border);
}

.result-team.podium.place-1st {
  border-color: #e11d2e;
  box-shadow: 0 0 0 2px rgba(225, 29, 46, 0.25);
}

.result-team.podium.place-2nd {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.22);
}

.result-team.also-ran {
  background: rgba(244, 246, 250, 0.92);
  opacity: 0.95;
}

.result-place-badge {
  min-width: 58px;
  text-align: center;
  font-weight: 900;
  font-size: 0.85rem;
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--white);
  background: #64748b;
}

.result-place-badge.place-1st {
  background: linear-gradient(135deg, #e11d2e, #b9101f);
}

.result-place-badge.place-2nd {
  background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
}

.result-place-badge.place-other {
  background: #334155;
  font-size: 0.78rem;
}

.result-team-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-on-card);
}

.result-players {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted-on-card);
  line-height: 1.3;
}

.playoff-note {
  margin: 6px 0 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1d4ed8;
}

.result-score {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.result-total {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text-on-card);
  line-height: 1;
}

.result-vs {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--blue);
}


/* --- v6: tournaments list + team page links (no modal) --- */

.result-team-link {
  color: #1d4ed8;
  text-decoration: underline;
  text-decoration-color: rgba(225, 29, 46, 0.55);
  text-underline-offset: 3px;
  font-weight: 800;
  font-size: inherit;
}

.result-team-link:hover,
.result-team-link:focus-visible {
  color: #e11d2e;
  text-decoration-color: #1d4ed8;
  outline: none;
}

.tournament-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tournament-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--card);
  color: var(--text-on-card);
  border: 1px solid var(--card-border);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.tournament-card:hover,
.tournament-card:focus-visible {
  border-color: rgba(29, 78, 216, 0.55);
  outline: none;
}

.tournament-card-main {
  min-width: 0;
  flex: 1;
}

.tournament-date {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-on-card);
}

.tournament-meta {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted-on-card);
  font-weight: 650;
}

.tournament-name {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--blue);
  font-weight: 700;
}

.tournament-chevron {
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--blue);
  line-height: 1;
}

.team-page-header {
  margin-bottom: 12px;
}

.team-back {
  margin: 0 0 8px;
}

.team-back a {
  color: #93c5fd;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.team-back a:hover {
  color: #fff;
  text-decoration: underline;
}

.team-page-title {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--white);
}

.team-page-meta {
  margin: 6px 0 0;
}

.team-scorecard-table {
  margin-top: 12px;
}

.scorecard-players {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.scorecard-summary {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  gap: 8px 10px;
  background: var(--card);
  color: var(--text-on-card);
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--card-border);
}

.scorecard-summary-total {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}

.scorecard-summary-vs {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--blue);
}

.scorecard-summary-label {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-on-card);
}

.scorecard-table-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
}

.scorecard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.scorecard-table th,
.scorecard-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.scorecard-table th {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background:
    linear-gradient(90deg, rgba(225,29,46,0.35) 0%, rgba(255,255,255,0.08) 48%, rgba(29,78,216,0.35) 100%);
}

.scorecard-table td {
  color: var(--text);
  font-weight: 650;
}

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

.scorecard-empty {
  text-align: center;
  color: var(--muted);
  font-weight: 500;
}

.scorecard-table .mark-eagle { color: #fbbf24; font-weight: 800; }
.scorecard-table .mark-birdie { color: #86efac; font-weight: 800; }
.scorecard-table .mark-par { color: var(--muted); }
.scorecard-table .mark-bogey { color: #fca5a5; font-weight: 800; }
.scorecard-table .mark-double { color: #f87171; font-weight: 900; }


.result-team {
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.result-team:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(10, 22, 40, 0.18);
}
.view-scorecard-hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.view-scorecard-hint a {
  color: #1d4ed8;
  text-decoration: none;
}
.view-scorecard-hint a:hover,
.view-scorecard-hint a:focus-visible {
  color: #e11d2e;
  text-decoration: underline;
  outline: none;
}

.team-graphic-host {
  margin: 14px 0 8px;
}
.team-graphic-label,
.team-text-scorecard-label {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.team-graphic-scorecard {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  background: #0a1628;
}
.team-graphic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}


.btn-scorecard-link {
  display: inline-block;
  margin-top: 4px;
  padding: 6px 12px !important;
  font-size: 0.8rem !important;
  text-decoration: none !important;
}
.result-team-link {
  color: #1d4ed8 !important;
  text-decoration: underline !important;
  text-decoration-thickness: 2px;
  font-weight: 800;
}
.result-score-link {
  display: inline-block;
  margin-top: 6px;
  color: #1d4ed8;
  font-weight: 900;
  text-decoration: none;
  font-size: 1.1rem;
}

/* Auth bar + club/my tournament tabs (v7) */
.auth-bar {
  margin: -8px 0 16px;
}
.auth-lead {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px;
  padding: 12px;
}
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 2px solid #cbd5e1;
  background: var(--white);
  color: var(--text-on-card);
  font-size: 1rem;
  padding: 0 12px;
  outline: none;
}
.auth-form input:focus {
  border-color: var(--blue);
}
.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.auth-actions .btn {
  flex: 1 1 auto;
  min-height: 44px;
  font-size: 0.92rem;
}
.auth-status {
  margin: 0;
  min-height: 1.1em;
  font-size: 0.82rem;
  color: #86efac;
}
.auth-status.auth-error {
  color: #fca5a5;
}
.auth-signedin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 12px;
  padding: 8px 10px;
}
.auth-who {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--white);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
}
.board-tab {
  flex: 1;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
}
.board-tab.active {
  background: var(--card);
  color: var(--text-on-card);
  border-color: var(--blue);
}
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #86efac;
  margin-right: 6px;
  box-shadow: 0 0 0 3px rgba(134, 239, 172, 0.25);
}
.post-login-hint {
  color: #fde68a;
  font-size: 0.85rem;
  margin: 8px 0 0;
}


/* --- v7.1 organizer desk + live totals board --- */
.start-hole-note {
  margin: 0 0 8px;
  color: #86efac;
  font-size: 0.9rem;
  font-weight: 800;
}
.live-scores-banner {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}
.live-scores-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--red);
  color: var(--white);
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
}
.live-scores-link:hover { background: var(--red-dark); }
.live-scores-hint {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.org-desk { max-width: 560px; }
.org-gate .sub { max-width: 36em; }
.org-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 16px;
  padding: 16px;
  margin: 0 0 16px;
}
.org-card h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}
.org-form { display: flex; flex-direction: column; gap: 12px; }
.org-field label,
.org-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.org-field input,
.org-field select {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 2px solid #cbd5e1;
  background: var(--white);
  color: var(--text-on-card);
  font-size: 1.05rem;
  padding: 0 12px;
  outline: none;
}
.org-field input:focus,
.org-field select:focus { border-color: var(--blue); }
.org-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.org-player-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.org-holes-choice { margin: 0; }
.org-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.org-chip {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.08);
  color: var(--white);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}
.org-chip.selected {
  background: var(--card);
  color: var(--text-on-card);
  border-color: var(--blue);
}
.org-team-list { display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; }
.org-team-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  background: var(--card);
  color: var(--text-on-card);
  border-radius: 14px;
  padding: 12px;
}
.org-team-item-main { min-width: 0; flex: 1; }
.org-team-item-main strong { display: block; font-size: 1.05rem; }
.org-start-pill {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--blue);
}
.org-team-players {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--muted-on-card);
}
.org-team-item-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
}
.org-team-item-actions .btn { min-height: 36px; font-size: 0.8rem; color: var(--text-on-card); border-color: #cbd5e1; }
.org-status {
  margin: 8px 0 0;
  min-height: 1.1em;
  font-size: 0.85rem;
  color: #86efac;
}
.org-url-row { margin: 0 0 12px; }
.org-url {
  color: #93c5fd;
  font-weight: 700;
  word-break: break-all;
}
.org-handout .sub { margin-bottom: 6px; }

.live-legend {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}
.live-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.live-row {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto auto;
  align-items: center;
  gap: 10px;
  background: var(--card);
  color: var(--text-on-card);
  border-radius: 14px;
  padding: 12px 14px;
  min-height: 52px;
}
.live-rank {
  font-weight: 900;
  color: var(--muted-on-card);
}
.live-name {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-total {
  font-weight: 900;
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}
.live-vs {
  min-width: 2.2rem;
  text-align: right;
  font-weight: 800;
  color: var(--muted-on-card);
  font-variant-numeric: tabular-nums;
}
.live-empty {
  color: var(--muted);
  padding: 12px 0;
}
@media (max-width: 380px) {
  .org-row-2,
  .org-player-row { grid-template-columns: 1fr; }
}


/* --- v7.2 single play + start hole + Ironsmith green --- */
#format-choice .choice-btn,
#org-format-choice .choice-btn {
  align-items: flex-start;
  text-align: left;
}
.start-hole-grid {
  grid-template-columns: repeat(6, 1fr);
  margin-bottom: 16px;
}
.start-hole-grid .size-btn {
  font-size: 1.1rem;
  min-height: 48px;
}
.signed-player {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(47, 158, 92, 0.18);
  border: 1px solid rgba(47, 158, 92, 0.45);
  color: #d1fae5;
  font-weight: 700;
  line-height: 1.4;
}
.signed-player .signed-email {
  display: block;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
}
.org-format-pill {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #86efac;
}
#org-teams-card.is-single #btn-player-add,
#org-teams-card.is-single #org-team-name-field {
  display: none;
}

#name-fields .player-row:not(:has(.name-field)) {
  grid-template-columns: 1fr;
}

/* --- v7.5 organizer calendar, schedule, optional divisions, profile --- */
.org-cal { margin: 12px 0 16px; }
.org-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.org-cal-label {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--white);
}
.org-cal-btn {
  flex: 0 0 auto;
  min-width: 48px;
  min-height: 48px;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0;
}
.org-cal-dows,
.org-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.org-cal-dows { margin-bottom: 4px; }
.org-cal-dows span {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 0;
}
.org-cal-day {
  position: relative;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--white);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 6px 2px 12px;
}
.org-cal-day.muted { opacity: 0.38; }
.org-cal-day.today { border-color: var(--gold); }
.org-cal-day.selected {
  background: var(--card);
  color: var(--text-on-card);
  border-color: var(--blue);
}
.org-cal-day.in-span {
  background: rgba(47, 158, 92, 0.2);
  border-color: rgba(47, 158, 92, 0.4);
}
.org-cal-day.in-series::before {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #93c5fd;
}
.org-cal-day.span-active {
  box-shadow: 0 0 0 2px rgba(47, 158, 92, 0.45);
}
.org-cal-day.has-event.selected { border-color: var(--blue); }
.org-cal-num { display: block; }
.org-cal-dot {
  display: block;
  width: 6px;
  height: 6px;
  margin: 4px auto 0;
  border-radius: 50%;
  background: #86efac;
}
.org-cal-day.selected .org-cal-dot { background: var(--blue); }
.org-cal-count {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  color: #86efac;
  line-height: 1;
  margin-top: 2px;
}
.org-cal-day.selected .org-cal-count { color: var(--blue); }

.org-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.org-choice-grid .choice-btn {
  min-height: 48px;
  padding: 8px 6px;
  font-size: 0.82rem;
  text-align: center;
  align-items: center;
  justify-content: center;
}
.org-div-choice {
  grid-template-columns: repeat(2, 1fr);
}
.org-div-tee-choice {
  grid-template-columns: repeat(3, 1fr);
}
#org-coed-tee-hint { margin: 0 0 8px; }
.org-sched-extra { display: flex; flex-direction: column; gap: 10px; }
.org-sched-hint { margin: 0; color: var(--muted); font-size: 0.82rem; }
.org-field textarea {
  width: 100%;
  min-height: 88px;
  border-radius: 12px;
  border: 2px solid #cbd5e1;
  background: var(--white);
  color: var(--text-on-card);
  font-size: 1rem;
  padding: 10px 12px;
  outline: none;
  font-family: inherit;
  resize: vertical;
}
.org-field textarea:focus { border-color: var(--blue); }
.org-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
  text-transform: none;
  letter-spacing: 0;
}
.org-check-label input { width: 20px; height: 20px; accent-color: var(--blue); }
.org-bracket-row,
.org-tee-rule-row {
  display: grid;
  grid-template-columns: 1fr 70px 70px 40px;
  gap: 6px;
  margin: 0 0 8px;
  align-items: center;
}
.org-tee-rule-row { grid-template-columns: 64px 64px 1fr 1fr 40px; }
.org-bracket-row input,
.org-tee-rule-row input,
.org-tee-rule-row select {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 2px solid #cbd5e1;
  background: var(--white);
  color: var(--text-on-card);
  font-size: 0.92rem;
  padding: 0 8px;
}
.org-br-del, .org-tr-del { min-width: 40px; min-height: 44px; padding: 0; }
.org-player-block { display: flex; flex-direction: column; gap: 8px; }
.org-player-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.org-need-age, .org-need-gender { display: none; }
#org-teams-card.show-age .org-need-age { display: block; }
#org-teams-card.show-gender .org-need-gender { display: block; }
#org-teams-card:not(.show-age):not(.show-gender) .org-player-meta { grid-template-columns: 1fr; }
#org-teams-card.show-age:not(.show-gender) .org-player-meta,
#org-teams-card.show-gender:not(.show-age) .org-player-meta { grid-template-columns: 1fr 1fr; }
.org-div-head {
  margin: 12px 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #86efac;
}
.org-day1-row { margin: 0 0 10px; }
.org-day1-row .btn { flex: 1; }

.auth-optional { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.auth-optional-lead, .auth-optional-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.auth-optional-details { color: var(--muted); font-size: 0.85rem; }
.auth-optional-details summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.auth-form input[type="date"],
.auth-form input[type="number"],
.auth-form select {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 2px solid #cbd5e1;
  background: var(--white);
  color: var(--text-on-card);
  font-size: 1rem;
  padding: 0 12px;
  outline: none;
}
.auth-signedin-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.auth-profile-panel { margin-top: 8px; }
@media (max-width: 380px) {
  .org-player-meta,
  .org-tee-rule-row,
  .org-bracket-row { grid-template-columns: 1fr 1fr; }
  .org-br-del, .org-tr-del { grid-column: 1 / -1; }
}
