:root {
  color-scheme: dark;
  --ink: #0a0614;
  --panel: #140c22;
  --lime: #b8f000;
  --pink: #ff2d95;
  --cyan: #3ee0ff;
  --amber: #ffb020;
  --text: #f7f4ff;
  --muted: #d5cee8;
  --font: "Sora", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #05030c; }
body {
  font-family: var(--font);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
button, input { font-family: inherit; font-size: 16px; }
button { touch-action: manipulation; }

.phone {
  width: min(100%, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--ink);
  box-shadow: 0 0 0 1px rgba(184, 240, 0, 0.16);
}

.screen { min-height: 100dvh; padding: 28px 16px 32px; }
.kicker {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--lime);
}
h1 {
  margin: 8px 0 0;
  font-size: 48px;
  line-height: 0.95;
  font-weight: 800;
}
.lede { margin: 16px 0 0; max-width: 18rem; font-size: 18px; font-weight: 600; color: var(--muted); }
.note {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: #241833;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}
.note strong { color: var(--lime); }

label { display: block; margin: 14px 0 6px; font-size: 16px; font-weight: 700; }
input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  background: #120a1c;
  color: white;
}
.error { margin: 12px 0 0; color: var(--pink); font-weight: 800; }

.tap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 8px 12px;
  border-radius: 16px;
  border: 3px solid #fff;
  background: var(--panel);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: center;
}
.tap:active { transform: scale(0.98); }
.tap:focus-visible { outline: 4px solid var(--cyan); outline-offset: 2px; }
.tap:disabled { opacity: 0.35; }
.tap.lime { border-color: var(--lime); background: var(--lime); color: var(--ink); }
.tap.amber { border-color: var(--amber); background: var(--amber); color: var(--ink); }
.tap.pink { border-color: var(--pink); background: var(--pink); color: var(--ink); }
.tap.white { border-color: #fff; background: #fff; color: var(--ink); }
.tap.cyan { border-color: var(--cyan); background: var(--cyan); color: var(--ink); }
.tap.block { width: 100%; margin-top: 12px; }
.tap.stroke {
  width: 88px;
  height: 88px;
  min-width: 88px;
  min-height: 88px;
  padding: 0;
  font-size: 48px;
}
.tap.putt {
  width: 80px;
  height: 80px;
  min-width: 80px;
  min-height: 80px;
  padding: 0;
  font-size: 36px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 8px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.section-title {
  margin: 24px 0 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.card {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 3px solid rgba(255, 255, 255, 0.85);
  background: var(--panel);
  color: inherit;
  text-align: left;
  text-decoration: none;
}
.card .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card .score { font-family: var(--mono); font-size: 32px; font-weight: 700; }
.muted { color: var(--muted); font-weight: 700; }
.tiny { font-size: 14px; font-weight: 700; color: var(--muted); }

.pad { height: 100dvh; display: flex; flex-direction: column; }
.pad-head, .players {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}
.pad-head {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.head-actions { display: flex; gap: 8px; }
.head-actions .tap { min-width: 72px; }
.course-tap {
  width: 100%;
  min-height: 72px;
  justify-content: space-between;
  padding-inline: 16px;
  text-align: left;
}
.head-actions .course-tap { flex: 1; width: auto; min-width: 0; }
.topbar {
  display: grid;
  grid-template-columns: 1.05fr 0.85fr 0.75fr 1fr;
  gap: 8px;
}
.topbar .tap {
  min-height: 72px;
  padding: 8px 6px;
  font-size: 16px;
  line-height: 1.1;
}
.players { flex-wrap: nowrap; overflow-x: auto; }
.course-tap span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players .tap {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status { margin: 0; font-size: 16px; font-weight: 800; color: var(--amber); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conflict { margin: 0 0 8px; padding: 8px; border: 3px solid var(--amber); border-radius: 14px; background: #241808; }
.conflict p { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.25; }
.pad .conflict .grid-2 { margin-top: 6px; }
.pad .conflict .tap { min-height: 48px; padding: 6px; font-size: 16px; }
.course { margin: 0; font-size: 16px; font-weight: 800; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px 24px; }
.hole-row { display: flex; justify-content: space-between; align-items: flex-end; }
.hole-label { margin: 0; font-family: var(--mono); font-size: 13px; letter-spacing: 0.18em; color: var(--muted); }
.hole-num { margin: 0; font-family: var(--mono); font-size: 48px; line-height: 1; }
.rel { margin: 0; font-size: 24px; font-weight: 800; }
.stroke-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.ball {
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 6px solid #f7f4ff;
  background: var(--ink);
  font-family: var(--mono);
  font-size: 60px;
  font-weight: 700;
  line-height: 1;
}
.putt-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.putt-num { min-width: 64px; text-align: center; font-family: var(--mono); font-size: 48px; font-weight: 700; }
.hint { margin: 12px 0 0; font-size: 16px; font-weight: 600; color: var(--muted); }
.nav {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 12px max(12px, env(safe-area-inset-bottom));
  border-top: 3px solid rgba(255, 255, 255, 0.3);
  background: var(--ink);
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.table { width: 100%; border-collapse: collapse; margin-top: 12px; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 8px 4px; text-align: center; font-weight: 800; }
.table th { font-size: 12px; color: var(--muted); }
.table td.me { color: var(--lime); }
.rank { display: flex; justify-content: space-between; align-items: center; min-height: 72px; margin-top: 8px; padding: 0 16px; border-radius: 16px; border: 3px solid #fff; background: var(--panel); }
.rank b { font-family: var(--mono); font-size: 28px; }

.vs-hero {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 72px;
  line-height: 0.9;
  font-weight: 700;
}
.vs-live {
  margin: 0;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
button.course-row {
  display: flex;
  width: 100%;
  min-height: 72px;
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 3px solid rgba(255, 255, 255, 0.85);
  background: var(--panel);
  color: inherit;
  text-align: left;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: inherit;
  font-weight: 800;
}
button.course-row b { display: block; font-size: 18px; }
button.course-row .meta { display: block; margin-top: 2px; font-size: 14px; font-weight: 700; color: var(--muted); }
button.course-row.on { border-color: var(--lime); background: #1a2808; }
.par-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.par-grid .tap {
  flex-direction: column;
  gap: 2px;
  min-height: 72px;
  padding: 8px 4px;
  font-size: 22px;
}
.par-grid .tap small { font-size: 12px; font-weight: 800; letter-spacing: 0.04em; }

select.tap {
  display: block;
  width: 100%;
  text-align: left;
}
.filter-5, .filter-4 { display: grid; gap: 6px; margin-top: 8px; }
.filter-5 { grid-template-columns: repeat(5, 1fr); }
.filter-4 { grid-template-columns: repeat(4, 1fr); }
.filter-5 .tap, .filter-4 .tap { width: 100%; min-height: 72px; padding: 6px 2px; font-size: 14px; }
.map-page {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
}
.map-tabs, .map-toggle { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; padding: 8px 8px 0; }
.map-toggle { grid-template-columns: 1fr 1fr; padding-bottom: 8px; }
.map-tabs .tap, .map-toggle .tap, .map-holebar .tap { min-height: 72px; }
.map-holebar {
  display: grid;
  grid-template-columns: 72px 1fr 1fr 1fr 72px;
  gap: 6px;
  align-items: center;
  padding: 8px;
}
.map-stat { text-align: center; }
.map-stat .hole-num { font-size: 32px; }
.map-readout { padding: 0 12px 8px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.map-readout .vs-hero { font-size: 56px; }
.map-readout .unit { font-size: 22px; margin-left: 4px; }
#hole-map { flex: 1; min-height: 220px; background: #140c22; }
.leaflet-container { font-family: var(--font); background: #140c22; }
.leaflet-pane img { max-width: none !important; }
.leaflet-control-zoom a { width: 44px; height: 44px; line-height: 44px; font-size: 22px; }
.metre-label { background: transparent; border: 0; }
.metre-label span {
  display: inline-block;
  background: #0a0614;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 8px;
  padding: 2px 8px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
}
.map-list { flex: 1; overflow-y: auto; padding: 0 8px 16px; }
.map-note { margin: 0; padding: 6px 12px 10px; }

/* Scorer only: keep the five shortcuts above the hole bar on a short phone. */
.pad .pad-head { gap: 4px; padding: 4px 10px; }
.pad .players { padding: 4px 10px; }
.pad .topbar { gap: 6px; }
.pad .topbar .tap { min-height: 56px; padding: 4px; font-size: 15px; }
.pad .players .tap {
  min-height: 56px;
  flex-direction: column;
  gap: 1px;
  padding: 3px 2px;
  font-size: 15px;
  line-height: 1.05;
}
.who-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pad .players .shuffle {
  flex: 0 0 auto;
  align-self: center;
  height: 36px;
  min-height: 36px;
  padding: 0 8px;
  border-radius: 12px;
  border: 2px solid #fff;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.who-vs { font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 0; line-height: 1; }
.pad .hole-num { font-size: 40px; }
.pad .hole-row .tap { min-height: 56px; padding: 4px 10px; font-size: 16px; line-height: 1.05; }
.pad .hole-row .tiny { font-size: 12px; }
.pad .scroll { padding: 2px 12px 8px; }
.pad .stroke-row { margin-top: 4px; }
.pad .ball {
  width: 80px;
  height: 80px;
  border-width: 5px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 36px;
}
.ball-vs { font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 0; line-height: 1; }
.pad .tap.stroke {
  width: 80px;
  height: 80px;
  min-width: 80px;
  min-height: 80px;
  font-size: 40px;
}
.pad .grid-3, .pad .grid-2 { margin-top: 6px; gap: 6px; }
.pad .nav { gap: 8px; padding: 8px 10px max(8px, env(safe-area-inset-bottom)); }
