:root {
  --bg: #f4f1ea;
  --card: #ffffff;
  --ink: #17231c;
  --muted: #66746b;
  --line: #e3ded2;
  --green: #1f5a3a;
  --green-2: #2f7a51;
  --gold: #c8a24a;
  --red: #b23a2e;
  --under: #b23a2e;
  --chip: #eef3ee;
  --shadow: 0 1px 2px rgba(20, 35, 28, .06), 0 4px 16px rgba(20, 35, 28, .05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1612; --card: #17211b; --ink: #e8efe9; --muted: #92a398; --line: #26332b;
    --green: #2f7a51; --green-2: #4fa374; --chip: #1e2b23; --under: #ef7a6c;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0f1612; --card: #17211b; --ink: #e8efe9; --muted: #92a398; --line: #26332b;
    --green: #2f7a51; --green-2: #4fa374; --chip: #1e2b23; --under: #ef7a6c;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 Inter, system-ui, sans-serif; }
.wrap { max-width: 1100px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }

.hero { background: linear-gradient(135deg, #163f29, #1f5a3a 60%, #2f7a51); color: #fff; padding: 28px 0 56px; }
.brand { font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; opacity: .85; display: flex; gap: 8px; align-items: center; }
.hero h1 { text-wrap: balance; font-family: Fraunces, Georgia, serif; font-size: clamp(26px, 5vw, 40px); margin: 6px 0 8px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); padding: 3px 10px; border-radius: 99px; font-size: 13px; }
.pill.live { background: #c8a24a; border-color: #c8a24a; color: #1b1b1b; font-weight: 600; }

.tabs { display: flex; gap: 4px; margin-top: -40px; overflow-x: auto; }
.tabs button { flex: 0 0 auto; border: 0; background: rgba(255,255,255,.12); color: #fff; padding: 10px 16px; border-radius: 10px 10px 0 0; font: 600 14px Inter, sans-serif; cursor: pointer; }
.tabs button.active { background: var(--bg); color: var(--ink); }
.tab { display: none; padding-block: 18px 32px; }
.tab.active { display: block; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.snapbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.snapbar button { border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 5px 12px; border-radius: 99px; cursor: pointer; font: 500 13px Inter; }
.snapbar button.active { background: var(--green); color: #fff; border-color: var(--green); }

.team { margin-bottom: 10px; overflow: hidden; }
.team-head { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; cursor: pointer; }
.rank { font: 700 20px Fraunces, serif; color: var(--muted); text-align: center; }
.team:first-child .rank { color: var(--gold); }
.tname { font-weight: 600; }
.towner { font-size: 13px; color: var(--muted); }
.ttotal { text-align: right; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.ttotal small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.delta { font-size: 12px; font-weight: 600; margin-left: 6px; }
.delta.up { color: var(--green-2); } .delta.down { color: var(--red); }
.roster { display: none; border-top: 1px solid var(--line); }
.team.open .roster { display: block; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; }
tr.mc td { color: var(--muted); }
.under { color: var(--under); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.lb { background: var(--card); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.own { display: inline-block; background: var(--chip); border-radius: 99px; padding: 1px 8px; font-size: 12px; color: var(--muted); }
.cutrow td { background: var(--chip); color: var(--red); font-size: 12px; font-weight: 600; text-align: center; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
input, select { font: 14px Inter; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
input[type=search] { flex: 1; min-width: 180px; }

.picker { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.lineup { padding: 16px; position: sticky; top: 12px; }
.lineup-head { display: flex; justify-content: space-between; }
.label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.big { font: 700 28px Fraunces, serif; }
.big.small { font-size: 20px; text-align: right; }
.big.over { color: var(--red); }
.capbar { height: 6px; background: var(--chip); border-radius: 9px; margin: 10px 0 12px; overflow: hidden; }
#capFill { height: 100%; background: var(--green-2); width: 0; transition: width .2s; }
#capFill.over { background: var(--red); }
#slots { list-style: none; padding: 0; margin: 0 0 12px; }
#slots li { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; margin-bottom: 6px; min-height: 40px; font-size: 14px; }
#slots li.filled { border-style: solid; background: var(--chip); }
#slots li .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.lineup input { width: 100%; margin-bottom: 8px; }
.row { display: flex; gap: 8px; }
button.primary, button.ghost { flex: 1; padding: 10px; border-radius: 10px; font: 600 14px Inter; cursor: pointer; }
button.primary { background: var(--green); color: #fff; border: 0; }
button.primary:disabled { opacity: .45; cursor: not-allowed; }
button.ghost { background: none; border: 1px solid var(--line); color: var(--ink); }
.field { padding: 12px; }
.fieldtbl tr { cursor: pointer; }
.fieldtbl tr:hover td { background: var(--chip); }
.fieldtbl tr.picked td { background: var(--chip); font-weight: 600; }
.fieldtbl tr.cant td { opacity: .4; }
.add { border: 1px solid var(--green-2); color: var(--green-2); background: none; border-radius: 8px; padding: 2px 10px; font-weight: 700; cursor: pointer; }
tr.picked .add { background: var(--green-2); color: #fff; }

.season-table { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
footer { padding-block: 24px 40px; }

@media (max-width: 760px) {
  .picker { grid-template-columns: 1fr; }
  .lineup { position: static; }
  .hide-sm { display: none; }
}

tr.bench td { color: var(--muted); }
.counts-tag { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; background: var(--green-2); color: #fff; border-radius: 99px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }

/* ---------- Site navigation (all pages) ---------- */
.art-only { display: none; }
.topnav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.topnav a { color: #fff; text-decoration: none; }
.topnav .brand { opacity: 1; }
.topnav .links { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav .links a { font-size: 14px; font-weight: 500; padding: 6px 12px; border-radius: 99px; opacity: .85; }
.topnav .links a:hover, .topnav .links a[aria-current="page"] { opacity: 1; background: rgba(255,255,255,.14); }
.topnav .links a.cta-link { background: var(--gold); color: #1b1b1b; opacity: 1; font-weight: 600; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Home ---------- */
.hero.home { padding-block: 28px 64px; }
.hero.home h1 { font-size: clamp(32px, 6vw, 56px); max-width: 16ch; line-height: 1.05; margin-top: 10px; }
.lede { font-size: 18px; max-width: 54ch; opacity: .92; margin: 0 0 22px; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 12px 20px; border-radius: 10px; font-weight: 600; text-decoration: none; font-size: 15px; }
.btn.gold { background: var(--gold); color: #1b1b1b; }
.btn.line { border: 1px solid rgba(255,255,255,.45); color: #fff; }
.section { padding-block: 36px 8px; }
.section h2 { font: 700 clamp(24px, 4vw, 32px)/1.15 Fraunces, Georgia, serif; margin: 0 0 6px; text-wrap: balance; }
.section > p.sub { color: var(--muted); margin: 0 0 20px; max-width: 62ch; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; counter-reset: step; }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; counter-increment: step; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.steps li::before { content: counter(step); font: 700 15px Fraunces, serif; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); color: var(--green-2); }
.steps .when { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--green-2); font-weight: 600; }
.steps h3 { margin: 0; font-size: 17px; }
.steps p { margin: 0; color: var(--muted); font-size: 14px; }
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
.split > * { min-width: 0; }
.formula { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.formula .eq { font: 600 17px/1.5 Inter, sans-serif; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 14px; }
.frac { display: inline-flex; flex-direction: column; align-items: center; font-size: 14px; }
.frac span:first-child { border-bottom: 2px solid var(--ink); padding: 0 6px 2px; }
.frac span:last-child { padding: 2px 6px 0; }
.example { background: var(--chip); border-radius: 10px; padding: 12px 14px; font-size: 14px; font-variant-numeric: tabular-nums; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.facts li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.facts li:last-child { border-bottom: 0; }
.facts b { text-align: right; }
.payouts { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.payouts h3 { margin: 0 0 4px; font-size: 16px; }
.payouts p { margin: 0; color: var(--muted); font-size: 14px; }
.notice { border-left: 3px solid var(--gold); padding: 10px 14px; background: var(--chip); border-radius: 0 10px 10px 0; font-size: 14px; }

/* ---------- Forms (sign up / admin) ---------- */
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field-row { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-row label { font-size: 13px; font-weight: 600; }
.field-row input { width: 100%; }
.field-row .hint { font-size: 12px; color: var(--muted); }
.field-row .err { font-size: 12px; color: var(--red); min-height: 0; }
.field-row.bad input { border-color: var(--red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.banner { padding: 14px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 15px; }
.banner.ok { background: color-mix(in srgb, var(--green-2) 15%, var(--card)); border: 1px solid var(--green-2); }
.banner.bad { background: color-mix(in srgb, var(--red) 12%, var(--card)); border: 1px solid var(--red); }
.banner a { color: inherit; font-weight: 600; word-break: break-all; }
.who-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.who-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; min-width: 120px; }
.stat b { display: block; font: 700 24px Fraunces, serif; }
.admin-table td { vertical-align: top; }
.team-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--chip); border-radius: 99px; padding: 2px 4px 2px 10px; margin: 0 4px 4px 0; font-size: 13px; }
.team-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 4px; }
.team-chip.confirm { background: color-mix(in srgb, var(--red) 15%, var(--card)); }
.small-btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 6px 12px; font: 500 13px Inter; cursor: pointer; }
@media (max-width: 760px) {
  .split, .form-grid { grid-template-columns: 1fr; }
}

.btn.ghost-dark { border: 1px solid var(--line); color: var(--ink); background: var(--card); }

/* Pick8Pool logo */
.topnav .brand { text-transform: none; letter-spacing: 0; font: 700 18px Fraunces, Georgia, serif; gap: 10px; }
.brand-logo { width: 36px; height: auto; background: #fff; border-radius: 8px; padding: 3px; box-sizing: content-box; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; }
.hero-copy { min-width: 0; }
.hero-logo { background: #fff; border-radius: 20px; padding: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.hero-logo img { display: block; width: clamp(180px, 24vw, 300px); height: auto; }
@media (max-width: 720px) {
  .hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .hero-logo { order: -1; justify-self: start; padding: 12px; border-radius: 16px; }
  .hero-logo img { width: 160px; }
}

/* lineups, withdrawals, winners */
#teamPick { width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; margin: 4px 0 10px; }
.wd-tag { font-size: 10px; font-weight: 700; letter-spacing: .04em; color: #fff; background: #b4372f; padding: 1px 5px; border-radius: 4px; vertical-align: 1px; }
.ok-text { color: var(--accent, #1f5a3a); }
.err-text { color: #b4372f; }
.winners { padding: 14px 16px; margin-bottom: 14px; border: 1px solid var(--gold); }
.winners ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.winners li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.winners .wtotal { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.medal { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; color: #1b1b1b; }
.medal.m1 { background: #e2b33c; } .medal.m2 { background: #c9ccd1; } .medal.m3 { background: #d39a64; }
.jobs { padding: 14px 16px; margin: 0 0 16px; display: grid; gap: 10px; }
.jobs .row { display: flex; gap: 8px; flex-wrap: wrap; }
.jobs pre { white-space: pre-wrap; margin: 0; background: var(--bg); padding: 10px; border-radius: 8px; }

/* season schedule */
table.schedule td { vertical-align: top; }
table.schedule tr.past td { opacity: .6; }
.nowrap { white-space: nowrap; }
.kind { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; margin-left: 4px; vertical-align: 1px; background: var(--line); color: var(--ink); }
.kind.k-major { background: var(--gold); color: #1b1b1b; }
.kind.k-signature { background: #1f5a3a; color: #fff; }
.kind.k-playoffs { background: #2c4a6e; color: #fff; }
.pill-now { font-size: 11px; font-weight: 700; color: #1b1b1b; background: var(--gold); padding: 2px 8px; border-radius: 99px; }
table.schedule td:nth-child(3) { white-space: normal; min-width: 0; }
@media (max-width: 600px) {
  table.schedule { font-size: 13px; }
  table.schedule th:first-child, table.schedule td:first-child { display: none; }
  table.schedule td, table.schedule th { padding-inline: 6px; }
  table.schedule .kind { display: none; }
  table.schedule th { white-space: normal; }
}

/* member pages */
.you-tag { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--gold); color: #1b1b1b; padding: 1px 6px; border-radius: 4px; margin-left: 6px; vertical-align: 2px; }
.team.mine { border-color: var(--gold); }
table.ytd tr.mine td { background: color-mix(in srgb, var(--gold) 14%, transparent); }
.week-pick { display: flex; flex-direction: column; gap: 4px; max-width: 360px; margin-bottom: 6px; }
.week-pick span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.week-pick select { padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; font: inherit; }
.week-pick select option { color: #1b1b1b; }
table.ytd td:nth-child(2) { white-space: normal; }
@media (max-width: 600px) {
  table.ytd { font-size: 13px; }
  table.ytd td, table.ytd th { padding-inline: 6px; }
  table.ytd th { white-space: normal; }
  table.ytd td:nth-child(2) .muted { display: block; }
}

/* leaderboard: golfers on the logged-in member's team */
.lb tr.my-golfer td { background: color-mix(in srgb, var(--gold) 16%, transparent); }
.lb tr.my-golfer td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.yours-tag { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: #ff8c00; color: #0b1f4b; padding: 2px 7px; border-radius: 4px; margin-left: 6px; vertical-align: 1px; white-space: nowrap; }

/* college logos */
.clogo { display: inline-block; width: 18px; height: 18px; object-fit: contain; vertical-align: -4px; margin-right: 7px; }
/* phones: the lineup builder's columns must be able to shrink to the screen */
.picker > * { min-width: 0; }
#slots li > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) {
  .lineup-head { gap: 12px; }
  .big { font-size: 24px; }
}
