/* Novelty Manager — light, clean, high-contrast (built for phones in sunlight). */
:root {
  --page: #f6f7f9;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --green: #2d6a4f;
  --green-dark: #1f4d39;
  --green-tint: #e8f3ee;
  --gold: #b7791f;
  --gold-tint: #fdf6e3;
  --red: #b42318;
  --red-tint: #fdecea;
  --amber-tint: #fff7e0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
}
[hidden] { display: none !important; }
a { color: var(--green); }
button, input { font: inherit; color: inherit; }

/* ---- top bar ---- */
.topbar {
  text-align: center;
  background: var(--green);
  color: #fff;
  padding: 14px 16px;
}
.topbar .brand { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; font-weight: 600; }
.topbar h1 { margin: 2px 0 0; font-size: 20px; line-height: 1.25; font-weight: 700; }
.topbar .sub { font-size: 14px; opacity: 0.9; margin-top: 2px; }

.wrap { max-width: 560px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}
.card h2 { margin: 0 0 10px; font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: var(--green-tint);
  color: var(--green-dark);
  border: 1px solid #cfe5da;
  white-space: nowrap;
}
.badge.hole { background: var(--green); color: #fff; border-color: var(--green); }
.badge.mens { background: #e8f0fb; color: #1e4e8c; border-color: #cddcf3; }
.badge.ladies { background: #fbeaf2; color: #9b2c5c; border-color: #f3d0e0; }

/* ---- entry page ---- */
.novelty-head .badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.novelty-head .title { font-size: 28px; font-weight: 800; line-height: 1.15; margin: 0; }
.novelty-head .sponsor { margin-top: 6px; color: var(--muted); font-size: 16px; }
.novelty-head .sponsor strong { color: var(--text); }
.novelty-head .prize { margin-top: 4px; font-size: 15px; color: var(--muted); }

.leader-strip {
  display: flex; align-items: center; gap: 12px;
  background: var(--gold-tint);
  border: 1px solid #f1dfb0;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 16px;
}
.leader-strip .trophy { font-size: 26px; }
.leader-strip .lbl { font-size: 12px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; }
.leader-strip .who { font-weight: 700; }
.leader-strip .val { margin-left: auto; font-weight: 800; font-size: 20px; white-space: nowrap; }
.leader-strip.empty { background: var(--card); border-color: var(--line); color: var(--muted); }

.note {
  background: var(--green-tint);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  margin-bottom: 14px;
}
.note.warn { background: var(--amber-tint); }
.note.error { background: var(--red-tint); color: var(--red); font-weight: 600; }

label.field { display: block; font-weight: 700; margin-bottom: 8px; font-size: 17px; }

.input {
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border: 2px solid #cbd2d9;
  border-radius: 12px;
  background: #fff;
  font-size: 19px;
}
.input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-tint); }

.player-list { list-style: none; margin: 10px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.player-list li + li { border-top: 1px solid var(--line); }
.player-list button {
  width: 100%; text-align: left; background: #fff; border: 0; padding: 14px 16px; min-height: 56px; cursor: pointer;
  font-size: 18px;
}
.player-list button:active, .player-list button:hover { background: var(--green-tint); }
.player-list .co { display: block; font-size: 14px; color: var(--muted); }
.player-list .more { padding: 10px 16px; font-size: 14px; color: var(--muted); background: #fafafa; }

.chosen {
  display: flex; align-items: center; gap: 12px;
  background: var(--green-tint); border: 2px solid var(--green); border-radius: 12px; padding: 12px 14px;
}
.chosen .name { font-size: 20px; font-weight: 800; }
.chosen .co { font-size: 14px; color: var(--muted); }
.chosen .link-btn { margin-left: auto; }

.link-btn {
  background: none; border: 0; color: var(--green); font-weight: 700; text-decoration: underline;
  padding: 10px 4px; min-height: 44px; cursor: pointer; font-size: 16px;
}

.value-row { display: flex; align-items: stretch; gap: 10px; }
.value-row .input { font-size: 30px; font-weight: 800; text-align: center; }
.value-row .unit {
  display: flex; align-items: center; padding: 0 16px; border-radius: 12px; background: var(--page);
  border: 2px solid var(--line); font-weight: 700; font-size: 18px; white-space: nowrap;
}

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 60px; padding: 14px 18px;
  border-radius: 14px; border: 2px solid var(--green);
  background: var(--green); color: #fff; font-size: 20px; font-weight: 800; cursor: pointer;
  text-decoration: none;
}
.btn:active { background: var(--green-dark); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn.secondary { background: #fff; color: var(--green); }
.btn.secondary:active { background: var(--green-tint); }
.btn + .btn { margin-top: 10px; }

/* group → team radio picker */
.hint { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.measure-tip { margin: 10px 0 0; font-size: 14px; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.group-grid button {
  text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px;
  min-height: 56px; cursor: pointer; font-size: 18px; font-weight: 800; color: var(--text);
}
.group-grid button:hover, .group-grid button:active { border-color: var(--green); background: var(--green-tint); }
.group-grid .names { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.team { border: 0; margin: 0; padding: 0; min-width: 0; }
.team-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0; font-size: 18px; font-weight: 800; }
.team-head .link-btn { margin-left: auto; }
.team-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.team-list label {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 60px; cursor: pointer; font-size: 19px;
}
.team-list label + label { border-top: 1px solid var(--line); }
.team-list label:has(input:checked) { background: var(--green-tint); font-weight: 800; }
.team-list input[type="radio"] { width: 24px; height: 24px; flex: none; accent-color: var(--green); margin: 0; }
.team-list .co { display: block; font-size: 14px; color: var(--muted); font-weight: 500; }
.return-note { margin: 8px 0 12px; color: var(--muted); font-size: 15px; }

/* GPS two-tap */
.gps { border: 2px dashed #cbd2d9; border-radius: 14px; padding: 14px; margin-top: 14px; }
.gps .gps-title { font-weight: 800; margin-bottom: 4px; }
.gps .gps-help { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.gps .steps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gps .btn { font-size: 16px; min-height: 64px; flex-direction: column; gap: 0; white-space: nowrap; padding: 10px 8px; }
.gps .btn small { font-weight: 600; font-size: 12px; opacity: 0.85; }
.gps .btn.done { background: var(--green-tint); color: var(--green-dark); }
.gps .btn + .btn { margin-top: 0; }
.gps .result { margin-top: 12px; font-size: 16px; }
.gps .result strong { font-size: 22px; }

/* confirmation */
.confirm { text-align: center; }
.confirm .big { font-size: 56px; line-height: 1; margin: 6px 0; }
.confirm .headline { font-size: 26px; font-weight: 800; margin: 6px 0; }
.confirm .detail { color: var(--muted); font-size: 17px; margin-bottom: 14px; }
.confirm .leaders { text-align: left; }
.confirm.leader { border: 3px solid var(--gold); background: var(--gold-tint); }

.leaders { list-style: none; margin: 0; padding: 0; }
.leaders li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.leaders li:first-child { border-top: 0; }
.leaders .pos {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; background: var(--page); border: 1px solid var(--line); font-size: 15px;
}
.leaders li.p1 .pos { background: var(--gold); border-color: var(--gold); color: #fff; }
.leaders .who { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaders .val { font-weight: 800; white-space: nowrap; }
.leaders .tie { font-size: 11px; font-weight: 800; color: var(--gold); margin-left: 6px; text-transform: uppercase; }
.leaders .none { color: var(--muted); font-style: italic; justify-content: center; }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 10px 16px 30px; }
.center { text-align: center; }
.mt { margin-top: 14px; }

/* ---- live board ---- */
body.live { font-size: 16px; }
.live-bar {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  background: var(--green); color: #fff; padding: 14px 24px;
  position: sticky; top: 0; z-index: 5;
}
.live-bar h1 { margin: 0; font-size: 26px; font-weight: 800; }
.live-bar .sub { font-size: 15px; opacity: 0.9; }
.live-bar .right { display: flex; justify-content: center; flex-wrap: wrap; align-items: center; gap: 14px; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; }
.live-dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #9ef0c4; animation: pulse 1.6s infinite; }
.live-dot.stale::before { background: #f6c560; animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.tabs { display: inline-flex; background: rgba(255, 255, 255, 0.15); border-radius: 999px; padding: 4px; }
.tabs button {
  border: 0; background: none; color: #fff; padding: 8px 16px; border-radius: 999px; font-weight: 700; cursor: pointer; font-size: 15px;
  min-height: 40px;
}
.tabs button.on { background: #fff; color: var(--green-dark); }

/* Players who came from an entry form get their way back (not shown on a TV). */
.live-nav { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 24px 0; }
.live-nav .btn { width: auto; margin: 0; }
@media (max-width: 640px) { .live-nav { padding: 12px 16px 0; } .live-nav .btn { flex: 1 1 auto; } }

.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; padding: 20px 24px 40px; }
.ncard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; transition: box-shadow 0.3s, border-color 0.3s; }
.ncard.flash { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-tint); }
.ncard .top { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ncard .name { font-size: 22px; font-weight: 800; margin: 0; line-height: 1.2; }
.ncard .sponsor { color: var(--muted); font-size: 15px; margin: 2px 0 10px; }
.ncard .leaders .val { font-size: 19px; }
.ncard .leaders .who { font-size: 18px; }
.ncard .count { color: var(--muted); font-size: 13px; margin-top: 8px; }
.board-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 60px 0; font-size: 20px; }

@media (max-width: 640px) {
  .live-bar { padding: 12px 16px; }
  .live-bar h1 { font-size: 20px; }
  .board { grid-template-columns: minmax(0, 1fr); padding: 14px 16px 30px; gap: 12px; }
}
@media (min-width: 1600px) {
  .board { grid-template-columns: repeat(4, 1fr); }
  .ncard .name { font-size: 26px; }
  .ncard .leaders .who, .ncard .leaders .val { font-size: 22px; }
}
.confirm .return-note + .btn, .confirm #backToGdpBtn + .btn { margin-top: 10px; }

/* Beat the Pro (pro.html) */
.team-list input[type="checkbox"] { width: 24px; height: 24px; flex: none; accent-color: var(--green); margin: 0; }
.player-list button.on { background: var(--green-tint); font-weight: 800; }
.add-btn { width: auto; flex: none; padding: 0 22px; }
.leaders.beaten .link-btn { min-height: 0; padding: 0 4px; font-size: 14px; }

/* ---- Beat the Pro: logo, organiser, next group ---- */
.logo-bar { background: #fff; text-align: center; padding: 8px 16px; border-bottom: 1px solid var(--line); line-height: 0; }
/* the image is cropped tight to the artwork, so the bar's padding is the only white space */
.logo-bar img { height: 60px; width: auto; max-width: 100%; display: inline-block; }
.organiser { display: flex; align-items: center; gap: 12px; }
.organiser > span { flex: 1; }
.organiser .btn { width: auto; flex: none; padding-left: 22px; padding-right: 22px; }
.team-start { margin: -4px 0 10px; }
.next-group { margin-top: 12px; }
.next-hint { margin: 6px 0 0; text-align: center; }

/* ---- entry page in GolfDayPro's mobile-scoring look (body.gdp) ----
   GDP scoring: Helvetica/Arial bold, grey page, a dark hole bar, a pale-yellow
   prize strip and rounded yellow buttons. Kept to this page only. */
body.gdp {
  --page: #e9e9e9;
  --gdp-dark: #333333;
  --gdp-yellow: #fadb4e;
  --gdp-yellow-edge: #e6b800;
  --gdp-yellow-tint: #fff4c2;
  --green: #333333;
  --green-dark: #111111;
  --green-tint: #f2f2f2;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: #222;
}
body.gdp .wrap { padding: 10px 10px 24px; }
body.gdp .comp-bar {
  background: var(--gdp-dark); color: #fff; text-align: center; border-radius: 6px 6px 0 0;
  padding: 10px 12px; text-shadow: 0 1px 0 #000;
}
body.gdp .comp-name { font-size: 19px; font-weight: 700; line-height: 1.25; }
body.gdp .comp-sub { font-size: 15px; font-weight: 700; margin-top: 2px; }
body.gdp .comp-prize {
  background: var(--gdp-yellow-tint); border: 1px solid #e8d78a; border-top: 0; text-align: center;
  font-weight: 700; font-size: 17px; padding: 8px 12px;
}
body.gdp .leader-strip {
  display: block; text-align: center; background: #fff; border: 1px solid #ccc; border-top: 0;
  border-radius: 0 0 6px 6px; padding: 10px 12px; font-size: 16px; margin-bottom: 12px;
}
body.gdp .leader-strip.empty { color: #666; }
body.gdp .leader-strip .val { white-space: nowrap; font-size: inherit; margin: 0; }
body.gdp .card { border-radius: 6px; border-color: #ccc; padding: 12px; margin-bottom: 12px; box-shadow: none; }
body.gdp label.field { font-size: 16px; }
body.gdp .hint { color: #555; }
body.gdp .input { border-radius: 8px; border-width: 1px; border-color: #bbb; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15); }
body.gdp .input:focus { border-color: #888; box-shadow: 0 0 0 3px #dde8f5; }
body.gdp .value-row .unit { border-radius: 8px; border-width: 1px; }
body.gdp .group-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
body.gdp .group-grid button {
  text-align: center; border-radius: 8px; border: 1px solid #bbb; font-size: 20px; font-weight: 700;
  background: linear-gradient(#fff, #f0f0f0);
}
body.gdp .team-list { border-color: #ccc; border-radius: 8px; }
body.gdp .team-list label { font-size: 18px; min-height: 54px; }
body.gdp .team-list label:has(input:checked) { background: var(--gdp-yellow-tint); font-weight: 700; }
body.gdp .team-list input[type="radio"] { accent-color: #333; }
body.gdp .link-btn { color: #2a5d9f; font-weight: 600; }
body.gdp .link-btn.small { font-size: 14px; min-height: 36px; padding: 6px 2px 0; }
body.gdp .btn {
  min-height: 52px; border-radius: 26px; font-size: 18px; font-weight: 700;
  background: linear-gradient(#fde56c, var(--gdp-yellow)); color: #222; border: 1px solid var(--gdp-yellow-edge);
  text-shadow: 0 1px 0 #fff6c8; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
body.gdp .btn:active { background: var(--gdp-yellow-edge); }
body.gdp .confirm .headline { font-size: 22px; }
body.gdp .confirm .big { font-size: 44px; }
body.gdp .confirm.leader { border-color: var(--gdp-yellow-edge); background: var(--gdp-yellow-tint); }
body.gdp .return-note { margin: 10px 0 0; }
body.gdp .chosen { border-width: 1px; border-color: #bbb; border-radius: 8px; }

/* ---- activity / putting page: a score box on every player in the group ---- */
.score-list .score-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 60px; font-size: 18px; }
.score-list .score-row + .score-row { border-top: 1px solid var(--line); }
.score-list .score-row.done { background: var(--green-tint); }
.score-list .score-row .who { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.score-list .score-row .input { width: 64px; flex: none; text-align: center; padding-left: 6px; padding-right: 6px; }
.score-list .score-row .btn { width: auto; flex: none; padding: 0 12px; font-size: 16px; min-height: 48px; }

/* ---- intro (spiel) + per-player notes on the pro / activity pages ---- */
.intro-text { white-space: pre-wrap; font-size: 18px; line-height: 1.45; margin-bottom: 6px; }
.note-input { font-size: 17px; min-height: 0; resize: vertical; line-height: 1.4; }
.note-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.note-actions .btn.note-save { width: auto; min-height: 48px; padding: 0 22px; font-size: 17px; }
.link-btn.small { font-size: 14px; min-height: 32px; padding: 4px 2px; }
.pnote { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 0 16px 8px 54px; }
.pnote:has(textarea) { display: block; padding-left: 16px; }
.pnote-text { white-space: pre-wrap; font-size: 15px; color: var(--text); font-style: italic; overflow-wrap: anywhere; }
.pnote-text::before { content: '📝 '; font-style: normal; }
.prow + .prow { border-top: 1px solid var(--line); }
.prow:has(input:checked), .prow:has(.score-row.done) { background: var(--green-tint); }
.prow .score-row.done, .prow label:has(input:checked) { background: none; }
.score-list .prow .pnote { padding-left: 12px; }
.leaders li:has(.pnote) { flex-wrap: wrap; }
.leaders li .pnote { flex-basis: 100%; padding: 0 0 0 48px; }

/* Notes report (report.html) — screen, then paper */
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.report-actions .hint, .report-actions .note, .report-actions .link-btn { flex-basis: 100%; margin: 0; }
.report-intro { white-space: pre-line; margin: 6px 0; }
.report-count { font-weight: 600; margin: 6px 0 10px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.report-table th, .report-table td { text-align: left; vertical-align: top; padding: 6px 6px; border-bottom: 1px solid #ddd; }
.report-table th { font-size: 12px; text-transform: uppercase; color: var(--muted); }
.report-table .rnote { white-space: pre-line; }
.report-stamp { text-align: right; }
@media (max-width: 560px) {
  .report-table th:nth-child(2), .report-table td:nth-child(2), .report-table th:nth-child(3), .report-table td:nth-child(3) { display: none; }
}
@media print {
  .no-print, .logo-bar, .foot { display: none !important; }
  body.report-page { background: #fff; }
  .report-page .topbar { background: none; color: #000; padding: 0 0 8px; }
  .report-page .card { box-shadow: none; border: 0; padding: 0; margin: 0 0 18px; break-inside: auto; }
  .report-table th:nth-child(n), .report-table td:nth-child(n) { display: table-cell; }
  .report-table tr { break-inside: avoid; }
}

/* ---- novelty choices form (choose.html) ---- */
.choose-page .wrap { max-width: 640px; }
.field-label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.note.ok { background: var(--green-tint, #e7f3ec); color: var(--green); font-weight: 600; }
.choose-message { white-space: pre-line; margin: 10px 0 0; }
.choose-hole { padding: 12px 0; border-top: 1px solid var(--line); }
.choose-hole:first-of-type { border-top: 0; padding-top: 0; }
.choose-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.choose-num { font-size: 20px; font-weight: 800; color: var(--green); min-width: 28px; }
.choose-where { color: var(--muted); font-size: 14px; }
.choose-extra { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; margin-top: 8px; }
.choose-extra[hidden] { display: none !important; }
.choose-extra .field-label { margin: 0; font-weight: 500; color: var(--muted); }
.choose-extra input { grid-column: 1 / -1; }

/* sponsor logo per hole on the choices form */
.choose-logo { grid-column: 1 / -1; }
.choose-logo .field-label { display: block; margin: 0 0 4px; font-weight: 500; color: var(--muted); }
.choose-logo-row { display: flex; align-items: center; gap: 12px; }
.choose-logo-preview { flex: none; }
.choose-logo-preview img { display: block; max-width: 120px; max-height: 60px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px; }
.choose-logo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.choose-logo-input { display: none; }
.choose-logo-status { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.choose-logo-status.error-text { color: var(--red); font-weight: 600; }
.btn-lite { background: #fff; color: var(--green); border: 1px solid var(--green); border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.btn-lite[hidden] { display: none !important; }
.btn-lite[disabled] { opacity: .5; cursor: default; }
