/* ============================================================ tokens ===== */
:root {
  --brand: #0f5132;        /* fairway green */
  --brand-2: #157347;
  --brand-ink: #ffffff;
  --brand-soft: #e7f2ec;
  --accent: #c9a24a;       /* trophy gold, from the original app */
  --accent-soft: #fbf3df;
  --bg: #f4f5f1;
  --surface: #ffffff;
  --surface-2: #f1f3ef;
  --ink: #15201a;
  --ink-2: #56625b;
  --ink-3: #8a958e;
  --line: #e2e6e1;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --win: #157347;
  --loss: #b3261e;
  --eagle: #b7791f; --birdie: #c0392b; --par: #157347; --bogey: #1f5fa8; --dbl: #3949ab; --triple: #6a1b9a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 4px 16px rgba(16, 24, 20, .06);
  --tap: 48px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #3fb27f; --brand-2: #57c793; --brand-ink: #06140d; --brand-soft: #143325;
    --accent: #d8b862; --accent-soft: #3a3120;
    --bg: #0d1210; --surface: #161d19; --surface-2: #1d2621; --ink: #eef3ef; --ink-2: #a9b5ae; --ink-3: #74817a;
    --line: #26302b; --danger: #ff8a80; --danger-soft: #3a1d1b; --win: #57c793; --loss: #ff8a80;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--brand-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ============================================================ layout ===== */
.app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; padding: calc(10px + var(--safe-top)) 12px 10px;
  background: var(--brand); color: var(--brand-ink);
  display: flex; align-items: center; gap: 8px; min-height: 56px;
}
.topbar h1 { font-size: 17px; font-weight: 700; flex: 1; text-align: center; letter-spacing: .2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .icon-btn { color: var(--brand-ink); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; flex: none; }
.icon-btn:active { background: rgba(255,255,255,.15); }
.icon-btn.ghost { visibility: hidden; }
.content { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 16px 16px calc(120px + var(--safe-bottom)); }

.progress { height: 4px; background: rgba(255,255,255,.25); position: sticky; top: 56px; z-index: 19; }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.steps-label { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .8px; font-weight: 700; margin-bottom: 4px; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -.3px; margin-bottom: 4px; }
.page-sub { color: var(--ink-2); margin-bottom: 18px; }

.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px 16px calc(12px + var(--safe-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.bottom-bar .inner { max-width: 640px; margin: 0 auto; display: flex; gap: 10px; }

/* ============================================================ pieces ===== */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.card-pad { padding: 16px; }
.card-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; color: var(--ink-2); padding: 14px 16px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.section-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; color: var(--ink-2); margin: 22px 4px 8px; }
.muted { color: var(--ink-2); } .small { font-size: 13px; } .tiny { font-size: 12px; } .center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.divider { height: 1px; background: var(--line); margin: 0 16px; }

.btn {
  min-height: var(--tap); padding: 0 18px; border-radius: 14px; font-weight: 700; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s, background .15s;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-secondary { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-text { color: var(--brand-2); font-weight: 700; padding: 8px 4px; min-height: 0; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.flex1 { flex: 1; }

.choice {
  display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; padding: 18px 16px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px;
  border: 2px solid transparent;
}
.choice.on { border-color: var(--brand); }
.choice .emoji { font-size: 30px; line-height: 1; }
.choice h3 { font-size: 18px; margin-bottom: 2px; }
.choice p { color: var(--ink-2); font-size: 14px; }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.input {
  width: 100%; min-height: var(--tap); padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); font-size: 16px; outline: none;
}
.input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft); }
.input.num { text-align: center; font-variant-numeric: tabular-nums; }
.input.invalid { border-color: var(--danger); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 32px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-top: 1px solid var(--line); min-height: 60px; }
.list-row:first-child { border-top: 0; }
.list-row .title { font-weight: 700; }
.list-row .sub { font-size: 13px; color: var(--ink-2); }
button.list-row { width: 100%; text-align: left; }
button.list-row:active { background: var(--surface-2); }

.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }

.player-row { display: grid; grid-template-columns: 34px 1fr 112px 40px; gap: 8px; align-items: center; padding: 8px 8px 8px 12px; border-top: 1px solid var(--line); }
.player-row:first-child { border-top: 0; }
.player-row .input { min-height: 44px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); color: var(--ink);
  font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid transparent;
}
.chip.on { background: var(--brand); color: var(--brand-ink); }
.chip.outline { background: transparent; border-color: var(--line); }

.toggle-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
.toggle-row:first-child { border-top: 0; }
.toggle-row .grow .t { font-weight: 700; }
.toggle-row .grow .s { font-size: 13px; color: var(--ink-2); }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + i { background: var(--brand-2); }
.switch input:checked + i::after { transform: translateX(20px); }

.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.stepper button { width: 40px; height: 40px; border-radius: 10px; font-size: 20px; font-weight: 800; background: var(--surface); box-shadow: var(--shadow); }
.stepper .val { min-width: 56px; text-align: center; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .3px; background: var(--surface-2); color: var(--ink-2); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.gold { background: var(--accent-soft); color: #8a6a17; }
@media (prefers-color-scheme: dark) { .badge.gold { color: var(--accent); } }

.notice { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; color: var(--ink); margin-bottom: 14px; }
.notice.info { background: var(--brand-soft); }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.errors { margin: 0 0 14px; padding: 12px 14px 12px 30px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: 14px; }

.search { position: relative; }
.search .input { padding-left: 42px; }
.search::before { content: "⌕"; position: absolute; left: 14px; top: 50%; transform: translateY(-52%); font-size: 22px; color: var(--ink-3); pointer-events: none; }

/* hole grid for manual course entry */
.hole-grid { display: grid; grid-template-columns: 44px 1fr 1fr 1fr; gap: 6px 8px; align-items: center; padding: 12px 16px 16px; }
.hole-grid .hd { font-size: 11px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .6px; text-align: center; }
.hole-grid .hn { font-weight: 800; text-align: center; color: var(--ink-2); }
.hole-grid .input { min-height: 40px; padding: 6px; }
.par-btn { min-height: 40px; border-radius: 10px; font-weight: 800; background: var(--surface-2); }
.par-btn.p3 { background: #e8f1fb; color: var(--bogey); } .par-btn.p5 { background: var(--accent-soft); color: #8a6a17; }
@media (prefers-color-scheme: dark) { .par-btn.p3 { background: #1a2a3d; color: #8ab4f8; } .par-btn.p5 { color: var(--accent); } }

.hcp-table { width: 100%; border-collapse: collapse; }
.hcp-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); font-weight: 800; padding: 10px 8px 6px; text-align: center; }
.hcp-table th:first-child, .hcp-table td:first-child { text-align: left; padding-left: 16px; }
.hcp-table td { padding: 6px 8px; border-top: 1px solid var(--line); text-align: center; font-variant-numeric: tabular-nums; }
.hcp-table .input { min-height: 40px; width: 64px; padding: 6px; }
.hcp-table td:last-child, .hcp-table th:last-child { padding-right: 16px; }

.match-row { display: grid; grid-template-columns: 1fr auto 1fr 40px; gap: 8px; align-items: center; padding: 8px 8px 8px 16px; border-top: 1px solid var(--line); }
.match-row .vs { font-size: 12px; font-weight: 800; color: var(--ink-3); }
.match-row .input { min-height: 44px; }

/* bottom sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 16, 13, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: up .2s ease-out; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 10px 18px; }
.sheet-head h2 { font-size: 18px; flex: 1; }
.sheet-body { overflow-y: auto; padding: 4px 16px calc(24px + var(--safe-bottom)); -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 10px 16px calc(12px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; z-index: 60; animation: fade .2s; max-width: calc(100% - 32px); }

.empty { text-align: center; padding: 28px 16px; color: var(--ink-2); }
.empty .big { font-size: 40px; margin-bottom: 8px; }

.hero { padding: 26px 4px 8px; }
.hero h2 { font-size: 30px; font-weight: 850; letter-spacing: -.5px; line-height: 1.1; }
.hero p { color: var(--ink-2); margin-top: 6px; }

.summary-list { list-style: none; }
.summary-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 15px; }
.summary-list li:first-child { border-top: 0; }
.summary-list li span:first-child { color: var(--ink-2); }
.summary-list li span:last-child { font-weight: 700; text-align: right; }

.code-box { font: 800 28px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 6px; text-align: center; padding: 16px; background: var(--surface-2); border-radius: 12px; }

/* ======================================================= event / scoring ===== */
.tabbar { position: sticky; top: calc(56px + var(--safe-top)); z-index: 18; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; background: var(--brand); padding: 0 8px; }
.tabbar::-webkit-scrollbar { display: none; }
.tabbar a { flex: none; padding: 10px 12px 11px; color: rgba(255,255,255,.72); font-weight: 700; font-size: 14px; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .tabbar a { color: rgba(6,20,13,.65); } }
.tabbar a.on { color: var(--brand-ink); border-bottom-color: var(--accent); }

.sync { font-size: 11px; font-weight: 800; letter-spacing: .4px; padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,.18); color: var(--brand-ink); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: #7CFC9A; }
.sync.off i { background: #ffb4a8; }
.sync.local i { background: rgba(255,255,255,.6); }
.sync .live { animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.segmented { display: flex; background: var(--surface-2); padding: 4px; border-radius: 12px; gap: 4px; margin-bottom: 14px; }
.segmented button { flex: 1; min-height: 38px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.hole-head { background: var(--brand); color: var(--brand-ink); border-radius: var(--radius) var(--radius) 0 0; display: flex; align-items: center; justify-content: space-between; padding: 12px; }
.hole-head .nav { width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.14); color: var(--brand-ink); font-size: 26px; font-weight: 700; display: grid; place-items: center; }
.hole-head .nav[disabled] { opacity: .3; }
.hole-head .mid { text-align: center; }
.hole-head .num { font-size: 26px; font-weight: 850; letter-spacing: -.3px; line-height: 1.1; }
.hole-head .meta { font-size: 13px; opacity: .85; margin-top: 2px; }
.entry { background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; touch-action: pan-y; }
.score-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-top: 1px solid var(--line); min-height: 72px; }
.score-row:first-child { border-top: 0; }
.score-row .who { flex: 1; min-width: 0; }
.score-row .who .n { font-weight: 800; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-row .who .s { font-size: 12px; color: var(--ink-2); }
.pops { color: var(--accent); font-size: 14px; letter-spacing: 1px; margin-left: 4px; }
.sbtn { width: 52px; height: 52px; border-radius: 50%; background: var(--surface-2); font-size: 28px; font-weight: 700; display: grid; place-items: center; color: var(--ink); flex: none; }
.sbtn:active { transform: scale(.94); background: var(--line); }
.sval { width: 58px; height: 58px; border-radius: 14px; display: grid; place-items: center; font-size: 28px; font-weight: 850; border: 2px solid var(--line); font-variant-numeric: tabular-nums; flex: none; background: var(--surface); }
.sval.empty { color: var(--ink-3); }
.c-eagle { background: #fff4d6 !important; color: #8a5a00 !important; border-color: #e0a92e !important; }
.c-birdie { background: #fde8e6 !important; color: #b3261e !important; border-color: #e46a5f !important; }
.c-par { background: var(--brand-soft) !important; color: var(--brand) !important; border-color: var(--brand-2) !important; }
.c-bogey { background: #e7f0fb !important; color: #1f5fa8 !important; border-color: #7aa6dc !important; }
.c-dbl { background: #eceefa !important; color: #3949ab !important; border-color: #9fa8da !important; }
.c-triple { background: #f3e8f8 !important; color: #6a1b9a !important; border-color: #b68bd0 !important; }
@media (prefers-color-scheme: dark) {
  .c-eagle { background: #3a2e10 !important; color: #ffd166 !important; } .c-birdie { background: #3a1b19 !important; color: #ff8a80 !important; }
  .c-bogey { background: #15263b !important; color: #8ab4f8 !important; } .c-dbl { background: #1d2140 !important; color: #a5adf0 !important; }
  .c-triple { background: #2c1a36 !important; color: #d7a6f2 !important; }
}
.jump { display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; padding: 12px; }
.jump button { aspect-ratio: 1; border-radius: 9px; font-weight: 800; font-size: 13px; background: var(--surface-2); color: var(--ink-2); }
.jump button.done { background: var(--brand-soft); color: var(--brand); }
.jump button.part { background: var(--accent-soft); color: #8a6a17; }
.jump button.on { background: var(--brand); color: var(--brand-ink); }

.totals { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 12px 16px 16px; }
.tot { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tot .n { font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tot .s { font-size: 11px; color: var(--ink-2); }
.tot .v { font-weight: 850; font-size: 20px; text-align: right; font-variant-numeric: tabular-nums; }
@media (min-width: 560px) { .totals { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.match { padding: 12px 16px; border-top: 1px solid var(--line); }
.match:first-of-type { border-top: 0; }
.pill { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.up1 { background: var(--brand-soft); color: var(--brand); } .pill.up2 { background: #e7f0fb; color: #1f5fa8; }
.pill.final { background: var(--brand); color: var(--brand-ink); } .pill.halved { background: var(--accent-soft); color: #8a6a17; }
@media (prefers-color-scheme: dark) { .pill.up2 { background: #15263b; color: #8ab4f8; } }
.mholes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.mholes span { width: 26px; height: 26px; border-radius: 7px; font-size: 11px; font-weight: 800; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); }
.mholes .p1 { background: var(--brand-2); color: #fff; } .mholes .p2 { background: #1f5fa8; color: #fff; } .mholes .push { background: var(--line); color: var(--ink-2); }

.money { font-weight: 850; font-variant-numeric: tabular-nums; }
.money.pos { color: var(--win); } .money.neg { color: var(--loss); } .money.zero { color: var(--ink-3); }
.press-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.press-row:first-child { border-top: 0; }
.press-row .chip { min-height: 36px; padding: 0 12px; }

.lb-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); width: 100%; text-align: left; }
.lb-row:first-child { border-top: 0; }
.rank { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 850; font-size: 14px; background: var(--surface-2); color: var(--ink-2); flex: none; }
.rank.r1 { background: #f6d77a; color: #4a3a00; } .rank.r2 { background: #d9dde1; color: #3a4148; } .rank.r3 { background: #e3b48a; color: #4a2a0e; }
.lb-row .pts { font-size: 20px; font-weight: 850; color: var(--brand); font-variant-numeric: tabular-nums; }
.lb-detail { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px 60px; }

.sc-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sc { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 100%; }
.sc th, .sc td { padding: 7px 5px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; min-width: 30px; }
.sc th { font-size: 11px; color: var(--ink-3); font-weight: 800; }
.sc .pc { position: sticky; left: 0; background: var(--surface); text-align: left; padding-left: 12px; font-weight: 800; min-width: 84px; z-index: 1; }
.sc .sub td { color: var(--ink-3); font-size: 11px; }
.sc .tc { font-weight: 850; background: var(--surface-2); }
.sc td.cell { cursor: pointer; }
.sc td.cell span { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 6px; border: 1.5px solid transparent; }
.sc sup { color: var(--accent); font-size: 9px; }

.pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pad button { min-height: 58px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-size: 22px; font-weight: 850; }
.pad button.on { background: var(--brand); color: var(--brand-ink); }

/* course search: plain look on iPhone (no native rounded search styling) */
input[type="search"].input { -webkit-appearance: none; appearance: none; }
input[type="search"].input::-webkit-search-decoration { -webkit-appearance: none; }

/* ============================================================ brand art ===== */
:root {
  --art-sky-top: #cfe6dc; --art-sky-bottom: #fbefd6; --art-sun: #f3c85b;
  --art-hill-far: #a9cdb0; --art-trees: #6f9f7c; --art-hill-mid: #6bb183; --art-hill-near: #2f7d52;
  --art-fairway-far: #7ccc94; --art-fairway-near: #45a96c; --art-stripe: #9be0b0;
  --art-green: #8fdcaa; --art-sand: #f1e2bb; --art-hole: #12301f; --art-pole: #ffffff; --art-flag: #c9a24a; --art-ball: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --art-sky-top: #0c1f19; --art-sky-bottom: #2b3a2a; --art-sun: #d8b862;
    --art-hill-far: #1d3a2c; --art-trees: #15301f; --art-hill-mid: #22553a; --art-hill-near: #133d27;
    --art-fairway-far: #2f7a4f; --art-fairway-near: #24603e; --art-stripe: #3f9466;
    --art-green: #3c9c66; --art-sand: #8c7c55; --art-hole: #06120b; --art-pole: #e9efe9; --art-flag: #d8b862; --art-ball: #e9efe9;
  }
}
.hero-banner { position: relative; margin: -16px -16px 0; overflow: hidden; }
.hero-banner .hero-art { display: block; width: 100%; height: 190px; }
.hero-banner::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 18px; background: linear-gradient(to bottom, transparent, var(--bg)); }
@media (min-width: 640px) { .hero-banner { margin: 8px 0 0; border-radius: var(--radius); } .hero-banner::after { display: none; } }
.hero-banner + .hero { padding-top: 6px; }

.topbar .brand { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; }
.topbar .brand h1 { flex: none; font-size: 19px; font-weight: 850; letter-spacing: .3px; }
.logo-mark { border-radius: 6px; box-shadow: 0 0 0 1.5px rgba(255,255,255,.35); flex: none; }

/* course banner at the top of each round */
.round-banner { position: relative; height: 104px; border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; box-shadow: var(--shadow); }
.round-banner .hero-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.round-banner::before { content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(8, 36, 22, .88) 0%, rgba(8, 36, 22, .62) 55%, rgba(8, 36, 22, .05) 100%); }
.round-banner .rb-text { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 0 18px; color: #fff; max-width: 82%; }
.rb-kicker { font-size: 11px; font-weight: 800; letter-spacing: .9px; text-transform: uppercase; color: #e9cf86; }
.rb-name { font-size: 22px; font-weight: 850; letter-spacing: -.3px; line-height: 1.15; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-meta { font-size: 12.5px; opacity: .9; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-edit { position: absolute; top: 10px; right: 10px; z-index: 3; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(8, 36, 22, .55); color: #fff; font-size: 17px; display: grid; place-items: center; box-shadow: 0 0 0 1.5px rgba(255,255,255,.35); }
.rb-edit:active { transform: scale(.94); }
.par-btn.p6 { background: #fde8e6; color: var(--birdie); }

/* ===================================================== scorecard symbols ===== */
/* birdie = circle, eagle+ = double circle, bogey = square, double = 2 squares, triple = 3 */
.sc td.cell, .sc td:has(> .sym) { padding: 9px 7px; min-width: 38px; }
.sc td span.sym { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 2px; border: 1.5px solid transparent; font-weight: 700; color: var(--ink); }
.sc td span.sym.sym-birdie { border-color: currentColor; border-radius: 50%; }
.sc td span.sym.sym-eagle { border-color: currentColor; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px currentColor; }
.sc td span.sym.sym-bogey { border-color: currentColor; border-radius: 2px; }
.sc td span.sym.sym-dbl { border-color: currentColor; border-radius: 2px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px currentColor; }
.sc td span.sym.sym-triple { border-color: currentColor; border-radius: 2px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px currentColor, 0 0 0 5.5px var(--surface), 0 0 0 7px currentColor; }
.sc sup { margin-left: 3px; }

/* stroke dots (tap to give up a stroke) */
button.pops { background: none; border: 0; padding: 2px 4px; margin-left: 2px; border-radius: 8px; color: var(--accent); font-size: 14px; letter-spacing: 1px; }
button.pops:active { background: var(--accent-soft); }
.pop-given { color: var(--ink-3); }

/* banker audit */
.audit-hole { padding-bottom: 4px; }
.audit-row { display: grid; grid-template-columns: 1fr auto 72px; gap: 8px; align-items: center; padding: 8px 16px; border-top: 1px solid var(--line); }
.audit-row > :last-child { text-align: right; }
.audit-foot { display: flex; flex-direction: column; gap: 2px; padding: 8px 16px 10px; border-top: 1px dashed var(--line); font-size: 13px; }

/* champion + awards + rules */
.champion-card { display: flex; align-items: center; gap: 16px; padding: 18px; margin-bottom: 14px; border-radius: var(--radius);
  color: #fff; background: linear-gradient(135deg, #0b3d26 0%, #157347 60%, #2e9b62 100%); box-shadow: var(--shadow); }
.champion-card .trophy { font-size: 46px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,.3)); }
.champion-card .champ-name { font-size: 26px; font-weight: 850; letter-spacing: -.3px; line-height: 1.15; margin: 2px 0; }
.lb-row .rank { font-size: 15px; }
.awards { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 10px 12px 14px; }
@media (min-width: 560px) { .awards { grid-template-columns: 1fr 1fr; } }
.award { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.award.empty { opacity: .65; }
.award-icon { font-size: 24px; line-height: 1.2; width: 30px; text-align: center; flex: none; }
.award-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-2); }
.award-who { font-size: 17px; font-weight: 800; margin: 1px 0; }
.rules-list { margin: 6px 0 12px; padding: 0 16px 0 34px; }
.rules-list li { margin: 6px 0; font-size: 15px; line-height: 1.45; }

/* match play: name key + one row per player (who won = which row, not just color) */
:root { --match-p1: #157347; --match-p2: #1f5fa8; }
@media (prefers-color-scheme: dark) { :root { --match-p1: #3fb27f; --match-p2: #5b9bea; } }
.match-key { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.kchip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); }
.kchip.muted { font-weight: 600; }
.kdot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; }
.kdot.p1 { background: var(--match-p1); } .kdot.p2 { background: var(--match-p2); }
.mgrid { display: grid; grid-template-columns: minmax(58px, 76px) repeat(9, minmax(0, 1fr)); gap: 3px; align-items: center; margin-top: 8px; }
.mhn { font-size: 11px; font-weight: 700; color: var(--ink-3); text-align: center; }
.mname { font-size: 12.5px; font-weight: 800; display: flex; align-items: center; gap: 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mc { height: 26px; border-radius: 6px; display: grid; place-items: center; font-size: 13px; background: var(--surface-2); color: var(--ink-3); }
.mc.win { color: #fff; font-weight: 800; }
.mc.win.p1 { background: var(--match-p1); } .mc.win.p2 { background: var(--match-p2); }
.mc.halve { background: transparent; color: var(--ink-2); font-weight: 800; }
.mc.todo { background: transparent; border: 1px dashed var(--line); }
.pill.side-p1 { background: var(--match-p1); color: #fff; }
.pill.side-p2 { background: var(--match-p2); color: #fff; }
@media (prefers-color-scheme: dark) { .mc.win, .pill.side-p1, .pill.side-p2 { color: #06140d; } }

/* side games */
.game-opts { border-top: 1px solid var(--line); padding-top: 10px; background: var(--surface-2); }
.game-opts .field { margin-bottom: 10px; }
.game-opts .chip { background: var(--surface); }
.game-opts .chip.on { background: var(--brand); }
.g-block { padding: 4px 16px 12px; }
.g-sub { font-size: 14px; margin: 8px 0 4px; }
.g-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.g-row:first-child { border-top: 0; }
.g-row > :last-child { text-align: right; }

/* ============================================ trip navigation (tab strip) ===== */
/* Light strip under the green header, clearly separated, with pill-shaped tabs. */
.tabwrap { position: sticky; top: calc(56px + var(--safe-top)); z-index: 18; background: var(--surface);
  border-top: 3px solid var(--accent); border-bottom: 1px solid var(--line); box-shadow: 0 2px 8px rgba(16, 24, 20, .08); }
.tabwrap .tabbar { position: static; background: transparent; padding: 8px 12px; gap: 6px; scroll-padding: 0 40px; }
.tabwrap .tabbar a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface-2); color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1; }
.tabwrap .tabbar a.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 4px rgba(15, 81, 50, .3); }
.tabwrap .tabbar a:active { transform: scale(.97); }
.tico { font-size: 14px; }
.tnum { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; font-size: 11px; font-weight: 800;
  background: var(--brand-soft); color: var(--brand); }
.tabbar a.on .tnum { background: rgba(255, 255, 255, .25); color: var(--brand-ink); }
.tdone { color: var(--brand-2); font-weight: 900; }
.tabbar a.on .tdone { color: var(--brand-ink); }
/* "more tabs this way" hints, shown by main.js when the strip can scroll */
.tab-hint { position: absolute; top: 3px; bottom: 0; width: 44px; display: none; align-items: center; pointer-events: none;
  font-size: 22px; font-weight: 800; color: var(--brand); }
.tab-hint.left { left: 0; justify-content: flex-start; padding-left: 4px; background: linear-gradient(90deg, var(--surface) 45%, transparent); }
.tab-hint.right { right: 0; justify-content: flex-end; padding-right: 6px; background: linear-gradient(270deg, var(--surface) 45%, transparent); }
.tabwrap.more-left .tab-hint.left, .tabwrap.more-right .tab-hint.right { display: flex; }

/* Plus-handicap toggle: iPhone number pads have no + key */
.hi-cell { display: flex; gap: 4px; align-items: center; }
.hi-cell .input { min-width: 0; flex: 1; }
.pm { flex: none; width: 34px; min-height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-3); font-weight: 800; font-size: 18px; }
.pm.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.pm.sm { width: 28px; min-height: 30px; font-size: 15px; }

/* How-to guide */
details.help > summary { list-style: none; cursor: pointer; }
details.help > summary::-webkit-details-marker { display: none; }
details.help[open] > summary .muted { transform: rotate(90deg); }
.help-steps { margin: 0; padding: 4px 18px 14px 40px; line-height: 1.5; }
.help-steps li { margin: 6px 0; }

/* Home tiles */
.home-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 6px; }
.home-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); min-height: 96px; }
.home-tile:active { transform: scale(.98); }
.home-tile .ht-icon { font-size: 24px; margin-bottom: 4px; }
.home-tile b { font-size: 15px; }

/* My stats tiles: label on top, number below */
.totals.stats .tot { display: flex; flex-direction: column-reverse; align-items: flex-start; justify-content: flex-end; gap: 2px; }
.totals.stats .tot .n { white-space: normal; font-size: 13px; }
.totals.stats .tot .v { text-align: left; font-size: 22px; white-space: nowrap; }

/* Game icon badges (setup, Games tab, summaries) */
.game-badge { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; line-height: 1; background: var(--brand-soft); box-shadow: inset 0 0 0 1px rgba(15, 81, 50, .08); }
.game-badge.sm { width: 32px; height: 32px; font-size: 17px; }
.game-row.on .game-badge { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.game-row .s b { color: var(--ink); font-weight: 700; }

/* Collapsible cards */
.card-title.fold { width: 100%; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.card-title.fold .chev { display: inline-block; font-size: 14px; color: var(--ink-3); transition: transform .15s; transform: rotate(0deg); }
.card.folded .card-title.fold .chev { transform: rotate(180deg); }
.card.folded > .card-title.fold { padding-bottom: 12px; }
.match-line { padding: 8px 16px; border-top: 1px solid var(--line); gap: 8px; }
.match-line:last-child { padding-bottom: 12px; }
.game-badge.xs { width: 24px; height: 24px; font-size: 13px; }

/* Home: game strip + action cards */
.game-strip { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.action-list { display: grid; gap: 10px; margin: 16px 0 8px; }
.action-card { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 12px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.action-card:active { transform: scale(.985); }
.action-card b { display: block; font-size: 16px; }
.action-card .sub { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.ac-ico { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.ac-ico.green { background: var(--brand-2); }
.ac-ico.gold { background: var(--accent); }
.ac-ico.blue { background: #2f6db5; }

/* Bottom navigation */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-bottom)); box-shadow: 0 -2px 12px rgba(16, 24, 20, .06); }
.bn-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--ink-3); font-size: 11px; font-weight: 700; padding: 4px 0; min-height: 48px; justify-content: center; }
.bn-tab.on { color: var(--brand-2); }
.bn-tab.bn-play .bn-ico { width: 40px; height: 40px; margin-top: -14px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-2); color: #fff; box-shadow: 0 3px 10px rgba(21, 115, 71, .35); }
body.has-nav .content { padding-bottom: calc(84px + var(--safe-bottom)); }
@media (min-width: 720px) { .bottom-nav { left: 50%; transform: translateX(-50%); max-width: 720px; border-radius: 16px 16px 0 0; } }

/* Multi-group setup */
.fmt-pick { display: grid; gap: 10px; }
.choice.slim { display: flex; align-items: center; gap: 14px; text-align: left; }
.choice.slim h3 { margin: 0; }
.choice.slim p { margin: 2px 0 0; }
.team-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.team-dot.a { background: #c0392b; }
.team-dot.b { background: #1f5fa8; }
.avatar.team-a, .avatar.team-b { border: 0; color: #fff; font-weight: 800; cursor: pointer; }
.avatar.team-a { background: #c0392b; }
.avatar.team-b { background: #1f5fa8; }
.tee-group { padding: 10px 16px; border-top: 1px solid var(--line); }
.chip.gp { min-height: 30px; padding: 0 10px; font-size: 13px; }
.tm-list { margin-top: 8px; display: grid; gap: 4px; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; }
.move-players { border-top: 1px solid var(--line); }
.move-players > summary { padding: 10px 16px; cursor: pointer; list-style: none; }
.move-players > summary::-webkit-details-marker { display: none; }

/* Multi-group round screen */
.group-switch { margin: 0 0 12px; }
.group-switch .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
.tm-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); }
.pill.team-a { background: #c0392b; color: #fff; }
.pill.team-b { background: #1f5fa8; color: #fff; }
.team-score { font-weight: 850; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.sc.lb tr.mine td { background: var(--accent-soft); }
.team-board { padding: 14px 0 0; }
.tb-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 0 16px; }
.tb-team { display: flex; flex-direction: column; align-items: center; padding: 12px 6px; border-radius: 14px; color: #fff; }
.tb-team.a { background: #c0392b; }
.tb-team.b { background: #1f5fa8; }
.tb-name { font-weight: 800; font-size: 14px; text-align: center; }
.tb-pts { font-weight: 900; font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tb-mid { text-align: center; }
.tb-proj { padding: 10px 16px 0; text-align: center; }

/* Pairings builder */
.pair-row { padding: 10px 12px; margin-bottom: 10px; background: var(--surface-2); border-radius: 12px; }
.pair-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; margin-top: 6px; }
.pair-sides > div { display: grid; gap: 6px; min-width: 0; }
.pair-sides .vs { font-weight: 800; font-size: 12px; color: var(--ink-3); padding-bottom: 12px; }
.pair-sel { min-height: 40px; font-size: 14px; padding: 4px 8px; }
.pops-line { margin-top: 4px; }

/* First-run welcome */
.welcome-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(10, 20, 15, .55); display: grid; place-items: end center; padding: 16px 16px calc(16px + var(--safe-bottom)); }
.welcome { width: 100%; max-width: 440px; background: var(--surface); border-radius: 22px; padding: 26px 22px 20px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.welcome-icon { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 36px; background: var(--brand-soft); }
.welcome h2 { margin: 0 0 8px; font-size: 22px; }
.welcome p { margin: 0 0 16px; color: var(--ink-2); line-height: 1.5; }
.welcome-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 16px; }
.welcome-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.welcome-dots i.on { background: var(--brand-2); width: 20px; border-radius: 4px; }

.tee-sel { min-height: 34px; padding: 2px 6px; font-size: 13px; width: 84px; }
.tee-edit > summary { list-style: none; cursor: pointer; margin-top: 6px; }
.tee-edit > summary::-webkit-details-marker { display: none; }

/* Optional hole stats under a score */
.stat-strip { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 6px 0 2px; }
.sc-group, .sc-count { display: inline-flex; align-items: center; gap: 4px; }
.sc-group .tiny, .sc-count .tiny { margin-right: 2px; }
.sc-chip { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-weight: 700; font-size: 13px; }
.sc-chip.on { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.sc-count b { min-width: 16px; text-align: center; font-size: 14px; }
.score-row { flex-wrap: wrap; }
.score-row .stat-strip { flex-basis: 100%; }

/* Settle up */
.settle-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.settle-amt { font-size: 17px; font-variant-numeric: tabular-nums; }
.settle-pay { display: flex; gap: 6px; }
.pay-btn { padding: 6px 10px; border-radius: 9px; font-size: 13px; font-weight: 800; text-decoration: none; color: #fff; }
.pay-btn.venmo { background: #008cff; }
.pay-btn.cash { background: #00c244; }

.hand-row { padding: 6px 0; border-top: 1px solid var(--line); }
.hand-row:first-child { border-top: 0; }
.hand-row .chips { margin-top: 4px; }
