/* Carryover styles, tuned for a phone in bright sunshine:
   - white background, near-black text, heavy weights (glare washes out thin and grey text)
   - no pale grey text; "secondary" text is still dark
   - strong, saturated colours that differ in lightness, not only in hue
   - big numbers and big touch targets (at least 48 px)
   A darker theme is kept for evening rounds (Setup > Display). */

:root {
  --bg: #ffffff; --card: #ffffff; --ink: #000000; --muted: #2e2e2e; --line: #1a1a1a; --soft-line: #9a9a9a;
  --green: #00692c; --green-soft: #d7f0dd; --red: #c1000f; --gold: #8a5a00; --blue: #0047d6;
  --btn: #ececec; --header: #0a3d91; --accent: #0a47b8; --accent-soft: #dbe7ff;
}
:root[data-theme="dark"] {
  --bg: #000000; --card: #111111; --ink: #ffffff; --muted: #d8d8d8; --line: #e6e6e6; --soft-line: #5a5a5a;
  --green: #5fe08a; --green-soft: #133d22; --red: #ff6b6b; --gold: #ffcf4a; --blue: #7fb0ff;
  --btn: #262626; --header: #0b1f45; --accent: #7fb0ff; --accent-soft: #142a52;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #000000; --card: #111111; --ink: #ffffff; --muted: #d8d8d8; --line: #e6e6e6; --soft-line: #5a5a5a;
    --green: #5fe08a; --green-soft: #133d22; --red: #ff6b6b; --gold: #ffcf4a; --blue: #7fb0ff;
    --btn: #262626; --header: #0b1f45; --accent: #7fb0ff; --accent-soft: #142a52;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 600 18px/1.35 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
header { position: sticky; top: 0; z-index: 2; background: var(--header); color: #fff;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 0; }
h1 { margin: 0 0 4px; font-size: 19px; font-weight: 800; }
nav { display: flex; gap: 2px; }
nav button { flex: 1; min-height: 50px; background: transparent; color: #fff; border: 0;
  font-size: 18px; font-weight: 800; line-height: 1; border-bottom: 5px solid transparent; opacity: .85; }
nav button.on { opacity: 1; border-bottom-color: #ffd400; }
main { padding: 10px; max-width: 560px; margin: 0 auto; padding-bottom: calc(env(safe-area-inset-bottom) + 120px); }
section { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
h2 { font-size: 16px; font-weight: 800; margin: 0 0 10px; color: var(--ink); text-transform: uppercase; letter-spacing: .03em; }
label { display: block; font-size: 16px; font-weight: 700; color: var(--ink); margin: 10px 0 4px; }
input, select { font: inherit; font-weight: 700; color: var(--ink); background: var(--bg); border: 2px solid var(--line);
  border-radius: 8px; padding: 10px; width: 100%; min-height: 48px; }
input[type=checkbox] { width: 26px; height: 26px; min-height: 0; accent-color: var(--accent); }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.row .narrow { flex: 0 0 78px; }
.check { display: flex; gap: 10px; align-items: center; margin: 10px 0; color: var(--ink); font-size: 17px; }
button { font-family: inherit; }
button.primary, button.ghost { font: inherit; font-weight: 800; border-radius: 10px; padding: 12px 14px; min-height: 52px; }
button.primary { background: var(--accent); color: #fff; border: 2px solid var(--accent); }
:root[data-theme="dark"] button.primary { color: #000; }
button.ghost { background: var(--btn); color: var(--ink); border: 2px solid var(--line); }
button:disabled { opacity: .4; }
.holes { display: grid; grid-template-columns: 30px 1fr 1fr; gap: 4px 6px; align-items: center; font-size: 16px; }
.holes input { padding: 6px; text-align: center; min-height: 42px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sub { color: var(--muted); font-size: 15px; font-weight: 600; }

/* ---------- GPS ---------- */
.gpsbox { padding: 6px; }
.gpstop { display: flex; align-items: stretch; gap: 6px; }
.holebtn { display: flex; align-items: center; gap: 6px; background: transparent; border: 0; color: var(--ink);
  font: inherit; font-size: 24px; font-weight: 900; padding: 4px 2px; min-height: 52px; }
.holebtn .sub { font-size: 18px; }
.circ { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: var(--bg); font-weight: 900; font-size: 20px; flex: none; }
.club { display: grid; place-items: center; min-width: 64px; padding: 0 8px; background: var(--blue); color: #fff;
  border-radius: 10px; font-size: 30px; font-weight: 900; }
.club:empty { display: none; }
.posthead { display: flex; justify-content: space-between; align-items: center; }
.postnums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; text-align: center; }
.postnums span { display: block; font-size: 13px; font-weight: 800; color: var(--muted); }
.postnums b { display: block; font-size: 28px; font-weight: 900; font-variant-numeric: tabular-nums; }
.postnums div:first-child b { font-size: 36px; color: var(--accent); }
a.btnlink { flex: 1; display: grid; place-items: center; text-decoration: none; font-weight: 800; border-radius: 10px;
  min-height: 52px; background: var(--btn); color: var(--ink); border: 2px solid var(--line); }
.teerow { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 6px; margin-top: 6px; }
.teerow input { padding: 8px 6px; }
.clubrow { display: grid; grid-template-columns: 30px 1fr 80px 30px 48px; gap: 6px; align-items: center; margin-top: 6px; }
.clubrow button.ghost { min-height: 44px; padding: 0; }
.clubrow span { font-size: 15px; }
details summary { cursor: pointer; font-weight: 800; color: var(--ink); min-height: 44px; display: flex; align-items: center; }
.topyd { flex: 1; display: flex; justify-content: space-between; align-items: center; background: #000; color: #fff;
  border-radius: 10px; padding: 2px 12px; border: 2px solid #000; }
:root[data-theme="dark"] .topyd { border-color: #fff; }
.topyd span { font-size: 15px; font-weight: 700; color: #fff; }
.topyd b { font-size: 48px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.05; }
.gpsbody { display: flex; gap: 6px; margin-top: 6px; }
.distcol { flex: 0 0 35%; display: flex; flex-direction: column; justify-content: space-between; }
.drow { text-align: right; padding: 3px 2px; border-bottom: 2px solid var(--soft-line); }
.drow:last-child { border-bottom: 0; }
.drow span { display: block; font-size: 14px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.drow b { display: block; font-size: 34px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.drow.main { background: var(--green); border-radius: 8px; padding: 5px 6px; border: 0; }
.drow.main span, .drow.main b { color: #fff; }
:root[data-theme="dark"] .drow.main span, :root[data-theme="dark"] .drow.main b { color: #000; }
.drow.main b { font-size: 44px; }
.holemap { position: relative; flex: 1; border-radius: 10px; overflow: hidden; background: #2e6b2a;
  touch-action: none; border: 2px solid var(--line); }
.holemap svg { display: block; width: 100%; height: auto; max-height: 72vh; }
.cleartarget { position: absolute; left: 6px; top: 6px; background: #000; color: #fff; border: 2px solid #fff;
  border-radius: 8px; padding: 10px 12px; font-size: 16px; font-weight: 800; min-height: 44px; }
.nomap { padding: 60px 16px; text-align: center; color: #fff; min-height: 260px; font-size: 18px; font-weight: 700; }
.offmap { position: absolute; left: 6px; right: 6px; bottom: 6px; text-align: center; color: #fff; background: #000;
  border-radius: 8px; padding: 6px; font-size: 15px; font-weight: 700; }

.holelist { padding: 0; overflow: hidden; }
.lhead { display: flex; justify-content: space-between; align-items: baseline; padding: 12px; border-bottom: 2px solid var(--line); }
.lrow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: transparent; border: 0;
  border-bottom: 2px solid var(--soft-line); padding: 10px 12px; color: var(--ink); font: inherit; min-height: 72px; }
.lrow.cur { background: var(--accent-soft); }
.ltext { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.lmain { font-size: 20px; font-weight: 800; }
.lstats { display: flex; flex-wrap: wrap; gap: 10px; font-size: 16px; font-weight: 800; color: var(--ink); }
.lstats .good { color: var(--green); } .lstats .bad { color: var(--red); } .lstats .putt { color: var(--gold); }
svg.thumb, .thumb.none { width: 44px; height: 100px; border-radius: 6px; flex: none; border: 2px solid var(--line); }
.thumb.none { background: var(--btn); }

/* ---------- Card (one hole at a time) ---------- */
.holehead { display: flex; justify-content: space-between; align-items: baseline; }
.holehead .num { font-size: 38px; font-weight: 900; }
.holehead .meta { color: var(--ink); font-size: 20px; font-weight: 800; }
.player { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 2px solid var(--soft-line); }
.player:first-of-type { border-top: 0; }
.player > div:first-child { flex: 1; min-width: 0; padding-right: 6px; }
.pname { font-size: 20px; font-weight: 900; }
.dots { color: var(--gold); letter-spacing: 2px; font-size: 18px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--line);
  background: var(--btn); color: var(--ink); font-size: 30px; font-weight: 800; line-height: 1; }
.stepper .score { width: 50px; text-align: center; font-size: 34px; font-weight: 900; }
.score.under { color: var(--red); }
/* Not entered yet: shown as a dashed box, not pale grey (pale grey vanishes in sun). */
.score.empty { color: var(--muted); font-weight: 700; border: 2px dashed var(--muted); border-radius: 8px; }
.stepper.putts { margin-top: 8px; justify-content: flex-end; }
.stepper.putts button { width: 44px; height: 44px; font-size: 24px; }
.stepper.putts .score { width: 80px; font-size: 20px; font-weight: 800; padding: 2px 0; }
.stepper.putts small { font-size: 14px; font-weight: 700; color: var(--ink); }
.fw { display: inline-flex; margin-top: 8px; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; }
.fw button { background: var(--btn); color: var(--ink); border: 0; padding: 0 10px; min-height: 44px; font-size: 17px;
  font-weight: 800; min-width: 44px; }
.fw button + button { border-left: 2px solid var(--line); }
.fw button.on { background: var(--green); color: #fff; }
:root[data-theme="dark"] .fw button.on { color: #000; }
.extras { display: flex; gap: 6px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.chip { background: var(--btn); color: var(--ink); border: 2px solid var(--line); border-radius: 8px;
  padding: 0 10px; min-height: 44px; font-size: 17px; font-weight: 800; white-space: nowrap; }
.chip.on { background: #ffd400; border-color: #000; color: #000; }
.pen { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 8px; overflow: hidden;
  font-size: 17px; font-weight: 800; color: var(--ink); }
.pen button { background: var(--btn); color: var(--ink); border: 0; width: 40px; height: 44px; font-size: 22px; font-weight: 800; }
.pen span { padding: 0 6px; min-width: 50px; text-align: center; white-space: nowrap; }
.pen.has span { color: #fff; background: var(--red); align-self: stretch; display: grid; place-items: center; }
.gir { font-size: 13px; font-weight: 900; padding: 1px 6px; border-radius: 6px; color: var(--ink);
  border: 2px solid var(--ink); vertical-align: 3px; }
.gir.yes { color: #fff; background: var(--green); border-color: var(--green); }
:root[data-theme="dark"] .gir.yes { color: #000; }
.navrow { display: flex; gap: 8px; }
.navrow button { flex: 1; }
.live div { display: flex; justify-content: space-between; padding: 6px 0; font-size: 17px; border-bottom: 1px solid var(--soft-line); }
.live div:last-of-type { border-bottom: 0; }
.live .sub { padding: 0; }

/* ---------- Bets and scorecard ---------- */
.money td, .money th { padding: 8px 4px; text-align: left; border-bottom: 2px solid var(--soft-line); font-size: 16px; }
.money th { font-weight: 900; }
.money { width: 100%; border-collapse: collapse; }
.money td.amt, .money th.amt { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--green); font-weight: 900; }
.neg { color: var(--red); font-weight: 900; }
.pay { font-size: 21px; font-weight: 800; padding: 8px 0; }
.scroll { overflow-x: auto; }
.grid { border-collapse: collapse; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.grid th, .grid td { padding: 6px 7px; text-align: center; border-bottom: 2px solid var(--soft-line); }
.grid td:first-child, .grid th:first-child { text-align: left; position: sticky; left: 0; background: var(--card); }
.brand { font-weight: 900; letter-spacing: .01em; }
.coursename { font-weight: 600; font-size: 15px; opacity: .9; margin-left: 6px; }
.wolfrow { margin: 10px 0 4px; padding: 8px; border: 2px solid var(--line); border-radius: 10px; }
.wolfpick { display: flex; flex-wrap: wrap; margin-top: 6px; }
.wolfpick button { flex: 1 1 auto; }
.bbbline + .bbbline { margin-top: 8px; }
.notice { background: #ffd400; color: #000; font-weight: 800; padding: 10px 12px; border-bottom: 2px solid #000; }
.notice[hidden] { display: none; }
.okbar { background: var(--green); color: #fff; font-weight: 800; border-color: var(--green); }
:root[data-theme="dark"] .okbar { color: #000; }
.playerbox { border: 2px solid var(--soft-line); border-radius: 10px; padding: 8px; margin-bottom: 8px; }
.packrow { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 2px solid var(--soft-line); }
.packrow:first-child { border-top: 0; }
.packrow button { flex: 0 0 auto; }
.updatebar { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: #ffd400; color: #000;
  font-weight: 800; padding: 8px 12px; border-bottom: 2px solid #000; }
.updatebar button { background: #000; color: #fff; border: 0; border-radius: 8px; padding: 10px 14px; font: inherit; font-weight: 800; min-height: 44px; }
.coursebox { border-color: var(--accent); border-width: 3px; }
