body {
  margin: 0;
  background: radial-gradient(circle at top, #131c35, #080d1d 45%, #050914);
  color: #e5e7eb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 12px 40px;
}

.page-header {
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #93c5fd;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 6px;
  color: #f8fafc;
  font-size: clamp(22px, 5vw, 30px);
}

.note {
  margin: 0;
  font-size: 13px;
  color: #9db2d8;
  line-height: 1.5;
}

.card {
  border: 1px solid #24324a;
  border-radius: 14px;
  padding: 14px;
  margin-top: 14px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(4px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.2);
}

h2 {
  margin: 0 0 10px;
  font-size: 17px;
  color: #f8fafc;
}

.grid {
  display: grid;
  gap: 10px;
}

.grid.two {
  grid-template-columns: 1fr 1fr;
}

.grid.one {
  grid-template-columns: 1fr;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
}

input,
textarea {
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  border: 1px solid #3c4b64;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 14px;
  color: #f8fafc;
  background: #0e172c;
}

input:focus,
textarea:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 700;
  transition: all 120ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: #22c55e;
  color: #07101f;
  border-color: #20b055;
}

.btn-secondary {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #3c4b64;
}

.btn-ghost {
  background: transparent;
  color: #dbeafe;
  border-color: #3c4b64;
  padding: 7px 10px;
}

.row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.row.compact {
  margin-top: 0;
}

.status {
  font-size: 13px;
  color: #93c5fd;
  min-height: 18px;
}

.status.status-loading {
  color: #fde68a;
}

.status.status-success {
  color: #86efac;
}

.status.status-error {
  color: #fca5a5;
}

.meta {
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  color: #dbe9ff;
  background: #0b1224;
  border: 1px solid #24324a;
  border-radius: 10px;
  padding: 10px;
  margin-top: 10px;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.round-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.round-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  color: #f8fafc;
}

.state-chip {
  border: 1px solid #3c4b64;
  background: #0b1224;
  color: #cbd5e1;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.scoreboard-wrap {
  margin-top: 10px;
  border: 1px solid #24324a;
  border-radius: 12px;
  overflow: hidden;
}

.scoreboard-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  border-top: 1px solid #24324a;
}

.scoreboard-row:first-child {
  border-top: none;
}

.row-label {
  display: flex;
  align-items: center;
  padding: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #b8c7e6;
  border-right: 1px solid #24324a;
  background: #10182e;
}

.score-cells {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(42px, 1fr);
  overflow-x: auto;
  scrollbar-width: thin;
}

.score-cell {
  border-right: 1px solid #24324a;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #dbeafe;
  background: #0a1122;
  padding: 0 6px;
  white-space: nowrap;
}

.scoreboard-row.labels .score-cell {
  background: #0d1830;
  color: #d1d9e8;
}

.score-cell.selected {
  background: #050507;
  color: #ffffff;
  font-weight: 800;
}

.score-cell.agg {
  background: #16243e;
  color: #bfdbfe;
}

.score-cell.score-good {
  color: #86efac;
}

.score-cell.score-bad {
  color: #fca5a5;
}

.score-cell.clickable {
  cursor: pointer;
}

.score-cell.clickable:hover {
  background: #1b2f57;
}

.hole-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #3c4b64;
  background: #0b1224;
  color: #dbeafe;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}

.hole-tabs {
  margin-top: 10px;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  gap: 6px;
  scrollbar-width: thin;
}

.hole-tabs button {
  background: #0f172a;
  color: #e5e7eb;
  border: 1px solid #334155;
  white-space: nowrap;
  min-width: 56px;
}

.hole-tabs button.active {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}

.hole-map {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #334155;
  background: radial-gradient(circle at 50% 45%, #164e2f, #083344);
  display: block;
}

.mapbox-map {
  width: 100%;
  height: 360px;
  border-radius: 10px;
  border: 1px solid #334155;
  overflow: hidden;
}

.hidden {
  display: none;
}

.hole-stage {
  position: relative;
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
  isolation: isolate;
}

.hole-stage .hole-map,
.hole-stage .mapbox-map {
  height: clamp(280px, 44vw, 420px);
}

.hole-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(5, 10, 20, 0.7) 0%, rgba(5, 10, 20, 0.38) 27%, rgba(5, 10, 20, 0.12) 52%, rgba(5, 10, 20, 0.46) 100%);
}

.overlay {
  position: absolute;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overlay.left {
  left: 10px;
  top: 10px;
}

.overlay.right {
  right: 10px;
  top: 10px;
  align-items: flex-end;
}

.metric-hole {
  font-size: 54px;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.metric-block {
  display: flex;
  flex-direction: column;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  color: #dbeafe;
  min-width: 74px;
}

.metric-block span {
  font-size: 10px;
  letter-spacing: 0.06em;
}

.metric-block strong {
  font-size: 24px;
  line-height: 1.1;
}

.mode-badge {
  border: 1px solid rgba(219, 234, 254, 0.65);
  border-radius: 999px;
  padding: 4px 10px;
  color: #dbeafe;
  background: rgba(0, 0, 0, 0.4);
  font-size: 12px;
  font-weight: 700;
}

.btn-floating {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(219, 234, 254, 0.55);
  color: #e2e8f0;
  border-radius: 999px;
  padding: 8px 14px;
}

.shot-card {
  margin-top: 4px;
  min-width: 132px;
  border-radius: 12px;
  border: 1px solid rgba(219, 234, 254, 0.44);
  background: rgba(2, 6, 23, 0.72);
  padding: 10px;
  color: #dbeafe;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.shot-title {
  font-size: 12px;
  font-weight: 800;
  color: #cbd5e1;
  letter-spacing: 0.04em;
}

.shot-distance {
  margin-top: 6px;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 800;
  color: #ffffff;
}

.shot-sg {
  margin-top: 4px;
  font-size: 13px;
  color: #bfdbfe;
  font-weight: 700;
}

.shot-hint {
  margin-top: 4px;
  font-size: 11px;
  color: #9fb2d3;
}

.json {
  background: #020617;
  color: #dbeafe;
  border-radius: 8px;
  padding: 10px;
  overflow: auto;
  font-size: 12px;
  border: 1px solid #24324a;
}

.json-wrap {
  margin-top: 10px;
}

.json-wrap summary {
  cursor: pointer;
  font-size: 13px;
  color: #94a3b8;
}

.comment-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.comment-list li {
  margin: 8px 0;
  border: 1px solid #24324a;
  border-radius: 10px;
  background: #0b1224;
  padding: 10px;
  color: #e2e8f0;
  line-height: 1.45;
}

.comment-list li.empty {
  color: #9db2d8;
  text-align: center;
}

@media (max-width: 720px) {
  .container {
    padding: 12px 10px 32px;
  }

  .card {
    padding: 12px;
    border-radius: 12px;
  }

  h2 {
    font-size: 16px;
  }

  .grid.two {
    grid-template-columns: 1fr;
  }

  .map-toolbar,
  .hole-header {
    flex-direction: column;
    align-items: stretch;
  }

  .overlay.left {
    top: auto;
    bottom: 10px;
  }

  .scoreboard-row {
    grid-template-columns: 70px 1fr;
  }

  .round-title {
    font-size: 24px;
  }

  .metric-hole {
    font-size: 42px;
  }

  .metric-block strong {
    font-size: 20px;
  }

  .shot-card {
    min-width: 116px;
    padding: 8px;
  }

  .shot-distance {
    font-size: 18px;
  }

  .row.compact {
    justify-content: flex-start;
  }

  button {
    min-height: 40px;
  }
}
