/* ============================================================
   app.css — Golf App Design System
   Fonts: Fraunces (display) · Figtree (UI) · JetBrains Mono (scores)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,600;0,9..144,700;1,9..144,400&family=Figtree:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600;700&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-base:        #090d0b;
  --bg-surface:     #111916;
  --bg-raised:      #172219;
  --bg-overlay:     #1e2d22;
  --bg-input:       #0f1a12;

  /* Greens */
  --green-900:      #0a2416;
  --green-800:      #0f3320;
  --green-700:      #1a4d30;
  --green-600:      #256640;
  --green-500:      #2d8653;
  --green-400:      #3aad6a;
  --green-300:      #52c882;
  --green-200:      #7ddea4;
  --green-100:      #b2eecb;
  --green-50:       #e8f8ef;

  /* Accent — mint */
  --accent:         #52c882;
  --accent-glow:    rgba(82, 200, 130, 0.25);
  --accent-dim:     rgba(82, 200, 130, 0.12);

  /* Score colors */
  --score-eagle:    #3b9edd;   /* blue */
  --score-birdie:   #52c882;   /* green */
  --score-par:      #8a9e92;   /* neutral */
  --score-bogey:    #f0a500;   /* amber */
  --score-double:   #e05c3a;   /* orange-red */
  --score-triple:   #d63031;   /* red */

  /* Text */
  --text-primary:   #e8f2ec;
  --text-secondary: #8aab94;
  --text-muted:     #4a6655;
  --text-inverse:   #090d0b;

  /* Borders */
  --border:         rgba(82, 200, 130, 0.1);
  --border-strong:  rgba(82, 200, 130, 0.22);

  /* Status */
  --danger:         #e05c3a;
  --danger-dim:     rgba(224, 92, 58, 0.15);
  --warning:        #f0a500;
  --warning-dim:    rgba(240, 165, 0, 0.15);
  --info:           #3b9edd;
  --info-dim:       rgba(59, 158, 221, 0.15);

  /* Typography */
  --font-display:   'Fraunces', Georgia, serif;
  --font-ui:        'Figtree', system-ui, sans-serif;
  --font-mono:      'JetBrains Mono', 'Courier New', monospace;

  /* Spacing */
  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;
  --space-4: 16px;  --space-5: 20px;  --space-6: 24px;
  --space-8: 32px;  --space-10: 40px; --space-12: 48px;

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 24px var(--accent-glow);

  /* Transitions */
  --transition: 0.18s ease;
  --transition-slow: 0.35s ease;

  /* Nav */
  --nav-height: 64px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html {
  height: 100%;
  overflow: hidden; /* prevent body scroll → browser chrome stays locked */
}

body {
  font-family: var(--font-ui);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  height: 100%;
  overflow: hidden; /* scroll happens inside .page-wrapper only */
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.8; }
img { max-width: 100%; display: block; }
button { font-family: var(--font-ui); cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: var(--font-ui); }

/* ── Page layout ────────────────────────────────────────────── */
.page-wrapper {
  /* The only scrollable element — body/html are overflow:hidden above */
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 16px);
}

.page-wrapper--no-nav {
  padding-bottom: env(safe-area-inset-bottom);
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container--wide {
  max-width: 720px;
}

/* ── Typography ─────────────────────────────────────────────── */
.display-xl {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.display-lg {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  font-weight: 600;
  line-height: 1.15;
}

.display-md {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1rem;    font-weight: 600; }

.text-muted    { color: var(--text-secondary); }
.text-sm       { font-size: 0.8125rem; }
.text-xs       { font-size: 0.75rem; }
.text-mono     { font-family: var(--font-mono); }
.text-accent   { color: var(--accent); }
.text-danger   { color: var(--danger); }
.text-center   { text-align: center; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card--raised {
  background: var(--bg-raised);
  box-shadow: var(--shadow-md);
}

.card__header {
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.card__body {
  padding: var(--space-5);
}

.card__footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--bg-overlay);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-5);
  height: 48px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font-ui);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn--primary {
  background: var(--accent);
  color: var(--text-inverse);
  box-shadow: 0 2px 12px var(--accent-glow);
}
.btn--primary:hover { background: var(--green-200); transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-glow); }
.btn--primary:active { transform: translateY(0); }

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn--ghost:hover { background: var(--bg-raised); border-color: var(--accent); }

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

.btn--sm {
  height: 36px;
  padding: 0 var(--space-4);
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
}

.btn--lg {
  height: 56px;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn--full { width: 100%; }

.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn--loading { pointer-events: none; }
.btn--loading::after {
  content: '';
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: var(--space-2);
}

/* ── Form controls ───────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 var(--space-4);
  height: 48px;
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: var(--font-ui);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
  -webkit-appearance: none;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-input::placeholder { color: var(--text-muted); }

.form-input--error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-dim);
}

.form-error {
  font-size: 0.8125rem;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238aab94' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ── Navigation ─────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  /* Body scroll is locked, so this stays perfectly anchored — no jank */
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color var(--transition);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  flex: 1;
  min-width: 0;
}

.bottom-nav__item svg { width: 22px; height: 22px; transition: transform var(--transition); }
.bottom-nav__item:hover, .bottom-nav__item.active { color: var(--accent); }
.bottom-nav__item.active svg { transform: scale(1.1); }

/* FAB — start round button */
.fab {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-inverse);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px var(--accent-glow);
  transition: all var(--transition);
  flex-shrink: 0;
  cursor: pointer;
  border: none;
  -webkit-tap-highlight-color: transparent;
}
.fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px var(--accent-glow); }
.fab svg { width: 24px; height: 24px; }

/* ── Page header ─────────────────────────────────────────────── */
.page-header {
  padding: var(--space-6) var(--space-4) var(--space-4);
  position: sticky;
  top: 0;
  background: var(--bg-base);
  z-index: 50;
  border-bottom: 1px solid var(--border);
}

.page-header__inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Score cells (scorecard) ─────────────────────────────────── */
.score-cell {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  background: var(--bg-overlay);
  color: var(--text-muted);
  user-select: none;
}

.score-cell:hover { border-color: var(--border-strong); color: var(--text-primary); }
.score-cell:active { transform: scale(0.92); }
.score-cell.entered { color: var(--text-primary); }

/* Score variants */
.score-cell.ace       { background: rgba(59,158,221,0.2); border-color: var(--score-eagle); color: var(--score-eagle); box-shadow: 0 0 12px rgba(59,158,221,0.3); }
.score-cell.eagle     { background: rgba(59,158,221,0.15); border-color: var(--score-eagle); color: var(--score-eagle); }
.score-cell.birdie    { background: rgba(82,200,130,0.18); border-color: var(--score-birdie); color: var(--score-birdie); }
.score-cell.par       { background: var(--bg-overlay); border-color: var(--border-strong); color: var(--text-secondary); }
.score-cell.bogey     { background: rgba(240,165,0,0.15); border-color: var(--score-bogey); color: var(--score-bogey); }
.score-cell.double    { background: rgba(224,92,58,0.15); border-color: var(--score-double); color: var(--score-double); }
.score-cell.triple    { background: rgba(214,48,49,0.2); border-color: var(--score-triple); color: var(--score-triple); }

/* ── Stat tiles ──────────────────────────────────────────────── */
.stat-tile {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat-tile__value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-tile__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge--green  { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(82,200,130,0.25); }
.badge--amber  { background: var(--warning-dim); color: var(--warning); }
.badge--red    { background: var(--danger-dim); color: var(--danger); }
.badge--blue   { background: var(--info-dim); color: var(--info); }
.badge--muted  { background: var(--bg-overlay); color: var(--text-muted); }

/* ── Avatar ──────────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  background: var(--bg-overlay);
  border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-ui);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar--sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar--md { width: 44px; height: 44px; font-size: 1rem; }
.avatar--lg { width: 64px; height: 64px; font-size: 1.25rem; }
.avatar--xl { width: 88px; height: 88px; font-size: 1.75rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-5) 0;
}

.divider--label {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: 0.75rem; color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.divider--label::before, .divider--label::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Toast ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: var(--space-4);
  left: 50%; transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
  width: min(calc(100vw - 32px), 400px);
}

.toast {
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
}

.toast--success { border-color: var(--accent); }
.toast--success .toast__icon { color: var(--accent); }
.toast--error   { border-color: var(--danger); }
.toast--error   .toast__icon { color: var(--danger); }
.toast__icon { font-size: 1.1rem; flex-shrink: 0; }

/* ── Filter chips (leaderboard, etc.) ──────────────────────── */
.filter-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--bg-overlay);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
}
.filter-chip.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}
.filter-chip:hover:not(.active) {
  border-color: var(--border-strong);
  color: var(--text-secondary);
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: flex-end;
  animation: fadeIn 0.2s ease;
}

@media (min-width: 480px) {
  .modal-backdrop { align-items: center; justify-content: center; }
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-6) var(--space-5) var(--space-8);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.22,1,0.36,1);
}

@media (min-width: 480px) {
  .modal {
    border-radius: var(--radius-xl);
    max-width: 420px;
    max-height: 80vh;
    animation: scaleIn 0.25s cubic-bezier(0.22,1,0.36,1);
  }
}

.modal__handle {
  width: 40px; height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  margin: 0 auto var(--space-5);
}

/* ── Score input picker ──────────────────────────────────────── */
.score-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
}

.score-picker__btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--bg-overlay);
  border: 1.5px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.score-picker__btn:hover { background: var(--bg-raised); border-color: var(--accent); }
.score-picker__btn:active { transform: scale(0.9); }

.score-picker__value {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 700;
  min-width: 80px;
  text-align: center;
  line-height: 1;
  transition: color var(--transition);
}

/* ── Scorecard table ─────────────────────────────────────────── */
.scorecard-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.scorecard-scroll::-webkit-scrollbar { display: none; }

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

.scorecard-table th,
.scorecard-table td {
  padding: 6px 8px;
  text-align: center;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.scorecard-table th {
  background: var(--bg-overlay);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scorecard-table td.player-name {
  text-align: left;
  font-weight: 600;
  min-width: 100px;
  position: sticky;
  left: 0;
  background: var(--bg-surface);
  z-index: 2;
}

.scorecard-table td.total {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Progress / Loading ──────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-raised) 25%, var(--bg-overlay) 50%, var(--bg-raised) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: shimmer 1.5s infinite;
}

/* ── Utilities ──────────────────────────────────────────────── */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between{ justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--space-1); } .gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); } .gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); } .gap-6 { gap: var(--space-6); }
.w-full        { width: 100%; }
.grid-2        { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.grid-3        { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-3); }
.grid-4        { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); }
.mt-1 { margin-top: var(--space-1); } .mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); } .mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); } .mb-5 { margin-bottom: var(--space-5); }
.p-4  { padding: var(--space-4); }  .p-5 { padding: var(--space-5); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes shimmer  { to { background-position: -200% 0; } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp  { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes scaleIn  { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes toastIn  { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px); } }
@keyframes pulse    { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.animate-fade-in  { animation: fadeIn 0.4s ease both; }
.animate-slide-up { animation: slideUp 0.4s cubic-bezier(0.22,1,0.36,1) both; }
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.10s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.20s; }
.stagger-5 { animation-delay: 0.25s; }

/* ── Responsive tweaks ──────────────────────────────────────── */
@media (min-width: 480px) {
  .container { padding: 0 var(--space-6); }
}

@media (min-width: 768px) {
  .page-wrapper { padding-bottom: 0; }
  .bottom-nav   { display: none; }

  .desktop-nav {
    display: flex !important;
    position: fixed; top: 0; left: 0; right: 0;
    height: 60px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    align-items: center;
    padding: 0 var(--space-6);
    z-index: 100;
  }

  .page-header {
    top: 60px;
  }

  .page-wrapper { padding-top: 60px; }
}

/* Desktop nav hidden on mobile */
.desktop-nav { display: none; }

/* ═══════════════════════════════════════════════════════════════
   POLISH PASS — v4 additions
   ═══════════════════════════════════════════════════════════════ */

/* ── Danger button variant ──────────────────────────────────── */
.btn--danger {
  background: transparent;
  border: 1.5px solid var(--danger);
  color: var(--danger);
}
.btn--danger:hover { background: rgba(239,68,68,0.1); }

/* ── Info / warning colours ─────────────────────────────────── */
:root {
  --info:    #38bdf8;
  --warning: #fbbf24;
  --green-200: #bbf7d0;
}

/* ── Badge colour variants ──────────────────────────────────── */
.badge--blue { background: rgba(56,189,248,0.12); color: #38bdf8; border-color: rgba(56,189,248,0.25); }
.badge--red  { background: rgba(239,68,68,0.12);  color: #f87171; border-color: rgba(239,68,68,0.25); }

/* ── Scorecard table (shared scorecard page) ────────────────── */
.scorecard-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.78rem;
}
.scorecard-table th,
.scorecard-table td {
  padding: 6px 5px; text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.scorecard-table th {
  background: var(--bg-overlay);
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted);
  position: sticky; top: 0;
}
.scorecard-table th.player-name,
.scorecard-table td.player-name {
  text-align: left; padding-left: var(--space-3);
  min-width: 90px;
}
.scorecard-table td.total {
  font-family: var(--font-mono); font-weight: 700;
  background: var(--bg-overlay);
}

/* ── PWA install banner ─────────────────────────────────────── */
.pwa-banner {
  position: fixed; bottom: 72px; left: var(--space-4); right: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex; align-items: center; gap: var(--space-3);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: slideUp 0.4s cubic-bezier(0.22,1,0.36,1) both;
  max-width: 440px; margin: 0 auto;
}
.pwa-banner__icon  { font-size: 2rem; flex-shrink: 0; }
.pwa-banner__text  { flex: 1; min-width: 0; }
.pwa-banner__title { font-weight: 700; font-size: 0.875rem; }
.pwa-banner__sub   { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }
.pwa-banner__close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1.2rem; padding: 4px; flex-shrink: 0;
  line-height: 1;
}

/* ── Round item (used in profile + dashboard) ───────────────── */
.round-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); text-decoration: none; color: inherit;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.round-item:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.round-item__score {
  font-family: var(--font-mono); font-size: 1.4rem;
  font-weight: 700; line-height: 1; min-width: 44px; text-align: center;
}
.round-item__info  { flex: 1; min-width: 0; }
.round-item__course {
  font-weight: 700; font-size: 0.875rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.round-item__meta  {
  display: flex; align-items: center; gap: var(--space-1);
  font-size: 0.75rem; color: var(--text-muted); margin-top: 2px;
  flex-wrap: wrap;
}
.tee-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; flex-shrink: 0;
}

/* ── Text utilities ─────────────────────────────────────────── */
.text-accent   { color: var(--accent); }
.text-sm       { font-size: 0.875rem; }
.text-xs       { font-size: 0.75rem; }
.text-muted    { color: var(--text-muted); }
.text-center   { text-align: center; }
.font-mono     { font-family: var(--font-mono); }

/* ── Search bar ─────────────────────────────────────────────── */
.search-bar { position: relative; }
.search-bar .form-input { padding-left: 40px; }

/* ── Tee card (course detail + new round step 2) ────────────── */
.tee-card {
  background: var(--bg-surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-md); padding: var(--space-3) var(--space-4);
  cursor: pointer; transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.tee-card:hover    { border-color: var(--border-strong); }
.tee-card.selected { border-color: var(--accent); background: var(--accent-dim); }

/* ── Back button (scorecard / detail views) ─────────────────── */
.sc-back-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-overlay); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--transition);
}
.sc-back-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }

/* ── Card body helper ───────────────────────────────────────── */
.card__body { padding: var(--space-4); }

/* ── Display heading util ───────────────────────────────────── */
.display-md {
  font-family: var(--font-display); font-size: 1.6rem;
  font-weight: 700; letter-spacing: -0.01em; line-height: 1.15;
}

/* ── Section spacing ────────────────────────────────────────── */
.section-header { margin-bottom: var(--space-2); }

/* ── Smooth page transitions ────────────────────────────────── */
.page-wrapper { animation: fadeIn 0.25s ease both; }

/* ── Focus-visible ring ─────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) { outline: none; }

/* ── Empty states ────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--text-muted);
}
.empty-state__illustration {
  width: 80px; height: 80px;
  margin-bottom: var(--space-5);
  opacity: 0.55;
}
.empty-state__title {
  font-size: 1.05rem; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.empty-state__body {
  font-size: 0.875rem; line-height: 1.55;
  color: var(--text-muted);
  max-width: 260px;
  margin-bottom: var(--space-5);
}
.empty-state .btn { min-width: 160px; }


@media print {
  .bottom-nav, .desktop-nav, .fab, .share-cta { display: none !important; }
  .share-page { background: #fff; color: #000; }
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:   0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration:  0.01ms !important;
  }
}
