/* 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 {
  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; align-items: center; gap: 16px; flex-wrap: wrap;
  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 { margin-left: auto; display: flex; 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); }

.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; }
  .live-bar .right { margin-left: 0; width: 100%; justify-content: space-between; }
  .board { grid-template-columns: 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; }
