/* Scratch — app shell styles
   Direction: the country-club scorecard, remade for a phone. Warm paper, deep
   green-black ink, one brass accent. Numbers in Fraunces (tabular), UI in the
   system sans. On-course the screen flips to true black for sunlight.        */

:root {
  /* Daylight, not cream: cool green-white ground, deep fairway ink. */
  --paper: #F4F8F2;
  --surface: #FFFFFF;
  --surface-2: #E8EFE5;
  --ink: #0F2A1C;
  --ink-2: #33473B;
  --quiet: #5F7066;
  --line: #DAE4D7;
  --line-2: #C2D0BE;
  --brass: #B8863F;
  --brass-ink: #7E5A24;
  --brass-soft: #F1E6CF;
  --good: #2F7D4F;
  --bad: #A8322A;
  --s1: #0C7B60; --s2: #B8863F; --s3: #4A5BA8; --s4: #9C4F3E; /* validated (dataviz six checks) */

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Helvetica, Arial, sans-serif;

  --r: 14px;
  --r-sm: 10px;
  --gutter: 16px;
  --tab-h: 64px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --dur: 150ms;
  --ease: cubic-bezier(.2,.7,.2,1);
  color-scheme: light;
}

/* The on-course world: true black, big white numerals. Set on <html data-scene="play"> */
:root[data-scene="play"] {
  --paper: #0B0F0D;
  --surface: #121915;
  --surface-2: #1A231E;
  --ink: #F3EEE2;
  --ink-2: #D8D3C6;
  --quiet: #8E968D;
  --line: #263029;
  --line-2: #33403A;
  --brass-soft: #2B2516;
  --s1: #14876A; --s2: #B8863F; --s3: #6170C0; --s4: #B0583F;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  min-height: 100%;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  transition: background-color 220ms var(--ease), color 220ms var(--ease);
}
::selection { background: var(--brass-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 4px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: var(--brass-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-family: var(--serif); font-size: 28px; font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
svg { display: block; }
.num { font-family: var(--serif); font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1; }
.tnum { font-variant-numeric: tabular-nums; }
.quiet { color: var(--quiet); }
.small { font-size: 14px; }
.label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--quiet); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Layout ---- */
#app { min-height: 100dvh; display: flex; flex-direction: column; }
.screen {
  flex: 1;
  padding: calc(var(--sat) + 14px) var(--gutter) calc(var(--tab-h) + var(--sab) + 24px);
  max-width: 560px; width: 100%; margin: 0 auto;
  animation: screen-in 240ms var(--ease) both;
}
.screen.full { max-width: none; padding-left: 0; padding-right: 0; }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-bottom: 12px; }
.topbar .title { font-family: var(--serif); font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.section { margin-top: 28px; }
.section > h2 { margin-bottom: 10px; }
.rule { height: 1px; background: var(--line); border: 0; margin: 20px 0; }
.spacer { flex: 1; }

/* ---- Buttons (flat; no pulse, no glow) ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 16px; line-height: 1; white-space: nowrap;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 100ms ease-out, opacity var(--dur);
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
:root[data-scene="play"] .btn.primary { background: var(--brass); color: #0B0F0D; border-color: var(--brass); }
.btn.brass { background: var(--brass); color: #141008; border-color: var(--brass); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.quietb { background: transparent; }
.btn.block { width: 100%; }
.btn.lg { min-height: 56px; font-size: 17px; }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn.icon { width: 44px; min-height: 44px; padding: 0; border-color: transparent; background: transparent; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn.danger { color: var(--bad); border-color: var(--line); }
.btn .ico { width: 20px; height: 20px; }

/* ---- Inputs ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.input, select.input {
  min-height: 48px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); width: 100%;
  appearance: none; -webkit-appearance: none;
}
.input::placeholder { color: var(--quiet); }
.input:focus { border-color: var(--brass); outline: none; box-shadow: 0 0 0 3px var(--brass-soft); }
.input.error { border-color: var(--bad); }
.hint { font-size: 13px; color: var(--quiet); }
.err { font-size: 13px; color: var(--bad); }
.toggle { display: flex; align-items: center; justify-content: space-between; min-height: 48px; gap: 12px; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 30px; background: var(--line-2); border: 0; padding: 0; flex: none; transition: background var(--dur); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform 180ms var(--ease); }
.switch[aria-checked="true"] { background: var(--brass); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

/* Segmented control */
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--r-sm); padding: 3px; gap: 2px; width: 100%; }
.seg > button { flex: 1; min-height: 40px; border: 0; background: transparent; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--quiet); transition: background var(--dur), color var(--dur); }
.seg > button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
:root[data-scene="play"] .seg > button[aria-pressed="true"] { background: var(--surface-2); box-shadow: none; outline: 1px solid var(--line-2); }

/* Pills (sub-tabs) */
.pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 -2px; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---- Lists ---- */
.list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.list > .item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 0; border-bottom: 1px solid var(--line); text-align: left; background: transparent; border-left: 0; border-right: 0; border-top: 0; width: 100%; color: inherit; }
.item .main { flex: 1; min-width: 0; }
.item .t { font-weight: 600; display: block; }
.item .s { font-size: 13px; color: var(--quiet); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .s.wrap { white-space: normal; }
.item .main br { display: none; }
a.item, a.btn, a.resume { text-decoration: none; }
.item .r { text-align: right; }
.chev { width: 18px; height: 18px; color: var(--quiet); flex: none; }

/* ---- Panels (one level only — never nested) ---- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.panel.brass { border-color: var(--brass); background: var(--brass-soft); }
.callout { border-left: 1px solid var(--brass); padding: 4px 0 4px 14px; color: var(--ink-2); font-size: 15px; }

/* ---- Home ---- */
.hero-index { padding: 8px 0 4px; }
.hero-index .big { font-family: var(--serif); font-size: 112px; line-height: 0.95; font-weight: 400; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; font-variation-settings: "opsz" 144, "SOFT" 30; }
.hero-index .big.none { font-size: 56px; color: var(--quiet); letter-spacing: -0.02em; }
.hero-index .under { display: flex; align-items: baseline; gap: 14px; margin-top: 6px; flex-wrap: wrap; }
.hero-index .under .num { font-size: 18px; }
.trend { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; }
.trend.down { color: var(--good); }
.trend.up { color: var(--bad); }
.actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 22px; }
.actions .btn { flex-direction: column; min-height: 76px; gap: 8px; font-size: 13px; padding: 10px 6px; white-space: normal; text-align: center; line-height: 1.15; }
.actions .btn .ico { width: 24px; height: 24px; }
.spark { width: 100%; height: 64px; }
.resume { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--ink); color: var(--paper); border: 0; width: 100%; text-align: left; }
.resume .t { font-weight: 600; }
.resume .s { font-size: 13px; opacity: .75; }

/* ---- Tab bar ---- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--tab-h) + var(--sab)); padding-bottom: var(--sab);
  background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 1fr 1.2fr 1fr 1fr; grid-template-rows: minmax(0, 1fr); align-items: stretch; overflow: visible;
}
.tabbar a { min-height: 0; max-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--quiet); font-size: 11px; font-weight: 600; letter-spacing: 0.02em; min-height: 44px; }
.tabbar a .ico { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a.play { color: var(--paper); }
.tabbar a.play .disc { width: 54px; height: 54px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; margin-top: -22px; border: 3px solid var(--surface); }
.tabbar a.play .disc .ico { width: 26px; height: 26px; color: var(--paper); }
.tabbar a.play span { color: var(--quiet); }
:root[data-scene="play"] .tabbar { display: none; }

/* ---- Play screen ---- */
.play { display: flex; flex-direction: column; height: 100dvh; padding: var(--sat) 0 var(--sab); }
.screen.full:has(.play) { padding: 0; }
.play .bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 6px; gap: 8px; }
.play .holehead { display: flex; align-items: baseline; gap: 10px; padding: 0 16px; }
.play .holehead .hn { font-family: var(--serif); font-size: 44px; line-height: 1; letter-spacing: -0.03em; }
.play .holehead .meta { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--ink-2); font-size: 15px; }
.play .holehead .meta b { color: var(--ink); font-weight: 600; }
.play .map { position: relative; margin: 8px 12px 0; border-radius: var(--r); overflow: hidden; background: #0E1612; flex: 1 1 0; min-height: 130px; }
.play .map > #holemap { width: 100%; height: 100%; display: block; }   /* only the map — not the icons inside buttons on it */
/* Map · Satellite · 3D — top-left of the map card, clear of the F/C/B plate on the right. */
.play .map .views { position: absolute; top: 10px; left: 10px; display: flex; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(11, 15, 13, .66); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.play .map .views > * { min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: rgba(241, 238, 228, .78); font: 600 13px/32px var(--sans, system-ui); text-decoration: none; -webkit-tap-highlight-color: transparent; transition: background-color 150ms ease-out, color 150ms ease-out; }
.play .map .views > [aria-pressed="true"] { background: #F1EEE4; color: #0F2A1C; }
.play .map .views > a { color: #E6C98A; }
.play .map .views > *:active { transform: scale(.96); }
.play .map .views > *:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
.play .map .views .short { display: none; }
.play .map .fit { position: absolute; left: 10px; top: 52px; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 999px; background: rgba(11, 15, 13, .66); color: #F1EEE4; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.play .map .fit[hidden] { display: none; }
.play .map .fit .ico { width: 18px; height: 18px; }
.play .map .fit:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
/* 3D course, full-screen over the play screen, edge to edge (Luke, 2026-10-16: "free up headroom"): the frame fills the whole
   screen and one small round back button floats over it. Marker (the other full-screen page) keeps a bar. */
html.v3d-open, html.v3d-open body { overflow: hidden; }
.v3d { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #0B0F0D; color: #F1EEE4; animation: v3d-in 260ms cubic-bezier(.16, 1, .3, 1); }
.v3d-bar { display: flex; align-items: center; gap: 8px; padding: calc(var(--sat) + 6px) 8px 6px; min-height: 52px; }
.v3d-back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 12px 0 6px; border: 0; border-radius: 999px; background: rgba(241, 238, 228, .1); color: inherit; font: 600 15px/1 var(--sans); text-decoration: none; }
.v3d-gap { flex: none; width: 40px; }   /* keeps the title centred now the open-outside button is gone */
.v3d-back .ico { width: 20px; height: 20px; }
.v3d-title { flex: 1; min-width: 0; text-align: center; font: 600 14px/1.2 var(--sans); color: rgba(241, 238, 228, .75); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v3d-stage { position: relative; flex: 1; min-height: 0; }
.v3d.bar .v3d-stage { padding-bottom: var(--sab); }
.v3d.edge .v3d-stage { position: absolute; inset: 0; }
.v3d iframe { display: block; width: 100%; height: 100%; border: 0; background: #0B0F0D; opacity: 0; transition: opacity 400ms ease-out; }
.v3d.ready iframe { opacity: 1; }
.v3d-load { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font: 500 15px/1 var(--sans); color: rgba(241, 238, 228, .7); }
.v3d.ready .v3d-load { display: none; }
.v3d-back:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
/* Back to Scratch, over a course's 3D: a labelled button top-left, where the club logo used to be (the logo is top-centre now).
   Its place is shared with the course page (worker/stay-in-app.js keeps the course's own buttons below it). */
.v3d-scratch { position: absolute; z-index: 3; left: calc(14px + env(safe-area-inset-left, 0px)); top: calc(max(var(--sat), 14px) + 2px); height: 44px; display: inline-flex; align-items: center; gap: 4px; padding: 0 16px 0 8px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 20px; background: linear-gradient(90deg, rgba(8, 32, 18, .55), rgba(8, 32, 18, .28)), url(/img/hna-grass-720.webp) center / 360px auto, #2E6B3A; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 6px 16px rgba(0, 0, 0, .35); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); font: 600 13px/1 var(--sans); letter-spacing: .1em; }   /* the crisscross mown grass of the Continue round card */
@media (min-resolution: 2dppx) { .v3d-scratch { background-image: linear-gradient(90deg, rgba(8, 32, 18, .55), rgba(8, 32, 18, .28)), url(/img/hna-grass-1080.webp); } }
.v3d-scratch .ico { width: 16px; height: 16px; }
.v3d-scratch { opacity: 0; pointer-events: none; transition: opacity 350ms ease-out; }   /* hidden while the course is loading */
.v3d.course-ready .v3d-scratch { opacity: 1; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .v3d-scratch { transition: none; } }
.v3d-scratch:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.v3d .sc3 { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; justify-content: center; background: rgba(4, 12, 8, .45); animation: sc3-in 220ms ease-out; }
.sc3-card { width: min(100%, 460px); box-sizing: border-box; padding: 16px 16px calc(var(--sab, 0px) + 18px); border-radius: 24px 24px 0 0; background: rgba(12, 30, 20, .94); -webkit-backdrop-filter: blur(14px) saturate(120%); backdrop-filter: blur(14px) saturate(120%); border: 1px solid rgba(255, 255, 255, .16); border-bottom: 0; color: #F4F8F2; box-shadow: 0 -18px 40px rgba(0, 0, 0, .4); }
.sc3-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.sc3-head b { font: 400 22px/1.1 var(--serif); }
.sc3-head span { flex: 1; font: 600 12px var(--sans); letter-spacing: .06em; color: rgba(244, 248, 242, .7); }
.sc3-x { align-self: center; width: 44px; height: 44px; margin: -8px -8px -8px 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: #F4F8F2; }
.sc3-x .ico { width: 20px; height: 20px; }
.sc3-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sc3-q { min-height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .08); color: #F4F8F2; font-family: var(--sans); }
.sc3-n { font: 400 30px/1 var(--serif); }
.sc3-w { font: 650 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: rgba(244, 248, 242, .78); }
.sc3-q.sc3-par { background: #1F9A55; border-color: #1F9A55; }
.sc3-q.sc3-par .sc3-w { color: #fff; }
.sc3-q[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff; }
.sc3-step { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 14px 0 10px; }
.sc3-b { width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .08); color: #F4F8F2; font: 500 26px/1 var(--sans); }
.sc3-v { min-width: 56px; text-align: center; font: 400 38px/1 var(--serif); }
.sc3-pick { width: 100%; min-height: 44px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); background: none; color: rgba(244, 248, 242, .85); font: 600 14px var(--sans); }
.sc3-pick[aria-pressed="true"] { background: rgba(255, 255, 255, .14); color: #fff; }
.sc3 button:active { transform: scale(.97); }
.sc3 button:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
@keyframes sc3-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .v3d .sc3 { animation: none; } .sc3 button:active { transform: none; } }
/* The Hole-in-One game keeps a small round back button bottom-left (its own back chip also closes it). */
.v3d-exit { position: absolute; z-index: 3; left: calc(14px + env(safe-area-inset-left, 0px)); bottom: calc(var(--sab) + 130px); width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(241, 238, 228, .28); border-radius: 50%; background: rgba(11, 15, 13, .62); -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); color: #F1EEE4; }
.v3d-exit .ico { width: 22px; height: 22px; }
.v3d-exit:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
@keyframes v3d-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .v3d { animation: none; } .v3d iframe { transition: none; } }
@media (max-width: 380px) {   /* small phones: the switch must clear the distance plate on the right */
  .play .map .views { top: 8px; left: 8px; }
  .play .map .views > * { padding: 0 9px; font-size: 12px; }
  .play .map .views .long { display: none; }
  .play .map .views .short { display: inline; }
}
.play .map .nogps { position: absolute; inset: auto 12px 12px 12px; display: flex; justify-content: center; }
.play .fcb { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 8px 10px; border-radius: 10px; background: rgba(11,15,13,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.play .fcb .l { font-size: 11px; color: var(--quiet); letter-spacing: .08em; text-transform: uppercase; }
.play .fcb .v { font-family: var(--serif); font-size: 26px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.play .fcb .v.c { font-size: 40px; color: #fff; }
.play .fcb .v.dim { color: var(--quiet); font-size: 20px; }
.play .strip { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; padding: 10px 12px 0; }
.play .strip::-webkit-scrollbar { display: none; }
.play .strip .h { flex: none; width: 40px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-bottom: 2px solid transparent; background: transparent; border-top: 0; border-left: 0; border-right: 0; color: var(--quiet); font-size: 12px; }
.play .strip .h .n { font-weight: 600; }
.play .strip .h .sc { font-family: var(--serif); font-size: 18px; color: var(--ink); height: 26px; display: grid; place-items: center; }
.play .strip .h[aria-current="true"] { border-bottom-color: var(--brass); color: var(--ink); }
.play .strip .h .sc.b { outline: 1.5px solid var(--ink); border-radius: 50%; width: 26px; }
.play .strip .h .sc.e { outline: 1.5px solid var(--ink); border-radius: 50%; width: 26px; box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--ink); }
.play .strip .h .sc.o { outline: 1.5px solid var(--ink); width: 26px; }
.play .strip .h .sc.d { outline: 1.5px solid var(--ink); width: 26px; box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--ink); }
.play .entry { padding: 10px 12px 0; }
.play .players { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 8px; }
.play .players .p { flex: none; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.play .players .p[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); border-color: var(--line-2); }
.play .score-now { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 8px; }
.play .score-now .v { font-family: var(--serif); font-size: 48px; line-height: 1; letter-spacing: -0.03em; }
.play .score-now .v.blank { color: var(--quiet); opacity: .35; }
.play .score-now .rel { font-size: 15px; color: var(--ink-2); font-weight: 600; }
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.keypad button { min-height: 50px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-family: var(--serif); font-size: 26px; font-weight: 500; transition: background var(--dur), transform 80ms ease-out; }
.keypad button:active { transform: scale(.97); background: var(--surface-2); }
.keypad button.par { background: var(--surface-2); }
.keypad button.sel { background: var(--brass); color: #141008; border-color: var(--brass); }
.keypad button.txt { font-family: var(--sans); font-size: 14px; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tiles button { min-height: 64px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tiles button .n { font-family: var(--serif); font-size: 24px; line-height: 1; }
.tiles button .l { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--quiet); }
.tiles button.sel { background: var(--brass); color: #141008; border-color: var(--brass); }
.tiles button.sel .l { color: #3A2E12; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip { min-height: 40px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); border-color: var(--brass); }
.chip .cnt { font-family: var(--serif); font-size: 16px; }
.play .nav { display: flex; align-items: center; gap: 10px; padding: 10px 12px calc(10px + var(--sab)); }
.play .nav .btn { flex: 1; }
.saved { font-size: 12px; color: var(--quiet); display: inline-flex; align-items: center; gap: 6px; }
.saved .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.saved.pending .dot { background: var(--brass); }

/* ---- Review / scorecard ---- */
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.totals .cell { padding: 12px 0; border-top: 1px solid var(--line); }
.totals .cell .v { font-family: var(--serif); font-size: 36px; line-height: 1; letter-spacing: -0.02em; }
.totals .cell .l { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--quiet); margin-top: 6px; }
.card { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.card th, .card td { padding: 6px 4px; text-align: center; border-bottom: 1px solid var(--line); }
.card th { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--quiet); font-weight: 600; }
.card td.lab, .card th.lab { text-align: left; color: var(--quiet); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; width: 44px; }
.card td.sc { font-family: var(--serif); font-size: 15px; }
.card .tot { font-weight: 600; background: var(--surface-2); }
.cardwrap { overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.notation { display: inline-grid; place-items: center; width: 24px; height: 24px; }
.notation.b { border: 1.5px solid currentColor; border-radius: 50%; }
.notation.e { border: 1.5px solid currentColor; border-radius: 50%; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px currentColor; }
.notation.o { border: 1.5px solid currentColor; }
.notation.d { border: 1.5px solid currentColor; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px currentColor; }

/* ---- Setup ---- */
.picked { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; text-align: left; min-height: 64px; }
.picked .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.picked .t { font-family: var(--serif); font-size: 22px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; }
.picked .s { font-size: 13px; color: var(--quiet); }
.picked .chg { color: var(--brass-ink); font-weight: 600; font-size: 14px; }
.tee { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); width: 100%; text-align: left; color: inherit; }
.tee .sw { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); flex: none; }
.tee[aria-pressed="true"] { border-color: var(--brass); box-shadow: 0 0 0 2px var(--brass-soft); }
.tee .r { margin-left: auto; text-align: right; font-size: 13px; color: var(--quiet); }
.tee .r b { color: var(--ink); font-family: var(--serif); font-size: 16px; font-weight: 500; }
.flag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--brass-ink); background: var(--brass-soft); padding: 2px 8px; border-radius: 999px; font-weight: 600; }

/* ---- Misc ---- */
.empty { padding: 40px 0; text-align: center; color: var(--quiet); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--sab) + 16px); transform: translateX(-50%) translateY(10px); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; opacity: 0; transition: opacity 180ms var(--ease), transform 180ms var(--ease); z-index: 30; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
:root[data-scene="play"] .toast { bottom: calc(var(--sab) + 90px); background: var(--brass); color: #141008; }
.kbd-hint { font-size: 13px; color: var(--quiet); }
.gate { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px; max-width: 480px; margin: 0 auto; }
.gate .wordmark { font-family: var(--serif); font-size: 64px; letter-spacing: -0.04em; line-height: 1; font-weight: 400; font-variation-settings: "opsz" 144, "SOFT" 50; }
.gate .for { margin-top: 14px; color: var(--ink-2); font-size: 17px; }
.gate .for b { font-weight: 600; color: var(--ink); }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; opacity: 0; transition: opacity 200ms var(--ease); }
.sheet-backdrop.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--surface); border-radius: 18px 18px 0 0; padding: 10px 16px calc(16px + var(--sab)); max-height: 86dvh; overflow: auto; transform: translateY(100%); transition: transform 320ms cubic-bezier(.2,.9,.3,1); box-shadow: 0 -8px 30px rgba(0,0,0,.18); }
.sheet.show { transform: none; }
.sheet .handle { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto 12px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 1ms !important; transition-duration: 1ms !important; }
  .sheet { transition: opacity 150ms ease; }
}


/* Welcome has its own full-screen chrome: no tab bar. */
:root[data-scene="welcome"] .tabbar { display: none; }

/* Desktop: the app is a phone-width column, centred, so nothing stretches to 1900px. */
@media (min-width: 700px) {
  body { background: #DCE6D8; }
  #app { max-width: 560px; margin: 0 auto; background: var(--paper); min-height: 100dvh; box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(8, 28, 16, .12); position: relative; }
  :root[data-scene="play"] body { background: #050806; }
  .tabbar { left: 50%; right: auto; width: 560px; transform: translateX(-50%); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .toast { bottom: calc(var(--tab-h) + 24px); }
}

/* Short phones (iPhone SE class): same screen, tighter, still one page. */
@media (max-height: 720px) {
  .play .holehead .hn { font-size: 34px; }
  .play .map { min-height: 96px; margin-top: 4px; }
  .play .strip { padding-top: 4px; }
  .play .strip .h { padding: 2px 0; }
  .play .entry { padding-top: 4px; }
  .play .score-now { padding-bottom: 2px; }
  .play .score-now .v { font-size: 36px; }
  .keypad { gap: 6px; }
  .keypad button { min-height: 44px; font-size: 22px; }
  .chips { margin-top: 6px; gap: 6px; }
  .play .nav { padding-top: 6px; padding-bottom: calc(6px + var(--sab)); }
}

/* Club logos (crests.js). A white disc keeps every logo legible on paper and on the dark play screen; a club whose
   logo is white-only gets a deep green disc. */
.crest { flex: none; display: grid; place-items: center; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px rgba(15, 42, 28, .1), 0 1px 3px rgba(15, 42, 28, .12); overflow: hidden; }
.crest img { width: 78%; height: 78%; object-fit: contain; display: block; }
.crest.on-dark { background: #12301F; }
.crest-sm { width: 36px; height: 36px; }
.crest-md { width: 44px; height: 44px; }
.crest-lg { width: 88px; height: 88px; }
.crest-hero { display: flex; justify-content: center; margin: 4px 0 10px; }
.rv-course { display: flex; align-items: center; gap: 10px; }
.play .bar .crest { width: 28px; height: 28px; }
.play .holehead .lie { font-weight: 600; color: #E6C98A; white-space: nowrap; }
.play .holehead .lie.down { color: #9FD1B2; }

/* Me: profile picture (avatar.js). */
.me-pic { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.me-pic-face { width: 88px; height: 88px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--quiet);
  display: grid; place-items: center; padding: 0; overflow: hidden; }
.me-pic-face .ico { width: 36px; height: 36px; }
.me-pic-face .avatar { width: 100%; height: 100%; object-fit: cover; display: block; }
.me-pic-txt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.me-pic-txt .hint { flex-basis: 100%; margin: 2px 0 0; }

/* Courses by province: tap a province, its courses drop down. */
.prov-list { display: grid; gap: 10px; }
.prov { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.prov > summary { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.prov > summary::-webkit-details-marker { display: none; }
.prov > summary .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prov > summary .t { font-weight: 650; font-size: 17px; }
.prov > summary .s { font-size: 14px; color: var(--quiet); }
.prov > summary .chev { transition: transform 160ms ease-out; color: var(--quiet); }
.prov[open] > summary .chev { transform: rotate(90deg); }
.prov > .list { border-top: 1px solid var(--line); }
.prov-badge { flex: none; display: block; }
.prov-art { width: auto; height: auto; max-height: 100%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); }
@media (prefers-reduced-motion: reduce) { .prov > summary .chev { transition: none; } }

/* Handicap calculator: shots on each hole + typed scores */
.card td.cs-shot { color: var(--brass, #C9A14A); font-size: 13px; letter-spacing: -1px; }
.card .cs-cell { width: 34px; min-width: 34px; height: 36px; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; text-align: center; }
.card .cs-cell.on { border-color: var(--brass, #C9A14A); box-shadow: 0 0 0 2px var(--brass, #C9A14A); }
.cs-pad { margin-top: 12px; }
.cs-who { margin: 0 0 8px; font-size: 15px; }
.cs-more { margin-top: 8px; }
.cs-pad .quick button.birdie { background: #DDEFD9; border-color: #4E9A4A; color: #14301A; }
.cs-pad .quick button.par { background: #FBF0C4; border-color: #D4A82A; color: #3A2E08; }
.cs-pad .quick button.bogey { background: #F7D9D5; border-color: #C9524A; color: #3A0F0B; }
.cs-pad .quick button.birdie .q-w, .cs-pad .quick button.par .q-w, .cs-pad .quick button.bogey .q-w { color: inherit; }
.cs-pad .quick button[aria-pressed="true"].birdie { background: #3E9A47; border-color: #3E9A47; color: #fff; }
.cs-pad .quick button[aria-pressed="true"].par { background: #E3B422; border-color: #E3B422; color: #231A02; }
.cs-pad .quick button[aria-pressed="true"].bogey { background: #D4453C; border-color: #D4453C; color: #fff; }
#saved { margin-top: 2px; }

/* Sync chip + Send to HNA preview */
.rv-sync, .hs-sync { margin: 4px 0 0; }
.rv-sync[data-sync="wait"], .hs-sync[data-sync="wait"] { color: #B9770E; }
.rv-sync[data-sync="sent"], .hs-sync[data-sync="sent"] { color: #4C8B5A; }
.hs-preview { margin: 12px 0; }

.cs-done { margin-top: 12px; display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: #DDEFD9; border: 1px solid #4E9A4A; color: #14301A; }
.cs-done div { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.cs-done b { font-size: 16px; }
.cs-done .quiet { color: #3C5A40; font-size: 12px; }
.cs-tick { flex: none; width: 36px; height: 36px; border-radius: 50%; background: #3E9A47; color: #fff; display: grid; place-items: center; }
.cs-tick svg { width: 20px; height: 20px; }
.cs-gdetail { margin-top: 8px; }
.cs-owe { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.cs-owe li { padding: 10px 12px; border-radius: 10px; background: var(--surface-2, var(--surface)); border: 1px solid var(--line-2); font-size: 15px; }
.cs-wolf { margin-bottom: 10px; }

.tl-putt { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); display: grid; gap: 8px; }
.tl-ph { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--quiet); font-weight: 600; }
.tl-pl { margin: 0; font-size: 13px; display: flex; justify-content: space-between; }
.tl-putt input[type=range] { width: 100%; }
.tl-read-out { margin: 4px 0 0; font-size: 17px; line-height: 1.35; font-weight: 600; }

.tl-here { justify-self: start; display: inline-flex; align-items: center; gap: 6px; }
.tl-here svg { width: 15px; height: 15px; }
.tl-hint { min-height: 1.2em; font-size: 12px; color: var(--quiet); display: block; }
