/* Sacari Golf website. Palette mirrors mobile/lib/colors.ts. */

/* ===== Self-hosted variable fonts (latin subset, woff2) ===== */
@font-face {
  font-family: 'Fraunces';
  font-style: normal; font-weight: 400 900; font-display: swap;
  src: url('/fonts/fraunces-var-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('/fonts/inter-var-latin.woff2') format('woff2');
}

:root {
  /* Neutrals (deep, refined). Names preserved so existing rules keep working. */
  --bg: #000; --card: #0c0c10; --card-alt: #131318; --border: #26242b;
  /* Champagne gold + warm silver text */
  --gold: #cdaa62; --gold-light: #ecd49a; --text: #ece9e1; --muted: #9b988d;
  --dim: #565049; --good: #7aab78; --bad: #b8463f;

  /* ===== Design tokens (used progressively as pages are restyled) ===== */
  /* Typography */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  /* Fluid modular type scale */
  --fs-100: 0.72rem; --fs-200: 0.82rem; --fs-300: 0.92rem; --fs-400: 1rem;
  --fs-500: 1.15rem; --fs-600: clamp(1.3rem, 2.2vw, 1.6rem);
  --fs-700: clamp(1.7rem, 3.4vw, 2.2rem); --fs-800: clamp(2.1rem, 5vw, 3rem);
  --fs-900: clamp(2.6rem, 7vw, 4.2rem);
  /* Spacing (8pt-based) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px; --sp-10: 128px;
  /* Radii */
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 26px; --r-pill: 999px;
  /* Elevation + glow */
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.45);
  --shadow-md: 0 16px 38px -20px rgba(0,0,0,0.7);
  --shadow-lg: 0 36px 80px -34px rgba(0,0,0,0.82);
  --glow-gold: 0 0 0 1px rgba(205,170,98,0.22), 0 22px 60px -28px rgba(205,170,98,0.5);
  /* Motion */
  --dur-1: 140ms; --dur-2: 240ms; --dur-3: 440ms; --dur-4: 760ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* author display rules must not override the hidden attribute */
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(820px 460px at 50% -140px, rgba(212,169,63,0.10), transparent 70%),
    radial-gradient(720px 520px at 100% 0%, rgba(154,124,255,0.08), transparent 60%),
    #000;
  background-attachment: fixed;
  color: var(--text); font-family: var(--font-body);
  font-size: 16px; line-height: 1.6; font-weight: 400; letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--gold); text-decoration: none; }
h1, h2 { font-family: var(--font-display); font-optical-sizing: auto; line-height: 1.06; letter-spacing: -0.02em; }
h3 { line-height: 1.2; letter-spacing: -0.01em; }
::selection { background: rgba(212,169,63,0.28); color: #fff; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #0a0a0d; }
::-webkit-scrollbar-thumb { background: #2a2620; border-radius: 6px; border: 3px solid #0a0a0d; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* Top bar + nav */
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0;
  background: rgba(0,0,0,0.82); backdrop-filter: blur(8px); z-index: 10; }
.brand { display: inline-flex; align-items: center; line-height: 0; }
.brand-logo { width: 42px; height: 42px; border-radius: 11px; box-shadow: 0 2px 12px rgba(212,169,63,0.3);
  transition: transform .15s ease, box-shadow .15s ease; }
.brand:hover .brand-logo { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(212,169,63,0.42); }
@media (max-width: 560px) {
  .topbar { flex-direction: column; gap: 11px; padding: 12px 14px; }
  .nav { gap: 16px; flex-wrap: wrap; justify-content: center; }
}
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { color: var(--muted); font-size: 14px; font-weight: 700; position: relative; transition: color .12s ease; }
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--gold); }
.nav a.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -7px; height: 2px; background: var(--gold); border-radius: 2px; }
.nav-cta { background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: #1a1206 !important; padding: 8px 15px; border-radius: 7px; transition: filter .12s ease; }
.nav-cta:hover { filter: brightness(1.07); }
.nav-cta.on::after { display: none; }

main { flex: 1; width: 100%; }
.foot { border-top: 1px solid var(--border); padding: 30px 20px; text-align: center; }
.foot-brand { display: inline-block; line-height: 0; margin-bottom: 12px; }
.foot-brand img { width: 42px; height: 42px; border-radius: 11px; box-shadow: 0 3px 14px rgba(212,169,63,0.22); }
.foot-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.foot-links a { color: var(--muted); font-size: 13px; font-weight: 700; }
.foot-copy { color: var(--dim); font-size: 12px; }

/* Shared blocks */
.cta { display: inline-block; background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: #1a1206; font-weight: 900;
  padding: 14px 28px; border-radius: 10px; letter-spacing: 0.5px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(212,169,63,0.16); transition: transform .12s ease, box-shadow .12s ease, filter .12s ease; }
.cta:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 10px 26px rgba(212,169,63,0.28); }
.cta-ghost { display: inline-block; padding: 13px 22px; border-radius: 10px; font-weight: 800;
  border: 1px solid var(--border); color: var(--text); transition: border-color .12s ease, background .12s ease, color .12s ease; }
.cta-ghost:hover { border-color: var(--gold); color: var(--gold); background: rgba(212,169,63,0.08); }
.cta-link { display: inline-block; margin-top: 18px; font-weight: 700; }
.empty { color: var(--muted); padding: 18px; text-align: center; }
.page-head { max-width: 920px; margin: 0 auto; padding: 36px 20px 8px; }
.page-head h1 { font-size: 2rem; font-weight: 900; margin: 0 0 6px; }
.page-head p { color: var(--muted); margin: 0; }
.cta-band { position: relative; text-align: center; padding: 60px 20px;
  background: radial-gradient(620px 280px at 50% 50%, rgba(212,169,63,0.10), transparent 70%); }
.cta-band h2 { font-size: 1.8rem; margin: 0 0 18px; }

/* Home */
.hero { position: relative; text-align: center; padding: 56px 20px 30px; max-width: 760px; margin: 0 auto;
  background: radial-gradient(560px 360px at 50% 80%, rgba(154,124,255,0.13), transparent 70%); }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); font-weight: 900; margin: 0 0 16px; }
.hero-eyebrow { display: inline-block; font-size: 0.7rem; letter-spacing: 2px; text-transform: uppercase; font-weight: 800;
  color: var(--gold); background: rgba(212,169,63,0.09); border: 1px solid rgba(212,169,63,0.32);
  padding: 5px 13px; border-radius: 999px; margin-bottom: 16px; }
/* Premium silver-gold gradient on the big headings, site-wide. */
.hero h1, .feature h2, .cta-band h2, .page-head h1 {
  background: linear-gradient(180deg, #fdfcf8 0%, #c9c2ad 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-sub { color: var(--muted); font-size: 1.1rem; line-height: 1.6; max-width: 560px; margin: 0 auto 26px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-crest { display: block; width: clamp(132px, 32vw, 178px); margin: 4px auto 20px; border-radius: 20px;
  filter: drop-shadow(0 14px 38px rgba(212,169,63,0.42)); }
.feature { max-width: 980px; margin: 0 auto; padding: 44px 20px; text-align: center; }
.feature.alt { background: linear-gradient(180deg, rgba(20,20,26,0.7), rgba(10,10,13,0.7)); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); max-width: none; }
.feature h2 { font-size: 1.9rem; margin: 0 0 10px; position: relative; display: inline-block; }
.feature h2::after { content: ''; display: block; width: 54px; height: 3px; margin: 12px auto 0; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.feature > p { color: var(--muted); max-width: 560px; margin: 0 auto 26px; line-height: 1.6; }
.ladder { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 760px; margin: 0 auto; }
.ladder-cell { background: linear-gradient(180deg, #15151b, #0e0e12); border: 1px solid var(--border); border-radius: 12px; padding: 16px 8px;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.ladder-cell:hover { transform: translateY(-2px); border-color: rgba(212,169,63,0.35); box-shadow: 0 12px 26px rgba(0,0,0,0.45); }
.ladder-cell img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.55)); }
.ladder-name { font-weight: 900; margin-top: 6px; }
.ladder-range { color: var(--dim); font-size: 0.7rem; margin-top: 2px; }
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; max-width: 820px; margin: 0 auto; }
.feature-card { background: linear-gradient(180deg, #16161c, #0d0d11); border: 1px solid var(--border); border-radius: 14px; padding: 24px; text-align: left;
  position: relative; overflow: hidden; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.feature-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); transition: opacity .15s ease; }
.feature-card:hover { transform: translateY(-3px); border-color: rgba(212,169,63,0.4); box-shadow: 0 18px 36px rgba(0,0,0,0.5); }
.feature-card:hover::before { opacity: 1; }
.feature-card h3 { margin: 0 0 8px; font-size: 1.2rem; color: var(--gold); }
.feature-card p { margin: 0; color: var(--muted); line-height: 1.55; }

/* Leaderboard */
.lb { max-width: 720px; margin: 14px auto 10px; padding: 0 16px 30px; }
.lb-head, .lb-row { display: grid; grid-template-columns: 34px 38px 1fr auto auto; align-items: center; gap: 10px; }
.lb-head { color: var(--muted); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1px; padding: 6px 12px; }
.lb-row { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; margin-bottom: 7px; }
.lb-row:hover { border-color: var(--gold); }
.lb-pos { font-weight: 900; color: var(--dim); text-align: center; }
.lb-row.g .lb-pos { color: var(--gold); } .lb-row.s .lb-pos { color: #c0c0c0; } .lb-row.b .lb-pos { color: #a1673a; }
.lb-crest img { width: 30px; height: 30px; object-fit: contain; }
.lb-name { font-weight: 700; }
.lb-rank { font-weight: 800; font-size: 0.85rem; }
.lb-rec { color: var(--muted); font-size: 0.85rem; min-width: 60px; text-align: right; }

/* Recent matches feed */
.feed { max-width: 640px; margin: 10px auto 0; padding: 0 16px 30px; display: flex; flex-direction: column; gap: 12px; }
.feed-item { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px;
  transition: border-color .12s ease; }
.feed-item:hover { border-color: rgba(212,169,63,0.35); }
.feed-side { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding: 6px 0; }
.feed-side + .feed-side { border-top: 1px solid var(--border); }
.feed-crest { width: 30px; height: 30px; object-fit: contain; flex: none; }
.feed-id { min-width: 0; display: flex; align-items: baseline; gap: 8px; overflow: hidden; }
.feed-names { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.feed-name { color: var(--text); }
.feed-name:hover { color: var(--gold); }
.feed-side.win .feed-name { color: var(--gold); }
.feed-rank { flex: none; font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
.feed-sc { font-weight: 900; font-size: 1.05rem; text-align: right; white-space: nowrap; color: var(--text); }
.feed-sc small { font-weight: 700; font-size: 0.72rem; color: var(--muted); }
.feed-side.win .feed-sc { color: var(--gold); }
.feed-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.feed-meta { color: var(--muted); font-size: 0.76rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-recap-link { font-weight: 700; font-size: 0.82rem; white-space: nowrap; flex: none; }

/* Courses */
.course-search-wrap { position: relative; max-width: 460px; margin-top: 16px; }
.course-search-wrap .course-search { margin-top: 0; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  box-shadow: 0 14px 30px rgba(0,0,0,0.6); }
.ac-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover { background: var(--card-alt); }
.ac-name { color: var(--text); font-weight: 700; font-size: 0.95rem; }
.ac-loc { color: var(--gold); font-size: 0.78rem; }
.course-search { display: flex; gap: 8px; margin-top: 16px; max-width: 460px; }
.course-search input { flex: 1; background: var(--card); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 11px 14px; font-size: 15px; }
.course-search button { background: var(--gold); color: #000; font-weight: 900; border: 0; border-radius: 6px; padding: 0 18px; cursor: pointer; }
.courses { max-width: 920px; margin: 0 auto; padding: 8px 20px 36px; }
.courses h2 { font-size: 1.2rem; margin: 18px 0 12px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.course-card { display: flex; flex-direction: column; gap: 3px; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; }
.course-card:hover { border-color: var(--gold); }
.course-name { color: var(--text); font-weight: 700; }
.course-loc { color: var(--gold); font-size: 0.82rem; }
.course-plays { color: var(--dim); font-size: 0.72rem; }

/* Course detail tees */
.tees, .course-board { max-width: 720px; margin: 0 auto; padding: 8px 20px; }
.tees h2, .course-board h2 { font-size: 1.2rem; margin: 18px 0 12px; }
.tee-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.tee-table th, .tee-table td { padding: 10px 12px; text-align: left; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
.tee-table th { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; }
.tee-table tr:last-child td { border-bottom: 0; }

/* Rounds list (profile + course board) */
.rounds { list-style: none; margin: 0; padding: 0; }
.round { display: flex; align-items: center; gap: 10px; padding: 11px 12px; margin-bottom: 7px;
  background: var(--card-alt); border: 1px solid var(--border); border-radius: 8px; }
.round-course { flex: 1; font-weight: 700; font-size: 0.95rem; }
.round-meta { color: var(--muted); font-size: 0.78rem; }
.round-score { font-weight: 800; }
.round-topar { font-weight: 900; min-width: 34px; text-align: right; color: var(--muted); }
.round-topar.good { color: var(--good); } .round-topar.bad { color: var(--bad); }

/* Profile card */
.card { width: 100%; max-width: 540px; margin: 28px auto; background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px 22px 26px; text-align: center; }
.crest { position: relative; width: min(64vw, 248px); aspect-ratio: 1 / 1; margin: 0 auto 8px; }
.crest-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.6)); }
.av-well { position: absolute; border-radius: 50%; overflow: hidden; }
.av-photo { width: 100%; height: 100%; background-size: cover; background-position: center; }
.av-letter { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 38% 30%, #20202a, #050507); color: var(--gold); font-weight: 900; font-size: 2.2rem; }
.av-vignette { position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 50% 44%, transparent 50%, rgba(0,0,0,0.62) 100%); box-shadow: inset 0 0 10px rgba(0,0,0,0.7); }
.av-wash { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
.name { font-size: 1.9rem; font-weight: 900; margin: 6px 0 2px; }
.rank { font-size: 1.25rem; font-weight: 900; letter-spacing: 0.5px; }
.rank-sub { color: var(--muted); font-size: 0.85rem; margin-top: 2px; font-weight: 700; }
.bio { color: var(--muted); font-size: 0.92rem; line-height: 1.5; margin: 14px auto 0; max-width: 420px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 22px 0 6px; }
.stat { background: var(--card-alt); border: 1px solid var(--border); border-radius: 10px; padding: 12px 6px; }
.stat-val { font-size: 1.15rem; font-weight: 900; color: var(--text); }
.stat-label { color: var(--muted); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }
.recent { text-align: left; margin-top: 22px; }
.recent-title { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 8px; }
.card .cta, .card .recent { }

/* Recaps (profile + per-user recaps page) */
.recaps { display: flex; flex-direction: column; gap: 7px; }
.recap-row { display: grid; grid-template-columns: 28px 1fr auto auto; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; text-align: left;
  transition: border-color .12s ease, transform .12s ease; }
.recap-row:hover { border-color: var(--gold); transform: translateY(-1px); }
.recap-result { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 0.82rem; flex: none; }
.recap-result.win { background: rgba(122,171,120,0.18); color: var(--good); }
.recap-result.loss { background: rgba(176,52,52,0.20); color: #d98686; }
.recap-result.tie { background: rgba(154,151,138,0.18); color: var(--muted); }
.recap-main { min-width: 0; }
.recap-vs { display: block; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recap-meta { display: block; color: var(--muted); font-size: 0.74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recap-row .round-topar { min-width: 30px; font-size: 0.9rem; }
.recap-elo { font-weight: 900; font-size: 0.82rem; min-width: 36px; text-align: right; }
.recap-elo.up { color: var(--good); } .recap-elo.down { color: #d98686; }
.recaps-all { display: inline-block; margin-top: 12px; font-weight: 700; font-size: 0.9rem; }
.recaps-page { max-width: 640px; margin: 14px auto 0; padding: 0 16px; }
.recaps-back { display: inline-block; margin-bottom: 6px; color: var(--muted); font-weight: 700; font-size: 0.85rem; }
.recaps-back:hover { color: var(--gold); }

/* Match recap */
.rc-head { text-align: center; }
.rc-kicker { color: var(--gold); font-size: 0.72rem; letter-spacing: 2px; text-transform: uppercase; font-weight: 900; margin-bottom: 6px; }
.rc { max-width: 920px; margin: 8px auto 0; padding: 16px 20px 0; display: flex; align-items: stretch; justify-content: center; gap: 14px; flex-wrap: wrap; }
.rc-side { flex: 1 1 280px; max-width: 380px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 22px 18px 20px; position: relative; }
.rc-side.win { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(212,169,63,0.25), 0 14px 40px -22px rgba(212,169,63,0.6); }
.rc-side.loss { opacity: 0.9; }
.rc-badge { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: #1a1206; font-weight: 900;
  font-size: 0.64rem; letter-spacing: 1px; text-transform: uppercase; padding: 4px 12px; border-radius: 999px; }
.rc-player { display: flex; align-items: center; gap: 11px; padding: 8px 0; }
.rc-player + .rc-player { border-top: 1px solid var(--border); }
.rc-crest { width: 44px; height: 44px; object-fit: contain; flex: none; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.6)); }
.rc-pmeta { flex: 1; min-width: 0; text-align: left; }
.rc-name { font-weight: 800; font-size: 1.05rem; }
.rc-name a { color: var(--text); }
.rc-name a:hover { color: var(--gold); }
.rc-rank { font-size: 0.8rem; font-weight: 700; }
.rc-elo { font-weight: 900; font-size: 0.82rem; white-space: nowrap; }
.rc-elo.up { color: var(--good); } .rc-elo.down { color: var(--bad); }
.rc-score { text-align: center; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--border); }
.rc-gross { font-size: 2.6rem; font-weight: 900; line-height: 1; color: var(--text); }
.rc-score .round-topar { display: inline-block; min-width: 0; margin-top: 6px; font-size: 1rem; }
.rc-course, .rc-difflabel { color: var(--muted); font-size: 0.78rem; margin-top: 6px; }
.rc-vs { align-self: center; color: var(--muted); font-weight: 900; letter-spacing: 1px; font-size: 0.9rem; flex: none; }
@media (max-width: 620px) { .rc { flex-direction: column; align-items: stretch; } .rc-vs { padding: 2px 0; } }

/* Recap scorecards (reuses the .scorecard table styles) */
.rc-sc-list { display: flex; flex-direction: column; gap: 18px; }
.rc-sc-title { font-weight: 800; margin: 0 0 8px; }
.rc-sc-title a { color: var(--text); }
.rc-sc-title a:hover { color: var(--gold); }
.rc-sc-sub { color: var(--muted); font-weight: 600; font-size: 0.82rem; }
.scorecard td.sc-eagle { color: var(--gold); font-weight: 900; }
.scorecard td.sc-birdie { color: var(--good); font-weight: 800; }
.scorecard td.sc-bogey { color: #c98f8f; }
.scorecard td.sc-dbl { color: var(--bad); font-weight: 800; }

/* How to play */
.guide { max-width: 860px; margin: 0 auto; padding: 8px 20px 36px; }
.guide-h { font-size: 1.5rem; font-weight: 900; margin: 34px 0 14px; position: relative; display: inline-block; }
.guide-h::after { content: ''; display: block; width: 48px; height: 3px; margin-top: 8px;
  border-radius: 2px; background: linear-gradient(90deg, var(--gold), transparent); }
.guide-lead { color: var(--muted); line-height: 1.65; max-width: 640px; margin: 0 0 18px; }
.guide-lead strong { color: var(--gold); }
.guide-steps { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.guide-step { display: flex; gap: 16px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
.guide-step:hover { transform: translateY(-2px); border-color: rgba(212,169,63,0.4); box-shadow: 0 10px 22px rgba(0,0,0,0.45); }
.guide-num { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1rem;
  color: #1a1206; background: linear-gradient(180deg, var(--gold-light), var(--gold)); }
.guide-step h3 { margin: 2px 0 4px; font-size: 1.08rem; color: var(--text); }
.guide-step p { margin: 0; color: var(--muted); line-height: 1.55; }
.guide-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 8px; }
.guide-card { background: var(--card-alt); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
.guide-card:hover { transform: translateY(-3px); border-color: rgba(212,169,63,0.45); box-shadow: 0 12px 24px rgba(0,0,0,0.45); }
.guide-card h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--gold); }
.guide-card p { margin: 0; color: var(--muted); line-height: 1.55; }
@media (max-width: 560px) { .guide-grid { grid-template-columns: 1fr; } }

/* Docs (privacy/terms/support) + small landing */
.doc { max-width: 720px; margin: 0 auto; padding: 36px 22px 48px; }
.doc h1 { font-size: 2rem; font-weight: 900; }
.doc h2 { font-size: 1.15rem; margin-top: 26px; color: var(--gold); }
.doc p { color: var(--text); line-height: 1.7; }
.landing { text-align: center; }
.hero-small { font-size: 2rem; font-weight: 900; }
.lead { color: var(--muted); line-height: 1.6; }

/* Pin editor */
.pins { max-width: 820px; margin: 0 auto; padding: 8px 18px 44px; }
.pin-steps { color: var(--muted); line-height: 1.6; padding-left: 20px; margin: 0 0 16px; }
.hole-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; margin-bottom: 14px; }
.hole-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; }
.hole-btn:hover { border-color: var(--gold); }
.hole-btn.sel { border-color: var(--gold); background: rgba(212,169,63,0.16); }
.hole-btn.has-pin { border-color: var(--good); }
.hole-btn.has-pin::after { content: '\2713'; color: var(--good); font-size: 0.7rem; }
.hole-n { font-weight: 900; font-size: 1.1rem; }
.hole-par { color: var(--muted); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.5px; }
.pin-map { height: 58vh; min-height: 360px; width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.leaflet-container { background: #111; }
.pin-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.pin-info { flex: 1; color: var(--text); font-size: 0.92rem; min-width: 200px; }
.pin-bar .cta { border: 0; cursor: pointer; font-family: inherit; }
.pin-bar .cta:disabled { opacity: 0.45; cursor: default; }
.pin-msg { color: var(--gold); font-size: 0.88rem; margin-top: 10px; min-height: 1.2em; }

/* Course scorecard + hole-by-hole viewer */
.course-card-sec { max-width: 920px; margin: 0 auto; padding: 18px 20px 0; }
.course-card-sec h2 { font-size: 1.3rem; font-weight: 900; margin: 0 0 12px; }
.sc-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--card); -webkit-overflow-scrolling: touch; }
.scorecard { border-collapse: collapse; width: 100%; font-size: 0.84rem; white-space: nowrap; }
.scorecard th, .scorecard td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--border); }
.scorecard thead th { color: var(--muted); font-size: 0.72rem; font-weight: 700; background: var(--card-alt); }
.scorecard tbody tr:last-child th, .scorecard tbody tr:last-child td { border-bottom: 0; }
.scorecard .sc-rl { text-align: left; color: var(--text); font-weight: 800; position: sticky; left: 0; background: var(--card); z-index: 1; }
.scorecard thead .sc-rl { background: var(--card-alt); }
.scorecard .sc-tot { color: var(--gold); font-weight: 900; background: rgba(212,169,63,0.06); }
.scorecard .sc-par td, .scorecard .sc-par th { color: var(--text); font-weight: 900; }
.scorecard .sc-si td { color: var(--muted); font-size: 0.78rem; }
.scorecard .sc-si th { color: var(--muted); }

.course-holes .ch-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.course-holes .ch-head h2 { margin: 0; }
.ch-tee { color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.ch-tee select { background: var(--card-alt); color: var(--text); border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 10px; font-family: inherit; font-size: 0.85rem; margin-left: 6px; }
.course-holes .hole-grid { margin-top: 12px; }
.course-map { height: 56vh; min-height: 320px; width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); margin-top: 4px; }
.hv-pin-icon { font-size: 18px; line-height: 1; background: none; border: 0; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.hv-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.hv-info { flex: 1; color: var(--text); font-size: 0.95rem; font-weight: 700; text-align: center; }
.hv-nav { flex: none; width: 44px; height: 40px; cursor: pointer; font-family: inherit; font-size: 1.3rem; line-height: 1;
  background: var(--card); border: 1px solid var(--border); border-radius: 9px; color: var(--text); }
.hv-nav:hover { border-color: var(--gold); color: var(--gold); }

/* Auth + dashboard */
.auth { max-width: 420px; }
.form { display: flex; flex-direction: column; gap: 14px; margin: 20px 0 8px; text-align: left; }
.field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.field input { background: var(--card-alt); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 12px 14px; font-size: 16px; }
.field input:focus { outline: none; border-color: var(--gold); }
.form .cta { border: 0; cursor: pointer; font-size: 1rem; font-family: inherit; }
.form-error { background: rgba(176,52,52,0.16); border: 1px solid var(--bad); color: #f0b8b8; border-radius: 8px; padding: 10px 12px; font-size: 0.88rem; }
.muted-note { color: var(--muted); font-size: 0.85rem; margin-top: 14px; }

/* Login screen (full-bleed split) */
body.login-body { display: block; } /* drop the flex chain so the wrap fills the viewport reliably */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; }
.login-brand { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  padding: 48px 32px; background: radial-gradient(circle at 50% 38%, #110d18 0%, #060608 64%); border-right: 1px solid var(--border); }
.brand-lg { font-size: 26px; letter-spacing: 3px; }
.login-logo-link { display: inline-block; line-height: 0; }
.login-logo { width: clamp(220px, 30vw, 330px); margin: 4px 0 20px; border-radius: 16px;
  filter: drop-shadow(0 0 38px rgba(212,169,63,0.3)); }
.login-tag { font-size: 1.9rem; font-weight: 900; margin: 0 0 8px; }
.login-sub { color: var(--muted); max-width: 330px; line-height: 1.6; margin: 0; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 2rem; font-weight: 900; margin: 0 0 6px; }
.login-card-sub { color: var(--muted); margin: 0 0 22px; }
.login-card .form { gap: 16px; margin: 4px 0 0; }
.field-label { color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.input-wrap { position: relative; display: block; }
.input-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--gold); opacity: 0.75;
  font-size: 0.9rem; font-weight: 700; pointer-events: none; }
.input-wrap input { width: 100%; color: var(--text); border-radius: 10px; padding: 14px 14px 14px 42px; font-size: 16px;
  background: linear-gradient(180deg, #16161d, #0d0d11); border: 1px solid #2a2722;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.55); transition: border-color .15s ease, box-shadow .15s ease; }
.input-wrap input::placeholder { color: var(--dim); }
.input-wrap input:hover { border-color: #3b362c; }
.input-wrap input:focus { outline: none; border-color: var(--gold);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4), 0 0 0 3px rgba(212,169,63,0.18); }
.login-btn { width: 100%; margin-top: 6px; border: 0; cursor: pointer; font-size: 1.02rem; font-family: inherit;
  letter-spacing: 0.5px; font-weight: 900; padding: 14px; border-radius: 10px; color: #1a1206;
  background: linear-gradient(180deg, var(--gold-light), var(--gold)); }
.login-btn:hover { filter: brightness(1.07); }
.login-home { display: inline-block; margin-top: 22px; color: var(--muted); font-size: 0.85rem; }
.login-home:hover { color: var(--text); }
@media (max-width: 800px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { border-right: 0; border-bottom: 1px solid var(--border); padding: 34px 24px 24px; }
  .login-logo { width: 210px; margin: 6px 0 12px; }
  .login-tag { font-size: 1.4rem; }
  .login-sub { display: none; }
}

.dash { max-width: 720px; margin: 24px auto; padding: 0 18px 40px; }
.dash-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.crest-sm { width: 116px; flex-shrink: 0; margin: 0; }
.dash-id { flex: 1; }
.dash-id .name { text-align: left; margin: 0 0 2px; font-size: 1.7rem; }
.dash-id .rank { font-size: 1.05rem; }
.dash-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dash-actions .cta-ghost { padding: 8px 14px; font-size: 0.85rem; }
.dash-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-top: 14px; }
.dash-card-title { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.dash-card .stats { margin: 0; }
.dash .stats { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 560px) {
  .ladder { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dash .stats { grid-template-columns: repeat(2, 1fr); }
  .lb-rec { display: none; }
  .dash-head { flex-direction: column; text-align: center; }
  .dash-id .name, .dash-id .rank { text-align: center; }
  .dash-actions { justify-content: center; }
}

/* ---- Polish layer: glows, hover lifts, gold accents ---- */
.hero h1 { text-shadow: 0 2px 30px rgba(154,124,255,0.25); }
.hero-crest { animation: floaty 5s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.feature h2, .cta-band h2 { position: relative; display: inline-block; }
.feature h2::after, .cta-band h2::after { content: ''; display: block; width: 56px; height: 3px; margin: 12px auto 0;
  border-radius: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

.page-head h1 { position: relative; padding-bottom: 10px; }
.page-head h1::after { content: ''; position: absolute; left: 0; bottom: 0; width: 48px; height: 3px;
  border-radius: 2px; background: linear-gradient(90deg, var(--gold), transparent); }

.ladder-cell, .feature-card { transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease; }
.ladder-cell:hover, .feature-card:hover { transform: translateY(-3px); border-color: rgba(212,169,63,0.45); box-shadow: 0 12px 24px rgba(0,0,0,0.45); }
.ladder-cell img { transition: transform .14s ease; }
.ladder-cell:hover img { transform: scale(1.07); }

/* ====================== Web app (logged-in play loop) ====================== */
.link-btn { background: none; border: 0; color: var(--muted); font-family: inherit; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; margin-top: 12px; text-decoration: underline; }
.link-btn:hover { color: var(--gold); }

.app-banner { display: block; max-width: 880px; margin: 14px auto 0; padding: 11px 16px; border-radius: 10px; font-weight: 700; font-size: 0.9rem;
  color: #f0c95a; background: rgba(212,169,63,0.1); border: 1px solid rgba(212,169,63,0.35); }
.app-banner:hover { background: rgba(212,169,63,0.16); }

.app-hero { max-width: 880px; margin: 22px auto 0; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.app-hero-id { display: flex; align-items: center; gap: 14px; }
.app-hero-crest { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5)); }
.app-hello { font-size: 1.5rem; font-weight: 900; }
.app-rank { font-weight: 800; font-size: 0.95rem; }
.app-play-cta { font-size: 1.05rem; }

.app-sec { max-width: 880px; margin: 26px auto 0; padding: 0 18px; }
.app-sec h2 { font-size: 1.15rem; font-weight: 900; margin: 0 0 12px; }
.app-list { display: flex; flex-direction: column; gap: 9px; }
.app-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 11px; padding: 12px 15px;
  transition: border-color .12s ease, transform .12s ease; }
.app-row:hover { border-color: var(--gold); transform: translateY(-1px); }
.app-row-main { min-width: 0; }
.app-row-title { display: block; font-weight: 800; color: var(--text); }
.app-row-sub { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.app-status { flex: none; font-weight: 900; font-size: 0.78rem; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.app-status.active { color: #1a1206; background: linear-gradient(180deg, var(--gold-light), var(--gold)); }
.app-status.pending { color: var(--muted); background: var(--card-alt); border: 1px solid var(--border); }
.app-status.win { color: var(--good); background: rgba(122,171,120,0.16); }
.app-status.loss { color: #d98686; background: rgba(176,52,52,0.18); }
.app-status.tie { color: var(--muted); background: var(--card-alt); }

.app-result { max-width: 880px; margin: 0 auto; background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 26px 20px; text-align: center; }
.app-result.win { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(212,169,63,0.22), 0 14px 40px -22px rgba(212,169,63,0.55); }
.app-result-big { font-size: 1.7rem; font-weight: 900; margin-bottom: 6px; }
.app-result.win .app-result-big { color: var(--gold); }
.app-result-elo { font-weight: 900; font-size: 1.05rem; margin-bottom: 16px; }
.app-result-elo.up { color: var(--good); } .app-result-elo.down { color: #d98686; }
.app-result .cta { border: 0; }
.app-result .muted-note { margin: 4px auto 18px; max-width: 420px; }

.app-players { display: flex; flex-direction: column; gap: 8px; }
.app-player { display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; }
.app-player-name { font-weight: 800; }
.app-player-score { font-weight: 900; font-size: 1.2rem; }
.app-player-score.muted { color: var(--dim); font-size: 1rem; }

/* Create-a-round form */
.app-form { max-width: 560px; margin: 8px auto 0; padding: 0 18px 40px; }
.af-group { margin-top: 20px; }
.af-label { display: block; color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.af-seg { display: inline-flex; gap: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); flex-wrap: wrap; }
.af-seg button { background: none; border: 0; color: var(--muted); font-family: inherit; font-weight: 800; font-size: 0.92rem;
  padding: 10px 18px; cursor: pointer; border-right: 1px solid var(--border); }
.af-seg button:last-child { border-right: 0; }
.af-seg button.on { color: #1a1206; background: linear-gradient(180deg, var(--gold-light), var(--gold)); }
.app-form .course-search-wrap { max-width: none; margin-top: 0; }
.app-form #play-course-q { width: 100%; color: var(--text); border-radius: 10px; padding: 13px 14px; font-size: 16px;
  background: linear-gradient(180deg, #16161d, #0d0d11); border: 1px solid #2a2722; }
.app-form #play-course-q:focus { outline: none; border-color: var(--gold); }
.af-picked { display: flex; align-items: center; gap: 12px; margin-top: 10px; background: var(--card-alt);
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; font-weight: 800; }
.af-picked button { margin-left: auto; background: none; border: 0; color: var(--gold); font-family: inherit; font-weight: 700; cursor: pointer; font-size: 0.85rem; }
.af-select { width: 100%; color: var(--text); background: var(--card-alt); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 16px; font-family: inherit; }
.app-form .cta { width: 100%; margin-top: 24px; border: 0; cursor: pointer; }
.app-form .cta:disabled { opacity: 0.45; cursor: default; }
.app-msg { color: var(--gold); font-size: 0.88rem; margin-top: 12px; min-height: 1.1em; text-align: center; }

/* Scorecard entry */
.app-score { max-width: 560px; margin: 8px auto 0; padding: 0 18px 44px; }
.sc-holes { display: flex; flex-direction: column; gap: 8px; }
.sc-hole { display: grid; grid-template-columns: 34px 1fr 44px 60px 44px; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.sc-h-num { font-weight: 900; font-size: 1.05rem; text-align: center; color: var(--gold); }
.sc-h-par { color: var(--muted); font-size: 0.8rem; }
.sc-step { height: 40px; border: 1px solid var(--border); background: var(--card-alt); color: var(--text);
  font-size: 1.3rem; font-weight: 900; border-radius: 9px; cursor: pointer; font-family: inherit; }
.sc-step:hover { border-color: var(--gold); color: var(--gold); }
.sc-in { height: 40px; width: 100%; text-align: center; font-size: 1.2rem; font-weight: 900; color: var(--text);
  background: linear-gradient(180deg, #16161d, #0d0d11); border: 1px solid #2a2722; border-radius: 9px; }
.sc-in:focus { outline: none; border-color: var(--gold); }
.sc-summary { display: flex; align-items: baseline; justify-content: center; gap: 12px; margin: 18px 0 6px; font-weight: 900; font-size: 1.15rem; }
.sc-summary .good { color: var(--good); } .sc-summary .bad { color: var(--bad); }
.app-score .field { margin-top: 14px; }
.app-score #sc-caption { width: 100%; color: var(--text); background: var(--card-alt); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; font-size: 16px; font-family: inherit; }
.app-score .cta { width: 100%; margin-top: 16px; border: 0; cursor: pointer; }
.app-score .cta:disabled { opacity: 0.5; }

.course-card, .lb-row { transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
.course-card:hover, .lb-row:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,0.5); }
.lb-row.g { border-color: rgba(212,169,63,0.5); background: linear-gradient(90deg, rgba(212,169,63,0.12), var(--card) 60%); }
.lb-row.s { border-color: rgba(192,192,192,0.38); }
.lb-row.b { border-color: rgba(161,103,58,0.45); }
.lb-crest img { filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6)); }

.stat { background: linear-gradient(180deg, var(--card-alt), #0c0c10); transition: border-color .12s ease; }
.stat:hover { border-color: rgba(212,169,63,0.3); }
.dash-card { transition: border-color .12s ease; }
.dash-card:hover { border-color: rgba(212,169,63,0.28); }
.tee-table thead th { background: var(--card-alt); }
.course-search button { transition: filter .12s ease; }
.course-search button:hover { filter: brightness(1.07); }
.crest-img { transition: filter .2s ease; }
.card:hover .crest-img, .dash-head:hover .crest-img { filter: drop-shadow(0 6px 18px rgba(0,0,0,0.6)) drop-shadow(0 0 16px rgba(212,169,63,0.25)); }
