/* Winners & Losers. A white page, black ink, and three colors that each
   mean one thing: blue is yours (your pick, your row), green is a win, red is
   a loss.
   A pick turns green or red once its game is decided. Each game is a line
   that ends in what it is worth, and the lines add up at the bottom. */
*, *::before, *::after { box-sizing: border-box; }

/* Bricolage Grotesque for titles, team codes and numbers; Instrument Sans for
   everything read as text. Each is one variable file, served from this site. */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 200 800; font-display: swap; src: url(/static/fonts/bricolage-grotesque.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 400 700; font-display: swap; src: url(/static/fonts/instrument-sans.woff2) format("woff2"); }

:root {
  --paper: #fff;
  --ink: #16181d;
  --muted: #5b6370;
  --line: #d8dce2;
  --wash: #f1f3f6;   /* a team to tap, empty bar */
  --tint: #e8f0fb;   /* your row */
  --crowd: #8d96a3;  /* the league's picks before a result */
  --flag: #1f5fbf;   /* yours */
  --on-flag: #fff;
  --win: #0a7a3d;
  --loss: #c1121f;
  --link: #0b4fa8;
  --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101214;
    --ink: #f2f3f5;
    --muted: #9aa3ae;
    --line: #2b3038;
    --wash: #1c2026;
    --tint: #18263d;
    --crowd: #6f7986;
    --win: #3ccf7e;
    --loss: #ff6b6b;
    --link: #8ab8ff;
    --flag: #8ab8ff;
    --on-flag: #101214;
  }
}

body {
  margin: 0;
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--link); }
h1, h2 { font-family: var(--display); line-height: 1.1; }
button, input, select { font-family: inherit; }
main { padding: 0 1rem 3rem; max-width: 80rem; margin: 0 auto; }
/* Log in, sign up, set a password: one narrow column in the middle. */
main.centered { max-width: 26rem; }
.error { color: var(--loss); }
.empty, .note { color: var(--muted); }
.note { font-size: 0.85rem; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

/* Header */
header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  padding: 0.6rem 1rem 0.35rem;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  color: inherit;
  text-decoration: none;
}
/* Picks and Standings sit on the left: under the name on a phone, beside it
   on anything wider. */
.sections { display: flex; gap: 1.25rem; order: 3; width: 100%; }
.sections a {
  min-width: 44px;
  min-height: 40px;
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.sections a[aria-current] { color: var(--ink); border-bottom-color: var(--flag); }
/* Your name opens a small menu: your account, and log out. */
.account { position: relative; margin-left: auto; min-width: 0; }
.account summary { display: flex; align-items: center; gap: 0.35rem; min-height: 36px; color: var(--muted); font-size: 0.9rem; cursor: pointer; list-style: none; }
.account summary::-webkit-details-marker { display: none; }
.account summary::after { content: ""; flex: none; border: 0.3em solid transparent; border-top-color: currentColor; border-bottom-width: 0; }
.account[open] summary { color: var(--ink); }
.account[open] summary::after { transform: rotate(180deg); }
.who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 9rem; }
.account .menu { position: absolute; z-index: 10; top: 100%; right: 0; min-width: 9rem; margin-top: 0.25rem; background: var(--paper); border: 1px solid var(--ink); border-radius: 12px; overflow: hidden; }
.account .menu form { margin: 0; border-top: 1px solid var(--line); }
.account .menu a, .account .menu button {
  display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 0.85rem;
  font: inherit; font-size: 0.95rem; font-weight: 600; text-align: left; white-space: nowrap;
  color: var(--ink); text-decoration: none; background: none; border: 0; cursor: pointer;
}
@media (min-width: 40rem) {
  header.site { padding-inline: max(1rem, calc((100% - 78rem) / 2)); }
  .sections { order: 0; width: auto; margin-left: 1rem; }
  .who { max-width: 20rem; }
}

/* Login */
/* Every page opens the same way: one title, left-aligned, the same size. */
main h1 { margin: 1.25rem 0 0.35rem; font-size: 2.1rem; font-weight: 700; text-align: left; overflow-wrap: anywhere; }
form.login { max-width: 24rem; display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
form.login input, form.login select, form.login button { font: inherit; font-size: 1rem; padding: 0.6rem 0.75rem; min-height: 46px; border-radius: 10px; }
form.login input, form.login select { border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
form.login button { border: 0; background: var(--ink); color: var(--paper); font-weight: 600; cursor: pointer; }

/* Joining and the admin page */
main > p { max-width: 36rem; }
form.login label { font-size: 0.9rem; color: var(--muted); }
main > h2, .newlink h2, .panel h2 { margin: 1.5rem 0 0.5rem; font-size: 1.15rem; font-weight: 600; }
main > h2 .count { color: var(--muted); font-weight: 500; }
.panel p { margin: 0.4rem 0; }
.problems { margin: 0.25rem 0 0.5rem; padding-left: 1.1rem; font-size: 0.9rem; overflow-wrap: anywhere; }
main > h3 { margin: 1rem 0 0.25rem; font-family: var(--text); font-size: 0.95rem; font-weight: 600; color: var(--muted); }
.panel form { margin: 0.5rem 0; }
.back { margin: 0.75rem 0 0; font-size: 0.9rem; }
.acts { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 0.4rem; flex: 0 1 auto; min-width: 0; }
.results .game { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.results .what { display: flex; flex-direction: column; min-width: 0; }
.results .what b { font-family: var(--display); font-size: 1.1rem; font-weight: 700; }
.results .when, .results .espn, .results label { font-size: 0.85rem; color: var(--muted); }
.results form { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.results select { font: inherit; min-height: 44px; padding: 0.3rem 0.4rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); }
.panel button, .results button {
  font: inherit; font-size: 0.95rem; font-weight: 500; min-height: 44px; padding: 0.3rem 0.9rem; border-radius: 10px; cursor: pointer;
  border: 0; background: var(--wash); color: var(--ink);
}
button.action, .members button {
  font: inherit; min-height: 44px; padding: 0.4rem 0.9rem; border-radius: 10px; cursor: pointer;
  border: 0; background: var(--ink); color: var(--paper); font-weight: 600;
}
.members button { background: var(--wash); color: var(--ink); font-weight: 500; font-size: 0.95rem; }
.newlink { margin: 1rem 0; padding: 0.75rem 1rem 0.25rem; border-radius: 12px; background: var(--tint); }
.newlink h2 { margin-top: 0; }
input.link { width: 100%; font: inherit; font-size: 0.9rem; padding: 0.5rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); }
.newlink p { margin: 0.5rem 0; font-size: 0.9rem; color: var(--muted); }
/* Over the Members list: find someone, narrow the list, change its order.
   All of it is links and one small form, so the address holds the view. */
.find { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.5rem; max-width: 40rem; margin: 0.5rem 0; }
.find label { flex: 1 0 100%; font-size: 0.9rem; color: var(--muted); }
.find input[type=search] { flex: 1 1 12rem; min-width: 0; min-height: 44px; padding: 0.3rem 0.75rem; font: inherit; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); }
.find button { font: inherit; font-size: 0.95rem; font-weight: 500; min-height: 44px; padding: 0.3rem 0.9rem; border: 0; border-radius: 10px; background: var(--wash); color: var(--ink); cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; max-width: 40rem; margin: 0.5rem 0; }
.chips a { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 40px; padding: 0 0.85rem; border-radius: 999px; background: var(--wash); color: var(--ink); font-size: 0.9rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.chips a b { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.chips a[aria-current] { background: var(--ink); color: var(--paper); }
.chips a[aria-current] b { color: inherit; }
.chips > span { font-size: 0.9rem; color: var(--muted); margin-right: 0.15rem; }
h2#members { scroll-margin-top: 0.5rem; }
ul.members { list-style: none; margin: 0; padding: 0; max-width: 40rem; }
.members li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 0.75rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.members form { margin: 0; flex: none; }
.member { min-width: 0; overflow-wrap: anywhere; }
.hint { margin: -0.25rem 0 0.25rem; font-size: 0.85rem; color: var(--muted); }
.member .login { font-size: 0.8rem; color: var(--muted); }
.rename { flex: 1 0 100%; font-size: 0.9rem; }
.rename summary { color: var(--link); cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; }
.rename form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.25rem 0 0.5rem; }
.rename input { font: inherit; flex: 1 1 12rem; min-height: 44px; padding: 0.3rem 0.5rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); }
.rename label { flex: 1 0 100%; color: var(--muted); }
.badge { font-size: 0.75rem; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0.05rem 0.45rem; white-space: nowrap; }

/* Your pick log: one request per row, refused ones marked. */
ol.picklog { list-style: none; margin: 0; padding: 0; max-width: 40rem; }
.picklog .event { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.picklog .event.refused .what b { color: var(--loss); }
.picklog .what b { font-weight: 600; }
.picklog .fixture, .picklog .when, .picklog .from { font-size: 0.85rem; color: var(--muted); }
.picklog .fixture { margin-left: 0.35rem; white-space: nowrap; }
.picklog .why { font-size: 0.9rem; color: var(--loss); }

/* Week page */
.weeknav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.5rem; margin-top: 0.75rem; }
.weeknav > a { justify-self: start; min-height: 44px; padding: 0 0.9rem; display: inline-flex; align-items: center; border-radius: 999px; background: var(--wash); color: var(--ink); font-size: 0.9rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.weeknav > .next { justify-self: end; grid-column: 3; }
.weeknav > .views { grid-column: 2; }
/* The heading says which week and whose picks: an entry's, or the league's. */
.weektitle { margin-top: 0.9rem; }
.weektitle .season { color: var(--muted); font-weight: 500; font-size: 0.75em; }
/* A past season's week: the way back to that year's standings, and whose picks are marked. */
.toseason { margin: 0 0 0.25rem; font-size: 0.9rem; }
/* A week's two views: one entry's picks, or how the whole league picked. */
.views { flex: none; }
.viewnote { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--muted); }
ul.picks a { color: inherit; text-decoration-color: var(--line); }

.standing {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.1rem;
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.standing b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.slot { margin-top: 1.25rem; }
.kick {
  margin: 0 0 0.15rem;
  font-family: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}
ol.games { list-style: none; margin: 0; padding: 0; }
/* A game is one line of the sum: the two teams on the left, and on the right
   what the line is worth. The status sits under the teams. */
.game {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.25rem 0.5rem;
  padding: 0.45rem 0;
}
.game > * { grid-column: 1 / -1; }
.game > .matchup { grid-column: 1; }

/* The two teams share the row equally, whatever state the game is in: to
   be played, being played or done. The score is part of the status below. */
.matchup { display: flex; align-items: center; gap: 0.5rem; }
.matchup .at { flex: none; color: var(--muted); font-size: 0.8rem; }
.side { flex: 1 1 0; min-width: 0; }
.side form { margin: 0; }

button.team {
  width: 100%;
  min-height: 46px;
  padding: 0.25rem 0.5rem;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--wash);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
button.team.picked { background: var(--flag); color: var(--on-flag); }
/* A locked game is a result, not a choice: the team that was not picked fades. */
button.team:disabled { cursor: default; color: var(--muted); }
.side.won button.team:disabled { color: var(--ink); }
button.team.picked:disabled { background: var(--flag); color: var(--on-flag); }
/* Once the game is decided, your pick says how it went. */
button.team.picked.right:disabled { background: var(--win); color: var(--paper); }
button.team.picked.wrong:disabled { background: var(--loss); color: var(--paper); }

/* The status goes under the teams; the points go in the right-hand column. */
.result { display: contents; }
.game .status { grid-column: 1; grid-row: 2; font-size: 0.8rem; color: var(--muted); }
/* A line's worth sits level with its team buttons, with or without a status under them. */
.game .points, .game .tally { grid-column: 2; grid-row: 1; justify-self: end; min-width: 3.25rem; text-align: right; font-family: var(--display); font-variant-numeric: tabular-nums; line-height: 1; }
.points { font-size: 1.9rem; font-weight: 700; }
.tally { font-size: 1.7rem; font-weight: 500; color: var(--muted); }
.points.win, td.win, .total.win { color: var(--win); }
.points.loss, td.loss, .total.loss { color: var(--loss); }
.points.even { color: var(--muted); }
.pickerror { margin: 0; font-size: 0.9rem; }

/* The lines add up: the week as it stands, the season, and what is still
   waiting on a result. */
/* On a screen wider than a phone but not wide enough for columns, a week
   keeps to a column's width so a line's worth stays beside its teams. */
.slots, .sum { max-width: 30rem; }
.sum { margin-top: 1.25rem; padding-top: 0.6rem; border-top: 3px solid var(--ink); }
.sumrow { display: flex; align-items: baseline; justify-content: space-between; margin: 0; font-weight: 600; }
.sumrow .total { font-family: var(--display); font-size: 2.4rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.sum .riding { margin: 0.35rem 0 0; font-size: 0.9rem; color: var(--muted); }

/* How the league picked: one bar as wide as the league. Away picks grow from
   the left, home picks from the right; the gap is everyone who sat it out. */
.split { margin-top: 0.1rem; }
.split summary { display: flex; align-items: center; gap: 0.5rem; min-height: 36px; cursor: pointer; list-style: none; }
.split summary::-webkit-details-marker { display: none; }
.split .count { flex: none; min-width: 3.6rem; font-family: var(--display); font-weight: 500; font-size: 0.9rem; color: var(--muted); white-space: nowrap; }
.split .count:last-child { text-align: right; }
.split .count b { font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.split .bar { flex: 1 1 auto; height: 10px; border-radius: 5px; background: var(--wash); }
.split .bar rect { fill: var(--crowd); }
.split .bar rect.won { fill: var(--win); }
.split .bar rect.lost { fill: var(--loss); }
.split .count.won b { color: var(--win); }
.split .count.lost b { color: var(--loss); }

.names { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 0.25rem; }
ul.picks { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; line-height: 1.5; overflow-wrap: anywhere; }
ul.picks.home { text-align: right; }
.picker.me { font-weight: 700; color: var(--flag); }
.out { margin: 0; font-size: 0.8rem; color: var(--muted); }
.split .out { margin-top: 0.4rem; text-align: center; }

/* Standings: rank, name and total stay put while the weeks scroll sideways. */
.standhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin: 1.25rem 0 0.5rem; }
.standhead h1 { margin: 0; white-space: nowrap; }
.standhead .season { color: var(--muted); font-weight: 500; }
.toggle { flex: none; display: flex; padding: 3px; border-radius: 999px; background: var(--wash); }
.toggle a { padding: 0 0.85rem; min-height: 38px; display: flex; align-items: center; border-radius: 999px; font-weight: 600; font-size: 0.9rem; color: var(--ink); text-decoration: none; }
.toggle a[aria-current] { background: var(--ink); color: var(--paper); }

/* The season beside the heading opens a list of every season. */
.standtitle { display: flex; align-items: baseline; gap: 0.4rem; }
.seasons { position: relative; font-family: var(--display); line-height: 1.1; white-space: nowrap; }
.seasons summary { color: var(--muted); cursor: pointer; list-style: none; font-size: 2.1rem; font-weight: 500; }
.seasons summary::-webkit-details-marker { display: none; }
.seasons summary::after { content: ""; display: inline-block; margin-left: 0.3em; vertical-align: 0.14em; border: 0.26em solid transparent; border-top-color: currentColor; border-bottom-width: 0; }
.seasons[open] summary::after { transform: rotate(180deg); }
.seasons ul { position: absolute; z-index: 5; top: 100%; left: 0; min-width: 100%; margin: 0.25rem 0 0; padding: 0; list-style: none; background: var(--paper); border: 1px solid var(--ink); border-radius: 12px; overflow: hidden; }
.seasons a { display: flex; align-items: center; min-height: 40px; padding: 0 0.75rem; font-weight: 600; font-size: 1rem; color: var(--ink); text-decoration: none; }
.seasons a[aria-current] { background: var(--ink); color: var(--paper); }

.mine { margin: 0 0 0.5rem; font-size: 0.9rem; }
.standings tr.me { scroll-margin-top: 4rem; }
.tablewrap { overflow-x: auto; margin: 0 -1rem; -webkit-overflow-scrolling: touch; }
table.standings { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; }
.standings th, .standings td { padding: 0.5rem 0.5rem; border-bottom: 1px solid var(--line); background: var(--paper); white-space: nowrap; text-align: right; }
.standings thead th { font-size: 0.8rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--ink); }
.standings thead a { color: inherit; }
/* A past season: the name and each week open that entry's picks. */
.standings tbody a { color: inherit; text-decoration-color: var(--line); }
.standings td a { text-decoration: none; }
.standings td { font-weight: 500; font-size: 0.95rem; }
.standings tbody th, .standings tbody td { height: 44px; padding-block: 0; }
.standings .rank { position: sticky; left: 0; z-index: 1; width: 2.4rem; min-width: 2.4rem; padding-left: 1rem; text-align: left; color: var(--muted); }
.standings .name {
  position: sticky; left: 2.4rem; z-index: 1;
  width: 9.5rem; min-width: 9.5rem; max-width: 9.5rem;
  overflow: hidden; text-overflow: ellipsis;
  text-align: left; font-weight: 500; font-size: 0.95rem;
}
.standings .total { position: sticky; left: 11.9rem; z-index: 1; min-width: 3.4rem; font-family: var(--display); font-weight: 700; font-size: 1.15rem; border-right: 1px solid var(--line); }
.standings thead .total { font-family: var(--text); font-size: 0.8rem; font-weight: 600; }
.standings .wk { min-width: 3rem; }
.standings td.even { color: var(--muted); }
.standings .rec { color: var(--muted); }
/* Your row is tinted and your name is blue; its numbers keep their colors. */
.standings tr.me th, .standings tr.me td { background: var(--tint); }
.standings tr.me .name, .standings tr.me .name a, .standings tr.me .rank { color: var(--flag); font-weight: 700; }

/* Wider screens. The week's games flow into columns, two on a tablet and
   three on a desktop; the standings table gets room for full names and, when
   every week fits, keeps its header in view while the page scrolls. */
@media (min-width: 44rem) {
  .slots { max-width: none; }
  /* The totals span the page under the columns of games: the rule runs edge
     to edge, and the week and the season sit side by side, each number next
     to its label. */
  .sum { max-width: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 3.5rem; }
  .sumrow { justify-content: flex-start; gap: 1rem; }
  .sum .riding { flex: 1 0 100%; }
  /* Kickoff slots sit side by side; a slot with three or more games (the
     Sunday afternoon block) takes the full width and lays its games out in
     the same columns. */
  ol.results { display: block; max-width: 44rem; }
  .slots, .slot:has(.game:nth-child(3)) ol.games {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
    gap: 0 2rem;
    align-items: start;
  }
  .slot:has(.game:nth-child(3)) { grid-column: 1 / -1; }
  .tablewrap { margin: 0; }
  .standings .name { width: 16rem; min-width: 16rem; max-width: 16rem; }
  .standings .total { left: 18.4rem; }
}
@media (min-width: 64rem) {
  .standings .wk { min-width: 2.75rem; }
  .standings tbody tr:hover th, .standings tbody tr:hover td { background: var(--wash); }
  .standings tbody tr.me:hover th, .standings tbody tr.me:hover td { background: var(--tint); }
}
@media (min-width: 82rem) {
  .tablewrap { overflow: visible; }
  .standings .rank, .standings .name, .standings .total { position: static; }
  .standings .name { width: auto; min-width: 12rem; max-width: 26rem; }
  .standings thead th { position: sticky; top: 0; z-index: 2; }
}

/* Narrow phones: the brand and log-out share a row, week links stay on one line. */
@media (max-width: 24rem) {
  .who { max-width: 6.5rem; }
  .brand { font-size: 1rem; }
  main h1 { font-size: 1.7rem; }
  .weeknav > a { padding: 0 0.6rem; font-size: 0.8rem; }
  .views a { padding: 0 0.6rem; }
  .matchup { gap: 0.3rem; }
  button.team { font-size: 1.1rem; }
}

/* Admin Members list: who has paid for the season, and when each joined. */
.payline { display: block; font-size: 0.8rem; color: var(--muted); }
.payline .paid { color: var(--win); font-weight: 600; }
.payline .unpaid { color: var(--ink); font-weight: 600; }
p.alt { margin-top: 1rem; font-size: 0.95rem; }
.signups input.link { max-width: 28rem; display: block; margin-bottom: 0.5rem; }
