:root {
  --bg: #0b1320;
  --card: #111a2e;
  --muted: #8fa3bf;
  --text: #e4ecfa;
  --accent: #3ea76f;
  --accent-2: #2b8cff;
  --error: #ff5a5f;
  --chip: #1a2440;
  --chip-border: #2a395e;
  --switch-off-bg: #2a3954;
  --switch-on-bg: #2b8cff;
  --switch-knob: #ffffff;
  --switch-knob-shadow: 0 2px 5px rgba(0,0,0,0.45);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(100% 100% at 50% 0%, #0c1a37 0%, var(--bg) 60%);
  color: var(--text);
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,'Helvetica Neue',Arial,'Noto Sans','Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji',sans-serif;
}

.site-header { padding: 32px 16px 12px; text-align: center; }
.site-header h1 { margin: 0 0 8px; font-weight: 750; letter-spacing: .2px; }
.subtitle { margin: 0; color: var(--muted); }

.container { max-width: 1100px; margin: 0 auto; padding: 16px; }

.card {
  background: linear-gradient(180deg,#111a2e 0%,#0f1730 100%);
  border: 1px solid #1f2b4a;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}

.grid {
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  gap: 12px;
}
.field { grid-column: span 6; display: flex; flex-direction: column; gap: 6px; }
@media (min-width:640px){ .field{ grid-column: span 3; } }
@media (min-width:920px){ .field{ grid-column: span 2; } }
label, .label { font-size: .92rem; }

/* Inputs */
input[type="text"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="range"],
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #243457;
  background: #0e1630;
  color: var(--text);
  outline: none;
}
select { -webkit-appearance: none; appearance: none; background-image: none; }

input:focus, select:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(43,140,255,0.2);
}

.range-wrap { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
output {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: #0c1531;
  border: 1px solid #1a2a54;
  padding: 6px 10px;
  border-radius: 8px;
  min-width: 72px;
  text-align: center;
}

.actions { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  appearance: none; border: 1px solid #2a395e;
  background: #0d1733; color: var(--text);
  padding: 10px 14px; border-radius: 10px; cursor: pointer;
}
.btn:hover { border-color: #375185; }
.btn.primary {
  background: linear-gradient(180deg,#2b8cff 0%,#1f6fd1 100%);
  border: 1px solid #1f6fd1;
}
.btn.primary:hover { filter: brightness(1.08); }

#status { margin-top: 10px; min-height: 24px; color: var(--muted); }
#status.error { color: var(--error); }

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--chip-border);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin-right: 8px; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Results grid and cards */
.results-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(290px,1fr));
  gap: 14px;
}

.course-card {
  background: linear-gradient(180deg,#0f1832 0%,#0c142c 100%);
  border: 1px solid #1b2a52;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.course-header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.course-name { margin: 0; font-size: 1.05rem; font-weight: 700; }
.price { color: var(--accent); font-weight: 700; }
.meta { color: var(--muted); font-size: .9rem; }

/* Tee time chips (each is a link) */
.chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: flex-start; align-content: flex-start;
}
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--chip); color: var(--text);
  border: 1px solid var(--chip-border);
  padding: 6px 9px; border-radius: 999px;
  font-size: .9rem; line-height: 1; white-space: nowrap;
  flex: 0 0 auto; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.chip:hover, .chip:focus { background: #233358; border-color: #375185; outline: none; }

.link { color: #9dc4ff; text-decoration: none; border-bottom: 1px dotted #335fa8; }
.link:hover { color: #bcd7ff; }

/* Skeleton loading cards */
.skeleton {
  background: linear-gradient(90deg,#0f1832 25%,#0e1630 37%,#0f1832 63%);
  background-size: 400% 100%;
  animation: shine 1.4s ease infinite;
  border-radius: 10px;
  height: 120px;
}
@keyframes shine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Holes segmented control */
.holes-field .segmented {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: #0e1630;
  border: 1px solid #243457;
  border-radius: 999px;
  overflow: hidden;
  user-select: none;
}
.holes-field .segmented input[type="radio"] {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden;
}
.holes-field .segmented label {
  padding: 8px 16px;
  text-align: center;
  color: #cfe0ff;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.2px;
  font-size: 0.95rem;
  transition: color .2s, background .2s;
}
.holes-field .segmented input[type="radio"]:focus-visible + label {
  outline: 2px solid var(--accent-2);
  outline-offset: -2px;
}
.holes-field .segmented input[type="radio"]:checked + label {
  background: linear-gradient(180deg, var(--switch-on-bg) 0%, #1f6fd1 100%);
  color: #fff;
}
.holes-field .segmented label:first-of-type {
  border-right: 1px solid #243457;
}

/* Mobile polish */
@media (max-width:480px){
  .container{ padding:12px; }
  .results-grid{ grid-template-columns:1fr; gap:12px; }
  .course-card{ padding:12px; }
  .chips{ gap:6px; }
  .chip{ padding:8px 10px; font-size:.95rem; }
  .actions .btn{ width:100%; }
}

input, select, textarea, button { font-size: 16px; }
html { -webkit-text-size-adjust: 100%; }

/* Footer */
.site-footer {
  margin-top: 40px;
  padding: 24px 16px;
  text-align: center;
  border-top: 1px solid #1f2b4a;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.footer-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--text);
}

/* Ad Container */
.ad-container {
  margin-top: 32px;
  padding: 16px 0;
  min-height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Content page styling for About and Privacy pages */
.content-page {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

.content-page h2 {
  margin-top: 28px;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 1.4rem;
}

.content-page h3 {
  margin-top: 20px;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 1.15rem;
}

.content-page p {
  margin-bottom: 14px;
  color: var(--text);
}

.content-page ul {
  margin: 12px 0;
  padding-left: 24px;
  color: var(--text);
}

.content-page li {
  margin-bottom: 8px;
}