:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-nav: #064e3b;
  --text-nav: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --brand-green: #064e3b;
  --brand-green-light: #059669;
  --gold-accent: #b45309;
  --gold-bright: #d97706;
  --gold-pill-bg: #fef3c7;
  --border-color: #e2e8f0;
  --border-card: #cbd5e1;
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.06);

  /* Golf Score Colors */
  --color-albatross: #7e22ce;
  --color-eagle: #b45309;
  --color-birdie: #dc2626;
  --color-par: #047857;
  --color-bogey: #2563eb;
  --color-double: #1d4ed8;
  --color-triple: #475569;
}

[data-theme="dark"] {
  --bg-page: #061e13;
  --bg-card: #0c2b1d;
  --bg-card-subtle: #09281b;
  --bg-nav: #092c1c;
  --text-nav: #ffffff;
  --text-main: #f0f7f4;
  --text-muted: #8ba89b;
  --text-subtle: #64748b;
  --brand-green: #10b981;
  --brand-green-light: #34d399;
  --gold-accent: #d4af37;
  --gold-bright: #ffd700;
  --gold-pill-bg: rgba(212, 175, 55, 0.2);
  --border-color: rgba(212, 175, 55, 0.2);
  --border-card: rgba(212, 175, 55, 0.25);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.4;
  user-select: none;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  transition: background-color 0.25s, color 0.25s;
}

.app-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 24px;
  overflow-x: hidden;
}

/* Header */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--bg-nav);
  color: var(--text-nav);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 50;
  max-width: 100vw;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.brand > div {
  min-width: 0;
  flex: 1;
}

.flag-icon {
  font-size: 1.45rem;
  flex-shrink: 0;
}

.brand h1 {
  font-family: 'Cinzel', serif;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffd700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tournament-sub {
  display: block;
  font-size: 0.7rem;
  color: #e2e8f0;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.sync-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

.status-online {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

.status-online .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.status-offline {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #ef4444;
}

.status-offline .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #ef4444;
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
}

.queue-badge {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
}

/* Dead zone warning */
.dead-zone-alert {
  background: #fef2f2;
  color: #991b1b;
  padding: 10px 14px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 2px solid #ef4444;
}

.dead-zone-alert button {
  background: #ef4444;
  color: #ffffff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
}

/* Group & Pairing selector */
.group-bar {
  padding: 12px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  max-width: 100%;
  overflow: hidden;
}

.group-select-wrap {
  max-width: 100%;
  min-width: 0;
}

.group-select-wrap label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--brand-green);
  margin-bottom: 4px;
}

.group-select-wrap select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 9px 10px;
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  outline: none;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.player-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}

.player-tab-btn {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.player-tab-btn.active {
  background: var(--brand-green);
  border-color: var(--brand-green);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(6, 78, 59, 0.25);
}

.player-tab-btn.active .tab-score {
  color: #ffd700;
}

.tab-flag {
  font-size: 1rem;
  flex-shrink: 0;
}

.tab-name {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-score {
  flex-shrink: 0;
  margin-left: 4px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--brand-green);
}

/* Hole Strip */
.hole-selector-container {
  padding: 12px 16px 8px;
  background: var(--bg-page);
}

.hole-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.hole-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.hole-details {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-green);
}

.hole-scroll-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.hole-pill {
  flex: 0 0 44px;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-card);
}

.hole-pill .h-num {
  font-size: 0.95rem;
  font-weight: 700;
}

.hole-pill .h-par {
  font-size: 0.65rem;
  color: var(--text-subtle);
}

.hole-pill.active {
  background: var(--brand-green);
  border-color: var(--brand-green);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(6, 78, 59, 0.35);
}
.hole-pill.active .h-par {
  color: #a7f3d0;
  font-weight: 700;
}

.hole-pill.scored {
  border-color: #10b981;
  position: relative;
}
.hole-pill.scored::after {
  content: '✓';
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 0.6rem;
  color: #10b981;
  font-weight: 900;
}

/* Player Hero Card */
.player-hero-card {
  margin: 12px 16px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-card);
}

.player-avatar-wrap img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--brand-green);
}

.player-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.name-flag {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  min-width: 0;
}

.country-flag {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.player-info h2 {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-meta-stats {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.meta-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.meta-tag strong {
  color: var(--text-main);
}

.score-under {
  color: #dc2626 !important;
  font-weight: 900;
}

/* Entry Pad */
.entry-pad {
  margin: 0 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.current-hole-badge {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--brand-green);
}

.current-par-badge {
  font-size: 0.75rem;
  font-weight: 800;
  background: #ecfdf5;
  color: #065f46;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #a7f3d0;
}

.preset-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Preset buttons grid */
.score-presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn .preset-strokes {
  font-size: 1.3rem;
  font-weight: 800;
}

.preset-btn .preset-term {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.preset-btn.eagle { border-color: #fde68a; color: #92400e; }
.preset-btn.birdie { border-color: #fecaca; color: #991b1b; }
.preset-btn.par { border-color: #a7f3d0; color: #065f46; }
.preset-btn.bogey { border-color: #bfdbfe; color: #1e40af; }

.preset-btn.active {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.preset-btn.eagle.active { background: #fef3c7; border-color: #f59e0b; color: #78350f; font-weight: 900; }
.preset-btn.birdie.active { background: #fee2e2; border-color: #ef4444; color: #7f1d1d; font-weight: 900; }
.preset-btn.par.active { background: #d1fae5; border-color: #10b981; color: #064e3b; font-weight: 900; }
.preset-btn.bogey.active { background: #dbeafe; border-color: #3b82f6; color: #1e3a8a; font-weight: 900; }
.preset-btn.double.active { background: #e0e7ff; border-color: #6366f1; color: #312e81; font-weight: 900; }
.preset-btn.other.active { background: #f1f5f9; border-color: #94a3b8; color: #334155; font-weight: 900; }

/* Large Touch Stepper */
.stepper-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 14px;
}

.stepper-btn {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--brand-green);
  font-size: 2rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: background 0.1s ease;
}

.stepper-btn:active {
  background: var(--brand-green);
  color: #ffffff;
}

.stepper-value-wrap {
  text-align: center;
}

.stepper-number {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text-main);
}

.stepper-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--brand-green);
  letter-spacing: 0.5px;
}

/* Secondary Stat Row */
.stats-toggle-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.stat-title {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.mini-stepper {
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.mini-stepper button {
  width: 32px;
  height: 32px;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

.mini-stepper span {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.stat-toggle-btn {
  width: 100%;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.stat-toggle-btn.active {
  background: #ecfdf5;
  color: #065f46;
  border-color: #10b981;
}

/* Main Submit Button */
.action-submit-btn {
  width: 100%;
  height: 56px;
  background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(6, 78, 59, 0.3);
  transition: all 0.15s ease;
}

.action-submit-btn:active {
  transform: scale(0.98);
  filter: brightness(0.95);
}

.save-feedback {
  margin-top: 10px;
  padding: 8px;
  border-radius: 6px;
  background: #d1fae5;
  border: 1px solid #10b981;
  color: #065f46;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

/* Mini Scorecard Table */
.mini-card-section {
  margin: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow-card);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--brand-green);
  margin-bottom: 10px;
}

.card-total {
  font-size: 0.75rem;
  color: var(--text-main);
  font-weight: 700;
}

.scorecard-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.hole-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  text-align: center;
}

.hole-table th, .hole-table td {
  padding: 6px 4px;
  border: 1px solid var(--border-color);
}

.header-row {
  background: var(--bg-card-subtle);
  color: var(--text-muted);
}

.par-row {
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 600;
}

.score-row {
  background: var(--bg-card);
  font-weight: 800;
  color: var(--text-main);
}

.sub-col {
  background: var(--bg-card-subtle) !important;
  color: var(--brand-green) !important;
  font-weight: 800;
}

/* Score styling in table */
.score-cell-birdie { background: #fee2e2 !important; color: #991b1b; }
.score-cell-eagle { background: #fef3c7 !important; color: #92400e; }
.score-cell-bogey { background: #dbeafe !important; color: #1e40af; }
.score-cell-double { background: #e0e7ff !important; color: #312e81; }
.score-cell-par { color: var(--text-main); }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1rem;
  color: var(--brand-green);
  font-weight: 800;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.queue-explain {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.queue-item {
  background: var(--bg-card-subtle);
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.queue-item-info {
  font-size: 0.82rem;
}

.queue-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.queue-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.queue-pending {
  background: #fef3c7;
  color: #92400e;
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
}

.primary-btn {
  flex: 1;
  padding: 10px;
  background: var(--brand-green);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.danger-btn {
  padding: 10px 14px;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #ef4444;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.bottom-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-around;
  padding: 14px;
  border-top: 1px solid var(--border-color);
}

.footer-link {
  color: var(--brand-green);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Scorer Sponsor Bar & WhatsApp Button */
.scorer-sponsor-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-card-subtle);
  border-bottom: 1px solid var(--border-color);
}

.scorer-sponsors {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.scorer-wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: #25d366;
  color: #ffffff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.25);
  transition: transform 0.15s, background 0.15s;
}

.scorer-wa-btn:active {
  transform: scale(0.98);
  background: #1eb855;
}

/* Senior Accessibility Mode (Oversized High-Contrast Controls) */
body.senior-accessibility-mode {
  font-size: 1.15rem;
}

body.senior-accessibility-mode .stepper-btn {
  width: 74px;
  height: 74px;
  font-size: 2.5rem;
  border: 3px solid #0f172a;
}

body.senior-accessibility-mode .stepper-number {
  font-size: 4.2rem;
}

body.senior-accessibility-mode .preset-btn {
  padding: 14px 8px;
  border-width: 2px;
}

body.senior-accessibility-mode .preset-strokes {
  font-size: 1.55rem;
}

body.senior-accessibility-mode .action-submit-btn {
  padding: 20px;
  font-size: 1.25rem;
  border: 3px solid #fbbf24;
}

/* ============================================================================
   CLEAN-SLATE 3-STEP TOURNAMENT & COURSE ONBOARDING WIZARD
   ============================================================================ */
.wizard-shell {
  padding: 14px;
}

.wizard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  padding: 16px;
}

.wizard-top-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.wizard-kicker {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.wizard-title {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--brand-green);
  margin: 0 0 4px 0;
}

.wizard-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.wizard-resume-btn {
  background: #f8fafc;
  color: var(--brand-green);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.wizard-resume-btn:hover {
  background: #ecfdf5;
  border-color: #10b981;
}

.wizard-steps-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.wiz-step-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.wiz-step-pill.active {
  background: #064e3b;
  color: #ffffff;
  border-color: #064e3b;
}

.wiz-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
  flex-shrink: 0;
}

.wiz-step-pill.active .wiz-step-num {
  background: #f59e0b;
  color: #0f172a;
}

.wiz-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--brand-green);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.wiz-course-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.wiz-course-card {
  border: 2px solid var(--border-color);
  background: var(--bg-card-subtle);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wiz-course-card.selected {
  border-color: #064e3b;
  background: #ecfdf5;
  box-shadow: 0 4px 12px rgba(6, 78, 59, 0.12);
}

.wiz-course-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.wiz-course-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  padding: 2px 7px;
  border-radius: 4px;
}

.wiz-course-par {
  font-size: 0.74rem;
  font-weight: 900;
  color: #064e3b;
}

.wiz-course-card h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 2px 0;
}

.wiz-course-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.wiz-yardage-preview-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
}

.wiz-yardage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-main);
  gap: 8px;
}

.wiz-link-btn {
  background: none;
  border: none;
  color: #064e3b;
  font-size: 0.74rem;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.wiz-form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.wiz-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.wiz-field input,
.wiz-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 700;
}

.wiz-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.wiz-mode-card {
  border: 2px solid var(--border-color);
  background: var(--bg-card-subtle);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wiz-mode-card.selected {
  border-color: #064e3b;
  background: #ecfdf5;
  box-shadow: 0 4px 12px rgba(6, 78, 59, 0.12);
}

.wiz-mode-icon {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.wiz-mode-card h4 {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 3px 0;
}

.wiz-mode-card p {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.3;
}

.wiz-multiflight-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.wiz-count-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--brand-green);
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
}

.wiz-clean-slate-box {
  background: #fffbeb;
  border: 1px solid #f59e0b;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.wiz-flights-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 2px;
}

.wiz-flight-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
}

.wiz-flight-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.wiz-flight-title {
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--brand-green);
}

/* Wizard Step 3: Clean, Un-overlapped Player Cards */
.wiz-player-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.wiz-player-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.wiz-player-name-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.wiz-player-role-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wiz-role-tag {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--text-muted, #64748b);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.wiz-role-tag.me-tag {
  color: var(--brand-green, #065f46);
  background: #dcfce7;
  padding: 2px 6px;
  border-radius: 4px;
}

.wiz-player-top-row input.wiz-p-name {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 6px;
  background: var(--bg-input, #ffffff);
  color: var(--text-main, #0f172a);
  font-size: 0.90rem;
  font-weight: 700;
  box-sizing: border-box;
}

.wiz-player-bottom-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  padding-top: 6px;
  border-top: 1px dashed var(--border-color, #e2e8f0);
}

.wiz-input-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wiz-input-label {
  font-size: 0.60rem;
  font-weight: 800;
  color: var(--text-muted, #64748b);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.wiz-cdh-group {
  width: 105px;
}

.wiz-hcp-group {
  width: 90px;
}

.wiz-badge-group {
  flex: 1;
  min-width: 170px;
}

.wiz-player-bottom-row input.wiz-p-cdh,
.wiz-player-bottom-row input.wiz-p-hcp {
  padding: 6px 8px;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 6px;
  background: var(--bg-input, #ffffff);
  color: var(--text-main, #0f172a);
  font-size: 0.82rem;
  font-weight: 700;
  box-sizing: border-box;
  width: 100%;
}

.whs-calc-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.70rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  box-sizing: border-box;
  width: 100%;
  min-height: 31px;
  text-align: center;
  line-height: 1.25;
}

/* Fallback legacy .wiz-player-row alias */
.wiz-player-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.wiz-photo-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px dashed #064e3b;
  background: #ecfdf5;
  color: #064e3b;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.wiz-photo-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wiz-player-idx {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #064e3b;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wiz-player-row input {
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.84rem;
  font-weight: 600;
  width: 100%;
}

.wiz-small-btn {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.wizard-nav-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.wiz-primary-btn {
  padding: 11px 16px;
  border-radius: 8px;
  border: none;
  background: #064e3b;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.wiz-secondary-btn {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.wiz-launch-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid #d97706;
  background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
  color: #fef3c7;
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(6, 78, 59, 0.25);
}

/* ==========================================================================
   ZEN TRANSLUCENT SCORER: Distraction-Free Focus on Current Score Pad Only
   ========================================================================== */
body.zen-focus-active .top-nav {
  opacity: 0.38;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.25s ease, filter 0.25s ease;
}
body.zen-focus-active .top-nav:hover,
body.zen-focus-active .top-nav:focus-within {
  opacity: 1;
}

body.zen-focus-active #pwaTopInstallBanner {
  opacity: 0.22;
  transition: opacity 0.25s ease;
}
body.zen-focus-active #pwaTopInstallBanner:hover {
  opacity: 1;
}

body.zen-focus-active .scorer-sponsor-bar {
  opacity: 0.28;
  filter: grayscale(35%);
  transition: opacity 0.25s ease, filter 0.25s ease;
}
body.zen-focus-active .scorer-sponsor-bar:hover,
body.zen-focus-active .scorer-sponsor-bar:focus-within {
  opacity: 1;
  filter: grayscale(0%);
}

body.zen-focus-active .group-bar {
  opacity: 0.58;
  transition: opacity 0.25s ease;
}
body.zen-focus-active .group-bar:hover,
body.zen-focus-active .group-bar:focus-within {
  opacity: 1;
}

body.zen-focus-active .hole-selector-container {
  opacity: 0.52;
  transition: opacity 0.25s ease;
}
body.zen-focus-active .hole-selector-container:hover,
body.zen-focus-active .hole-selector-container:focus-within {
  opacity: 1;
}

body.zen-focus-active .mini-card-section {
  opacity: 0.28;
  transition: opacity 0.25s ease;
}
body.zen-focus-active .mini-card-section:hover,
body.zen-focus-active .mini-card-section:focus-within {
  opacity: 1;
}

/* Crisp & Prominent Active Score Entry Pad */
.score-card-main {
  opacity: 1 !important;
  position: relative;
  z-index: 10;
}

body.zen-focus-active .player-hero-card {
  border: 2px solid var(--brand-green);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

body.zen-focus-active .entry-pad {
  border: 2px solid var(--brand-green);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16);
}

/* Flight Score Mismatch Alert & Pulse */
@keyframes pulseMismatch {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50% { transform: scale(1.015); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.mismatch-banner-pulse {
  animation: pulseMismatch 1.4s infinite ease-in-out;
}

/* ==========================================================================
   ZERO-SCROLL ZEN FLIGHT BAR & ON-DEMAND POP-OUT SCORECARD
   ========================================================================== */

/* Hide setup sponsor bars when on-course active scoring is displayed */
body:has(#activeScorerWorkspace:not(.hidden)) .setup-only-bar {
  display: none !important;
}

.zen-flight-bar {
  background: var(--bg-card);
  border-bottom: 2px solid var(--border-color);
  padding: 10px 14px 8px;
  position: sticky;
  top: 52px;
  z-index: 40;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.zen-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.zen-hole-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  border: 1.5px solid #10b981;
  border-radius: 10px;
  padding: 4px 6px;
}

.zen-nav-btn {
  background: #064e3b;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  font-size: 0.85rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.zen-nav-btn:hover {
  background: #047857;
}

.zen-hole-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 6px;
  min-width: 90px;
}

.zen-hole-title {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: #064e3b;
  line-height: 1.1;
}

.zen-hole-meta {
  font-size: 0.68rem;
  font-weight: 700;
  color: #047857;
  white-space: nowrap;
}

.zen-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zen-popout-btn {
  background: linear-gradient(135deg, #d4af37 0%, #b45309 100%);
  color: #031109;
  font-weight: 900;
  font-size: 0.78rem;
  padding: 8px 12px;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.35);
  transition: transform 0.15s, filter 0.15s;
}

.zen-popout-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.zen-menu-btn {
  background: #0f172a;
  color: #fef3c7;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.zen-menu-btn:hover {
  background: #1e293b;
}

/* 1-Row Compact Player Switcher */
.zen-player-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.zen-player-tabs::-webkit-scrollbar {
  display: none;
}

.zen-player-tabs .player-tab-btn {
  flex: 1;
  min-width: 90px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  white-space: nowrap;
}

/* Jumpable Hole Header in Pop-out Table */
.jumpable-hole {
  cursor: pointer;
  transition: background 0.15s;
}

.jumpable-hole:hover {
  background: #10b981 !important;
  color: #ffffff !important;
}

/* Official Scorecard Swap & Marker Assignment (Rule 3.3b) */
.zen-swap-btn {
  background: #f0fdf4;
  color: #065f46;
  font-weight: 800;
  font-size: 0.76rem;
  padding: 8px 11px;
  border: 1px solid #16a34a;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.zen-swap-btn:hover {
  background: #dcfce7;
  transform: translateY(-1px);
}

.marker-notice-banner {
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.12);
}

.card-swap-row {
  display: grid;
  grid-template-columns: 1fr 34px 1fr;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.swap-arrow {
  text-align: center;
  font-size: 1.15rem;
  color: #065f46;
  font-weight: 900;
}

/* Hide redundant setup sponsor bars to guarantee a zero-clutter, crisp mobile screen */
.setup-only-bar {
  display: none !important;
}

/* WHS Tee Box & Course Slope Cards */
.wiz-tee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.wiz-tee-card {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.wiz-tee-card:hover {
  border-color: #064e3b;
  background: #f0fdf4;
}

.wiz-tee-card.selected {
  border-color: #059669;
  background: #ecfdf5;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.18);
}

.wiz-tee-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  background: #dcfce7;
  color: #065f46;
  margin-top: 5px;
}

/* WHS Handicap Allowance % Grid */
.wiz-allowance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.wiz-allowance-card {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wiz-allowance-card:hover {
  border-color: #064e3b;
  background: #f0fdf4;
}

.wiz-allowance-card.selected {
  border-color: #059669;
  background: #ecfdf5;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.18);
}

.whs-calc-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 4px;
}

/* Mobile Responsiveness & Crisp Typography */
@media (max-width: 600px) {
  .top-nav {
    padding: 8px 10px;
  }
  .top-nav .brand h1 {
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .tournament-sub {
    font-size: 0.68rem;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sync-actions {
    gap: 5px;
  }
  .sync-actions .pill-badge {
    padding: 5px 8px;
    font-size: 0.7rem;
  }
  .wizard-top-banner {
    padding: 12px;
  }
  .wizard-title {
    font-size: 1.25rem;
  }
  .wizard-subtitle {
    font-size: 0.78rem;
  }
  .wiz-mode-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .wiz-tee-grid {
    grid-template-columns: 1fr;
  }
  .wiz-allowance-grid {
    grid-template-columns: 1fr;
  }
  .wiz-player-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
}

.hidden {
  display: none !important;
}
