:root {
  --bg: #161428;
  --panel: rgba(22, 20, 40, 0.94);
  --line: rgba(255,255,255,0.10);
  --text: #f0f0f0;
  --muted: #C4C0C0;
  --accent: #6EDBA4;
  --green: #5CE65C;
  --dark-green: #2D6E4C;
  --blue: #6478B4;
  --red: #E53935;
  --eagle: #facc15;
  --birdie: #5CE65C;
  --par-color: #C4C0C0;
  --bogey: #fb923c;
  --double: #E53935;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

/* ── App Shell ── */

.app-shell {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
}

/* ── Toolbar ── */

.toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}

.toolbar {
  grid-template-columns: auto 1fr auto auto;
}

.toolbar-center { text-align: center; min-width: 0; }

.toolbar-hero {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.toolbar-yards {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.toolbar-shot-label {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}

.toolbar-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}

.toolbar-hole-info {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.toolbar-tournament {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
}

.toolbar-title {
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.86rem;
  color: var(--accent);
}

.toolbar-meta {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toolbar-score {
  font-size: 0.76rem;
  color: var(--green);
  cursor: pointer;
  margin-top: 2px;
}
.toolbar-score:hover { text-decoration: underline; }

.scorecard-btn {
  font-size: 1rem;
  padding: 10px 12px;
}

.toolbar-hero-score .toolbar-yards {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.toolbar-hero-score .toolbar-shot-label {
  font-size: 1rem;
  font-weight: 600;
}

.nav-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  text-align: center;
}
.nav-btn:hover { background: rgba(255,255,255,0.12); }

/* ── Map ── */

.course-stage {
  position: relative;
  min-height: 0;
}

.map-container {
  width: 100%;
  height: 100%;
}

.mapboxgl-ctrl-attrib { display: none !important; }

/* ── Action Bar ── */

.action-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}

.action-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.action-btn:hover:not(:disabled) { background: rgba(255,255,255,0.12); color: var(--text); }
.action-btn:disabled { opacity: 0.35; cursor: default; }

.undo-btn {
  font-size: 1.1rem;
  padding: 7px 10px;
  line-height: 1;
  background: rgba(229,57,53,0.1);
  border-color: rgba(229,57,53,0.25);
  color: var(--muted);
}
.undo-btn:hover:not(:disabled) {
  background: rgba(229,57,53,0.2);
  border-color: rgba(229,57,53,0.4);
  color: var(--red);
}

.save-quit-btn {
  margin-left: auto;
}

.shot-info {
  flex: 1;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ── Shot Preview (pending confirmation) ── */
.shot-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.shot-distances {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.dist-hit {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.dist-remain {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}
.club-select {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.club-select:focus {
  outline: none;
  border-color: var(--accent);
}
.cancel-btn {
  background: rgba(229,57,53,0.15) !important;
  border-color: rgba(229,57,53,0.3) !important;
  color: var(--red) !important;
  font-size: 1rem !important;
  padding: 6px 12px !important;
  font-weight: 700;
}
.cancel-btn:hover {
  background: rgba(229,57,53,0.3) !important;
  color: #fff !important;
}
.confirm-btn {
  background: rgba(110,219,164,0.2) !important;
  border-color: rgba(110,219,164,0.4) !important;
  color: var(--accent) !important;
  font-size: 1.1rem !important;
  padding: 6px 16px !important;
  font-weight: 700;
}
.confirm-btn:hover {
  background: rgba(110,219,164,0.35) !important;
  color: #fff !important;
}

.shot-marker.preview {
  opacity: 0.6;
  border-style: dashed;
}

.ring-label {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  font-family: Inter, system-ui, sans-serif;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8), 0 0 8px rgba(0,0,0,0.5);
}

.ball-marker {
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255,255,255,0.8), 0 0 16px rgba(110,219,164,0.5);
  pointer-events: none;
  z-index: 15;
}

.shot-marker.replay-anim {
  animation: shot-pop 0.35s ease-out;
}
@keyframes shot-pop {
  0% { opacity: 0; transform: scale(0.3); }
  60% { transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); }
}

.save-quit-btn {
  background: rgba(100,120,180,0.12) !important;
  border-color: rgba(100,120,180,0.25) !important;
  color: var(--blue) !important;
  font-size: 0.68rem !important;
}
.save-quit-btn:hover {
  background: rgba(100,120,180,0.22) !important;
  color: #fff !important;
}

.stop-replay-btn {
  background: rgba(229,57,53,0.15) !important;
  border-color: rgba(229,57,53,0.3) !important;
  color: var(--red) !important;
  font-weight: 700;
}
.stop-replay-btn:hover {
  background: rgba(229,57,53,0.3) !important;
  color: #fff !important;
}

.replay-hole-btn {
  background: rgba(100,120,180,0.15) !important;
  border-color: rgba(100,120,180,0.3) !important;
  color: var(--blue) !important;
}
.replay-hole-btn:hover {
  background: rgba(100,120,180,0.25) !important;
  color: #fff !important;
}

.replay-round-btn {
  display: block;
  margin: 14px auto 0;
  background: rgba(100,120,180,0.15);
  border-color: rgba(100,120,180,0.3);
  color: var(--blue);
}
.replay-round-btn:hover {
  background: rgba(100,120,180,0.25);
  color: #fff;
}

/* ── Completion Badge ── */

.hole-complete-badge {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--panel);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 16px 28px;
  text-align: center;
  z-index: 20;
  animation: badge-in 0.3s ease-out;
  pointer-events: none;
}
.badge-emoji { font-size: 2.5rem; margin-bottom: 4px; }
.badge-score { font-size: 2rem; font-weight: 800; }
.badge-label { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.badge-breakdown { font-size: 0.72rem; color: var(--muted); margin-top: 6px; opacity: 0.8; }

@keyframes badge-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Next shot panel */
.next-shot-panel {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--panel);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 16px 32px;
  text-align: center;
  z-index: 20;
  pointer-events: none;
  animation: badge-in 0.3s ease-out;
}
.next-shot-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1px;
}
.next-shot-dist {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  margin: 4px 0;
}
.next-shot-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── Scorecard ── */

.scorecard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.scorecard-overlay[hidden] { display: none; }

.scorecard-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 12px;
  max-width: 96vw;
  max-height: 88vh;
  overflow: auto;
}
.scorecard-panel h2 {
  text-align: center;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--accent);
}

/* ── Horizontal Scorecard Grid ── */
.sc-nine {
  margin-bottom: 8px;
}
.sc-row {
  display: grid;
  grid-template-columns: 32px repeat(9, 1fr) 36px;
  gap: 0;
}
.sc-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
}
.sc-hole-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  padding: 3px 0;
  border-bottom: 1px solid var(--line);
}
.sc-par-cell {
  font-size: 0.65rem;
  color: var(--muted);
  text-align: center;
  padding: 2px 0;
}
.sc-yds-cell {
  font-size: 0.58rem;
  color: rgba(196,192,192,0.6);
  text-align: center;
  padding: 1px 0;
  border-bottom: 1px solid var(--line);
}
.sc-score-cell {
  text-align: center;
  padding: 4px 0;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sc-detail-cell {
  text-align: center;
  padding: 2px 0 4px;
  font-size: 0.55rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.sc-total-col {
  background: rgba(255,255,255,0.03);
  font-weight: 700;
}

/* Score indicators */
.sc-birdie {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border: 2px solid var(--birdie);
  border-radius: 50%;
  color: var(--birdie);
  font-size: 0.78rem; font-weight: 700;
}
.sc-eagle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border: 2px solid var(--eagle);
  border-radius: 50%;
  outline: 2px solid var(--eagle);
  outline-offset: 2px;
  color: var(--eagle);
  font-size: 0.78rem; font-weight: 700;
}
.sc-par {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--par-color);
  font-size: 0.78rem; font-weight: 700;
}
.sc-bogey {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border: 2px solid var(--bogey);
  border-radius: 2px;
  color: var(--bogey);
  font-size: 0.78rem; font-weight: 700;
}
.sc-double {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border: 2px solid var(--double);
  border-radius: 2px;
  outline: 2px solid var(--double);
  outline-offset: 2px;
  color: var(--double);
  font-size: 0.78rem; font-weight: 700;
}

/* FW/GIR checks */
.sc-check {
  font-size: 0.55rem;
  font-weight: 700;
}
.sc-check.hit { color: var(--accent); }
.sc-check.miss { color: rgba(196,192,192,0.3); }
.sc-putts { color: var(--muted); font-size: 0.55rem; }
.sc-pen { color: var(--red); font-size: 0.55rem; }

/* Totals row */
.sc-totals {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 0 4px;
  flex-wrap: wrap;
}
.sc-total-score {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}
.sc-total-stat {
  font-size: 0.72rem;
  color: var(--muted);
}
.sc-total-item { text-align: center; }
.sc-total-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}
.sc-total-val.under { color: #5CE65C; }
.sc-total-val.over { color: #fb923c; }
.sc-total-val.even { color: #C4C0C0; }
.sc-total-label {
  font-size: 0.6rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scorecard-close {
  display: block;
  margin: 14px auto 0;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 32px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
.scorecard-close:hover { background: rgba(255,255,255,0.12); }

/* ── Shot Markers ── */

.shot-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  border: 3px solid var(--bg);
  color: var(--bg);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  font-family: Inter, system-ui, sans-serif;
}

.shot-marker.in-water {
  background: var(--red);
}

.shot-marker.completed {
  background: rgba(110,219,164,0.6);
}

.tee-marker {
  background: rgba(255,255,255,0.92);
  border: 2px solid var(--bg);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 800;
  color: var(--bg);
  font-family: Inter, system-ui, sans-serif;
  cursor: default;
}

.pin-marker {
  position: relative;
  width: 4px;
  height: 36px;
  cursor: default;
  pointer-events: none;
  transform: translateY(16px);
}
/* stick */
.pin-marker::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 36px;
  background: #fff;
  border-radius: 1px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
/* flag */
.pin-marker::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 14px;
  height: 10px;
  background: var(--red);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.yard-label {
  background: rgba(22,20,40,0.82);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: Inter, system-ui, sans-serif;
  white-space: nowrap;
  pointer-events: none;
}

/* ── Auth Pages ── */

.auth-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.auth-logo {
  width: 180px;
  margin-bottom: 20px;
}

.auth-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.auth-error {
  background: rgba(229,57,53,0.15);
  border: 1px solid rgba(229,57,53,0.3);
  color: var(--red);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.82rem;
  margin-bottom: 16px;
}

.auth-link {
  margin-top: 16px;
  font-size: 0.82rem;
}
.auth-link a { color: var(--accent); text-decoration: none; }
.auth-link a:hover { text-decoration: underline; }

/* ── OAuth Buttons ── */

.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  border: 1px solid var(--line);
}

.btn-google {
  background: #fff;
  color: #3c4043;
}
.btn-google:hover {
  background: #f7f8f8;
  border-color: rgba(255,255,255,0.3);
}

.btn-twitter {
  background: #000;
  color: #fff;
}
.btn-twitter:hover {
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.2);
}

.oauth-icon {
  flex-shrink: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.78rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.oauth-row {
  display: flex;
  gap: 10px;
}
.btn-oauth-sm {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.btn-oauth-sm:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.btn-oauth-sm svg { flex-shrink: 0; }

/* ── Form Elements ── */

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 6px;
  text-align: left;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus {
  border-color: var(--accent);
}
.form-input::placeholder {
  color: rgba(255,255,255,0.3);
}
.form-input:disabled {
  opacity: 0.5;
}

.otp-input {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 12px;
  padding: 14px;
}

/* ── Buttons ── */

.btn {
  display: inline-block;
  padding: 12px 28px;
  border: none;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  text-align: center;
}

.btn-primary {
  background: var(--dark-green);
  color: var(--text);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--bg);
}

.btn-full {
  width: 100%;
}

/* ── Landing Page ── */

html:has(.landing), body:has(.landing) { overflow-y: auto; overflow-x: hidden; height: auto; }

.landing {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  min-height: 100dvh;
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 32px;
}

.hero-logo {
  width: 90%;
  max-width: 90vw;
  margin-bottom: 20px;
}

.hero-headline {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 24px;
  color: var(--text);
}

.hero-course {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: inline-block;
}
.hero-course-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 6px;
}
.hero-course-name {
  font-size: 1.1rem;
  font-weight: 700;
}
.hero-course-tournament {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
}

.hero-learn {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  transition: opacity 0.2s;
}
.hero-learn:hover { opacity: 0.7; }

/* Hero Login Card */
.hero-login {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
}
.hero-login h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.hero-login-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 20px;
}

/* Sections */
.section {
  padding: 80px 32px;
}
.section-inner {
  max-width: 860px;
  margin: 0 auto;
}
.section-dark {
  background: rgba(22, 20, 40, 0.6);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section-cta {
  text-align: center;
  padding: 64px 32px;
}
.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 16px;
}
.section-lead {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 640px;
}
.section-cta .section-lead { margin: 0 auto 32px; }
.section-dark .section-title,
.section-cta .section-title { text-align: center; }
.section-dark .section-lead { margin-left: auto; margin-right: auto; text-align: center; }

/* Steps */
.steps {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.step-number {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--dark-green);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}
.step-content p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.feature-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
}
.feature-icon-lg {
  font-size: 2rem;
  margin-bottom: 12px;
}
.feature-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--accent);
}
.feature-card p {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.faq-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 24px;
}
.faq-q {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.faq-a {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
}

/* CTA Button */
.btn-cta {
  display: inline-block;
  background: var(--green);
  color: #161428;
  font-size: 1.1rem;
  font-weight: 800;
  padding: 14px 40px;
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-cta:hover { background: var(--accent); }

/* Footer */
.landing-footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--line);
}

/* ── Landing Mobile ── */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    min-height: auto;
    padding: 40px 20px;
  }
  .hero-left { text-align: center; }
  .hero-headline { font-size: 1.6rem; }
  .hero-logo { width: 90%; }
  .hero-course { display: block; }
  .section { padding: 48px 20px; }
  .section-title { font-size: 1.3rem; }
  .feature-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .hero-headline { font-size: 1.3rem; }
  .hero-login { padding: 24px 20px; }
  .feature-grid { grid-template-columns: 1fr; }
}

/* ── Pages (history, profile, scorecard) ── */

.page {
  min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  overflow-y: auto;
}

.page-header {
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.back-link {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 8px;
}
.back-link:hover { color: var(--text); }

.history-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}
.history-card:hover { border-color: var(--accent); }

.history-tournament { font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.history-course { font-size: 0.82rem; color: var(--muted); margin-bottom: 8px; }
.history-details { display: flex; gap: 16px; font-size: 0.78rem; color: var(--muted); }
.history-score { color: var(--green); font-weight: 700; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state p { margin-bottom: 16px; }

/* ── Alert Boxes ── */

.alert-box {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  z-index: 200;
  min-width: 280px;
  text-align: center;
}
.alert-success {
  background: rgba(110,219,164,0.15);
  border: 1px solid rgba(110,219,164,0.3);
  color: var(--accent);
}
.alert-error {
  background: rgba(229,57,53,0.15);
  border: 1px solid rgba(229,57,53,0.3);
  color: var(--red);
}
.alert-title { font-weight: 700; margin-right: 8px; }

/* ── Responsive ── */

/* ── Dashboard ── */

html:has(.dashboard), body:has(.dashboard) {
  overflow-y: auto;
  height: auto;
}
.dashboard {
  min-height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  max-width: 480px;
  margin: 0 auto;
}
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.dash-logo img {
  height: 36px;
  display: block;
}
.dash-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
a.dash-user {
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
}
a.dash-user:hover { color: var(--accent); }
a.dash-logout {
  font-size: 0.72rem;
  color: var(--red);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}
a.dash-logout:hover { opacity: 1; }

.dash-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.dash-card h3 {
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

/* Course card */
.course-card-header h2 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 4px;
}
.course-meta {
  font-size: 0.72rem;
  color: var(--muted);
}
.course-card-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.rounds-recorded {
  font-size: 0.68rem;
  color: var(--muted);
}
.dash-btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.dash-btn:hover { background: rgba(255,255,255,0.12); }
.dash-btn-accent {
  background: rgba(110,219,164,0.15);
  border-color: rgba(110,219,164,0.3);
  color: var(--accent);
}
.dash-btn-accent:hover {
  background: rgba(110,219,164,0.25);
  color: #fff;
}
.dash-btn-secondary {
  background: rgba(196,192,192,0.1);
  border-color: rgba(196,192,192,0.25);
  color: #C4C0C0;
}
.dash-btn-secondary:hover {
  background: rgba(196,192,192,0.2);
  color: #fff;
}

/* Stats row */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.stat-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 4px;
  text-align: center;
}
.stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}
.stat-label {
  font-size: 0.6rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* Pie chart */
.pie-container {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.pie-container canvas {
  max-width: 180px;
  max-height: 180px;
}
.pie-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--muted);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot-eagle { background: var(--eagle); }
.dot-birdie { background: var(--birdie); }
.dot-par { background: var(--par-color); }
.dot-bogey { background: var(--bogey); }
.dot-double { background: var(--double); }

/* Club distances */
.club-distances {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}
.club-dist-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
}
.club-dist-row:nth-last-child(-n+2) { border-bottom: none; }
.club-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}
.club-yds {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 700;
}

/* Rounds list */
.rounds-list { display: flex; flex-direction: column; gap: 8px; }
a.round-row {
  text-decoration: none;
  color: inherit;
}
.round-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.round-row:hover {
  background: rgba(255,255,255,0.03);
}
.round-row:last-child { border-bottom: none; }
.round-course { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.round-meta { font-size: 0.65rem; color: var(--muted); margin-top: 2px; }
.round-scores { text-align: right; }
.round-score {
  font-size: 1rem;
  font-weight: 800;
}
.round-score.under { color: var(--birdie); }
.round-score.over { color: var(--bogey); }
.round-score.even { color: var(--par-color); }
.round-detail { font-size: 0.6rem; color: var(--muted); margin-top: 2px; }

.muted { color: var(--muted); font-size: 0.82rem; }

@media (max-width: 640px) {
  .toolbar { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .toolbar-yards { font-size: 0.7rem; }
  .toolbar-shot-label { font-size: 1.3rem; }
  .toolbar-hole-info { font-size: 0.7rem; }
  .toolbar-tournament { font-size: 0.65rem; }
  .toolbar-title { font-size: 0.78rem; }
  .toolbar-meta { font-size: 0.72rem; }
  .nav-btn { padding: 8px 12px; font-size: 0.8rem; }
  .action-bar { gap: 6px; padding: 7px 10px; }
  .action-btn { padding: 6px 10px; font-size: 0.72rem; }
  .shot-info { font-size: 0.72rem; }
  .feature-card { padding: 16px; }
  .dash-stats { grid-template-columns: repeat(3, 1fr); }
}

/* ── Course Editor ── */

body:has(.editor-shell) { overflow: hidden; }

.editor-shell {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.editor-toolbar .back-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
}

.editor-toolbar h2 {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
}

.editor-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.fw-btn {
  background: rgba(255,255,255,0.1);
  color: var(--muted);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.fw-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.fw-btn.active-mode { background: var(--bogey); color: #fff; border-color: var(--bogey); }
.fw-clear { color: var(--red); border-color: rgba(229,57,53,0.3); }
.fw-clear:hover { background: rgba(229,57,53,0.15); }

.save-btn {
  background: var(--dark-green);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.save-btn:hover { background: var(--accent); color: #161428; }
.save-btn.has-changes { background: var(--eagle); color: #161428; }
.save-btn:disabled { opacity: 0.5; cursor: default; }

.editor-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  overflow: hidden;
}

.editor-map {
  width: 100%;
  height: 100%;
}

.editor-sidebar {
  background: var(--panel);
  border-left: 1px solid var(--line);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.sidebar-header h3 { font-size: 0.95rem; font-weight: 600; }
.sidebar-hint { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

.hole-list {
  flex: 1;
  overflow-y: auto;
}

.hole-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s;
}
.hole-row:hover { background: rgba(255,255,255,0.05); }
.hole-row.active { background: rgba(110,219,164,0.12); border-left: 3px solid var(--accent); }

.hole-num {
  font-size: 0.85rem;
  font-weight: 600;
}

.hole-detail {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

.hole-ref {
  font-size: 0.7rem;
  color: var(--accent);
  margin-top: 2px;
  opacity: 0.7;
}

@media (max-width: 600px) {
  .editor-body {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .editor-sidebar {
    border-left: none;
    border-top: 1px solid var(--line);
    max-height: 200px;
  }
  .hole-list {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .hole-row {
    min-width: 100px;
    border-bottom: none;
    border-right: 1px solid var(--line);
  }
}

/* ── Share Card ── */

.share-card {
  text-align: center;
}

.share-card .dash-btn {
  margin-bottom: 16px;
}

.share-heading {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}

.share-btn:hover {
  background: rgba(255,255,255,0.12);
}

.share-x { border-color: #1da1f2; color: #1da1f2; }
.share-fb { border-color: #4267B2; color: #4267B2; }
.share-wa { border-color: #25D366; color: #25D366; }
.share-sms { border-color: var(--accent); color: var(--accent); }

/* ── Share CTA ── */

.share-cta {
  text-align: center;
  padding: 24px 16px;
}

.share-cta-text {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ── Replay CTA Bar ── */

.replay-cta-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}

.replay-cta-bar a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.replay-cta-bar a:hover {
  text-decoration: underline;
}
