* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; }
button, a { font: inherit; color: inherit; }
button { cursor: pointer; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.app {
  height: 100dvh;
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: calc(10px + env(safe-area-inset-top)) 16px calc(10px + env(safe-area-inset-bottom));
  background: #000;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 2px 2px 10px;
}
.brand {
  display: block;
  text-decoration: none;
  color: #dedede;
  font-size: 13px;
  font-weight: 500;
}
.hole-btn, .score-btn {
  background: none;
  border: 0;
  padding: 0;
  color: #fff;
}
.hole-btn {
  margin-top: 2px;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.03em;
}
.score-btn { text-align: right; }
.score-line, .shot-line { display: block; }
.score-line { font-size: 18px; font-weight: 650; }
.shot-line { margin-top: 2px; color: #d2d2d4; font-size: 15px; font-weight: 500; }
.view { display: none; min-height: 0; }
.view.on { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.map-wrap { position: relative; z-index: 2; flex: 1; min-height: 0; display: flex; }
.map {
  position: relative;
  flex: 1;
  background: #e7eee0;
  border-radius: 22px;
  overflow: hidden;
}
.map svg, .map-scroll svg { width: 100%; height: 100%; display: block; }
.gps-pill {
  position: absolute;
  top: 14px;
  left: 16px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(70, 82, 58, 0.45);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  line-height: 1.35;
}
.gps-pill em {
  display: block;
  margin-top: 1px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0;
  font-size: 12px;
  opacity: 0.9;
}
.yd-pill {
  position: absolute;
  transform: translate(-50%, -50%);
  background: #1c1c1c;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  padding: 10px 16px;
  border-radius: 14px;
  white-space: nowrap;
  pointer-events: none;
}
.dock {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 42%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: #2c2c2e;
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  z-index: 3;
  display: grid;
  place-items: center;
}
.dock svg { width: 22px; height: 22px; }
.yards {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 28px 0 4px;
}
.yard-card {
  background: #212121;
  border-radius: 18px;
  text-align: center;
  padding: 16px 6px 14px;
}
.yard-card strong {
  display: block;
  font-size: 34px;
  font-weight: 720;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.yard-card span { color: #a3a3a8; font-size: 13px; font-weight: 500; }
.panel { gap: 8px; }
.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.panel-head h1 { margin: 0; font-size: 22px; font-weight: 700; }
.back, .text-link, .sheet-links button, .calibrate button, .sheet-nav button {
  background: none;
  border: 0;
  color: #d7d7dc;
  padding: 8px 0;
}
.back {
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 50%;
  background: #2c2c2e;
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0;
  flex: 0 0 auto;
}
.back svg { width: 36px; height: 36px; }
.nine-label {
  margin: 14px 0 8px;
  color: #9a9aa0;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hole-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.hole-cell {
  background: #1c1c1e;
  border: 0;
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
}
.hole-cell.on { outline: 2px solid #3d7cff; }
.hole-cell b { display: block; font-size: 20px; }
.hole-cell span { color: #9b9ba1; font-size: 12px; }
.score-pad {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.score-name { margin: 0; color: #bdbdc2; font-size: 15px; }
.stepper { display: flex; align-items: center; gap: 22px; }
.stepper button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: #2a2a2e;
  color: #fff;
  font-size: 30px;
}
.stepper strong { font-size: 72px; font-variant-numeric: tabular-nums; min-width: 90px; text-align: center; }
.score-hint { margin: 0 0 8px; color: #8e8e93; }
.primary, .ghost {
  width: min(100%, 360px);
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 16px;
}
.primary { background: #fff; color: #111; border: 0; }
.ghost { background: #1c1c1e; color: #fff; border: 0; }
.card-scroll, .map-scroll { overflow: auto; flex: 1; min-height: 0; padding-bottom: 12px; }
.card-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.card-summary b { font-size: 28px; }
.holes-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.holes-table th, .holes-table td {
  text-align: center;
  padding: 8px 0;
  border-bottom: 1px solid #2a2a2e;
  font-size: 14px;
}
.holes-table th { color: #9a9aa0; font-weight: 600; }
.holes-table td.lab { text-align: left; color: #9a9aa0; }
.score-hit {
  background: none;
  border: 0;
  color: #fff;
  font-weight: 700;
  min-width: 28px;
}
.score-hit.under { color: #7ddea2; }
.score-hit.over { color: #ff8d7a; }
.card-actions { display: flex; justify-content: space-between; margin-top: 16px; }
.card-actions button { background: none; border: 0; color: #ff8d7a; padding: 8px 0; }
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 5;
}
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 980px);
  max-height: min(78dvh, 640px);
  overflow: auto;
  background: #141416;
  border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  z-index: 6;
}
.sheet-grip {
  width: 42px;
  height: 5px;
  border-radius: 99px;
  background: #3a3a3e;
  margin: 4px auto 12px;
}
.sheet .primary { width: 100%; }
.club-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0 4px;
}
.club-row button {
  flex: 0 0 auto;
  border: 0;
  background: #2a2a2e;
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
}
.club-row button.on { background: #fff; color: #111; }
.sheet-nav, .choice, .sheet-links { display: flex; gap: 8px; }
.sheet-nav button, .sheet-links button {
  flex: 1;
  background: #1c1c1e;
  border-radius: 12px;
  padding: 12px 8px;
}
.sheet-links { flex-wrap: wrap; margin-top: 8px; }
.sheet-links button { flex: 1 1 45%; }
.sheet-label { margin: 14px 0 6px; color: #9a9aa0; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.choice button {
  flex: 1;
  border: 0;
  background: #1c1c1e;
  color: #fff;
  border-radius: 12px;
  padding: 10px 8px;
  font-weight: 650;
}
.choice button.on { background: #fff; color: #111; }
.choice button.tee-blue.on { background: #1565c0; color: #fff; }
.choice button.tee-white.on { background: #f4f4f4; color: #111; }
.choice button.tee-red.on { background: #c62828; color: #fff; }
.calibrate { display: flex; flex-direction: column; align-items: flex-start; margin-top: 8px; }
.calibrate button { color: #8e8e93; font-size: 14px; }
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding-top: 8px;
}
.tabs button {
  border: 0;
  background: #141416;
  color: #b5b5ba;
  border-radius: 12px;
  padding: 10px 4px;
  font-size: 13px;
  font-weight: 700;
}
.tabs button.on { background: #fff; color: #111; }
.stat-grid, .link-list { display: grid; gap: 8px; }
.stat-grid { grid-template-columns: 1fr 1fr; margin-bottom: 14px; }
.stat-card, .link-card, .pace-card, .member-card {
  background: #1c1c1e;
  border-radius: 16px;
  padding: 14px;
}
.stat-card b, .pace-card b, .cart-pin {
  display: block;
  font-size: 28px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-card span, .pace-card span, .muted { color: #9a9aa0; font-size: 13px; }
.club-table, .history-list { width: 100%; border-collapse: collapse; }
.club-table th, .club-table td, .history-list td {
  text-align: left;
  padding: 8px 0;
  border-bottom: 1px solid #2a2a2e;
  font-size: 14px;
}
.club-table th { color: #9a9aa0; font-weight: 600; }
.club-table td:not(:first-child), .club-table th:not(:first-child) { text-align: right; }
.section-label { margin: 16px 0 8px; color: #9a9aa0; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.field span { color: #9a9aa0; font-size: 13px; }
.field input {
  user-select: text;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: #1c1c1e;
  color: #fff;
  padding: 12px 14px;
  font: inherit;
}
.link-list a {
  display: block;
  text-decoration: none;
  background: #1c1c1e;
  border-radius: 14px;
  padding: 14px;
  font-weight: 700;
}
.link-list a em { display: block; font-style: normal; color: #9a9aa0; font-weight: 500; font-size: 13px; margin-top: 2px; }
.cart-pin { font-size: 72px; text-align: center; line-height: 1; }
.cart-pin-label { text-align: center; color: #9a9aa0; margin: 0 0 12px; }
.member-card p { margin: 4px 0; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 78px;
  transform: translateX(-50%) translateY(12px);
  background: #fff;
  color: #111;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 8;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 380px) {
  .hole-btn { font-size: 22px; }
  .yard-card strong { font-size: 28px; }
}
