/* ---------- tokens ---------- */
:root {
  --green-950: #041f13;
  --green-900: #072a1a;
  --green-800: #0a3622;
  --green-700: #0e4a2e;
  --green-600: #13603c;
  --augusta: #006747;
  --gold: #f4c430;
  --gold-soft: #f8d86a;
  --gold-deep: #c99a12;
  --azalea: #d6336c;
  --cream: #f6f0dc;
  --paper: #fffcf2;
  --paper-2: #f3ecd5;
  --ink: #16241b;
  --ink-soft: #52614f;
  --under: #b00c26;
  --over: #0b5a34;
  --line: rgba(22, 36, 27, 0.12);
  --line-strong: rgba(22, 36, 27, 0.22);
  --on-green: #eef2e6;
  --on-green-soft: rgba(238, 242, 230, 0.68);
  --panel: rgba(4, 31, 19, 0.55);
  --panel-line: rgba(244, 196, 48, 0.22);
  --radius: 14px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -18px rgba(0, 0, 0, 0.55);
  --serif: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --sans: "Libre Franklin", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  color: var(--on-green);
  background-color: var(--green-900);
  background-image:
    radial-gradient(120% 60% at 50% -10%, rgba(19, 96, 60, 0.55), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 48px, transparent 48px 96px),
    linear-gradient(180deg, var(--green-800), var(--green-950));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold); }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--ink); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.nowrap { white-space: nowrap; }
.muted { color: var(--on-green-soft); font-size: 0.9rem; margin: 0.25rem 0 0; }

/* ---------- masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(7, 42, 26, 0.97), rgba(7, 42, 26, 0.92));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(244, 196, 48, 0.35);
  box-shadow: 0 1px 0 rgba(244, 196, 48, 0.12), 0 10px 30px -20px #000;
  padding-top: env(safe-area-inset-top);
}
.masthead-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--on-green); min-width: 0; }
.flag { width: 30px; height: 38px; flex: none; color: var(--cream); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 3.6vw, 1.8rem);
  color: var(--gold);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--on-green-soft);
  margin-top: 3px;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.18);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa89c; }
.live[data-state="live"] { color: #fff; border-color: rgba(200, 16, 46, 0.55); background: rgba(200, 16, 46, 0.18); }
.live[data-state="live"] .live-dot { background: #ff3b52; box-shadow: 0 0 0 0 rgba(255, 59, 82, 0.7); animation: pulse 1.8s infinite; }
.live[data-state="offline"] .live-dot { background: var(--gold); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 59, 82, 0.65); }
  70% { box-shadow: 0 0 0 8px rgba(255, 59, 82, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 82, 0); }
}

.tabs {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--on-green-soft);
  white-space: nowrap;
  transition: color 0.15s;
}
.tabs a:hover { color: var(--on-green); }
.tabs a.active { color: var(--gold); }
.tabs a.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--gold);
}
.tab-admin { margin-left: auto; }
.tab-admin svg { width: 16px; height: 16px; }
@media (max-width: 480px) { .tab-admin span { display: none; } }

/* ---------- layout ---------- */
.main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 20px 16px 32px; }
.footer {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--on-green-soft);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.footer a { font-style: normal; font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; }

.loading { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 60px 0; color: var(--on-green-soft); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.2); border-top-color: var(--gold); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.eyebrow { margin: 0 0 4px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.section-title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}
.count { font-family: var(--sans); font-size: 0.75rem; font-weight: 700; color: var(--ink); background: var(--gold); border-radius: 999px; padding: 1px 8px; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.08s, background 0.15s, border-color 0.15s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-gold { background: linear-gradient(180deg, var(--gold-soft), var(--gold)); color: var(--green-950); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 6px 16px -8px rgba(244, 196, 48, 0.7); }
.btn-gold:hover:not(:disabled) { background: var(--gold-soft); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); color: var(--on-green); border-color: rgba(244, 196, 48, 0.35); }
.btn-ghost:hover:not(:disabled) { border-color: var(--gold); background: rgba(244, 196, 48, 0.08); }
.btn-danger { background: transparent; color: #ff9aa8; border-color: rgba(255, 110, 130, 0.4); }
.btn-danger:hover:not(:disabled) { background: rgba(200, 16, 46, 0.2); border-color: #ff6e82; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 0.72rem; }
.btn-block { width: 100%; }
.btn.busy { opacity: 0.7; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.link-small { background: none; border: 0; padding: 4px 0; font-size: 0.8rem; font-weight: 600; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

.form { display: grid; gap: 14px; }
.form-inline { grid-template-columns: 1fr 140px auto; align-items: end; }
@media (max-width: 640px) { .form-inline { grid-template-columns: 1fr 1fr; } .form-inline .btn { grid-column: 1 / -1; } }
.field { display: grid; gap: 6px; }
.field > span { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-green-soft); }
.field em { color: var(--gold); font-style: normal; }
.field small { text-transform: none; letter-spacing: 0; font-weight: 500; opacity: 0.8; }
.field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(22, 36, 27, 0.2);
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
}
.field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(244, 196, 48, 0.35); }
.form-error { margin: 0; min-height: 1.2em; color: #ffb3bf; font-size: 0.88rem; }
.form-error:empty { display: none; }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 0.92rem; }
.switch small { display: block; color: var(--on-green-soft); font-size: 0.8rem; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { flex: none; width: 44px; height: 26px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); position: relative; transition: background 0.15s; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--cream); transition: transform 0.15s; }
.switch input:checked + .switch-ui { background: var(--gold); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); background: var(--green-900); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--gold); outline-offset: 2px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

/* ---------- score marks (circles for under par, squares for over) ---------- */
.sc {
  display: inline-grid;
  place-items: center;
  min-width: 1.75em;
  height: 1.75em;
  padding: 0 2px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  position: relative;
}
.sc-birdie { color: var(--under); border: 1.5px solid currentColor; border-radius: 50%; }
.sc-eagle { color: var(--under); border: 1.5px solid currentColor; border-radius: 50%; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px currentColor; }
.sc-ace { color: var(--green-950); background: var(--gold); border-radius: 50%; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--gold-deep); }
.sc-par { color: var(--ink); }
.sc-bogey { color: var(--ink); border: 1.5px solid var(--ink-soft); border-radius: 2px; }
.sc-double { color: var(--ink); border: 1.5px solid var(--ink-soft); border-radius: 2px; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink-soft); }
.dash { display: inline-block; width: 10px; height: 2px; border-radius: 2px; background: var(--line-strong); vertical-align: middle; }

.tp-under { color: var(--under); }
.tp-over { color: var(--over); }
.tp-even { color: var(--ink); }
.tp-none { color: var(--ink-soft); }

/* ---------- highlights ---------- */
.highlights {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.hl {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.hl-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--on-green-soft); }
.hl-num { font-family: var(--serif); font-size: 2rem; line-height: 1.15; color: var(--cream); font-variant-numeric: tabular-nums; }
.hl-num.tp-under { color: #ff7a8c; }
.hl-foot { font-size: 0.78rem; color: var(--on-green-soft); }
.hl-leader {
  background: linear-gradient(135deg, var(--paper), var(--cream));
  color: var(--ink);
  border-color: var(--gold);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
}
.hl-leader .hl-label { color: var(--augusta); grid-column: 1; }
.hl-leader .hl-value { font-family: var(--serif); font-size: 1.45rem; grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-big { grid-column: 2; grid-row: 1 / span 2; font-family: var(--serif); font-size: 2.6rem; font-weight: 700; line-height: 1; }
@media (max-width: 860px) {
  .highlights { grid-template-columns: repeat(3, 1fr); }
  .hl-leader { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .highlights { gap: 8px; }
  .hl { padding: 10px 12px; }
  .hl-num { font-size: 1.5rem; }
  .hl-foot { font-size: 0.7rem; }
}

/* ---------- leaderboard ---------- */
.board-card {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(244, 196, 48, 0.5), 0 0 0 6px var(--green-700), 0 0 0 7px rgba(244, 196, 48, 0.25), 0 30px 60px -30px #000;
  margin: 6px 0 24px;
}
.board-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--augusta);
  background: linear-gradient(180deg, #0a6b48, var(--augusta));
  color: #fff;
  border-bottom: 3px solid var(--gold);
}
.board-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #fff;
}
.board-meta { margin: 2px 0 0; font-size: 0.8rem; color: rgba(255, 255, 255, 0.78); }
.board-meta strong { color: var(--gold); }
.pill-locked { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--gold); color: var(--green-950); font-weight: 800; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; }

.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.18); flex: none; }
.seg button {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.seg button[aria-pressed="true"] { background: var(--gold); color: var(--green-950); }

.board-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lb { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.lb th, .lb td { padding: 0 6px; height: 48px; text-align: center; white-space: nowrap; }
.lb thead th {
  height: 38px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--augusta);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.lb .par-row td { height: 26px; font-size: 0.72rem; color: var(--ink-soft); background: var(--paper-2); border-bottom: 2px solid var(--augusta); }
.lb .par-row .c-player { font-style: italic; font-family: var(--serif); }
.lb .c-pos { width: 64px; text-align: left; padding-left: 16px; font-weight: 800; font-size: 0.95rem; }
.lb .c-player { text-align: left; min-width: 150px; }
.lb .c-topar { width: 76px; font-family: var(--serif); font-size: 1.3rem; font-weight: 700; }
.lb .c-thru { width: 52px; font-weight: 600; }
.lb td.c-thru { color: var(--ink-soft); }
.lb .c-sub { background: rgba(0, 103, 71, 0.06); font-weight: 700; }
.lb .c-tot { width: 56px; font-weight: 800; background: rgba(0, 103, 71, 0.1); border-left: 1px solid var(--line-strong); }
.lb .c-chev { width: 32px; color: var(--ink-soft); }
.lb .c-chev svg { width: 12px; height: 12px; transition: transform 0.2s; }
.lb .hc { width: 36px; padding: 0 2px; font-size: 0.9rem; }
.lb thead .c-topar { font-family: var(--sans); font-size: 0.68rem; }

.lb tbody tr.row { cursor: pointer; border-bottom: 1px solid var(--line); transition: background 0.15s; }
.lb tbody tr.row:hover { background: rgba(244, 196, 48, 0.12); }
.lb tbody tr.row:nth-child(4n + 1):not(:hover) { background: rgba(0, 103, 71, 0.025); }
.lb tbody tr.row.open { background: rgba(244, 196, 48, 0.16); }
.lb tbody tr.row.open .c-chev svg { transform: rotate(180deg); }
.lb tbody tr.row:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: -2px; }
.lb tbody tr.row.finished .c-thru { color: var(--augusta); font-weight: 800; }
.lb tr.flash { animation: flash 2.4s ease-out; }
@keyframes flash {
  0% { background: rgba(244, 196, 48, 0.75); }
  100% { background: transparent; }
}

.pname { font-weight: 700; font-size: 1rem; }
.hcp { margin-left: 6px; font-size: 0.7rem; font-weight: 600; color: var(--ink-soft); padding: 1px 6px; border-radius: 4px; background: rgba(22, 36, 27, 0.06); }
.you { margin-left: 6px; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--green-950); background: var(--gold); padding: 2px 6px; border-radius: 4px; vertical-align: 2px; }
.move { display: inline-block; margin-left: 5px; font-size: 0.62rem; font-weight: 800; vertical-align: 1px; }
.move.up { color: var(--augusta); }
.move.down { color: var(--under); }

.lb > tbody > tr.row.open > td:first-child { box-shadow: inset 4px 0 0 var(--gold); }
.lb > tbody > tr.detail > td { height: auto; padding: 0 0 0 4px; background: #efe6c9; box-shadow: inset 4px 0 0 var(--gold), inset 0 6px 8px -6px rgba(22, 36, 27, 0.35); border-bottom: 1px solid var(--line-strong); }
.board-hint { margin: 0; padding: 10px 16px; font-size: 0.75rem; color: var(--ink-soft); background: var(--paper-2); border-top: 1px solid var(--line); }

/* 27+ holes: slimmer hole columns so a full round still fits a laptop screen. */
.lb.many .hc { width: 26px; padding: 0 1px; font-size: 0.8rem; }
.lb.many .c-sub { width: 34px; }
.lb.many .c-player { min-width: 140px; }
.lb.many .c-topar { width: 70px; }
@media (max-width: 1279px) { .lb.many .hc { display: none; } .lb.many .c-player { min-width: 0; width: 100%; } }

/* Narrow screens: the hole-by-hole columns move into the tap-to-expand scorecard. */
@media (max-width: 1023px) {
  .lb .hc { display: none; }
  .lb .c-player { min-width: 0; width: 100%; }
}
@media (min-width: 1024px) {
  .lb .c-chev { width: 24px; }
  .lb .c-player { min-width: 170px; }
}
@media (max-width: 480px) {
  .board-title { font-size: 1.2rem; letter-spacing: 0.16em; }
  .lb .c-pos { width: 52px; padding-left: 12px; }
  .lb .c-topar { width: 60px; }
  .lb .c-thru { width: 44px; }
  .lb .c-tot { width: 44px; }
  .pname { font-size: 0.95rem; }
  .lb .hcp { display: none; }
}

/* ---------- scorecard ---------- */
.scorecard { padding: 14px 16px 16px; color: var(--ink); }
.card-summary { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 12px; font-size: 0.82rem; color: var(--ink-soft); }
.card-summary b { color: var(--ink); font-size: 1rem; }
.card-scroll { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; overflow-x: auto; }
@media (max-width: 860px) { .card-scroll { grid-template-columns: 1fr; } }
.card {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}
.card th, .card td { padding: 5px 2px; text-align: center; border-left: 1px solid var(--line); min-width: 30px; }
.card th[scope="row"] { text-align: left; padding-left: 10px; min-width: 52px; border-left: 0; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.card-hole { background: var(--augusta); }
.card-hole th, .card-hole th[scope="row"] { color: #fff; font-weight: 700; }
.card-par td { color: var(--ink-soft); background: var(--paper-2); }
.scorecard .card th, .scorecard .card td { height: auto; }
.scorecard .card-score td { height: 40px; }
.card-score .sc { font-size: 0.9rem; }
.card-putts td { color: var(--ink-soft); font-size: 0.78rem; }
.card td:last-child, .card th:last-child { background: rgba(0, 103, 71, 0.08); font-weight: 700; }
.card-hole th:last-child { background: #04513a; }
.lb .card-hole { background: #3f7a5c; }
.lb .card-hole th:last-child { background: #356b50; }
.dots { display: block; font-style: normal; font-size: 0.6rem; line-height: 0.6; color: var(--augusta); letter-spacing: 1px; }

/* ---------- feed & legend ---------- */
.feed { margin-bottom: 20px; }
.feed-title { margin: 0 0 10px; font-family: var(--serif); font-weight: 400; font-size: 1.1rem; color: var(--gold); }
.feed ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.feed li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.88rem;
}
.feed-mark { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: var(--paper); }
.feed li.ev-great { border-color: rgba(244, 196, 48, 0.55); background: linear-gradient(90deg, rgba(244, 196, 48, 0.16), var(--panel)); }
.feed li.ev-good { border-color: rgba(255, 122, 140, 0.35); }
.ev-text { flex: 1; min-width: 0; }
.feed time { flex: none; font-size: 0.72rem; color: var(--on-green-soft); }

.legend { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 12px 14px; border-radius: 10px; background: var(--paper); color: var(--ink); font-size: 0.78rem; }
.legend > span { display: inline-flex; align-items: center; gap: 8px; }
.legend .sc { font-size: 0.8rem; }

.empty { text-align: center; max-width: 440px; margin: 40px auto; padding: 32px 24px; }
.empty svg { width: 72px; height: 72px; color: var(--cream); }
.empty h2 { font-family: var(--serif); font-weight: 400; font-size: 1.8rem; color: var(--gold); margin: 12px 0 8px; }
.empty p { color: var(--on-green-soft); margin: 0 0 22px; }

/* ---------- my round ---------- */
.play { max-width: 560px; margin: 0 auto; display: grid; gap: 14px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(244, 196, 48, 0.35);
  background: rgba(0, 0, 0, 0.15);
  color: var(--on-green);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.chip[aria-selected="true"] { background: var(--gold); color: var(--green-950); border-color: var(--gold); }
.play-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.play-name { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 1.8rem; color: var(--cream); }
.play-name .hcp { color: var(--on-green-soft); background: rgba(255, 255, 255, 0.08); vertical-align: 4px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--paper); color: var(--ink); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--gold); }
.stat { padding: 10px 8px; text-align: center; display: grid; gap: 2px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-label { font-size: 0.64rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--augusta); }
.stat-val { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.hole-strip {
  display: grid;
  grid-template-columns: repeat(var(--holes, 18), minmax(34px, 1fr));
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 2px 6px;
}
.hole-strip::-webkit-scrollbar { display: none; }
.hs {
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.18);
  color: var(--on-green-soft);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0;
  position: relative;
}
.hs.done { background: var(--paper); color: var(--ink); border-color: transparent; box-shadow: none; }
.hs.done.r-birdie, .hs.done.r-eagle { background: #ffe3e7; color: var(--under); }
.hs.done.r-bogey { background: #e5eadf; }
.hs.done.r-double { background: #d3dbcc; }
.hs.done.r-ace { background: var(--gold); color: var(--green-950); }
.hs.done::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--augusta); }
.hs.done.r-birdie::after, .hs.done.r-eagle::after { background: var(--under); }
.hs.done.r-bogey::after, .hs.done.r-double::after { border-radius: 1px; background: var(--ink-soft); }
.hs.done.r-double::after { width: 8px; margin-left: -4px; }
.hs.current { outline: 2px solid var(--gold); outline-offset: 1px; color: var(--gold); }
.hs.done.current { color: var(--ink); }
@media (max-width: 480px) { .hole-strip { grid-template-columns: repeat(var(--holes, 18), 38px); } }

.hole-card {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  gap: 18px;
  box-shadow: var(--shadow);
}
.hole-top { display: flex; align-items: center; gap: 16px; }
.hole-no {
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  background: var(--paper);
  color: var(--augusta);
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 4px var(--green-800);
}
.hole-no span { font-size: 0.56rem; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; }
.hole-no b { font-family: var(--serif); font-size: 2rem; line-height: 1; color: var(--ink); }
.hole-info { display: grid; gap: 4px; }
.hole-par { font-family: var(--serif); font-size: 1.6rem; color: var(--cream); }
.hole-si { font-size: 0.82rem; color: var(--on-green-soft); }
.gets { color: var(--gold); font-weight: 700; }

/* The chosen score, drawn with the same circle/square marks as the scorecard. */
.hero-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px;
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
}
.hero-mark { font-family: var(--serif); font-size: 3rem; line-height: 1; }
.hero-mark.sc-birdie, .hero-mark.sc-bogey { border-width: 3px; }
.hero-mark.sc-eagle, .hero-mark.sc-double { border-width: 3px; box-shadow: 0 0 0 4px var(--paper), 0 0 0 7px currentColor; }
.hero-mark.sc-double { box-shadow: 0 0 0 4px var(--paper), 0 0 0 7px var(--ink-soft); }
.hero-mark.sc-ace { box-shadow: 0 0 0 4px var(--paper), 0 0 0 7px var(--gold-deep); }
.hero-name { display: grid; gap: 2px; font-size: 1rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--augusta); }
.hero-name small { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: none; color: var(--ink-soft); }
.hero-score.is-suggest .hero-mark { opacity: 0.4; }
.hero-score.is-suggest .hero-name { color: var(--ink-soft); }

.quicks { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.quick {
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 8px 2px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.15);
  color: var(--on-green);
}
.quick b { font-family: var(--serif); font-size: 1.25rem; }
.quick:disabled { opacity: 0.45; }
.quick small { font-size: 0.56rem; font-weight: 700; letter-spacing: 0; text-transform: uppercase; color: var(--on-green-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick.r-birdie b, .quick.r-eagle b, .quick.r-ace b { color: #ff7a8c; }
.quick.on { background: var(--paper); border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.quick.on b { color: var(--ink); }
.quick.on.r-birdie b, .quick.on.r-eagle b { color: var(--under); }
.quick.on small { color: var(--ink-soft); }
@media (max-width: 380px) { .quicks { grid-template-columns: repeat(4, 1fr); } }

.putts { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.putts-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-green-soft); }
.putts-label small { text-transform: none; letter-spacing: 0; font-weight: 500; opacity: 0.7; }
.putt-opts { display: flex; gap: 6px; }
.putt {
  width: 44px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.15);
  font-weight: 700;
}
.putt.on { background: var(--cream); color: var(--ink); border-color: var(--cream); }

.play-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.btn-save { min-height: 54px; font-size: 0.95rem; }
.play-actions .btn-ghost { min-height: 54px; }
.clear-hole { justify-self: center; color: var(--on-green-soft); }
.locked-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(244, 196, 48, 0.12); border: 1px solid rgba(244, 196, 48, 0.4); font-size: 0.9rem; }
.done-banner { padding: 14px 16px; border-radius: var(--radius); background: var(--paper); color: var(--ink); border-left: 5px solid var(--gold); }
.done-banner span { font-weight: 800; }
.play-card { background: var(--paper); border-radius: var(--radius); overflow: hidden; }
.play-card .section-title { color: var(--augusta); padding: 14px 16px 0; margin: 0; }
.play-card .card-scroll { grid-template-columns: 1fr; }

/* ---------- join ---------- */
.join { max-width: 480px; margin: 12px auto 0; display: grid; gap: 20px; }
.join-hero h2 { margin: 0 0 8px; font-family: var(--serif); font-weight: 400; font-size: 2.2rem; color: var(--cream); line-height: 1.1; }
.join-hero p { margin: 0; color: var(--on-green-soft); line-height: 1.55; }
.join .form { padding: 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--panel-line); box-shadow: var(--shadow); }
.join .btn-block { min-height: 52px; font-size: 0.9rem; }

/* ---------- admin ---------- */
.admin-login { max-width: 400px; margin: 20px auto; }
.admin-login h2, .admin-head h2 { margin: 0 0 6px; font-family: var(--serif); font-weight: 400; font-size: 1.9rem; color: var(--cream); }
.admin-login p { color: var(--on-green-soft); margin: 0 0 18px; }
.admin { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 860px) { .admin-grid { grid-template-columns: minmax(0, 1fr); } }
.admin .form .btn { justify-self: start; }
.invite { display: flex; gap: 16px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.qr { width: 132px; height: 132px; flex: none; background: #fff; border-radius: 10px; padding: 6px; }
.qr svg { display: block; width: 100%; height: 100%; }
.invite-side { display: grid; gap: 10px; min-width: 0; flex: 1; }
.url { display: block; padding: 10px 12px; border-radius: 8px; background: rgba(0, 0, 0, 0.3); font-size: 0.85rem; color: var(--cream); overflow-wrap: anywhere; }

.plist { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 6px; }
.plist li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.05); flex-wrap: wrap; }
.plist .pl-main { display: grid; min-width: 0; }
.plist .pl-main .muted { margin: 0; font-size: 0.8rem; }
.plist .pl-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.plist .edit-form { width: 100%; }

.grid-scroll { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--paper); }
.grid { border-collapse: collapse; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 100%; }
.grid th, .grid td { padding: 2px 3px; text-align: center; font-size: 0.78rem; }
.grid thead th { background: var(--augusta); color: #fff; font-weight: 700; height: 32px; }
.grid .par-row td { background: var(--paper-2); color: var(--ink-soft); font-size: 0.72rem; }
.grid tbody tr { border-top: 1px solid var(--line); }
.grid .g-name { text-align: left; padding-left: 12px; min-width: 120px; position: sticky; left: 0; background: var(--paper); font-weight: 700; font-size: 0.85rem; z-index: 1; }
.grid thead .g-name { background: var(--augusta); }
.grid .par-row .g-name { background: var(--paper-2); font-style: italic; font-weight: 400; }
.gcell {
  width: 38px;
  height: 32px;
  text-align: center;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
}
.gcell:focus { outline: none; border-color: var(--gold-deep); box-shadow: 0 0 0 3px rgba(244, 196, 48, 0.4); }
.gcell.dirty { background: #fff4c7; border-color: var(--gold-deep); }
.course-tot { font-weight: 800; }
.grid-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.grid-foot .muted { margin: 0; }

.panel-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-bar .section-title { margin: 0; }
.half-toggle { display: none; }
.holes-toggle button { min-width: 44px; }
.copy-nine { margin-top: 10px; }
.half-toggle button { color: var(--on-green-soft); }
@media (max-width: 760px) {
  .half-toggle { display: inline-flex; }
  .grid-scroll[data-nine="0"] :is(.n1, .n2, .n3),
  .grid-scroll[data-nine="1"] :is(.n0, .n2, .n3),
  .grid-scroll[data-nine="2"] :is(.n0, .n1, .n3),
  .grid-scroll[data-nine="3"] :is(.n0, .n1, .n2) { display: none; }
  .admin .panel { padding: 14px 12px; }
  .grid th, .grid td { padding: 3px 1px; }
  .grid .g-name { min-width: 0; max-width: 60px; padding-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; }
  .gcell { width: 28px; height: 40px; font-size: 0.9rem; }
  .admin .btn-sm { min-height: 42px; padding: 0 14px; }
  .plist .pl-actions { width: 100%; }
  .plist .pl-actions .btn { flex: 1; }
}

.panel-danger { border-color: rgba(255, 110, 130, 0.25); }
.panel-danger .section-title { color: #ff9aa8; }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; flex-wrap: wrap; }
.danger-row + .danger-row { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.danger-row p { margin: 2px 0 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: calc(12px + env(safe-area-inset-top));
  transform: translate(-50%, -20px);
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.6);
  border-left: 5px solid var(--augusta);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { border-left-color: var(--gold); }
.toast.bad { border-left-color: var(--under); }

/* ---------- clubhouse TV ---------- */
body.is-tv .masthead, body.is-tv .footer { display: none; }
body.is-tv .main { max-width: none; padding: 24px 32px; }
.tv { display: grid; gap: 18px; min-height: calc(100vh - 48px); grid-template-rows: auto 1fr auto; }
.tv-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; border-bottom: 3px solid var(--gold); padding-bottom: 14px; }
.tv-head h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 4vw, 3.6rem); color: var(--gold); letter-spacing: 0.04em; }
.tv-head p { margin: 4px 0 0; font-size: 0.9rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--on-green-soft); }
.tv-join { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; color: var(--on-green-soft); text-align: right; }
.tv-join .qr { width: 110px; height: 110px; order: 2; }
.tv-body { background: var(--paper); color: var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: 0 0 0 6px var(--green-700), 0 0 0 7px rgba(244, 196, 48, 0.3); }
.tv-lb th, .tv-lb td { height: 64px; }
.tv-lb thead th { height: 48px; font-size: 0.9rem; background: var(--augusta); color: #fff; }
.tv-lb .c-pos { font-size: 1.4rem; width: 90px; }
.tv-lb .pname { font-size: 1.5rem; }
.tv-lb .c-topar { font-size: 2rem; width: 100px; }
.tv-lb .c-thru, .tv-lb .c-tot { font-size: 1.3rem; }
.tv-lb .hc { display: table-cell; font-size: 1.1rem; width: auto; }
.tv-lb tbody tr { border-bottom: 1px solid var(--line); }
.tv-lb tbody tr:nth-child(even) { background: rgba(0, 103, 71, 0.04); }
@media (max-width: 1100px) { .tv-lb .hc { display: none; } }
.tv-empty { text-align: center; padding: 60px; font-family: var(--serif); font-size: 1.5rem; color: var(--ink-soft); }
.tv-foot { display: flex; justify-content: space-between; align-items: center; padding: 0 16px 8px; color: var(--on-green-soft); font-size: 1rem; }
.tv-lb .nine { border-right: 3px solid var(--line-strong); }
.tv-lb thead th.c-tot { background: var(--augusta); color: #fff; }
.tv-foot a { text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
