/* ============================================================
   FAIRWAY — Design System
   A cohesive, modern, mobile-first golf coaching app.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Brand greens */
  --green-50:  #ecfdf3;
  --green-100: #d1fadf;
  --green-200: #a7f3c4;
  --green-300: #6ee7a3;
  --green-400: #34d399;
  --green-500: #16a34a;
  --green-600: #15803d;
  --green-700: #166534;
  --green-800: #14532d;

  --lime: #b6f36b;
  --sky:  #38bdf8;
  --amber:#fbbf24;
  --rose: #fb7185;
  --violet:#a78bfa;

  /* Dark theme surfaces — neutral charcoal so any accent scheme sits cleanly on top */
  --bg:        #0c0d10;
  --bg-2:      #101116;
  --surface:   #15171c;
  --surface-2: #1b1d23;
  --surface-3: #24272f;
  --hairline:  rgba(255,255,255,0.08);
  --hairline-2:rgba(255,255,255,0.14);

  --text:      #e9eaee;
  --text-2:    #aab0bb;
  --text-3:    #7f8693;
  --on-accent: #0b0d11;

  --accent:    var(--green-400);
  --accent-2:  var(--green-500);
  --accent-ink:#0a3d24;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius:    18px;
  --radius-lg: 24px;
  --radius-xl: 30px;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 8px 24px rgba(0,0,0,.36);
  --shadow-3: 0 18px 50px rgba(0,0,0,.5);
  --glow: 0 8px 30px color-mix(in srgb, var(--accent) 26%, transparent);

  --maxw: 720px;
  --tab-h: 76px;
  --top-h: 60px;

  --ease: cubic-bezier(.2,.7,.2,1);
  --ease-spring: cubic-bezier(.22,1.2,.36,1);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Sora', var(--font);
}

/* Light theme — neutral so the accent scheme defines the colour */
[data-theme="light"] {
  --bg:        #eef0f3;
  --bg-2:      #e6e8ee;
  --surface:   #ffffff;
  --surface-2: #f4f5f8;
  --surface-3: #e9ebf1;
  --hairline:  rgba(20,25,35,0.10);
  --hairline-2:rgba(20,25,35,0.18);
  --text:      #131720;
  --text-2:    #4a5160;
  --text-3:    #737b8a;
  --on-accent: #0b0d11;
  --accent:    var(--green-500);
  --accent-2:  var(--green-600);
  --accent-ink:#0c5132;
  --shadow-2: 0 10px 28px rgba(20,60,40,.12);
  --shadow-3: 0 20px 50px rgba(20,60,40,.16);
  --glow: 0 10px 30px color-mix(in srgb, var(--accent) 24%, transparent);
}

/* ---------- Colour schemes (accent palette; works in dark & light) ---------- */
[data-scheme="emerald"] { --green-300:#6ee7a3; --green-400:#34d399; --green-500:#16a34a; --green-600:#15803d; --green-700:#166534; --accent-ink:#0a3d24; }
[data-scheme="ocean"]   { --green-300:#7dd3fc; --green-400:#38bdf8; --green-500:#0ea5e9; --green-600:#0284c7; --green-700:#075985; --accent-ink:#0c3a52; }
[data-scheme="violet"]  { --green-300:#c4b5fd; --green-400:#a78bfa; --green-500:#8b5cf6; --green-600:#7c3aed; --green-700:#5b21b6; --accent-ink:#3b1f73; }
[data-scheme="sunset"]  { --green-300:#fdba74; --green-400:#fb923c; --green-500:#f97316; --green-600:#ea580c; --green-700:#9a3412; --accent-ink:#7c2d12; --on-accent:#2a1206; }
[data-scheme="rose"]    { --green-300:#fda4af; --green-400:#fb7185; --green-500:#f43f5e; --green-600:#e11d48; --green-700:#9f1239; --accent-ink:#7f1233; --on-accent:#2a0810; }
[data-scheme="gold"]    { --green-300:#fde68a; --green-400:#fbbf24; --green-500:#f59e0b; --green-600:#d97706; --green-700:#92400e; --accent-ink:#713f12; --on-accent:#241803; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  touch-action: manipulation; /* no double-tap zoom */
}
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font: inherit; color: inherit; }
::selection { background: var(--green-400); color: #06140c; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }

/* ---------- Splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--accent) 16%, var(--bg)) 0%, var(--bg) 60%);
  transition: opacity .5s var(--ease), visibility .5s;
}
.splash.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.splash__logo { animation: pop .7s var(--ease-spring) both; filter: drop-shadow(0 10px 30px color-mix(in srgb, var(--accent) 40%, transparent)); }
.splash__name {
  font-family: var(--display); font-weight: 800; letter-spacing: .28em;
  font-size: 22px; margin-top: 14px; color: var(--text);
  animation: fadeUp .6s .15s var(--ease) both;
}
.splash__tag { color: var(--text-3); font-size: 13px; letter-spacing: .04em; animation: fadeUp .6s .28s var(--ease) both; }
.splash__spinner {
  margin-top: 26px; width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--surface-3); border-top-color: var(--green-400);
  animation: spin .8s linear infinite; animation-delay: .3s;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- App shell ---------- */
.app { min-height: 100dvh; }
.main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(var(--top-h) + env(safe-area-inset-top) + 8px) 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 18px);
  outline: none;
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: calc(var(--top-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0;
  display: flex; align-items: center; justify-content: space-between;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  border-bottom: 1px solid var(--hairline);
}
.topbar__brand { display: flex; align-items: center; gap: 9px; background: none; border: 0; padding: 6px; color: var(--text); }
.topbar__mark { display: grid; place-items: center; filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--accent) 30%, transparent)); }
.topbar__title { font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: .01em; }
.topbar__actions { display: flex; align-items: center; gap: 6px; }
.iconbtn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--hairline);
  background: var(--surface); color: var(--text-2);
  display: grid; place-items: center; transition: .18s var(--ease);
}
.iconbtn:hover { color: var(--text); background: var(--surface-2); border-color: var(--hairline-2); }
.iconbtn:active { transform: scale(.92); }
.avatarbtn {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--accent);
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  color: #fff; font-weight: 700; font-size: 15px; display: grid; place-items: center;
  font-family: var(--display);
}
.avatarbtn:active { transform: scale(.92); }

/* ---------- Bottom tab bar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(150%) blur(18px);
  -webkit-backdrop-filter: saturate(150%) blur(18px);
  box-shadow: 0 -14px 28px -16px rgba(0,0,0,.55);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3); font-size: 11px; font-weight: 600; letter-spacing: .01em;
  transition: color .18s var(--ease); position: relative; padding-top: 6px;
}
.tab svg { transition: transform .25s var(--ease-spring); }
.tab.is-active { color: var(--accent); }
.tab.is-active svg { transform: translateY(-2px); }
.tab.is-active::before {
  content: ""; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 3px;
  background: var(--accent); box-shadow: var(--glow);
}
.tab--accent .tab__fab {
  width: 56px; height: 56px; margin-top: -26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-400), var(--green-600));
  color: var(--on-accent); display: flex; align-items: center; justify-content: center;
  transition: transform .2s var(--ease-spring);
}
.tab--accent .tab__fab svg { width: 26px; height: 26px; display: block; }
.tab--accent { color: var(--text-2); }
.tab--accent:active .tab__fab { transform: scale(.9); }

/* ---------- Typography helpers ---------- */
.h1 { font-family: var(--display); font-weight: 800; font-size: clamp(26px, 7vw, 34px); letter-spacing: -.02em; line-height: 1.1; margin: 0; }
.h2 { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.01em; margin: 0; }
.h3 { font-family: var(--display); font-weight: 700; font-size: 16px; margin: 0; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---------- Layout utilities ---------- */
.page { animation: pageIn .4s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 18px; }
.page-head .sub { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.spacer { flex: 1; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 26px; }
.center { text-align: center; }
.hide { display: none !important; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-1);
}
.card.pad-lg { padding: 20px; }
.card.glass {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(12px);
}
.card-link { transition: transform .15s var(--ease), border-color .15s; }
.card-link:active { transform: scale(.985); border-color: var(--hairline-2); }

/* Section heading row */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 12px; }
.section-head .h2 { font-size: 18px; }
.link-more { color: var(--accent); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--hairline-2); background: var(--surface-2); color: var(--text);
  padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 15px;
  transition: .16s var(--ease); white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn:hover { border-color: var(--accent); }
.btn--primary {
  background: linear-gradient(135deg, var(--green-400), var(--green-600));
  color: var(--on-accent); border: 0; box-shadow: var(--glow); font-weight: 700;
}
.btn--primary:hover { filter: brightness(1.05); }
.btn--ghost { background: transparent; border-color: var(--hairline); color: var(--text-2); }
.btn--ghost:hover { color: var(--text); }
.btn--danger { background: transparent; border-color: color-mix(in srgb, var(--rose) 50%, transparent); color: var(--rose); }
.btn--block { width: 100%; }
.btn--sm { padding: 9px 13px; font-size: 13px; border-radius: 11px; }
.btn--lg { padding: 15px 22px; font-size: 16px; border-radius: 16px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--hairline); color: var(--text-2);
  font-size: 13px; font-weight: 600; transition: .15s var(--ease); white-space: nowrap;
}
.chip:active { transform: scale(.95); }
.chip.is-active { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); color: var(--accent); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill--green { background: color-mix(in srgb, var(--green-400) 18%, transparent); color: var(--green-300); }
.pill--amber { background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber); }
.pill--sky   { background: color-mix(in srgb, var(--sky) 18%, transparent); color: var(--sky); }
.pill--rose  { background: color-mix(in srgb, var(--rose) 18%, transparent); color: var(--rose); }
.pill--violet{ background: color-mix(in srgb, var(--violet) 18%, transparent); color: var(--violet); }
.pill--muted { background: var(--surface-3); color: var(--text-2); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.field > .input, .field > .select, .field > .textarea { width: 100%; }
/* segmented inside a field only takes the width it needs */
.field > .seg { align-self: flex-start; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--hairline-2); color: var(--text);
  padding: 13px 14px; border-radius: 13px; font-size: 16px; transition: .15s var(--ease);
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.textarea { resize: vertical; min-height: 84px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%237d978a' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
.input-row { display: flex; gap: 10px; }

/* stepper */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--hairline-2); border-radius: 13px; overflow: hidden; background: var(--bg-2); }
.stepper button { width: 46px; height: 48px; background: transparent; border: 0; color: var(--accent); font-size: 22px; font-weight: 700; display: grid; place-items: center; }
.stepper button:active { background: var(--surface-3); }
.stepper .val { min-width: 54px; text-align: center; font-family: var(--display); font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; }

/* iOS-style wheel picker */
.wheel-row { display: flex; gap: 14px; justify-content: center; align-items: flex-end; margin-top: 4px; }
.wheel-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.wheel-label { font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
.wheel-wrap { position: relative; width: 124px; }
.wheel {
  height: 220px; overflow-y: scroll; scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  scrollbar-width: none; -ms-overflow-style: none; touch-action: pan-y;
  border-radius: 18px; background: var(--bg-2); border: 1px solid var(--hairline-2);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 24%, #000 76%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 24%, #000 76%, transparent);
}
.wheel::-webkit-scrollbar { display: none; width: 0; height: 0; }
.wheel-pad { height: 88px; flex: none; }
.wheel-item {
  height: 44px; display: grid; place-items: center; scroll-snap-align: center;
  background: transparent; border: 0; padding: 0; width: 100%; cursor: pointer;
  font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--text);
  transition: opacity .14s ease, transform .14s ease;
}
.wheel-item.is-sel { color: var(--green-400); }
.wheel-band {
  position: absolute; left: 6px; right: 6px; top: 50%; height: 44px; transform: translateY(-50%);
  pointer-events: none; border-radius: 12px; background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--hairline-2);
}

/* ---------- Hole map (Leaflet satellite shot tracker) ---------- */
.map-readout { margin-bottom: 10px; }
.map-readout__row { display: flex; gap: 18px; justify-content: center; align-items: flex-end; }
.map-readout__big { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1; color: var(--sky); font-variant-numeric: tabular-nums; }
.map-readout__lbl { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); margin-top: 4px; }
.map-canvas { width: 100%; height: 46vh; min-height: 280px; border-radius: 16px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--hairline-2); }
.map-canvas.leaflet-container { font: inherit; }
.map-hint { font-size: 12.5px; color: var(--text-3); margin-top: 8px; line-height: 1.4; }
.map-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.map-shots { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.map-shot { display: flex; align-items: center; gap: 10px; padding: 6px 2px; }
.map-shot__n { width: 26px; height: 26px; flex: none; border-radius: 999px; background: var(--surface-3); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.map-shot__main { flex: 1; min-width: 0; }
.map-shot__top { display: flex; gap: 6px; }
.map-shot__meta { font-size: 12px; color: var(--text-3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.map-sel { background: var(--bg-2); color: var(--text); border: 1px solid var(--hairline-2); border-radius: 9px; padding: 5px 8px; font-size: 13px; font-weight: 600; -webkit-appearance: none; appearance: none; }
.map-cond { margin-top: 10px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--hairline-2); border-radius: 14px; }
.map-cond:empty { display: none; }
.map-cond .field { margin: 0; }
.map-tools .btn.is-active { border-color: var(--accent); color: var(--accent); }
.gps-live { width: 8px; height: 8px; border-radius: 999px; background: var(--sky); box-shadow: 0 0 0 0 var(--sky); animation: gpsPulse 1.4s infinite; }
@keyframes gpsPulse { 0% { box-shadow: 0 0 0 0 rgba(56,189,248,.6); } 70% { box-shadow: 0 0 0 7px rgba(56,189,248,0); } 100% { box-shadow: 0 0 0 0 rgba(56,189,248,0); } }
.btn.is-pending { opacity: .5; }

/* ---------- Sign in / create account gate ---------- */
.login-overlay { position: fixed; inset: 0; z-index: 4000; background: var(--bg); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 24px 16px; animation: fade .25s ease; }
.login-overlay.out { animation: fade .25s reverse forwards; }
.login-card { width: 100%; max-width: 380px; margin: auto; background: var(--surface-2); border: 1px solid var(--hairline-2); border-radius: 22px; padding: 26px 22px; box-shadow: 0 24px 60px -24px rgba(0,0,0,.6); }
.login-head { text-align: center; margin-bottom: 18px; }
.login-logo { width: 64px; height: 64px; margin: 0 auto 10px; }
.login-name { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: .01em; }
.login-tag { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.login-seg { display: flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--hairline-2); border-radius: 13px; padding: 4px; margin-bottom: 16px; }
.login-seg .seg-opt { flex: 1; border: 0; background: transparent; color: var(--text-2); font-weight: 700; font-size: 14px; padding: 9px 0; border-radius: 10px; cursor: pointer; }
.login-seg .seg-opt.is-active { background: var(--accent); color: #06140c; }
.login-err { color: var(--rose); font-size: 13px; font-weight: 600; min-height: 18px; margin-top: 10px; text-align: center; }
.login-toggle { display: block; width: 100%; background: transparent; border: 0; color: var(--accent); font-weight: 700; font-size: 13px; padding: 14px 0 2px; cursor: pointer; }
.login-fine { color: var(--text-3); font-size: 11.5px; line-height: 1.5; text-align: center; margin-top: 10px; }
/* DivIcon markers */
.mk { display: grid; place-items: center; }
.mk--ball b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; background: #34d399; color: #06140c; font-size: 12px; font-weight: 800; box-shadow: 0 1px 4px rgba(0,0,0,.5); border: 2px solid #06140c; }
.mk--ball.mk--tee b { background: #fbbf24; }
.mk--ball.mk--sand b { background: #f4e2b3; }
.mk--ball.mk--rough b { background: #6ee7a3; }
.mk--ball.mk--green b { background: #38bdf8; }
.mk--flag span { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.mk--tee2 span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; background: #fbbf24; color: #06140c; font-size: 11px; font-weight: 800; border: 2px solid #06140c; box-shadow: 0 1px 3px rgba(0,0,0,.5); }

/* Camera flip (front/back) button in the record sheet */
.cam-flip {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 44px; height: 44px; border-radius: 999px; border: 0;
  background: rgba(11,20,17,.55); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0,0,0,.4); cursor: pointer;
}
.cam-flip:active { background: rgba(11,20,17,.8); transform: scale(.94); }
.cam-flip svg { display: block; }
.clip-tag { position: absolute; top: 8px; left: 8px; z-index: 2; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: rgba(11,20,17,.62); color: #fff; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.leaflet-container .leaflet-control-attribution { font-size: 9px; background: rgba(0,0,0,.45); color: #cbd5e1; }
.leaflet-bar a { background: var(--surface-2); color: var(--text); border-bottom-color: var(--hairline-2); }
.leaflet-bar a:hover { background: var(--surface-3); }

/* ---------- Stat tiles ---------- */
.stat {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--hairline); border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden;
}
.stat__label { font-size: 12px; color: var(--text-3); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat__value { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__delta { font-size: 12px; font-weight: 700; }
.stat__delta.up { color: var(--green-300); } .stat__delta.down { color: var(--rose); }
.stat__spark { position: absolute; right: 0; bottom: 0; opacity: .55; }

/* ---------- Progress ---------- */
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green-400), var(--green-500)); transition: width .6s var(--ease); }
.ring { display: inline-grid; place-items: center; }
.ring text { font-family: var(--display); }

/* ---------- List rows ---------- */
.list { display: flex; flex-direction: column; }
.lrow { display: flex; align-items: center; gap: 13px; padding: 13px 4px; border-bottom: 1px solid var(--hairline); }
.lrow:last-child { border-bottom: 0; }
.lrow__icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent); flex: none; }
.lrow__main { flex: 1; min-width: 0; }
.lrow__title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow__sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.lrow__end { color: var(--text-3); display: flex; align-items: center; gap: 8px; flex: none; }

/* ---------- Hero / featured ---------- */
.hero {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; padding: 20px;
  background:
    radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
    linear-gradient(160deg, var(--surface-3), var(--surface));
  border: 1px solid var(--hairline-2);
}
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%); }

/* video thumb */
.thumb { position: relative; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 16/10; background: var(--surface-3); }
.thumb__grad { position: absolute; inset: 0; }
.thumb__play { position: absolute; inset: 0; display: grid; place-items: center; }
.thumb__play span { width: 52px; height: 52px; border-radius: 50%; background: rgba(8,18,12,.55); backdrop-filter: blur(4px); display: grid; place-items: center; color: #fff; border: 1px solid rgba(255,255,255,.25); transition: transform .2s var(--ease-spring); }
.thumb:active .thumb__play span { transform: scale(.88); }
.thumb__time { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 7px; }
.thumb__tag { position: absolute; left: 8px; top: 8px; }

/* horizontal scroller */
.hscroll { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 6px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: none; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 40px 18px; color: var(--text-3); }
.empty svg { opacity: .5; margin-bottom: 10px; }
.empty .h3 { color: var(--text-2); margin-bottom: 6px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto; max-width: var(--maxw); width: max-content; max-width: calc(100% - 8px);
  background: var(--surface-3); color: var(--text); border: 1px solid var(--hairline-2);
  padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-3); font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 10px; animation: toastIn .3s var(--ease-spring);
}
.toast.out { animation: toastOut .3s var(--ease) forwards; }
.toast .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.toast.err .dot { background: var(--rose); }
.toast__action { margin-left: 6px; background: transparent; border: 0; color: var(--accent); font-weight: 800; font-size: 14px; padding: 4px 6px; }
.toast__action:active { opacity: .6; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Modal / sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(3,8,5,.6); backdrop-filter: blur(4px); animation: fade .25s var(--ease); display: flex; align-items: flex-end; justify-content: center; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: var(--maxw); background: var(--surface);
  border: 1px solid var(--hairline-2); border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 8px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-3); animation: sheetUp .35s var(--ease-spring); max-height: 92dvh; overflow-y: auto;
}
@media (min-width: 640px) {
  .scrim { align-items: center; }
  .sheet { border-radius: var(--radius-lg); border-bottom: 1px solid var(--hairline-2); margin: 0 16px; animation: pop .3s var(--ease-spring); }
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet__grab { width: 40px; height: 4px; border-radius: 4px; background: var(--surface-3); margin: 6px auto 14px; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet__close { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--hairline); color: var(--text-2); display: grid; place-items: center; }

/* ---------- Scorecard ---------- */
.scorecard { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--hairline); }
.scorecard table { border-collapse: collapse; width: 100%; min-width: 560px; }
.scorecard th, .scorecard td { padding: 9px 6px; text-align: center; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--hairline); font-size: 13px; }
.scorecard thead th { background: var(--surface-2); color: var(--text-3); font-weight: 700; position: sticky; top: 0; }
.scorecard .rowlabel { text-align: left; padding-left: 12px; color: var(--text-2); font-weight: 600; white-space: nowrap; position: sticky; left: 0; background: var(--surface); }
.scorecard .tot { background: var(--surface-2); font-weight: 800; font-family: var(--display); }
.sc-eagle { color: #fff; background: var(--violet); border-radius: 50%; }
.sc-birdie { color: #fff; background: var(--green-500); border-radius: 50%; }
.sc-par { color: var(--text); }
.sc-bogey { color: var(--text); box-shadow: inset 0 0 0 1.5px var(--amber); }
.sc-double { color: var(--text); box-shadow: inset 0 0 0 1.5px var(--rose); }
.sc-cell { display: inline-grid; place-items: center; width: 26px; height: 26px; font-weight: 700; }

/* ---------- Calendar ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-3); padding-bottom: 4px; }
.cal-cell {
  aspect-ratio: 1; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--hairline);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 14px; font-weight: 600; position: relative; transition: .15s var(--ease);
}
.cal-cell.dim { opacity: .35; }
.cal-cell.today { border-color: var(--accent); color: var(--accent); }
.cal-cell.sel { background: color-mix(in srgb, var(--accent) 20%, transparent); border-color: var(--accent); }
.cal-cell:active { transform: scale(.92); }
.cal-dots { display: flex; gap: 3px; position: absolute; bottom: 7px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; }
.cal-cell.done::after { content: "✓"; position: absolute; top: 4px; right: 6px; font-size: 9px; color: var(--green-300); }

/* segmented control */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--text-2); padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: 13px; transition: .15s var(--ease); }
.seg button.is-active { background: var(--accent); color: var(--on-accent); }

/* avatar group */
.avg { display: flex; }
.avg > * { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.avg > *:first-child { margin-left: 0; }

/* checklist */
.check { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--hairline); }
.check:last-child { border-bottom: 0; }
.check__box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--hairline-2); display: grid; place-items: center; color: transparent; transition: .18s var(--ease-spring); flex: none; }
.check.done .check__box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.check.done .check__label { color: var(--text-3); text-decoration: line-through; }
.check__label { flex: 1; font-weight: 500; }

/* badges grid */
.badge { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.badge__medal { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: var(--surface-3); border: 1px solid var(--hairline-2); }
.badge.locked { opacity: .4; filter: grayscale(1); }
.badge__name { font-size: 11px; font-weight: 600; color: var(--text-2); }

/* feed */
.feed-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.feed-item:last-child { border-bottom: 0; }
.feed-av { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.bubble { background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 4px 16px 16px 16px; padding: 11px 14px; }
.bubble.me { background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); border-radius: 16px 4px 16px 16px; }

/* misc */
.divider { height: 1px; background: var(--hairline); margin: 16px 0; border: 0; }
.kbd { font-family: var(--display); font-variant-numeric: tabular-nums; }
.tabular { font-variant-numeric: tabular-nums; }
.clickable { cursor: pointer; }
.tap { -webkit-tap-highlight-color: transparent; }
.skel { background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* fade-in stagger for lists */
.stagger > * { animation: fadeUp .45s var(--ease) both; }
.stagger > *:nth-child(1){animation-delay:.02s}.stagger > *:nth-child(2){animation-delay:.06s}.stagger > *:nth-child(3){animation-delay:.1s}.stagger > *:nth-child(4){animation-delay:.14s}.stagger > *:nth-child(5){animation-delay:.18s}.stagger > *:nth-child(6){animation-delay:.22s}.stagger > *:nth-child(7){animation-delay:.26s}.stagger > *:nth-child(8){animation-delay:.3s}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
[data-reduce-motion] *, [data-reduce-motion] *::before, [data-reduce-motion] *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }

/* left-handed mirroring of directional visuals */
[data-hand="left"] .hand-mirror { transform: scaleX(-1); }

/* swipe section transitions */
.main.swipe-next .page { animation: swipeInNext .34s var(--ease) both; }
.main.swipe-prev .page { animation: swipeInPrev .34s var(--ease) both; }
@keyframes swipeInNext { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: translateX(0); } }
@keyframes swipeInPrev { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: translateX(0); } }

/* ---------- Video player ---------- */
.vplayer { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; }
.vplayer__veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.55)); }
.vplayer__badge { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 5px; background: rgba(0,0,0,.5); color: #fff; font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 99px; backdrop-filter: blur(4px); }
.vplayer__title { position: absolute; left: 14px; bottom: 12px; right: 14px; color: #fff; font-family: var(--display); font-weight: 700; font-size: 17px; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.vplayer__center { position: absolute; width: 180%; height: 60%; background: radial-gradient(circle, rgba(255,255,255,.12), transparent 60%); animation: vpulse 3s ease-in-out infinite; }
@keyframes vpulse { 50% { transform: scale(1.1); opacity: .7; } }
.vplayer__play { position: absolute; width: 72px; height: 72px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: #06140c; display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: transform .2s var(--ease-spring); z-index: 2; }
.vplayer__play:active { transform: scale(.9); }
.vplayer.playing .vplayer__veil { background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.35)); }
.vplayer__controls { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.vplayer__bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.vplayer__bar > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 6px; transition: width .18s linear; }
.vplayer__time { display: flex; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cue-list { margin: 8px 0 14px; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.cue-list li { position: relative; padding-left: 26px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.cue-list li::before { content: ""; position: absolute; left: 6px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---------- Exercise card ---------- */
.excard { width: 230px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--hairline); background: var(--surface); }
.excard__media { position: relative; aspect-ratio: 16/10; }
.excard__grad { position: absolute; inset: 0; }
.excard__veil { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.5)); }
.excard__play { position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.9); color: #06140c; display: grid; place-items: center; }
.excard__tag { position: absolute; left: 10px; top: 10px; }
.excard__body { padding: 12px 13px 14px; }
.excard__title { font-weight: 700; font-size: 15px; font-family: var(--display); }
.excard__meta { display: flex; gap: 10px; color: var(--text-3); font-size: 12px; margin-top: 6px; align-items: center; }

/* exercise list item (full width) */
.exitem { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--radius); border: 1px solid var(--hairline); background: var(--surface); transition: .15s var(--ease); }
.exitem:active { transform: scale(.99); border-color: var(--hairline-2); }
.exitem__media { width: 76px; height: 60px; border-radius: 12px; position: relative; overflow: hidden; flex: none; }
.exitem__media .excard__veil { border-radius: 12px; }
.exitem__play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.exitem__main { flex: 1; min-width: 0; }
.exitem__title { font-weight: 700; font-size: 15px; }
.exitem__meta { color: var(--text-3); font-size: 12px; margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- club distance row ---------- */
.club-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--hairline); }
.club-row:last-child { border-bottom: 0; }
.club-badge { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 14px; color: #06140c; flex: none; }
.club-row__bar { flex: 1; min-width: 0; }
.club-row__name { font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.club-row__val { font-family: var(--display); font-weight: 800; font-variant-numeric: tabular-nums; }
.club-track { height: 8px; border-radius: 99px; background: var(--surface-3); margin-top: 7px; overflow: hidden; }
.club-track > span { display: block; height: 100%; border-radius: 99px; transition: width .7s var(--ease); }

/* dashboard hero ring layout */
.hero-grid { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.hero-stats { display: flex; gap: 18px; flex-wrap: wrap; }
.hero-stat .v { font-family: var(--display); font-weight: 800; font-size: 20px; }
.hero-stat .l { font-size: 11px; color: var(--text-2); }

/* coach card */
.coach-hero { display: flex; gap: 14px; align-items: center; }
.coach-av { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 22px; color: #06140c; flex: none; }

/* messages */
.msg-wrap { display: flex; flex-direction: column; gap: 12px; padding: 6px 0; }
.msg { display: flex; gap: 9px; max-width: 86%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg__time { font-size: 10px; color: var(--text-3); margin-top: 4px; }
.composer { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: 0; padding-top: 8px; background: linear-gradient(180deg, transparent, var(--bg) 30%); }

/* hole stepper big */
.hole-card { text-align: center; }
.hole-num { font-family: var(--display); font-weight: 800; font-size: 15px; color: var(--text-2); letter-spacing: .1em; text-transform: uppercase; }
.hole-par { font-size: 13px; color: var(--text-3); }
.score-display { font-family: var(--display); font-weight: 800; font-size: 64px; line-height: 1; margin: 10px 0; font-variant-numeric: tabular-nums; }
.score-pills { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }
.score-pick { width: 46px; height: 46px; border-radius: 13px; border: 1px solid var(--hairline-2); background: var(--surface-2); font-family: var(--display); font-weight: 700; font-size: 17px; display: grid; place-items: center; transition: .12s var(--ease); }
.score-pick.is-active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); transform: scale(1.05); }
.toggle-pill { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--hairline-2); background: var(--surface-2); font-weight: 600; font-size: 13px; color: var(--text-2); }
.toggle-pill.on { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); color: var(--accent); }

/* progress dots for hole nav */
.hole-dots { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.hole-dot { width: 22px; height: 22px; border-radius: 7px; font-size: 10px; font-weight: 700; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--hairline); color: var(--text-3); }
.hole-dot.cur { border-color: var(--accent); color: var(--accent); }
.hole-dot.played { background: var(--surface-3); color: var(--text); }

/* onboarding */
.onb { max-width: 460px; margin: 0 auto; }
.onb-logo { width: 84px; height: 84px; margin: 0 auto 18px; filter: drop-shadow(0 10px 30px color-mix(in srgb, var(--accent) 40%, transparent)); }
.onb-overlay { position: fixed; inset: 0; z-index: 95; display: flex; align-items: flex-start; justify-content: center; padding: 28px 20px calc(28px + env(safe-area-inset-bottom)); background: radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--accent) 16%, var(--bg)) 0%, var(--bg) 60%); animation: fade .3s var(--ease); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.onb-overlay.out { animation: fade .35s reverse forwards; }
/* margin:auto centres the card when there's room, but pins it to the top (fully
   scrollable, no clipping) when the content is taller than the viewport */
.onb-card { width: 100%; max-width: 440px; margin: auto; background: var(--surface); border: 1px solid var(--hairline-2); border-radius: var(--radius-lg); padding: 26px 22px; box-shadow: var(--shadow-3); animation: pop .4s var(--ease-spring); }
/* selectable interest tags (strengths / weaknesses) */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; padding: 8px 13px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--hairline); color: var(--text-2); font-size: 13px; font-weight: 600; transition: .15s var(--ease); white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.tag:active { transform: scale(.94); }
.tag.is-active { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); color: var(--accent); }
.tag--wk.is-active { background: color-mix(in srgb, var(--amber) 18%, transparent); border-color: var(--amber); color: var(--amber); }

.onb-progress { display: flex; gap: 7px; justify-content: center; margin-top: 22px; }
.onb-progress i { width: 7px; height: 7px; border-radius: 50%; background: var(--surface-3); transition: .2s var(--ease); }
.onb-progress i.on { background: var(--accent); width: 22px; border-radius: 4px; }

/* large-text accessibility — bumps common text; !important beats inline px sizes */
[data-bigtext] { font-size: 18px; }
[data-bigtext] .h1 { font-size: 32px !important; }
[data-bigtext] .h2 { font-size: 23px !important; }
[data-bigtext] .h3 { font-size: 18px !important; }
[data-bigtext] .lrow__title { font-size: 17px !important; }
[data-bigtext] .lrow__sub, [data-bigtext] .muted, [data-bigtext] .dim { font-size: 14.5px !important; }
[data-bigtext] .btn { font-size: 16.5px !important; }
[data-bigtext] .btn--sm { font-size: 14.5px !important; }
[data-bigtext] .chip, [data-bigtext] .seg button, [data-bigtext] .pill { font-size: 14px !important; }
[data-bigtext] p, [data-bigtext] .field > label, [data-bigtext] .check__label { font-size: 16px !important; }
[data-bigtext] .eyebrow { font-size: 13px !important; }

/* colour scheme picker */
.scheme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.scheme-chip { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 6px; border-radius: 14px; border: 1.5px solid var(--hairline); background: var(--surface-2); transition: .15s var(--ease); }
.scheme-chip.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); }
.scheme-chip:active { transform: scale(.96); }
.scheme-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.scheme-name { font-size: 12px; font-weight: 600; color: var(--text-2); }
.scheme-chip.is-active .scheme-name { color: var(--text); }

/* scrolling model picker list */
.model-scroll { max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--hairline); border-radius: 14px; padding: 2px 12px; background: var(--bg-2); overscroll-behavior: contain; }
.model-scroll .lrow:last-child { border-bottom: 0; }
.model-scroll .dim { padding: 10px 2px; }

/* keep single icons optically centred inside their circular/box containers
   (removes the inline-SVG baseline gap so they sit dead-centre) */
.iconbtn svg, .lrow__icon svg, .club-badge svg, .badge__medal svg, .tab__fab svg,
.scheme-dot svg, .check__box svg, .score-pick svg, .topbar__mark svg, .topbar__brand svg,
.thumb__play span svg, .vplayer__play svg, .coach-av svg, .feed-av svg, .avatarbtn svg,
.excard__play svg, .exitem__play svg, .stepper button svg { display: block; }

/* brand mark follows the active colour scheme */
.topbar__mark .bm-bg { fill: var(--surface-3); }
.topbar__mark .bm-flag { fill: var(--accent); }

/* tight line-height so initials/short text sit dead-centre in round/box badges */
.avatarbtn, .coach-av, .feed-av, .club-badge, .avg > *, .badge__medal,
.hole-dot, .scheme-dot, .lrow__icon, .stat__value, .score-pick,
.tab__fab, .check__box, .hole-num, .score-display { line-height: 1; }
/* optical nudge: all-caps initials/short text render high in their line box,
   so push them down ~0.06em to sit on the true centre (works for text nodes too) */
.avatarbtn, .coach-av, .feed-av, .club-badge, .avg > *, .hole-dot { padding-top: 0.12em; }

/* toggle switch */
.switch { width: 46px; height: 28px; border-radius: 999px; border: 0; background: var(--surface-3); position: relative; transition: background .2s var(--ease); flex: none; }
.switch.on { background: var(--accent); }
.switch__knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); transition: transform .2s var(--ease-spring); }
.switch.on .switch__knob { transform: translateX(18px); }

/* desktop niceties — frame the app as a centered column so the nav isn't stretched */
@media (min-width: 760px) {
  html { background: var(--bg-2); }
  .main {
    padding-left: 24px; padding-right: 24px; min-height: 100dvh;
    background: var(--bg);
    border-left: 1px solid var(--hairline); border-right: 1px solid var(--hairline);
  }
  .topbar {
    left: 50%; right: auto; transform: translateX(-50%); width: 100%; max-width: var(--maxw);
    border-left: 1px solid var(--hairline); border-right: 1px solid var(--hairline);
  }
  .tabbar {
    left: 50%; right: auto; transform: translateX(-50%); width: 100%; max-width: var(--maxw);
    border-top-left-radius: 18px; border-top-right-radius: 18px;
    border-left: 1px solid var(--hairline); border-right: 1px solid var(--hairline);
  }
  .grid-2.lg-4 { grid-template-columns: repeat(4, 1fr); }
  .excard { width: 250px; }
}
