/* Upset Pool — turf, chalk and kumquat. Display: Big Shoulders Display. Text: Barlow. */
@font-face { font-family: "Big Shoulders"; src: url("/fonts/big-shoulders-display-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Big Shoulders"; src: url("/fonts/big-shoulders-display-latin-900-normal.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/barlow-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/barlow-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/barlow-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --turf: #1e4d2f;
  --turf-stripe: #23573a;
  --turf-deep: #163b24;
  --chalk: #fafaf5;
  --paper: #edf1ea;
  --card: #f8faf6;
  --ink: #15261b;
  --muted: #56665b;
  --rule: #c9d4c7;
  --kumquat: #f2861e;
  --kumquat-ink: #9c4800;
  --kumquat-soft: #fde6cd;
  --loss: #a8352d;
  --display: "Big Shoulders", "Arial Narrow", sans-serif;
  --text: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.65rem;
  --step-3: 2.1rem;
  --step-4: 2.75rem;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--text); font-size: var(--step-0); line-height: 1.5; color: var(--ink); background: var(--paper); }
img { max-width: 100%; }
a { color: var(--turf); text-underline-offset: 2px; }
a:hover { color: var(--kumquat-ink); }
:focus-visible { outline: 3px solid var(--kumquat); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 900; line-height: 1; margin: 0 0 .5rem; letter-spacing: .005em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); font-weight: 700; }
p { margin: 0 0 1rem; max-width: 68ch; }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons and forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1.1rem; border-radius: 999px; border: 2px solid var(--turf); background: var(--turf); color: var(--chalk); font: 600 var(--step-0) var(--text); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--turf-deep); color: var(--chalk); }
.btn.go { background: var(--kumquat); border-color: var(--kumquat); color: var(--ink); }
.btn.go:hover { background: #ff9733; color: var(--ink); }
.btn.ghost { background: transparent; color: var(--turf); }
.btn.ghost:hover { background: rgba(30, 77, 47, .08); color: var(--turf); }
.btn.chalk { background: transparent; border-color: var(--chalk); color: var(--chalk); }
.btn.chalk:hover { background: rgba(250, 250, 245, .12); }
.btn.small { min-height: 36px; padding: .3rem .8rem; font-size: var(--step--1); }
.btn.danger { background: transparent; border-color: var(--loss); color: var(--loss); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--turf); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

label { display: block; font-weight: 600; margin: 0 0 .3rem; }
input[type=text], input[type=email], input[type=password], input[type=number], select {
  width: 100%; min-height: 44px; padding: .5rem .7rem; font: 400 var(--step-0) var(--text); color: var(--ink);
  background: #fff; border: 1.5px solid var(--rule); border-radius: 8px;
}
input:focus, select:focus { border-color: var(--turf); outline: none; box-shadow: 0 0 0 3px rgba(242, 134, 30, .35); }
.field { margin: 0 0 1rem; }
.hint { font-size: var(--step--1); color: var(--muted); margin-top: .25rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.choice { display: flex; gap: .6rem; }
.choice label { flex: 1; display: flex; gap: .5rem; align-items: center; padding: .7rem .9rem; border: 1.5px solid var(--rule); border-radius: 8px; background: #fff; cursor: pointer; font-weight: 500; }
.choice input { accent-color: var(--turf); width: 18px; height: 18px; }
.choice label:has(input:checked) { border-color: var(--turf); box-shadow: inset 0 0 0 1px var(--turf); }
.error { color: var(--loss); font-weight: 600; margin: .5rem 0; }

/* ---------- landing page ---------- */
.field-bg {
  background-color: var(--turf);
  background-image: repeating-linear-gradient(90deg, var(--turf) 0 80px, var(--turf-stripe) 80px 160px);
  color: var(--chalk);
}
.site-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem clamp(1rem, 4vw, 3rem); }
.wordmark { font-family: var(--display); font-weight: 900; font-size: 1.6rem; color: var(--chalk); text-decoration: none; letter-spacing: .01em; display: inline-flex; gap: .45rem; align-items: center; }
.wordmark:hover { color: var(--chalk); }
.wordmark svg { width: 30px; height: 30px; }
.site-head nav a { color: var(--chalk); font-weight: 600; margin-left: 1.2rem; }

.hero { padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem) 0; max-width: 1200px; }
.hero h1 { font-size: clamp(4rem, 15vw, 9.5rem); line-height: .86; margin: 0 0 1.25rem; color: var(--chalk); }
.hero .lede { font-size: var(--step-1); max-width: 36ch; color: #e8efe6; margin-bottom: 1.6rem; }
.hero .row { margin-bottom: 2.5rem; }

/* The points field: drag the football along the spread and watch what a win is worth. */
.pointsfield { position: relative; margin: 1rem 0 0; padding: 0 clamp(1rem, 4vw, 3rem) 2.5rem; max-width: 1200px; }
.pf-readout { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.pf-readout .pf-points { font-family: var(--display); font-weight: 900; font-size: clamp(3.5rem, 10vw, 6rem); line-height: .9; color: var(--kumquat); font-variant-numeric: tabular-nums; min-width: 2.2ch; }
.pf-readout .pf-words { font-size: var(--step-1); color: var(--chalk); max-width: 30ch; }
.pf-track { position: relative; height: 112px; border-top: 3px solid var(--chalk); border-bottom: 3px solid var(--chalk); }
.pf-mark { position: absolute; top: 0; bottom: 0; left: calc(29px + (100% - 58px) * var(--p)); pointer-events: none; }
.pf-mark::before { content: ""; position: absolute; top: 38px; bottom: 30px; left: -1px; border-left: 2px solid rgba(250, 250, 245, .55); }
.pf-mark.zero::before { border-left: 3px solid var(--chalk); left: -1.5px; }
.pf-mark b { position: absolute; top: 8px; left: 0; transform: translateX(-50%); font: 900 1.35rem var(--display); color: rgba(250, 250, 245, .92); white-space: nowrap; }
.pf-mark em { position: absolute; bottom: 8px; left: 0; transform: translateX(-50%); font: 600 .78rem var(--text); font-style: normal; color: rgba(250, 250, 245, .78); white-space: nowrap; }
.pf-ends { display: flex; justify-content: space-between; font-size: var(--step--1); color: #d7e3d5; margin-top: .45rem; }
.pf-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: grab; }
.pf-range:active { cursor: grabbing; }
.pf-range::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.pf-range::-moz-range-track { height: 100%; background: transparent; }
.pf-range::-webkit-slider-thumb { -webkit-appearance: none; width: 58px; height: 36px; margin-top: 35px; border: 0; background: url("/ball.svg") center / contain no-repeat; filter: drop-shadow(0 3px 2px rgba(0,0,0,.35)); }
.pf-range::-moz-range-thumb { width: 58px; height: 36px; border: 0; border-radius: 0; background: url("/ball.svg") center / contain no-repeat; }
.pf-range:focus-visible { outline: 3px solid var(--kumquat); outline-offset: 4px; }

.band { padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 4vw, 3rem); max-width: 1200px; }
.band h2 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 1.25rem; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: step; }
.steps li { counter-increment: step; padding-top: .9rem; border-top: 3px solid var(--turf); }
.steps li::before { content: counter(step); display: block; font: 900 3rem/1 var(--display); color: var(--kumquat-ink); margin-bottom: .4rem; }
.steps h3 { font-size: var(--step-2); }
.examples { width: 100%; max-width: 640px; border-collapse: collapse; margin: 1rem 0 1.5rem; }
.examples th, .examples td { text-align: left; padding: .55rem .4rem; border-bottom: 1px solid var(--rule); }
.examples th { font-size: var(--step--1); color: var(--muted); font-weight: 600; }
.examples td.num { font-size: 1.5rem; font-weight: 900; text-align: right; }
.examples th:last-child { text-align: right; }
.split { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.faq dt { font-weight: 600; font-size: var(--step-1); margin-top: 1.25rem; }
.faq dd { margin: .3rem 0 0; max-width: 68ch; }
.site-foot { padding: 2rem clamp(1rem, 4vw, 3rem) 3rem; color: var(--muted); font-size: var(--step--1); border-top: 1px solid var(--rule); }
.site-foot p { margin: 0 0 .4rem; }

/* ---------- app shell ---------- */
.topbar { background: var(--turf); color: var(--chalk); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: 1000px; margin: 0 auto; padding: .6rem 1rem; }
.topbar a, .topbar button.linkbtn { color: var(--chalk); }
.topbar .wordmark { font-size: 1.35rem; }
.topbar .wordmark svg { width: 24px; height: 24px; }
.topbar nav { display: flex; gap: 1rem; align-items: center; font-weight: 500; }
main.app { max-width: 1000px; margin: 0 auto; padding: 1.25rem 1rem 5rem; }
main.narrow { max-width: 460px; margin: 0 auto; padding: 2rem 1rem; }
body.plain { background: var(--paper); }

.panel { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.1rem 1.1rem 1.2rem; margin-bottom: 1.25rem; }
.panel h2 { font-size: var(--step-2); }
.panel > .head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.panel > .head h2 { margin: 0; }

.poolhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.poolhead h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); margin: 0; }
.poolhead .meta { color: var(--muted); }
.weeknav { display: flex; align-items: center; gap: .35rem; }
.weeknav select { width: auto; min-width: 10rem; font-weight: 600; }
.weeknav .btn { min-width: 44px; padding: 0; }
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--rule); margin-bottom: 1.2rem; overflow-x: auto; }
.tabs a { padding: .55rem .9rem; font-weight: 600; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--kumquat); }

/* My pick strip */
.mypick { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: space-between; background: var(--turf); color: var(--chalk); border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: 1.25rem; }
.mypick .who { display: flex; align-items: center; gap: .75rem; }
.mypick .who img { width: 44px; height: 44px; }
.mypick .big { font: 900 2rem/1 var(--display); }
.mypick .sub { color: #dfe9dd; font-size: var(--step--1); }
.mypick .pts { font: 900 2.4rem/1 var(--display); color: var(--kumquat); font-variant-numeric: tabular-nums; text-align: right; }
.mypick .pts small { display: block; font: 500 var(--step--1) var(--text); color: #dfe9dd; }

/* Leaderboard */
.board { width: 100%; border-collapse: collapse; }
.board th { text-align: left; font-size: var(--step--1); font-weight: 600; color: var(--muted); padding: .3rem .5rem; border-bottom: 2px solid var(--rule); }
.board td { padding: .6rem .5rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.board tr.me td { background: #f3f7f1; }
.board tr.me td:first-child { box-shadow: inset 4px 0 0 var(--turf); }
.board .rank { font: 900 1.5rem/1 var(--display); width: 2.4rem; color: var(--muted); }
.board .name { font-weight: 600; }
.board .name small { display: block; font-weight: 400; color: var(--muted); }
.board .total { font: 900 1.9rem/1 var(--display); text-align: right; font-variant-numeric: tabular-nums; }
.board th.r { text-align: right; }
.pickcell { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.pickcell img { width: 28px; height: 28px; flex: none; }
.pickcell .t { font: 700 1.15rem/1 var(--display); }
.pickcell .s { font-size: var(--step--1); color: var(--muted); line-height: 1.25; }
.tag { display: inline-block; font-size: .8rem; font-weight: 600; padding: .05rem .45rem; border-radius: 999px; background: #e3e9e1; color: var(--ink); white-space: nowrap; }
.tag.won { background: var(--kumquat-soft); color: var(--kumquat-ink); }
.tag.lost { background: #f2dcd9; color: var(--loss); }
.tag.live { background: var(--turf); color: var(--chalk); }
.tag.live::before { content: ""; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--kumquat); margin-right: .3rem; vertical-align: .05rem; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .tag.live::before { animation: none; } }

/* Games scoreboard */
.games { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.game { border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; padding: .65rem .8rem; }
.game.live { border-color: var(--turf); box-shadow: inset 0 3px 0 var(--kumquat); }
.game .status { display: flex; justify-content: space-between; font-size: var(--step--1); color: var(--muted); margin-bottom: .35rem; gap: .5rem; }
.team { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: .55rem; padding: .25rem 0; }
.team img { width: 28px; height: 28px; }
.team .nm { font-weight: 600; line-height: 1.15; }
.team .nm small { font-weight: 400; color: var(--muted); }
.team .sc { font: 900 1.6rem/1 var(--display); font-variant-numeric: tabular-nums; }
.team.lost .nm, .team.lost .sc { color: var(--muted); }
.team .ln { font-size: var(--step--1); color: var(--muted); }
.team .ln b { color: var(--kumquat-ink); }
.rk { font: 700 .85rem var(--display); color: var(--muted); margin-right: .15rem; }
.pickers { margin-top: .4rem; font-size: var(--step--1); color: var(--muted); }
.pickers b { color: var(--ink); font-weight: 600; }

/* Pick page */
.dayhead { font: 900 1.5rem/1 var(--display); margin: 1.5rem 0 .6rem; }
.pickgame { border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; margin-bottom: .75rem; overflow: hidden; }
.pickgame .when { display: flex; justify-content: space-between; padding: .45rem .8rem; font-size: var(--step--1); color: var(--muted); border-bottom: 1px solid var(--rule); background: var(--card); }
.pickbtn { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: .7rem; width: 100%; padding: .7rem .8rem; border: 0; border-bottom: 1px solid var(--rule); background: #fff; font: inherit; color: inherit; text-align: left; cursor: pointer; min-height: 60px; }
.pickbtn:last-child { border-bottom: 0; }
.pickbtn:hover:not([disabled]) { background: #f6faf4; }
.pickbtn img { width: 36px; height: 36px; }
.pickbtn .nm { font-weight: 600; }
.pickbtn .nm small { display: block; font-weight: 400; color: var(--muted); }
.pickbtn .worth { text-align: right; line-height: 1.1; }
.pickbtn .worth .num { font-size: 1.7rem; font-weight: 900; color: var(--kumquat-ink); }
.pickbtn .worth small { display: block; font-size: .78rem; color: var(--muted); }
.pickbtn.chosen { background: var(--kumquat-soft); box-shadow: inset 5px 0 0 var(--kumquat); }
.pickbtn[disabled] { cursor: default; color: var(--muted); }
.pickbtn[disabled] .worth .num { color: var(--muted); }
.stickybar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--ink); color: var(--chalk); padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); z-index: 5; }
.stickybar .in { max-width: 1000px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.stickybar b { color: var(--kumquat); font-family: var(--display); font-size: 1.4rem; }

/* Season grid */
.gridwrap { overflow-x: auto; }
.grid { border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 100%; }
.grid th, .grid td { padding: .4rem .55rem; border-bottom: 1px solid var(--rule); text-align: center; white-space: nowrap; }
.grid th { font-size: .8rem; color: var(--muted); font-weight: 600; }
.grid td:first-child, .grid th:first-child { text-align: left; position: sticky; left: 0; background: var(--card); font-weight: 600; }
.grid td.w { color: var(--kumquat-ink); font-family: var(--display); font-weight: 900; font-size: 1.15rem; }
.grid td.l { color: var(--muted); }

/* Lists, admin */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .55rem 0; border-bottom: 1px solid var(--rule); }
.list li:last-child { border-bottom: 0; }
.activity li { font-size: var(--step--1); }
.activity time { color: var(--muted); margin-right: .4rem; }
.pools { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 1.5rem; }
.poolcard { display: block; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--rule); border-left: 6px solid var(--turf); border-radius: var(--radius); padding: .9rem 1rem; }
.poolcard:hover { border-color: var(--turf); color: var(--ink); }
.poolcard h3 { margin: 0 0 .25rem; font-size: 1.7rem; }
.poolcard .stat { font: 900 1.4rem var(--display); color: var(--kumquat-ink); }
.invite { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.invite code { font-size: 1rem; background: #fff; border: 1px dashed var(--turf); border-radius: 6px; padding: .45rem .6rem; word-break: break-all; }
.mtable { width: 100%; border-collapse: collapse; }
.mtable th { text-align: left; font-size: var(--step--1); color: var(--muted); padding: .3rem .4rem; border-bottom: 2px solid var(--rule); }
.mtable td { padding: .45rem .4rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.mtable input[type=number] { max-width: 7rem; }
.mtable select { min-width: 12rem; }
.mtable .res { font-size: var(--step--1); color: var(--muted); }
.empty { text-align: center; padding: 1.5rem 1rem; color: var(--muted); }
.empty .btn { margin-top: .75rem; }

.toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); background: var(--ink); color: var(--chalk); padding: .7rem 1.1rem; border-radius: 999px; font-weight: 600; z-index: 20; max-width: calc(100% - 2rem); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.toast.bad { background: var(--loss); }
.stickybar + .toast, body:has(.stickybar) .toast { bottom: 5rem; }

@media (max-width: 640px) {
  .board .hide-sm { display: none; }
  .board .total { font-size: 1.6rem; }
  .site-head nav a.hide-sm { display: none; }
  .pf-mark em { display: none; }
  .pf-mark::before { bottom: 8px; }
  .mtable thead { display: none; }
  .mtable tr { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; padding: .6rem 0; border-bottom: 1px solid var(--rule); }
  .mtable td { border: 0; padding: 0; }
  .mtable td.full { grid-column: 1 / -1; }
}

.pf-mark.p0 { --p: 0; } .pf-mark.p20 { --p: .2; } .pf-mark.p40 { --p: .4; } .pf-mark.p60 { --p: .6; } .pf-mark.p80 { --p: .8; } .pf-mark.p100 { --p: 1; }
.gap-top { margin-top: 2rem; }
svg.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.narrow-in { max-width: 460px; margin: 1rem auto 0; }
fieldset.plainset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.lbl { font-weight: 600; padding: 0; margin-bottom: .35rem; }
label.radio, label.check { display: flex; align-items: center; gap: .6rem; font-weight: 500; padding: .55rem 0; border-bottom: 1px solid var(--rule); cursor: pointer; margin: 0; }
label.check { border-bottom: 0; }
label.radio input, label.check input { width: 18px; height: 18px; accent-color: var(--turf); }
.row > .grow { flex: 1 1 14rem; }
.row > div { margin: 0; }
.row > .end { align-self: flex-end; }
.nologo { display: inline-block; width: 28px; height: 28px; border-radius: 50%; background: #dfe6dc; }
.mypick a.sub { color: var(--chalk); display: inline-block; margin-top: .2rem; }
.mypick .pts { margin-left: auto; }
