:root {
  --ink: #1c1914;
  --paper: #f3efe4;
  --cream: #faf7f0;
  --panel: #ffffff;
  --green: #1b3d2f;
  --green-2: #244a3a;
  --fairway: #2f5d47;
  --gold: #c4a35a;
  --gold-dim: #8a7038;
  --line: #d9d1c2;
  --muted: #6b6558;
  --danger: #8b2e2e;
  --live: #d44535;
  --ok: #2a6b45;
  --shadow: 0 1px 2px rgba(28, 25, 20, 0.06), 0 8px 24px rgba(28, 25, 20, 0.06);
  --serif: Georgia, "Palatino Linotype", Palatino, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; }
body {
  min-height: 100%;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.45;
}

a { color: var(--fairway); }
h1, h2, h3, .brand {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }

.topbar {
  background: var(--green);
  color: #f4efe3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 14px 22px;
  border-bottom: 3px solid var(--gold);
}
.topbar a { color: #f4efe3; text-decoration: none; }
.topbar .brand { font-size: 1.15rem; }
.topbar .sub {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d7c899;
}
.topbar nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.topbar nav a { font-size: 0.92rem; opacity: 0.9; }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.topbar button,
.topbar .btn,
.topbar button.secondary,
.topbar .btn.secondary {
  background: transparent;
  color: #f4efe3;
  border-color: #8aa08f;
  padding: 6px 12px;
}
.topbar button:hover,
.topbar .btn:hover,
.topbar button.secondary:hover,
.topbar .btn.secondary:hover { background: var(--green-2); color: #f4efe3; }
.topbar button.danger { color: #f3c7c7; border-color: #b86a6a; }
textarea::placeholder { color: #9a9284; }


.wrap { max-width: 1100px; margin: 0 auto; padding: 28px 20px 64px; }
.wrap-wide { max-width: 1280px; }

.hero {
  padding: 28px 0 8px;
}
.hero .eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 8px;
}
.lede { color: var(--muted); max-width: 40rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: block;
}
a.card:hover { border-color: var(--gold); }
.card h2 { margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.panel {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin: 16px 0;
}

label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfc6b6;
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold-dim);
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
}
.row > * { flex: 1 1 140px; }
.row .shrink { flex: 0 0 auto; }

button, .btn {
  font: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--green);
  color: #f4efe3;
  text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { background: var(--green-2); }
button.secondary, .btn.secondary {
  background: transparent;
  color: var(--green);
  border-color: #b7c4bb;
}
button.danger, .btn.danger {
  background: transparent;
  color: var(--danger);
  border-color: #d8b3b3;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.big {
  padding: 14px 18px;
  font-size: 1.05rem;
}

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
.tabs button {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.tabs button[aria-selected="true"] {
  background: var(--green);
  color: #f4efe3;
  border-color: var(--green);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
table.data th, table.data td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data th { font-size: 0.78rem; color: var(--muted); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
table.data td.num, table.data th.num { text-align: right; }
table.data input { padding: 6px 8px; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.badge.live { color: #fff; background: var(--live); border-color: var(--live); }
.badge.open { color: var(--ok); border-color: #9cc5ab; }
.badge.locked, .badge.final { color: var(--gold-dim); border-color: var(--gold); }

.notice { color: var(--muted); font-size: 0.92rem; }
.error { color: var(--danger); font-size: 0.92rem; }
.ok { color: var(--ok); }

.hidden { display: none !important; }

/* Scorer */
.scorer-shell { max-width: 720px; margin: 0 auto; padding: 16px 16px 80px; }
.hole-hero {
  text-align: center;
  padding: 8px 0 16px;
}
.hole-hero .hole-num {
  font-family: var(--serif);
  font-size: 4.5rem;
  line-height: 1;
}
.hole-hero .meta { color: var(--muted); margin-top: 4px; }
.points-line {
  font-size: 1.15rem;
  margin-top: 8px;
}
.keypad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.keypad button {
  background: #fff;
  color: var(--ink);
  border-color: #cfc6b6;
  padding: 16px 0;
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}
.keypad button:hover { background: #f6f1e6; }
.keypad button.clear { color: var(--danger); }
.hole-nav { display: flex; gap: 8px; margin-top: 8px; }
.hole-nav button { flex: 1; }
.mini-card {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  margin: 18px 0;
}
.mini-card button {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  padding: 8px 2px;
  font-size: 0.78rem;
}
.mini-card button .n { display: block; color: var(--muted); font-size: 0.68rem; }
.mini-card button.on { border-color: var(--gold-dim); background: #f7efd8; }
.mini-card button.filled { font-weight: 600; }

/* Leaderboard / TV */
body.tv {
  background: #0c1410;
  color: #f3eee2;
  overflow: hidden;
}
body.tv .tv-frame {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 24px 32px 20px;
}
.tv-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 14px;
  margin-bottom: 16px;
}
.tv-header h1 { font-size: clamp(1.6rem, 3vw, 2.6rem); color: #f3eee2; }
.tv-header .meta { color: #c9c0aa; margin-left: auto; text-align: right; }
.pulse {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--live);
  margin-right: 8px;
  box-shadow: 0 0 0 0 rgba(212, 69, 53, 0.6);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(212, 69, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 69, 53, 0); }
}
table.board {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  flex: 1;
}
table.board th {
  text-align: left;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b9ae93;
  font-weight: 600;
  padding: 8px 10px 12px;
  border-bottom: 1px solid #2a3b32;
}
table.board td {
  padding: 10px 10px;
  border-bottom: 1px solid #1c2a23;
  font-size: clamp(1rem, 2.1vw, 1.55rem);
}
table.board td.num, table.board th.num { text-align: right; }
table.board tr.flash { background: rgba(196, 163, 90, 0.16); }
table.board tr:first-child td { color: var(--gold); }
table.board td .sub {
  display: block;
  font-size: 0.58em;
  color: #9aa394;
  letter-spacing: 0.02em;
  margin-top: 2px;
}
textarea {
  width: 100%;
  min-height: 4.5rem;
  font: inherit;
  padding: 8px 10px;
}

.tv-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  color: #9aa394;
  font-size: 0.85rem;
  margin-top: 12px;
}
.tv-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
body.tv input, body.tv select {
  background: #152019;
  color: #f3eee2;
  border-color: #3a4d42;
}
body.tv button.secondary {
  color: #f3eee2;
  border-color: #3a4d42;
}

@media (max-width: 640px) {
  .topbar { padding: 12px 14px; }
  .wrap { padding: 18px 14px 48px; }
  .hole-hero .hole-num { font-size: 3.6rem; }
  table.data { font-size: 0.92rem; }
  body.tv .tv-frame { padding: 14px 12px 12px; }
  table.board td { font-size: 0.95rem; padding: 8px 6px; }
}

@media print {
  .topbar nav, .tv-controls, button, .tabs { display: none !important; }
  body, body.tv { background: #fff; color: #000; }
  body.tv .tv-frame { min-height: auto; padding: 0; }
  body.tv .tv-header h1, table.board tr:first-child td { color: #000; }
  table.board th, table.board td { border-color: #ccc; color: #000; }
}

.chk { display: inline-flex; align-items: center; gap: 6px; margin: 6px 8px 0 0; font-size: 0.85rem; color: var(--muted); }
.chk input { width: auto; }
.side-games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px 24px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #2a3b32;
  color: #d8d0be;
  font-size: 0.95rem;
}
.side-games h2 { font-size: 1.05rem; color: #d7c899; margin-bottom: 8px; }
.side-games ul { margin: 0; padding-left: 1.15rem; }
.side-games li { margin: 0 0 4px; }
.side-games p { margin: 0; color: #9aa394; }
body.tv .btn { color: #f3eee2; }

@media print {
  .topbar nav, #print-btn { display: none !important; }
  .panel { box-shadow: none; border-color: #ccc; }
}


/* Season, Cup, and King of the Hill boards */
.notice-tv { color: #d8d0be; padding: 24px 8px; font-size: 1.05rem; max-width: 44rem; }
.champion-banner {
  background: linear-gradient(90deg, #7a5a16, #c6a45a 40%, #7a5a16);
  color: #1a1410;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: 10px 16px;
  border-radius: 4px;
  margin: 0 0 16px;
  font-size: 1.05rem;
}
.champion-banner.open { background: #1e2c26; color: #d7c899; border: 1px solid #3a4c42; letter-spacing: 0.04em; text-transform: none; font-weight: 500; }
.bracket-board { padding-bottom: 16px; }
.bracket-leg { margin-bottom: 12px; }
.bracket-leg h2 { color: #d7c899; font-size: 0.95rem; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 10px; }
.bracket-rounds { display: flex; gap: 16px; align-items: flex-start; overflow-x: auto; padding-bottom: 8px; }
.bracket-round { min-width: 200px; flex: 1; }
.bracket-round h3 { color: #9aa394; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 8px; font-weight: 600; }
.match-card { background: #16211c; border: 1px solid #2f4138; border-radius: 6px; padding: 5px 8px; margin: 0 0 6px; }
.match-card.done { border-color: #4a5f52; }
.match-name { color: #8a9288; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 4px; }
.match-side { padding: 5px 6px; color: #f3eee2; border-radius: 3px; font-size: 0.92rem; display: flex; gap: 8px; align-items: center; }
.match-side.winner { background: #2a4634; color: #f4e3a8; font-weight: 600; }
.match-side.champion { box-shadow: inset 0 0 0 1px #c6a45a; }
.match-side.empty, .tbd { color: #6d756e; font-style: italic; }
.match-side .seed { color: #d7c899; font-size: 0.75rem; min-width: 1.2em; }
.match-result { color: #d7c899; font-size: 0.75rem; text-align: right; margin-top: 2px; }
.cut-row td { border-top: 2px solid #c6a45a !important; }
tr.cup-qual td { color: #f3eee2; }
.cup-board { padding-bottom: 12px; }
.cup-scoreline { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: start; margin-bottom: 10px; }
.cup-team-name { color: #d7c899; font-size: 1.15rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px; }
.cup-roster { list-style: none; margin: 0; padding: 0; columns: 2; gap: 8px 16px; }
.cup-roster li { font-size: 0.82rem; color: #f3eee2; padding: 1px 0; break-inside: avoid; }
.cup-roster .pick { color: #9aa394; font-size: 0.75rem; display: inline-block; min-width: 1.2em; }
.cup-roster .cap { color: #1a1410; background: #c6a45a; font-size: 0.65rem; font-weight: 700; padding: 0 5px; border-radius: 2px; margin-left: 4px; }
.cup-total { text-align: center; padding-top: 8px; min-width: 200px; }
.cup-nums { font-size: 3.1rem; font-weight: 700; color: #f4e3a8; line-height: 1; display: flex; gap: 10px; justify-content: center; align-items: baseline; }
.cup-nums .dash { color: #9aa394; font-weight: 400; font-size: 2.4rem; }
.cup-leader { color: #d7c899; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 8px; font-size: 0.85rem; }
.cup-session { margin-bottom: 8px; }
.cup-session h2 { color: #d7c899; font-size: 0.92rem; display: flex; justify-content: space-between; gap: 12px; margin: 0 0 4px; }
.cup-session h2 span { color: #f3eee2; font-weight: 600; }
.cup-matches { width: 100%; border-collapse: collapse; }
.cup-matches td { padding: 3px 8px; border-bottom: 1px solid #2a3b32; color: #d8d0be; font-size: 0.88rem; }
.cup-matches td.won { color: #f4e3a8; font-weight: 600; }
.cup-matches td.match-stat { text-align: center; color: #d7c899; width: 5.5rem; }
.cup-matches td.num { width: 2.4rem; text-align: center; }
.cup-session .pending { color: #9aa394; margin: 0; }
#round-select { margin-left: 8px; }
.match-boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 12px 0; }
@media (max-width: 900px) {
  .cup-scoreline { grid-template-columns: 1fr; }
  .cup-roster { columns: 2; }
  .cup-nums { font-size: 3rem; }
}

.tv-controls select { width: auto; min-width: 240px; max-width: 420px; }
.bracket-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 8px 18px; align-items: start; }
.bracket-leg-finals { grid-column: 1 / -1; }
.bracket-leg-finals .bracket-rounds { flex-wrap: wrap; }
.bracket-round .match-name { display: none; }
.champion-banner { margin-bottom: 10px; padding: 7px 16px; }

body.tv:has(.bracket-board) .tv-frame { padding: 14px 24px 8px; }
body.tv:has(.bracket-board) .tv-header { padding-bottom: 8px; margin-bottom: 8px; }
body.tv:has(.bracket-board) .tv-header h1 { font-size: 1.8rem; }
body.tv:has(.bracket-board) .tv-footer { margin-top: 6px; font-size: 0.78rem; }
.tv-controls select { width: auto; min-width: 240px; max-width: 420px; }
.bracket-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 4px 16px; align-items: start; }
.bracket-leg-finals { grid-column: 1 / -1; }
.bracket-leg-finals h3 { display: none; }
.bracket-leg-finals .bracket-rounds { display: flex; flex-wrap: wrap; gap: 12px; }
.bracket-leg-finals .bracket-round { min-width: 260px; max-width: 380px; flex: 1; }
.bracket-round .match-name { display: none; }
.champion-banner { margin-bottom: 8px; padding: 6px 16px; font-size: 0.95rem; }
.bracket-round { min-width: 148px; }
.match-card { padding: 3px 7px; margin: 0 0 5px; }
.match-side { padding: 3px 5px; font-size: 0.86rem; }


.scan-actions { margin: 16px 0 8px; }
.scan-actions .notice { margin-top: 8px; }
.scan-review {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(28, 25, 20, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.scan-review.hidden { display: none; }
.scan-review-sheet {
  background: var(--cream);
  width: 100%;
  max-width: 720px;
  max-height: 96vh;
  overflow: auto;
  border-radius: 16px 16px 0 0;
  padding: 14px 14px 28px;
  box-shadow: var(--shadow);
}
.scan-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.scan-review-head h2 { font-size: 1.15rem; }
#scan-photo {
  display: block;
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  background: #111;
  border-radius: 8px;
  margin: 8px 0;
}
.scan-nine {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.scan-nine button.on {
  background: var(--live);
  color: #fff;
  border-color: var(--live);
}
.scan-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.scan-grid {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  font-size: 0.86rem;
}
table.scan-grid th, table.scan-grid td {
  border: 1px solid var(--line);
  padding: 3px;
  text-align: center;
  min-width: 36px;
}
table.scan-grid th.scan-name, table.scan-grid td.scan-name {
  text-align: left;
  min-width: 132px;
  padding: 4px 6px;
}
.scan-abbrev { font-size: 0.75rem; color: var(--muted); margin-bottom: 2px; }
table.scan-grid input {
  width: 36px;
  text-align: center;
  padding: 6px 2px;
  font-size: 0.95rem;
}
table.scan-grid input.conflict {
  background: #f8e4e4;
  border-color: var(--danger);
  color: var(--danger);
  font-weight: 600;
}
table.scan-grid input.edited { background: #f7efd8; }
table.scan-grid tr.mismatch td.scan-name { box-shadow: inset 3px 0 0 var(--danger); }
table.scan-grid select { width: 100%; font-size: 0.82rem; }
@media (max-width: 500px) {
  .scan-review-sheet { padding-left: 10px; padding-right: 10px; }
  table.scan-grid { font-size: 0.75rem; table-layout: fixed; width: 100%; }
  table.scan-grid th, table.scan-grid td { min-width: 0; padding: 2px 0; }
  table.scan-grid th.scan-name, table.scan-grid td.scan-name { width: 27%; padding: 3px 3px; }
  table.scan-grid input { width: 100%; max-width: 28px; padding: 5px 0; font-size: 0.82rem; }
  table.scan-grid select { font-size: 0.75rem; }
  #scan-photo { max-height: 168px; }
}
.scan-review-actions { margin-top: 14px; }
.scan-review-actions button { width: 100%; }
.scan-review-actions .notice { margin-top: 8px; }
@media (min-width: 720px) {
  .scan-review { align-items: center; padding: 24px; }
  .scan-review-sheet { border-radius: var(--radius); max-height: 90vh; }
}

/* Sunday mode hides association-only UI until data-mode="full" is set. */
html:not([data-mode="full"]) .full-only { display: none !important; }
html[data-mode="full"] .sunday-only { display: none !important; }
html[data-program="weekly"] .full-only,
html[data-program="weekly"] .association-only { display: none !important; }
html[data-program="association"] .sunday-only,
html[data-program="association"] .weekly-only { display: none !important; }
html[data-program="association"] .full-only { display: revert !important; }

.program-switcher {
  display: flex;
  gap: 0;
  border: 1px solid #8aa08f;
  border-radius: 8px;
  overflow: hidden;
  flex: 1 1 auto;
  max-width: 28rem;
}
.program-switcher a {
  flex: 1;
  text-align: center;
  padding: 6px 12px;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: #f4efe3 !important;
  text-decoration: none !important;
  opacity: 0.8;
  background: transparent;
}
.program-switcher a.is-active,
.program-switcher a[aria-selected="true"] {
  background: var(--gold);
  color: var(--green) !important;
  opacity: 1;
  font-weight: 600;
}
.program-area-grid {
  display: grid;
  gap: 20px;
  margin-top: 8px;
}
@media (min-width: 880px) {
  .program-area-grid { grid-template-columns: 1fr 1fr; }
}
.program-area h2 { margin-bottom: 0.3rem; }
.tv-header .program-switcher,
.tv-controls .program-switcher {
  max-width: 24rem;
  margin: 0;
}

.roster-box { margin-top: 20px; }
.roster-box h3 { margin-bottom: 6px; }
.roster-table td, .roster-table th { vertical-align: middle; }
.share-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.share-url {
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--muted);
}
.qr-box svg, .qr-box img {
  width: 168px;
  height: 168px;
  background: #fff;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.player-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}
.player-picks button {
  flex: 1 1 calc(50% - 8px);
  min-height: 48px;
  padding: 10px 12px;
  font-size: 1.02rem;
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.player-picks button.on {
  background: var(--green);
  color: #f4efe3;
  border-color: var(--green);
}
.group-lock { margin: 8px 0 0; font-size: 0.95rem; }
.offline-note {
  margin-top: 16px;
  padding: 10px 12px;
  background: #f7efd8;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  color: var(--ink);
}
body.mode-sunday .keypad button {
  min-height: 56px;
  font-size: 1.4rem;
  padding: 18px 0;
}
body.mode-sunday .hole-nav button {
  min-height: 48px;
  font-size: 1.05rem;
}
body.mode-sunday .hole-hero { padding: 4px 0 8px; }
body.mode-sunday .hole-hero .hole-num { font-size: 4.2rem; }
body.mode-sunday .mini-card { margin: 10px 0; }
body.mode-sunday .keypad { margin: 10px 0; }
@media (max-width: 500px) {
  body.mode-sunday .scorer-shell { padding: 10px 12px 24px; }
  .player-select-fallback { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}


/* Weekly roster: missing handicap index, SHGA import preview, season picker */
.needs-index-flag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #8b3a2a;
  color: #fff8ee;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.needs-index-input {
  border-color: #8b3a2a !important;
  background: #fff4ea;
}
.import-box { margin-top: 22px; padding-top: 8px; border-top: 1px solid #e0d4c0; }
.import-preview { margin-top: 12px; overflow-x: auto; }
.import-preview table { font-size: 0.9rem; }
.import-preview .warn { color: #8b3a2a; }
.import-counts { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 8px 0 12px; }
.import-counts span { background: #f3eee2; padding: 4px 10px; border-radius: 4px; font-size: 0.85rem; }
.season-pick { display: inline-flex; align-items: center; gap: 8px; color: #f3eee2; font-size: 0.85rem; }
.season-pick select {
  background: #2a241c;
  color: #f3eee2;
  border: 1px solid #c6a45a;
  border-radius: 4px;
  padding: 4px 8px;
  font: inherit;
}
.board th.event, .board td.event { font-size: 0.78rem; white-space: nowrap; }
.member-flag { font-size: 0.75rem; color: #9aa394; }


.points-table-wrap { margin-top: 16px; max-width: 32rem; }
.points-table th[scope="row"] { font-weight: 600; text-align: left; }
.points-table input[type="number"] { width: 5.5rem; text-align: right; }

table.results-board tfoot th,
table.results-board tfoot td {
  border-top: 2px solid var(--line);
  font-family: var(--serif);
  font-size: 1rem;
  padding-top: 10px;
}
@media print {
  .topbar nav a:not([aria-current]), .topbar nav button { display: none; }
  #pots, #sheet, #notes-panel, #points-shares { break-inside: avoid; }
}

/* PGA-style printable scorecards (landscape Letter) */
.scorecards-wrap { padding-top: 18px; }
.scorecards-print {
  background: #fff;
  color: #111;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px 18px 14px;
  box-shadow: var(--shadow);
}
.scorecards-head { margin-bottom: 8px; }
.scorecards-head .club {
  font-family: var(--serif);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
  font-weight: 600;
}
.scorecards-head .event-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  border-bottom: 2px solid var(--green);
  padding-bottom: 4px;
  margin-top: 2px;
}
.scorecards-head h1 {
  font-size: 1.45rem;
  color: var(--ink);
  line-height: 1.15;
}
.scorecards-head .meta {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}
.scorecards-head .legend {
  margin: 5px 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}
table.scorecards-sheet {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  line-height: 1.15;
}
table.scorecards-sheet th,
table.scorecards-sheet td {
  border: 1px solid #c8c2b6;
  padding: 3px 3px;
  text-align: center;
  vertical-align: middle;
  background: #fff;
}
table.scorecards-sheet thead th,
table.scorecards-sheet thead td {
  font-size: 0.86em;
  font-weight: 600;
  background: #f3efe4;
  color: #1c1914;
}
table.scorecards-sheet tr.par-row th,
table.scorecards-sheet tr.par-row td,
table.scorecards-sheet tr.si-row th,
table.scorecards-sheet tr.si-row td {
  font-weight: 600;
  background: #eef3ef;
}
table.scorecards-sheet tr.si-row th,
table.scorecards-sheet tr.si-row td { background: #f6f3eb; font-weight: 500; }
table.scorecards-sheet .pos { width: 2.2em; font-weight: 600; }
table.scorecards-sheet .name { text-align: left; padding-left: 6px; white-space: nowrap; font-weight: 600; min-width: 7.5em; }
table.scorecards-sheet .tee { white-space: nowrap; font-size: 0.92em; }
table.scorecards-sheet .hcp { width: 2.4em; }
table.scorecards-sheet .hole { width: 2.15%; padding: 1px 1px 0; }
table.scorecards-sheet .split,
table.scorecards-sheet .tot-col {
  font-weight: 700;
  background: #f7f3ea;
  min-width: 2em;
}
table.scorecards-sheet tbody td.split,
table.scorecards-sheet tbody td.tot-col { background: #fbf8f1; }
table.scorecards-sheet tbody tr:nth-child(even) td { background: #fcfcfa; }
table.scorecards-sheet tbody tr:nth-child(even) td.split,
table.scorecards-sheet tbody tr:nth-child(even) td.tot-col { background: #f4efe4; }
.score-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 1.7em;
  line-height: 1;
}
.score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35em;
  height: 1.35em;
  font-weight: 600;
}
.score.mark-birdie {
  border: 1px solid #111;
  border-radius: 50%;
}
.score.mark-eagle {
  border: 1.15px solid #111;
  border-radius: 50%;
  box-shadow: 0 0 0 1.2px #111;
}
.score.mark-bogey {
  border: 1px solid #111;
}
.score.mark-double {
  border: 1.15px solid #111;
  box-shadow: 0 0 0 1.2px #111;
}
.hole-pts {
  display: block;
  font-size: 0.62em;
  font-weight: 500;
  color: #6b6558;
  margin-top: 1px;
  line-height: 1;
}
.scorecards-foot {
  margin-top: 8px;
  border-top: 2px solid var(--green);
  padding-top: 6px;
  font-size: 0.78rem;
  color: #1c1914;
}
.scorecards-foot p { margin: 0 0 2px; }
.scorecards-print.field-sm table.scorecards-sheet { font-size: 11.5px; }
.scorecards-print.field-md table.scorecards-sheet { font-size: 10px; }
.scorecards-print.field-lg table.scorecards-sheet { font-size: 8.6px; }
.scorecards-print.field-xl table.scorecards-sheet { font-size: 7.3px; }
.scorecards-print.field-lg .scorecards-head h1,
.scorecards-print.field-xl .scorecards-head h1 { font-size: 1.15rem; }
.scorecards-print.field-lg .scorecards-head .legend,
.scorecards-print.field-xl .scorecards-head .legend { font-size: 0.64rem; }
.scorecards-print.field-lg .scorecards-foot,
.scorecards-print.field-xl .scorecards-foot { font-size: 0.68rem; }
.scorecards-print.field-xl .score { width: 1.15em; height: 1.15em; }
.scorecards-print.field-xl table.scorecards-sheet th,
.scorecards-print.field-xl table.scorecards-sheet td { padding: 1px 1px; }

@page scorecards {
  size: letter landscape;
  margin: 0.32in 0.32in 0.28in 0.32in;
}

@media print {
  body.scorecards-page {
    background: #fff;
    color: #000;
  }
  body.scorecards-page .topbar,
  body.scorecards-page .screen-only { display: none !important; }
  body.scorecards-page .wrap {
    max-width: none;
    padding: 0;
    margin: 0;
  }
  body.scorecards-page .scorecards-print {
    box-shadow: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    page: scorecards;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  body.scorecards-page .scorecards-head .club { color: #111; }
  body.scorecards-page .scorecards-head .event-row { border-bottom-color: #111; }
  body.scorecards-page .scorecards-foot { border-top-color: #111; }
  table.scorecards-sheet th,
  table.scorecards-sheet td {
    border-color: #444;
    background: #fff !important;
    color: #000;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  table.scorecards-sheet thead th,
  table.scorecards-sheet thead td,
  table.scorecards-sheet .split,
  table.scorecards-sheet .tot-col {
    background: #f0f0f0 !important;
  }
  .score.mark-birdie,
  .score.mark-eagle,
  .score.mark-bogey,
  .score.mark-double {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Course conditions */
.condition-banner {
  margin: 8px 0 0;
  font-size: 0.95rem;
  color: var(--ink);
}
.condition-banner .condition-star,
.condition-star {
  color: var(--gold-dim);
  font-weight: 700;
}
.condition-banner.history {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 4px 0 0;
  font-weight: 400;
}
.condition-banner.tv-condition,
p.tv-condition {
  color: #d8d0be;
  font-size: 0.92rem;
  max-width: 36rem;
  margin-top: 6px;
}
body.tv .condition-star { color: #d7c899; }
#mini-card button.flagged .n { color: var(--gold-dim); }
.scorecards-sheet th.flagged { color: var(--green); }
.scorecards-footnote {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: #333;
}
.cond-report-list { margin: 8px 0; padding-left: 1.2rem; }
.cond-report-list li { margin: 6px 0; }
#cond-value-wrap { min-width: 6rem; }

/* Association team-stroke results board (2-man alternate shot, etc.) */
.team-stroke-print { color: #1a1a1a; }
.team-stroke-head h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  text-align: center;
}
.team-stroke-date { font-weight: 500; }
table.team-stroke-board { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.team-stroke-board th, table.team-stroke-board td {
  border: 1px solid #333;
  padding: 6px 8px;
  vertical-align: middle;
}
table.team-stroke-board thead th { background: #eef3f0; text-align: center; font-weight: 650; }
td.board-names { font-weight: 600; line-height: 1.25; }
td.board-tees { text-align: center; font-weight: 650; }
td.board-hcp { color: #b42318; font-weight: 700; }
td.board-gross, td.board-net, td.board-place, td.board-hole { font-weight: 650; }
.board-award {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border: 1px solid #b42318;
  color: #b42318;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  vertical-align: middle;
}
.team-stroke-side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.team-stroke-side-table th { background: #eef3f0; }
@media print {
  .team-stroke-print { break-inside: avoid; }
  td.board-hcp { color: #b42318 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


/* Season results list and board-place mismatches */
.season-events-panel { margin-bottom: 1.25rem; }
.season-events-heading { margin: 0 0 10px; font-size: 1.05rem; }
.season-event-list { display: grid; gap: 6px; margin-bottom: 12px; }
.season-event-link {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  padding: 8px 10px;
  border: 1px solid var(--line, #d0d5d2);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  background: #f7f9f8;
}
.season-event-link[aria-current="page"] { border-color: #1f6b4a; background: #eef6f1; }
.season-event-link .season-date { font-variant-numeric: tabular-nums; font-weight: 650; min-width: 6.5rem; }
.season-event-link .season-name { font-weight: 650; flex: 1; }
.season-event-link .season-meta { color: #555; font-size: 0.9rem; }
.event-select-label { display: inline-block; margin-right: 8px; font-weight: 650; }
#event-select { min-width: 16rem; padding: 4px 8px; }
.place-mismatch { display: block; font-size: 0.78rem; font-weight: 600; color: #8a4b08; }
.board-flag { color: #8a4b08; font-weight: 650; font-size: 0.85rem; }
.board-unverified { color: #6b4f00; }
.board-notes { margin-top: 16px; }
.board-notes li { margin: 4px 0; }
td.board-place { white-space: nowrap; }
@media print {
  .season-events-panel { break-inside: avoid; }
  .event-select-label, #event-select { display: none; }
}


/* Official season schedule */
.schedule-panel { margin-bottom: 1.25rem; }
.schedule-lede { margin: 0 0 12px; font-size: 0.95rem; }
.schedule-list { display: grid; gap: 6px; }
.schedule-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  padding: 8px 10px;
  border: 1px solid var(--line, #d0d5d2);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  background: #f7f9f8;
}
a.schedule-row:hover { border-color: #1f6b4a; }
.schedule-row[aria-current="page"] { border-color: #1f6b4a; background: #eef6f1; }
.schedule-row.is-done { background: #eef6f1; }
.schedule-row.is-blackout { background: #f3f1ea; border-style: dashed; }
.schedule-row.is-tentative { background: #fbf6ea; }
.schedule-date { font-variant-numeric: tabular-nums; font-weight: 650; min-width: 13rem; }
.schedule-name { font-weight: 650; flex: 1; }
.schedule-sub { font-weight: 500; color: #444; }
.schedule-meta { color: #555; font-size: 0.9rem; max-width: 36rem; }
@media print {
  .schedule-panel { break-inside: avoid; }
}


.nine-picker,
.nine-required-banner {
  border: 2px solid var(--gold, #c4a35a);
  background: #f7f1e3;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 4px 0 8px;
}
.nine-picker.nine-missing,
.nine-required-banner {
  border-color: #b4552b;
  background: #f8ece6;
}
.nine-picker label,
.nine-required-banner h3 {
  font-weight: 700;
  margin: 0 0 8px;
}
.nine-required-banner p { margin: 0 0 10px; color: var(--text, #2b2418); }
.nine-picker-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.nine-picker-btns button {
  flex: 1;
  min-width: 8rem;
  min-height: 44px;
  font-size: 1.05rem;
}
#wrap-new-nine select,
#wrap-nine select { width: 100%; }
