/* Teed Up — "clubhouse tee-sheet" identity. Server-rendered, mobile-first.
   Palette: fairway green + chalk white, flag-red + optic-yellow accents.
   Type: Barlow Semi Condensed (leaderboard display) / Inter (body) /
   Space Mono (tee times & numerals). Signature: waving flag, mowing
   stripes, and poll toggles that fill in like penciled scorecard cells. */
:root {
  --fairway: #0d5c33;
  --fairway-2: #12723f;
  --rough: #0a3f24;
  --green-soft: #e9f1ea;
  --chalk: #f7faf4;
  --card: #ffffff;
  --ink: #16241b;
  --pencil: #5f7168;
  --line: #e1e7dc;
  --line-2: #eef2ea;
  --flag: #e6432b;
  --optic: #e2ec52;
  --shadow: 0 1px 2px rgba(16, 36, 24, .06), 0 10px 26px -14px rgba(16, 36, 24, .22);
  --radius: 14px;
  --display: "Barlow Semi Condensed", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, "SFMono-Regular", monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--chalk);
  background-image: radial-gradient(circle at 1px 1px, rgba(13, 92, 51, .05) 1px, transparent 0);
  background-size: 22px 22px;
}

/* ---- brand header ---- */
.site-header {
  display: flex;
  align-items: center;
  gap: .9rem;
  flex-wrap: wrap;
  background: var(--rough);
  padding: .7rem clamp(1rem, 4vw, 2rem);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; }
.brand-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1;
}
.brand-tag {
  margin-left: auto;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #93bda4;
}
.flag-mark .flag-green { fill: #1c9457; }
.flag-mark .flag-pole { stroke: #dfe7df; stroke-width: 1.6; stroke-linecap: round; }
.flag-mark .flag-cloth { fill: var(--flag); transform-origin: 16px 6px; animation: wave 2.8s ease-in-out infinite; }
.flag-mark .flag-hole { fill: #06251a; }
@keyframes wave { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.66); } }
.fairway-stripes {
  height: 8px;
  background: repeating-linear-gradient(115deg, var(--fairway) 0 26px, var(--fairway-2) 26px 52px);
}

/* ---- layout ---- */
main { max-width: 840px; margin: 0 auto; padding: clamp(1.1rem, 4vw, 2rem) clamp(1rem, 4vw, 1.5rem) 2.5rem; }
.site-footer {
  max-width: 840px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2.5rem;
  text-align: center;
  color: var(--pencil);
  font-size: .8rem;
}
.site-footer span { font-family: var(--display); font-weight: 700; letter-spacing: .05em; color: var(--fairway); text-transform: uppercase; }

/* ---- headings & text ---- */
h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 6.5vw, 2.9rem);
  line-height: 1.02;
  letter-spacing: -.005em;
  margin: .1rem 0 .35rem;
}
h2 { font-family: var(--display); font-weight: 700; font-size: 1.55rem; letter-spacing: .01em; margin: 1.7rem 0 .55rem; }
h3 { font-family: var(--display); font-weight: 700; font-size: 1.2rem; margin: .2rem 0 .4rem; }
p { margin: .45rem 0; }
a { color: var(--fairway); }
strong { font-weight: 600; }

/* ---- admin tab nav ---- */
nav {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  margin: 0 0 1.4rem;
  padding: .35rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  position: sticky;
  top: .5rem;
  z-index: 5;
}
nav a {
  text-decoration: none;
  color: var(--pencil);
  padding: .42rem .9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .92rem;
  white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
nav a:hover { color: var(--fairway); background: var(--green-soft); }
nav a.active { background: var(--fairway); color: #fff; }

/* ---- cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  margin: .85rem 0;
  box-shadow: var(--shadow);
}

/* ---- buttons ---- */
button, .btn {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: .02em;
  font-size: 1.04rem;
  background: var(--fairway);
  color: #fff;
  border: 0;
  border-radius: 11px;
  padding: .6rem 1.2rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 2px 0 rgba(10, 63, 36, .38);
  transition: transform .08s ease, background .15s ease, box-shadow .12s ease;
}
button:hover, .btn:hover { background: var(--fairway-2); transform: translateY(-1px); }
button:active, .btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(10, 63, 36, .38); }
button.ghost, .btn.ghost {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  box-shadow: none; font-family: var(--body); font-weight: 600;
}
button.ghost:hover, .btn.ghost:hover { background: var(--green-soft); border-color: var(--fairway); }

/* ---- form controls ---- */
input, select {
  font-family: var(--body);
  font-size: 1rem;
  padding: .6rem .7rem;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--fairway); outline-offset: 1px; border-color: var(--fairway); }
input[type="time"], input[type="date"], input[type="number"] { font-family: var(--mono); }
label { display: block; font-weight: 500; }
form.inline { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; }
form.inline label {
  flex: 1 1 140px;
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--pencil);
}

/* ---- tables: the tee sheet ---- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
thead th {
  background: var(--rough);
  color: #dceae0;
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .8rem;
}
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line-2); }
td { font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #fafcf8; }
tbody tr:hover { background: var(--green-soft); }

/* ---- chips: scorecard cells & tier pills ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .36rem .8rem;
  margin: .15rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  font-family: var(--body);
  font-weight: 600;
  font-size: .9rem;
  background: #fff;
  color: var(--pencil);
  box-shadow: none;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.chip:hover { border-color: var(--fairway); color: var(--fairway); }
.chip.on { background: var(--fairway); color: #fff; border-color: var(--fairway); }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
label.chip:has(input:checked) { background: var(--fairway); color: #fff; border-color: var(--fairway); }
label.chip:has(input:checked)::before { content: "✓"; font-family: var(--mono); font-weight: 700; margin-right: .1rem; }
label.chip:has(input:focus-visible) { outline: 2px solid var(--flag); outline-offset: 2px; }

/* ---- poll page: scorecard rows ---- */
.poll-row { display: flex; align-items: center; gap: .45rem; padding: .6rem .9rem; }
.poll-row > span:first-child {
  margin-right: auto;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .01em;
}
.poll-row .chip { min-width: 4rem; justify-content: center; padding: .5rem .8rem; font-size: .95rem; }

/* ---- search: grouped-by-course cards ---- */
.course-group { padding: .9rem 1.1rem; }
.cg-head { display: flex; align-items: baseline; gap: .55rem; flex-wrap: wrap; margin-bottom: .5rem; }
.cg-name { font-family: var(--display); font-weight: 700; font-size: 1.3rem; letter-spacing: .01em; }
.cg-count { margin-left: auto; }
.cg-date { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .55rem 0; border-top: 1px solid var(--line-2); }
.cg-date:first-of-type { border-top: 0; }
.cg-date-label { font-family: var(--display); font-weight: 700; color: var(--pencil); min-width: 4.5rem; }
.cg-times { display: flex; flex-wrap: wrap; gap: .3rem; flex: 1; min-width: 0; }
.cg-times .chip { cursor: default; margin: 0; font-family: var(--mono); font-size: .82rem; padding: .28rem .5rem; }
.cg-times .chip:hover { border-color: var(--line); color: var(--pencil); }
.cg-date .btn { margin-left: auto; }

/* ---- misc ---- */
.muted { color: var(--pencil); font-size: .85rem; }
::selection { background: var(--optic); color: var(--ink); }
:focus-visible { outline: 2px solid var(--fairway); outline-offset: 2px; }
a:focus-visible { outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media (max-width: 520px) {
  .brand-tag { display: none; }
  .poll-row { flex-wrap: wrap; }
  nav { border-radius: 16px; }
}
