:root {
  --ink: #17201b;
  --muted: #647067;
  --line: #d9e1da;
  --paper: #fbfcf8;
  --panel: #ffffff;
  --green: #176d43;
  --green-dark: #0d4f30;
  --gold: #c58b28;
  --red: #b43232;
  --blue: #315f8c;
  --shadow: 0 18px 50px rgba(23, 32, 27, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input, textarea { font: inherit; }
button, .button, .file-button {
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  text-decoration: none;
  font-weight: 760;
}
button.secondary, .button.secondary { background: var(--blue); }
button.ghost { background: #eef3ef; color: var(--ink); }
button.primary { width: 100%; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
}
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
}
label { display: grid; gap: 7px; font-size: 0.9rem; font-weight: 720; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1; }
h2 { font-size: 1.35rem; margin-bottom: 0.25rem; }
h3 { font-size: 1rem; margin-bottom: 0.75rem; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); min-height: 1.4em; }
.eyebrow { color: var(--gold); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0; font-weight: 850; margin-bottom: 0.35rem; }
.stack { display: grid; gap: 14px; }

.landing-body {
  min-height: 100vh;
  background: #f7f8f2;
}
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(18px, calc((100vw - 1180px) / 2));
  background: rgba(247, 248, 242, 0.94);
  border-bottom: 1px solid rgba(217, 225, 218, 0.9);
  backdrop-filter: blur(10px);
}
.brand-mark {
  color: var(--green-dark);
  font-weight: 950;
  text-decoration: none;
}
.landing-nav nav { display: flex; gap: 16px; flex-wrap: wrap; }
.landing-nav a { color: var(--ink); text-decoration: none; font-weight: 760; }
.event-hero {
  position: relative;
  min-height: min(760px, calc(100vh - 64px));
  display: grid;
  align-items: end;
  overflow: hidden;
  background: #203520;
}
.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15, 31, 19, 0.84) 0%, rgba(15, 31, 19, 0.58) 42%, rgba(15, 31, 19, 0.12) 100%),
    url("/assets/bottlebrush-hero.png") center right / cover no-repeat;
}
.fairway-line, .pin, .green { display: none; }
.hero-content {
  position: relative;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 0 0 92px;
  color: #fff;
}
.hero-content h1 {
  max-width: 720px;
  font-size: clamp(3rem, 8vw, 6.6rem);
  line-height: 0.92;
  margin-bottom: 18px;
}
.hero-copy {
  max-width: 620px;
  font-size: 1.24rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.88);
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.quick-facts {
  width: min(1180px, calc(100% - 36px));
  margin: -44px auto 0;
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.quick-facts div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.quick-facts span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}
.quick-facts strong { display: block; margin-top: 7px; font-size: 1.12rem; }
.content-band, .registration-section {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 78px 0 0;
}
.section-head { max-width: 720px; margin-bottom: 22px; }
.section-head h2, .content-band h2, .registration-copy h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.02;
  margin-bottom: 14px;
}
.format-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.format-grid article, .course-note, .cost-box, .note-list p {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 12px 35px rgba(23, 32, 27, 0.08);
}
.format-grid article span {
  color: var(--gold);
  font-weight: 900;
  font-size: 0.82rem;
  text-transform: uppercase;
}
.format-grid article h3 { font-size: 1.4rem; margin: 10px 0; }
.split-band {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 34px;
  align-items: start;
}
.timeline {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 10px;
}
.timeline li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.timeline span { color: var(--muted); }
.course-note a { color: var(--green-dark); font-weight: 900; }
.note-list { display: grid; gap: 10px; }
.registration-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
  gap: 34px;
  padding-bottom: 80px;
}
.registration-copy p {
  color: var(--muted);
  line-height: 1.55;
}
.cost-box {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  background: #fff9eb;
}
.cost-box span { color: var(--muted); line-height: 1.45; }
.registration-form {
  display: grid;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.landing-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding: 24px max(18px, calc((100vw - 1180px) / 2));
  color: var(--muted);
}
.landing-footer a { color: var(--green-dark); font-weight: 900; }

.admin-body { min-height: 100vh; background: #f2f5ef; }
.admin-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0; }
.login-panel {
  min-height: calc(100vh - 56px);
  display: grid;
  align-content: center;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 48px;
}
.login-panel form, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.admin-grid { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
.panel-head { display: flex; justify-content: space-between; align-items: center; }
.event-list { display: grid; gap: 10px; }
.event-card {
  width: 100%;
  min-height: auto;
  justify-content: flex-start;
  background: #f7faf6;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 14px;
  text-align: left;
}
.event-card.active { background: var(--green); color: #fff; border-color: var(--green); }
.event-card strong { display: block; }
.event-card span { display: block; font-weight: 500; opacity: 0.78; margin-top: 4px; }
.event-title-row, .actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.stats-row div {
  background: #f6f8f3;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.stats-row strong { display: block; font-size: 1.8rem; line-height: 1; }
.stats-row span { display: block; color: var(--muted); margin-top: 6px; font-size: 0.86rem; }
.file-button { position: relative; overflow: hidden; background: var(--green-dark); }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.cards { display: grid; gap: 10px; }
.mini-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.mini-card-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.copy-row input { font-size: 0.82rem; }
.pill { display: inline-flex; align-items: center; min-height: 24px; border-radius: 999px; padding: 0 9px; background: #edf5ef; color: var(--green-dark); font-size: 0.78rem; font-weight: 800; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.round-manager {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcf8;
}
.round-head, .assignment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.round-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.round-tabs button.active { background: var(--green); color: #fff; }
.assignment-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}
.hole-drop {
  min-height: 170px;
  border: 1px dashed #b9c7bc;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}
.hole-drop.drag-over { border-color: var(--green); background: #f1f8f2; }
.hole-drop h4 {
  margin: 0 0 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.92rem;
}
.hole-drop h4 span { color: var(--muted); font-weight: 700; }
.hole-drop.unassigned { background: #f8f6f1; }
.drop-list { display: grid; gap: 8px; min-height: 52px; }
.team-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  cursor: grab;
}
.team-chip:active { cursor: grabbing; }
.team-chip strong, .team-chip span { display: block; }
.team-chip span {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 3px;
}
.copy-row.compact { grid-template-columns: 1fr 70px; margin-top: 9px; }
.copy-row.compact input, .copy-row.compact button { min-height: 34px; font-size: 0.75rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f7faf6; color: #334039; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0; }
tr:last-child td { border-bottom: 0; }

.score-body {
  min-height: 100vh;
  background: #f7f8f2;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
.score-shell { max-width: 560px; margin: 0 auto; padding: 12px 12px 22px; }
.score-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 2px 12px;
}
.score-event { margin: 0; font-weight: 900; font-size: 1.12rem; }
.icon-button {
  width: 52px;
  min-height: 52px;
  border-radius: 50%;
  padding: 0;
  font-size: 2rem;
  background: #e9efe9;
  color: var(--ink);
}
.hole-card {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr 1fr;
  gap: 8px;
  background: var(--green-dark);
  color: #fff;
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.hole-card div {
  min-height: 92px;
  display: grid;
  align-content: center;
  justify-items: center;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
}
.hole-card .label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 850;
  opacity: 0.78;
}
.hole-card strong { display: block; font-size: clamp(2.2rem, 16vw, 4.8rem); line-height: 0.95; }
.score-list { display: grid; gap: 10px; margin-top: 14px; }
.score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 86px 58px;
  gap: 8px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.player-name { font-weight: 900; font-size: 1rem; line-height: 1.1; }
.player-name span { display: block; color: var(--muted); font-size: 0.76rem; font-weight: 720; margin-top: 3px; }
.score-row button {
  min-height: 58px;
  border-radius: 8px;
  padding: 0;
  font-size: 2rem;
  background: #eaf1ea;
  color: var(--ink);
}
.score-row button.plus { background: var(--green); color: #fff; }
.score-value {
  min-height: 64px;
  border: 2px solid var(--green);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 2.35rem;
  line-height: 1;
  font-weight: 950;
  background: #fafffb;
}
.score-value.empty { color: #9aa59c; border-color: var(--line); }
.submit-hole {
  width: 100%;
  min-height: 64px;
  margin-top: 14px;
  font-size: 1.18rem;
  background: var(--gold);
  color: #17130b;
}
.save-status { min-height: 1.5em; text-align: center; color: var(--green-dark); font-weight: 780; }
.score-state, .drawer-screen {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.drawer-screen h1 { font-size: 1.6rem; }
.leaderboard-list { display: grid; gap: 8px; }
.leader-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.leader-row strong { display: block; }
.leader-row span { color: var(--muted); font-size: 0.82rem; }
.to-par { font-size: 1.3rem; font-weight: 950; color: var(--green-dark); }
.help-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  margin-bottom: 10px;
}
.bottom-tray {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px max(8px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
  background: rgba(255,255,255,0.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 35px rgba(23,32,27,0.12);
}
.bottom-tray button {
  min-height: 58px;
  display: grid;
  gap: 2px;
  align-content: center;
  padding: 0;
  background: #eef2ee;
  color: var(--ink);
  font-size: 0.76rem;
}
.bottom-tray button span { font-size: 1rem; font-weight: 950; }
.bottom-tray button.active { background: var(--green); color: #fff; }

@media (max-width: 820px) {
  .admin-shell { width: min(100% - 20px, 720px); padding: 14px 0; }
  .login-panel, .admin-grid, .two-col { grid-template-columns: 1fr; }
  .login-panel { min-height: calc(100vh - 28px); gap: 18px; }
  .stats-row, .assignment-board { grid-template-columns: 1fr; }
  .event-title-row { align-items: flex-start; }
  .landing-nav { align-items: flex-start; flex-direction: column; }
  .event-hero { min-height: 680px; }
  .hero-media { background-position: center; }
  .hero-content { padding-bottom: 78px; }
  .quick-facts, .format-grid, .split-band, .registration-section, .form-row { grid-template-columns: 1fr; }
  .quick-facts { margin-top: 14px; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 390px) {
  .score-row { grid-template-columns: minmax(0, 1fr) 52px 76px 52px; }
  .score-value { font-size: 2rem; }
  .score-row button { min-height: 54px; }
}
