:root {
  --pine: #123526;
  --pine-2: #1c4d36;
  --fairway: #2f7d4e;
  --gold: #c6a15a;
  --gold-2: #8c6a2f;
  --paper: #f3efe4;
  --card: #fffdf8;
  --ink: #1c2418;
  --muted: #5e6758;
  --line: #e4dccb;
  --birdie: #1f7a4d;
  --bogey: #a33b24;
  --eagle: #8a6414;
  --shadow: 0 10px 30px rgba(18, 53, 38, 0.12);
  font-family: Outfit, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 400px at 50% -80px, #1f5a3c 0%, transparent 60%),
    var(--paper);
  color: var(--ink);
  min-height: 100vh;
  padding-bottom: 32px;
}
button, input { font: inherit; }
button { cursor: pointer; }
.app { max-width: 720px; margin: 0 auto; }

.top {
  background: linear-gradient(180deg, var(--pine) 0%, var(--pine-2) 100%);
  color: #f7f3e8;
  padding: 22px 18px 16px;
  border-bottom: 4px solid var(--gold);
}
.eyebrow {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--gold);
  margin: 0 0 6px;
}
.top h1 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 680;
  font-size: 30px;
  line-height: 1.05;
  margin: 0;
}
.course-line { margin: 8px 0 0; color: #d7e4d8; font-size: 13px; }
.live-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: #d7e4d8; }
.dot {
  width: 9px; height: 9px; border-radius: 50%; background: #8d8d8d; display: inline-block;
}
.dot.on { background: #7dffa8; box-shadow: 0 0 0 4px rgba(125, 255, 168, 0.18); }

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 12px 12px 0;
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(243, 239, 228, 0.92);
  backdrop-filter: blur(8px);
}
.tabs button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 4px;
  font-weight: 600;
  font-size: 13px;
}
.tabs button.on {
  background: var(--pine);
  color: #f7f3e8;
}

#view, #sheet-body { padding: 12px; }
.banner {
  background: #fff4df;
  border: 1px solid #efd3a0;
  color: #6d4b12;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 14px;
}
.banner.error { background: #fde8e4; border-color: #f0c2b8; color: #7a2c1c; }

.team-row {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 8px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  color: inherit;
}
.team-row:active { transform: scale(0.995); }
.rank {
  font-family: Fraunces, Georgia, serif;
  font-size: 20px;
  color: var(--gold-2);
}
.name { font-weight: 700; font-size: 16px; }
.members { color: var(--muted); font-size: 13px; margin-top: 3px; line-height: 1.35; }
.scorebox { text-align: right; min-width: 64px; }
.rel {
  font-family: Fraunces, Georgia, serif;
  font-size: 26px;
  line-height: 1;
}
.rel.under { color: var(--birdie); }
.rel.over { color: var(--bogey); }
.rel.even { color: var(--ink); }
.rel.none { color: #9aa192; font-size: 22px; }
.thru { color: var(--muted); font-size: 12px; margin-top: 3px; }
.gross { color: var(--muted); font-size: 11px; }

.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
h2 {
  font-family: Fraunces, Georgia, serif;
  font-size: 22px;
  margin: 0 0 8px;
}
label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 4px; }
input[type="text"], input[type="password"], input[type="number"], select {
  width: 100%;
  border: 1px solid #d9d0be;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
}
.btn {
  border: 0;
  background: var(--fairway);
  color: white;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  width: 100%;
  margin-top: 10px;
}
.btn.gold { background: var(--gold-2); }
.btn.ghost {
  background: transparent;
  color: var(--pine);
  border: 1px solid var(--line);
}
.btn.danger { background: #8d3324; }
.btn.small { width: auto; padding: 8px 10px; margin: 0; font-size: 13px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.hole {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.hole b { font-size: 16px; }
.hole .meta { color: var(--muted); font-size: 12px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button, .clear-hole {
  width: 48px; height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 26px;
  line-height: 1;
}
.gross-num { min-width: 52px; text-align: center; }
.gross-num strong { display: block; font-size: 22px; font-family: Fraunces, Georgia, serif; }
.gross-num small { color: var(--muted); font-size: 11px; }
.gross-num small.under, .side .under { color: var(--birdie); }
.gross-num small.over, .side .over { color: var(--bogey); }
.gross-num small.eagle { color: var(--eagle); }
.side {
  display: flex; justify-content: space-between;
  background: #f7f1e3; border-radius: 12px; padding: 10px 12px; margin: 8px 0;
  font-weight: 700;
}
.readonly-note {
  background: #eef4ea;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 14px;
}

.sheet {
  position: fixed; inset: 0;
  background: rgba(18, 30, 20, 0.45);
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet.hidden { display: none; }
.sheet-card {
  background: var(--paper);
  width: min(720px, 100%);
  max-height: 92vh;
  overflow: auto;
  border-radius: 20px 20px 0 0;
  padding-bottom: 18px;
}
.sheet-head {
  position: sticky; top: 0;
  background: var(--paper);
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px;
  padding: 14px 14px 8px;
  border-bottom: 1px solid var(--line);
}
.x {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: white; font-size: 20px;
}

.chips { display: flex; gap: 6px; overflow: auto; padding-bottom: 8px; }
.chips button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 8px 10px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}
.chips button.on { background: var(--pine); color: white; border-color: var(--pine); }
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.shot {
  background: white;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.shot img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #ddd; }
.shot figcaption { padding: 8px; font-size: 12px; }
.shot strong { display: block; }

.admin-team {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 10px;
}
.foot {
  color: var(--muted);
  font-size: 12px;
  padding: 4px 16px 20px;
  line-height: 1.45;
}
@media (min-width: 760px) {
  .sheet { align-items: center; }
  .sheet-card { border-radius: 20px; max-height: 86vh; }
}

.home-link { color: var(--gold); text-decoration: none; }
.home-link:hover { text-decoration: underline; }
.site { max-width: 760px; margin: 0 auto; }
.hero {
  background:
    radial-gradient(420px 180px at 100% 0%, rgba(198, 161, 90, 0.35), transparent 70%),
    linear-gradient(165deg, var(--pine) 0%, #1a4632 55%, #245c40 100%);
  color: #f7f3e8;
  padding: 28px 20px 32px;
  border-bottom: 4px solid var(--gold);
}
.hero h1 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 680;
  font-size: 40px;
  line-height: 1.02;
  margin: 0 0 12px;
  max-width: 14ch;
}
.lede { font-size: 18px; line-height: 1.45; margin: 0 0 18px; color: #e7f0e6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-actions a, .cta a.btn {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
}
.hero-actions a.primary { background: var(--gold); color: #1c2418; }
.hero-actions a.quiet {
  background: transparent;
  color: #f7f3e8;
  border: 1px solid rgba(247, 243, 232, 0.45);
}
.band { padding: 8px 16px 4px; }
.band h2 {
  font-family: Fraunces, Georgia, serif;
  font-size: 26px;
  margin: 18px 0 8px;
}
.steps { display: grid; gap: 8px; }
.step-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: start;
}
.num {
  font-family: Fraunces, Georgia, serif;
  color: var(--gold-2);
  font-size: 22px;
  line-height: 1;
}
.step-card h3, .benefit h3 { margin: 0 0 4px; font-size: 16px; }
.step-card p, .benefit p, .band > p { margin: 0; color: var(--muted); line-height: 1.45; }
.benefits, .fun-grid { display: grid; gap: 8px; }
.benefit, .fun-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.fun-card strong { display: block; margin-bottom: 4px; }
.jump {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 10px;
}
.jump a {
  display: block;
  text-decoration: none;
  background: var(--pine);
  color: #f7f3e8;
  border-radius: 14px;
  padding: 14px;
  font-weight: 700;
}
.jump a span { display: block; font-weight: 500; color: #d7e4d8; font-size: 13px; margin-top: 3px; }
.cta {
  margin: 18px 16px 28px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.cta h2 { margin-top: 0; }
.placeholder {
  margin-top: 12px;
  background: #fff4df;
  border: 1px dashed #e0c27a;
  border-radius: 12px;
  padding: 10px 12px;
  color: #6d4b12;
  font-size: 14px;
}
@media (min-width: 700px) {
  .hero h1 { font-size: 52px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .benefits { grid-template-columns: 1fr 1fr; }
  .jump { grid-template-columns: 1fr 1fr 1fr; }
}

.home-bar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 4px 12px;
  background: var(--pine);
}
.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--gold);
  color: #1c2418;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
}
.home-ico { display: block; flex: none; }
.tabs { top: 52px; }
.sheet-titles { flex: 1; min-width: 0; }
.sheet-head .home-btn { flex: none; }
