/* Box pool. Matches the raegune.ca homepage theme ("line", 2026-10-22).
   Strict CSP: no inline style or script and no style="" attributes; the one
   dynamic width (the score bar) is set through the CSSOM in pool.js. */

@font-face { font-family: "Syne"; src: url("/site/fonts/syne-latin-wght-normal.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Plex"; src: url("/site/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("/site/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("/site/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --y: #ffff00; --on-y: #0b0b0b;
  --bg: #0b0b0b; --ink: #ececec; --dim: #8d8d8d; --rule: #262626; --panel: #161616;
  --warn: #ffb020; --bad: #ff6b5b; --stripe: #151515;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  /* players: 1 cyan, 2 yellow, then two spares (the board allows up to 4) */
  --p0: #00ffff; --p1: #ffff00; --p2: #ff7ab6; --p3: #b39dff;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f4f3ee; --ink: #121212; --dim: #6a6a66; --rule: #d6d5cf; --panel: #ffffff;
          --warn: #9a6400; --bad: #c0281b; --stripe: #eae9e3; }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.6 "Plex", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; padding-top: env(safe-area-inset-top, 0); padding-bottom: env(safe-area-inset-bottom, 0); }
a { color: inherit; }
::selection { background: var(--y); color: var(--on-y); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---- header ---- */
.top, .wrap { padding-left: var(--gutter); padding-right: var(--gutter); max-width: calc(78rem + 2 * var(--gutter)); margin-left: auto; margin-right: auto; }
.top { padding-top: 1.5rem; }
.meta { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; align-items: baseline;
  font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.meta a { text-decoration: none; padding: 0.1em 0.3em; margin: 0 -0.3em; }
.meta a:hover, .meta a:focus-visible { background: var(--y); color: var(--on-y); outline: none; }
.pages { margin-left: auto; display: flex; gap: 1.5rem; }
.pages a[aria-current] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--y); }
.pages a[aria-current]:hover { box-shadow: none; }
@media (prefers-color-scheme: light) { .pages a[aria-current] { box-shadow: inset 0 -2px 0 var(--ink); } }
/* Syne's default digits are old-style (1 sits at x-height, 6 and 8 rise above it); force lining figures */
h1, h2, h3, h4 { font-family: "Syne", sans-serif; letter-spacing: -0.03em; font-variant-numeric: lining-nums; }
h1 { font-weight: 800; font-size: clamp(2.6rem, 8vw, 5.5rem); line-height: 0.95; margin: clamp(2rem, 6vw, 4rem) 0 0; }
.sub { color: var(--dim); margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule); }

/* ---- sections (were boxed cards; now separated by rules) ---- */
.wrap { padding-bottom: 4rem; }
.card { padding: 2rem 0 0; margin-top: 2.5rem; border-top: 1px solid var(--rule); }
.wrap > .card:first-child, #main > .card:first-child { border-top: 0; margin-top: 1rem; padding-top: 0; }
h2 { font-weight: 700; font-size: clamp(1.6rem, 3.5vw, 2.4rem); line-height: 1.05; margin: 0 0 1.25rem; }
.note { font-size: 0.9rem; color: var(--dim); line-height: 1.55; max-width: 48rem; }
.card .note { margin-top: 1rem; }
.card.note { margin-top: 3rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em;
  background: var(--panel); padding: 0.05em 0.35em; }

/* ---- scoreboard ---- */
.score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 1rem; }
.score > div:last-child { text-align: right; }
.score .who { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 1.1rem; line-height: 1.2; }
.score > div:last-child .who { justify-content: flex-end; }
.pts { font-family: "Syne", sans-serif; font-weight: 800; font-size: clamp(4rem, 14vw, 9rem); line-height: 0.9;
  letter-spacing: -0.05em; font-variant-numeric: lining-nums tabular-nums; color: var(--dim); margin-top: 0.5rem; }
.lead .pts { color: var(--ink); }
.vs { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); font-weight: 500; padding-bottom: 1rem; }
.bar { height: 0.6rem; display: flex; gap: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; }
.barwrap { margin-top: 1.25rem; }
.verdict { margin-top: 1rem; color: var(--dim); }
.verdict b { color: var(--ink); font-weight: 600; }

/* ---- tables ---- */
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
th { text-align: right; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--rule); font-size: 0.75rem;
  color: var(--dim); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td { padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--rule); text-align: right; color: var(--dim); }
td:first-child { color: var(--ink); }
td.win { color: var(--ink); font-weight: 600; }
td.who { font-size: 0.9rem; }
tr.total td { border-bottom: 0; padding-top: 1rem; color: var(--ink); font-family: "Syne", sans-serif;
  font-weight: 700; font-size: 1.4rem; letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; }
.wt, .of { font-size: 0.75rem; color: var(--dim); font-weight: 500; letter-spacing: 0.06em; margin-left: 0.4rem; }
.of { margin-left: 0.15rem; }

/* ---- player colours (classes, since style="" is blocked) ---- */
.c0 { background: var(--p0); } .c1 { background: var(--p1); } .c2 { background: var(--p2); } .c3 { background: var(--p3); }
.dot, .tag { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; flex: 0 0 auto; }
.dot.inl { margin-right: 0.4rem; vertical-align: 0; }
.tag { margin-right: 0.5rem; vertical-align: 0; }
/* light mode: yellow is never shown bare on the pale background, so player marks get an ink ring */
@media (prefers-color-scheme: light) {
  .dot:is(.c0, .c1, .c2, .c3), .tag { box-shadow: 0 0 0 1.5px var(--ink); }
  .bar { outline: 1px solid var(--ink); outline-offset: 1px; }
}

/* ---- every pick ---- */
.grp { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 0 2.5rem; margin-top: 2rem; }
.grp h3, .dbox h4 span, .cand .tm {
  font-family: "Plex", sans-serif; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); }
.grp h3 { grid-column: 1 / -1; font-size: 0.8rem; margin: 0 0 0.25rem; }
.box { border-top: 1px solid var(--rule); padding: 0.75rem 0 1rem; }
.bx { font-family: "Syne", sans-serif; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 0.4rem; font-variant-numeric: lining-nums; }
.pk { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; padding: 0.2rem 0; font-size: 0.95rem; }
.pk .nm { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.5rem; min-width: 0; }
.pk .nm .dot { align-self: center; }
.pk .v { font-variant-numeric: tabular-nums; color: var(--dim); flex: 0 0 auto; }
.pk.top .v { color: var(--ink); font-weight: 600; }
.chip { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.chip.good { background: var(--ink); color: var(--bg); padding: 0 0.4em; }
.bestrow { border-top: 1px dashed var(--rule); margin-top: 0.4rem; padding-top: 0.5rem; color: var(--dim); font-size: 0.9rem; }
.bestrow b { color: var(--ink); font-weight: 600; }

/* ---- banners ---- */
.stale, div.err { background: var(--panel); padding: 1rem 1.25rem; border-left: 4px solid var(--warn); line-height: 1.55; }
.card.stale { margin-top: 1rem; border-top: 0; }
#main > .stale:first-child + .card { border-top: 0; margin-top: 2rem; padding-top: 0; }
div.err { border-left-color: var(--bad); color: var(--ink); }

/* ---- picks page ---- */
.ctrl, .pinrow { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.pinrow { margin-top: 1rem; }
.pinrow label { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
.pinrow input { width: 9rem; }
input, button { font: inherit; font-size: 0.95rem; color: var(--ink); background: transparent;
  border: 1px solid var(--rule); border-radius: 0; padding: 0.45rem 0.8rem; }
button { cursor: pointer; font-weight: 500; border-color: var(--dim); }
button:hover:not([disabled]), button:focus-visible { background: var(--y); color: var(--on-y); border-color: var(--y); outline: none; }
@media (prefers-color-scheme: light) { button:hover:not([disabled]), button:focus-visible { border-color: var(--ink); } }
button[disabled] { opacity: 0.5; cursor: not-allowed; }
input:focus { outline: none; border-color: var(--ink); }
.hide { display: none; }
.sync { font-size: 0.85rem; color: var(--dim); display: inline-flex; align-items: center; gap: 0.5rem; padding: 0 0.25rem; }
.dot.ok { background: #3ddc84; } .dot.warn { background: var(--warn); } .dot.err { background: var(--bad); }
@media (prefers-color-scheme: light) { .dot.ok { background: #1d7a45; } }

#who { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.25rem; }
#who input { width: 10rem; font-weight: 500; }
#who input[disabled] { opacity: 1; color: var(--ink); -webkit-text-fill-color: var(--ink); }
/* each name carries its colour as a solid block on the left; the one being picked for is filled */
#who .e0 { box-shadow: inset 0.6rem 0 0 var(--p0); padding-left: 1.2rem; }
#who .e1 { box-shadow: inset 0.6rem 0 0 var(--p1); padding-left: 1.2rem; }
#who .e2 { box-shadow: inset 0.6rem 0 0 var(--p2); padding-left: 1.2rem; }
#who .e3 { box-shadow: inset 0.6rem 0 0 var(--p3); padding-left: 1.2rem; }
.editable #who input.sel { border-color: var(--ink); }
.editable #who input.sel.e0 { background: var(--p0); color: var(--t0, var(--on-y)); -webkit-text-fill-color: var(--t0, var(--on-y)); }
.editable #who input.sel.e1 { background: var(--p1); color: var(--t1, var(--on-y)); -webkit-text-fill-color: var(--t1, var(--on-y)); }
.editable #who input.sel.e2 { background: var(--p2); color: var(--t2, var(--on-y)); -webkit-text-fill-color: var(--t2, var(--on-y)); }
.editable #who input.sel.e3 { background: var(--p3); color: var(--t3, var(--on-y)); -webkit-text-fill-color: var(--t3, var(--on-y)); }
/* each name's colour picker sits beside it */
#who .pl { display: inline-flex; align-items: stretch; gap: 0.3rem; }
#who input[type=color] { width: 2.6rem; padding: 0.15rem; cursor: pointer; background: var(--panel); }
#who input[type=color][disabled] { cursor: not-allowed; }
@media (prefers-color-scheme: light) { #who .e1 { border-color: var(--ink); } }

#board .card:first-child { border-top: 1px solid var(--rule); margin-top: 2.5rem; padding-top: 2rem; }
.boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 0 2.5rem; }
.dbox { border-top: 1px solid var(--rule); padding: 0.75rem 0 1.25rem; }
.dbox h4 { font-weight: 700; font-size: 1.15rem; line-height: 1.2; margin: 0 0 0.5rem;
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.dbox h4 span { font-size: 0.72rem; white-space: nowrap; letter-spacing: 0.06em; }
.wide { grid-column: 1 / -1; }
.cand { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem;
  padding: 0.35rem 0.5rem; margin: 0 -0.5rem; font-size: 0.95rem; }
.cand b { font-weight: 500; }
.editable:not(.pickslocked) .cand { cursor: pointer; }
/* hover is neutral here: a yellow fill already means "player 2 has this one" */
.editable:not(.pickslocked) .cand:hover { background: var(--rule); }
.cand.o0 { background: var(--p0); color: var(--t0, var(--on-y)); } .cand.o1 { background: var(--p1); color: var(--t1, var(--on-y)); }
.cand.o2 { background: var(--p2); color: var(--t2, var(--on-y)); } .cand.o3 { background: var(--p3); color: var(--t3, var(--on-y)); }
.cand[class*=" o"] b { font-weight: 600; }
.cand[class*=" o"] .tm, .cand[class*=" o"] .val, .cand[class*=" o"] .rn { color: inherit; opacity: 0.75; }
.cand .tm { font-size: 0.72rem; margin-left: 0.25rem; }
.cand .hold { display: inline-flex; gap: 0.2rem; margin-right: 0.4rem; vertical-align: -0.05rem; }   /* free pick: who else has it */
.cand .val { color: var(--dim); font-size: 0.85rem; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.cand .rn { font-size: 0.85rem; color: var(--dim); line-height: 1.4; display: block; margin-top: 0.15rem; max-width: 60ch; }

.flag { position: relative; display: inline-block; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em;
  margin-left: 0.4rem; vertical-align: 0.1em; cursor: help; }
.flag.out { color: var(--bad); } .flag.watch { color: var(--warn); }
.cand[class*=" o"] .flag { color: var(--on-y); text-decoration: underline; }
.flag .tip { display: none; position: absolute; left: 0; top: calc(100% + 0.4rem); z-index: 40; width: max-content;
  max-width: min(17rem, 68vw); background: var(--ink); color: var(--bg); font-size: 0.8rem; font-weight: 400;
  letter-spacing: 0; text-transform: none; line-height: 1.45; padding: 0.5rem 0.65rem; text-align: left; text-decoration: none; }
.flag:hover .tip, .flag:focus .tip, .flag.open .tip { display: block; }

/* setup page help: a ? with its text below it, and "Done this before" (body.brief) */
.qt { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 1.15rem; height: 1.15rem;
  border: 1px solid var(--rule); border-radius: 50%; font-size: 0.7rem; font-weight: 600; letter-spacing: 0; color: var(--dim);
  cursor: help; vertical-align: 0.05em; margin-left: 0.15rem; text-transform: none; }
.prow .qt { align-self: center; }
.qt:hover, .qt:focus, .qt.open { color: var(--ink); border-color: var(--ink); outline: none; }
.qt .tip { display: none; position: absolute; left: 0; top: calc(100% + 0.4rem); z-index: 40; width: max-content;
  max-width: min(18rem, calc(100vw - 2rem)); background: var(--ink); color: var(--bg); font-size: 0.8rem; font-weight: 400;
  letter-spacing: 0; text-transform: none; line-height: 1.45; padding: 0.5rem 0.65rem; text-align: left; white-space: normal; }
.qt:hover .tip, .qt:focus .tip, .qt.open .tip { display: block; }
body.brief .guide { display: none; }
.guide + .ctrl { margin-top: 1rem; }
.steps { padding-left: 1.2rem; margin: 0.75rem 0 0; }
.steps li { margin: 0.35rem 0; }
.rost { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 1.5rem 2.5rem; }
.rost > div > b { font-family: "Syne", sans-serif; font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; font-variant-numeric: lining-nums; }
.rost ul { list-style: none; padding: 0; margin: 0.5rem 0 0; border-top: 1px solid var(--rule); }
.rost li { padding: 0.35rem 0; border-bottom: 1px solid var(--rule); font-size: 0.9rem; }
.dimtxt { color: var(--dim); font-size: 0.85rem; }

@media (max-width: 40rem) {
  .meta { gap: 0.35rem 1.25rem; }
  .pages { margin-left: 0; width: 100%; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
  .pages a, .pages button { white-space: nowrap; }
  th, td { padding-left: 0.3rem; padding-right: 0.3rem; }
  td.who { font-size: 0.8rem; }
}

/* "Every pick": one-box groups (hitters, blockers, ...) sit side by side instead of a row each */
.card:has(> .grp) { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 0 2.5rem; align-items: start; }
.card:has(> .grp) > h2, .card > .grp:has(> .box ~ .box) { grid-column: 1 / -1; }
.card > .grp:not(:has(> .box ~ .box)) { grid-template-columns: 1fr; }

/* row shading so the eye can follow a row across the wide gaps */
tr:nth-child(even):not(.total) td { background: var(--stripe); }
th:first-child, td:first-child { padding-left: 0.6rem; }
th:last-child, td:last-child { padding-right: 0.6rem; }
.field li:nth-child(even) { background: var(--stripe); }

/* whole-box list under each box on the standings page */
.more { margin-top: 0.6rem; padding: 0.3rem 0.6rem; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--dim); border-color: var(--rule); }
.more::after { content: " +"; }
.more[aria-expanded="true"]::after { content: " \2212"; }
.cardhead { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 1.25rem; }
.cardhead h2 { margin: 0; }
.allx { display: flex; gap: 0.5rem; }
.allx button { padding: 0.3rem 0.6rem; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--dim); border-color: var(--rule); }
.allx button:hover, .allx button:focus-visible { color: var(--ink); border-color: var(--ink); }
/* scoring notes: under each group on the picks page, behind a button on the standings */
#howscore { margin-top: 0.5rem; }
.card .catnote { margin: -0.5rem 0 1rem; }
.scorehelp { margin-top: 0.75rem; }
.scorehelp p { margin: 0 0 0.5rem; }
.scorehelp ul { margin: 0; padding-left: 1.1rem; }
.scorehelp li { margin: 0.2rem 0; }
.field { list-style: none; padding: 0; margin: 0.5rem 0 0; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.field li { display: grid; grid-template-columns: 1.75rem 1fr auto; gap: 0.5rem; align-items: baseline; padding: 0.25rem 0.5rem; color: var(--dim); }
.field li.mine { color: var(--ink); font-weight: 600; }
.field .rk { font-size: 0.75rem; }
.field .nm { display: flex; align-items: baseline; gap: 0.45rem; min-width: 0; }
.field .nm .dot { align-self: center; }
.field .tm { font-size: 0.7rem; font-weight: 500; letter-spacing: 0.1em; color: var(--dim); }

/* hidden player name: a small padlock after the public name, gone once the PIN unlocks the picks page */
.lock { display: inline-block; width: 0.62em; height: 0.72em; margin-left: 0.35em; vertical-align: -0.02em;
  fill: none; stroke: var(--dim); stroke-width: 1.6; flex: 0 0 auto; }
.lock rect { fill: var(--dim); stroke: none; }
.pts .lock { display: none; }

/* unlock control in the top row, styled like the row's links */
.metabtn { font: inherit; font-size: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
  background: none; border: 0; padding: 0.1em 0.3em; margin: 0 -0.3em; cursor: pointer; }
.metabtn:hover, .metabtn:focus-visible { background: var(--y); color: var(--on-y); outline: none; }
.top .pinrow { margin-top: 1rem; }
.pinmsg { font-size: 0.85rem; color: var(--dim); }
/* the picks page stays blank until save.php confirms the unlock */
.gated main { visibility: hidden; }

/* ---- three or more players: one row of scores, the total underneath ---- */
.score.many { grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); gap: 1rem 1.5rem; }
.score.many > div:last-child { text-align: left; }
.score.many > div:last-child .who { justify-content: flex-start; }
.score.many .pts { font-size: clamp(3.2rem, 11vw, 7rem); }
.vs.ofall { padding: 0.75rem 0 0; }

/* wide tables scroll inside their card rather than the page; with three or more
   players on a phone the Leads column goes (the winning total is already bold) */
.tablewrap { overflow-x: auto; }
@media (max-width: 34rem) {
  table.cats.many th:last-child, table.cats.many td:last-child { display: none; }
  table.cats.many td:nth-last-child(2), table.cats.many th:nth-last-child(2) { padding-right: 0; }
}

/* ---- setup page ---- */
select, textarea { font: inherit; font-size: 0.95rem; color: var(--ink); background: var(--bg);
  border: 1px solid var(--rule); border-radius: 0; padding: 0.45rem 0.8rem; }
textarea { width: 100%; max-width: 48rem; display: block; line-height: 1.5; resize: vertical; }
select:focus, textarea:focus { outline: none; border-color: var(--ink); }
input[disabled], select[disabled] { opacity: 0.6; }
input[type=number] { width: 4.5rem; padding-right: 0.3rem; }
.form { display: grid; grid-template-columns: max-content minmax(0, 24rem); gap: 0.75rem 1.25rem; align-items: center; }
.form > label, .cathead label, .chk { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
.form .row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.form input:not([type=checkbox]), .form select { min-width: 0; width: 100%; }
.form .row input { width: auto; flex: 1 1 12rem; }
.card > .ctrl { margin-top: 1rem; }
.card > .ctrl:first-child { margin-top: 0; }
#lockednote { margin-top: 1rem; }

.prow { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: stretch; margin-bottom: 0.6rem; }
.prow input:not([type]) { width: 14rem; max-width: 100%; font-weight: 500; }
.prow .ppin { width: 13rem; max-width: 100%; }
.prow .e0 { box-shadow: inset 0.6rem 0 0 var(--p0); padding-left: 1.2rem; }
.prow .e1 { box-shadow: inset 0.6rem 0 0 var(--p1); padding-left: 1.2rem; }
.prow .e2 { box-shadow: inset 0.6rem 0 0 var(--p2); padding-left: 1.2rem; }
.prow .e3 { box-shadow: inset 0.6rem 0 0 var(--p3); padding-left: 1.2rem; }
.prow input[type=color] { width: 2.6rem; padding: 0.15rem; cursor: pointer; background: var(--panel); }
.chk { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.chk input { width: 1.1rem; height: 1.1rem; accent-color: var(--ink); }

.cat { border-top: 1px solid var(--rule); padding: 1rem 0 1.25rem; }
.cat.off .clabel { color: var(--dim); }
.cathead { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; }
.cathead label { display: inline-flex; align-items: center; gap: 0.4rem; }
.clabel { font-family: "Syne", sans-serif; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; width: 16rem; max-width: 100%; }
.cat .boxes { margin-top: 1rem; }
.sbox { border-top: 1px solid var(--rule); padding: 0.75rem 0 1rem; }
.bname { width: 100%; font-weight: 600; }
.clist { list-style: none; padding: 0; margin: 0.5rem 0; font-size: 0.92rem; }
.clist li { display: grid; grid-template-columns: 1fr auto auto; gap: 0.5rem; align-items: center; padding: 0.15rem 0 0.15rem 0.5rem; }
.clist li:nth-child(even) { background: var(--stripe); }
.clist b { font-weight: 500; }
.clist .tm { font-size: 0.7rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.clist .val { color: var(--dim); font-size: 0.82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
button.x { border: 0; padding: 0.1rem 0.55rem; color: var(--dim); font-size: 1.1rem; line-height: 1; }
.add { display: flex; gap: 0.4rem; }
.add input { flex: 1 1 auto; min-width: 0; }
.sbox .dimtxt { font-size: 0.8rem; }

@media (max-width: 40rem) {
  .form { grid-template-columns: 1fr; gap: 0.3rem; }
  .form > label { margin-top: 0.6rem; }
}

/* ---- new-pool and admin pages ---- */
.plist { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.plist input { min-width: 0; }
#newcode { margin: 1rem 0; }
#newcode .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.2rem; letter-spacing: 0.08em; user-select: all; }
#invites, #pools { margin-top: 1rem; }
#invites td, #pools td { white-space: nowrap; }
#invites button, #pools button { padding: 0.2rem 0.6rem; font-size: 0.85rem; }
.chk input[type=number] { width: 4.5rem; height: auto; }

/* ---- the pools page (/pools/, home.js) ---- */
.hlist { border-top: 1px solid var(--rule); }
.hrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 1.5rem; align-items: center;
  padding: 1rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.hrow:hover, .hrow:focus-visible { background: var(--panel); }
.hn { display: grid; gap: 0.15rem; min-width: 0; }
.hn b { font-family: "Syne", sans-serif; font-size: clamp(1.2rem, 3vw, 1.6rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.hf { color: var(--dim); font-size: 0.85rem; }
.hs { text-align: right; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.hs b { font-weight: 600; }
.hrow .arrow { display: inline-block; margin-left: 0.25rem; transition: transform 0.15s; }
.hrow:hover .arrow { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) { .hrow .arrow { transition: none; } }
.after { margin: 2rem 0 0; color: var(--dim); font-size: clamp(1.15rem, 2.4vw, 1.4rem); line-height: 1.4; }
.go { color: var(--ink); font-weight: 600; text-decoration: none; box-shadow: inset 0 -2px 0 var(--y); }
.go:hover, .go:focus-visible { background: var(--y); color: var(--on-y); box-shadow: none; outline: none; }
@media (prefers-color-scheme: light) { .go { box-shadow: inset 0 -2px 0 var(--ink); } }
@media (max-width: 34rem) { .hrow { grid-template-columns: 1fr; } .hs { text-align: left; } }

/* ---- playoff pools (playoff.html, playoff.js) ---- */
.form.hide, .plist.hide, .ctrl.hide, .tabs .hide { display: none; }
.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
#auth .note { margin-top: 0.75rem; }
.find { width: min(100%, 18rem); margin-bottom: 0.75rem; }
table.lb th:first-child, table.lb td:first-child { width: 3rem; color: var(--dim); }
table.lb th:nth-child(2), table.lb td:nth-child(2) { text-align: left; color: var(--ink); }
table.lb tbody tr[data-id] { cursor: pointer; }
table.lb tbody tr[data-id]:hover td { background: var(--panel); }
table.lb tr.me td { color: var(--ink); font-weight: 600; }
table.lb tr.me td:first-child { box-shadow: inset 4px 0 0 var(--y); }
@media (prefers-color-scheme: light) { table.lb tr.me td:first-child { box-shadow: inset 4px 0 0 var(--ink); } }
table.lb tr.det td { text-align: left; background: var(--panel); color: var(--dim); font-size: 0.9rem; line-height: 1.9; }
.pk { white-space: nowrap; margin-right: 1.1rem; }
.pk b { color: var(--ink); font-weight: 600; }
.pk.good b { box-shadow: inset 0 -2px 0 var(--y); }
@media (prefers-color-scheme: light) { .pk.good b { box-shadow: inset 0 -2px 0 var(--ink); } }
.pk.miss b { color: var(--dim); text-decoration: line-through; }
.rnd { margin-top: 1.75rem; }
.rnd:first-of-type { margin-top: 0; }
.rnd h3 { font: 500 0.8rem/1.4 "Plex", system-ui, sans-serif; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); margin: 0 0 0.25rem; }
.sr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 1rem; align-items: baseline; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
.sr .st { text-align: right; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.sr .dist { grid-column: 1 / -1; }
.sr .tm, .ser .tm { color: var(--dim); font-size: 0.85rem; }
.dist { font-size: 0.85rem; color: var(--dim); margin: 0; }
@media (max-width: 34rem) { .sr { grid-template-columns: 1fr; } .sr .st { text-align: left; } }
.ser { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.6rem 1.25rem; align-items: center; padding: 1rem 0; border-top: 1px solid var(--rule); }
.ser .teams { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.tbtn, .cupgrid button { display: grid; gap: 0.1rem; text-align: left; padding: 0.55rem 0.8rem; border-color: var(--rule); }
.tbtn b, .cupgrid b { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.02em; }
.tbtn small, .cupgrid small { font-size: 0.78rem; color: var(--dim); font-weight: 400; }
.tbtn.on, .gbtn.on, .cupgrid button.on { background: var(--y); color: var(--on-y); border-color: var(--y); }
.tbtn.on small, .cupgrid button.on small, .tbtn:hover:not([disabled]) small, .cupgrid button:hover:not([disabled]) small { color: inherit; opacity: 0.8; }
.ser button.on[disabled], .cupgrid button.on[disabled] { opacity: 1; cursor: default; }
.games { display: flex; align-items: center; gap: 0.35rem; }
.gbtn { min-width: 2.5rem; padding: 0.45rem 0; text-align: center; border-color: var(--rule); }
.ser .st { grid-column: 1 / -1; font-size: 0.85rem; color: var(--dim); }
@media (max-width: 40rem) { .ser { grid-template-columns: 1fr; } }
.cupgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); gap: 0.5rem; margin-top: 1rem; }
p.st { margin: 0.75rem 0 0; }
table.ptab td:first-child, table.ppl td:first-child, table.fix td:first-child { color: var(--ink); }
table.ptab input { width: 4.5rem; text-align: right; }
table.ppl td.acts { white-space: nowrap; }
table.ppl button, table.fix button { padding: 0.2rem 0.6rem; font-size: 0.85rem; margin-left: 0.3rem; }
table.fix td { vertical-align: top; }
table.fix td:nth-child(2) { text-align: left; }
.fixin { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; }
.fixin select, .fixin input { padding: 0.25rem 0.4rem; font-size: 0.85rem; }
b.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; align-self: center; user-select: all; }
/* on a phone the per-round columns give way to Cup and Total; a click on the name shows the rounds */
@media (max-width: 34rem) { table.lb .rc { display: none; } }
.rc0 { display: none; }
@media (max-width: 34rem) { .rc0 { display: inline; } }
table.lb:not(.all):not(.q) tr.rest { display: none; }

/* setup page: Advanced settings, folded away until opened */
details.adv > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.4rem 1rem; }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary h2 { margin: 0; display: inline; }
details.adv > summary h2::after { content: " +"; color: var(--dim); font-weight: 500; }
details.adv[open] > summary h2::after { content: " −"; }
details.adv[open] > summary { margin-bottom: 1.25rem; }
details.adv > summary:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.form .nhlonly.hide, .form label.hide { display: none; }

/* ---- survivor pools (survivor.html, survivor.js) ---- */
table.lb.sv th:nth-child(3), table.lb.sv td:nth-child(3) { text-align: left; }
table.lb.sv .pk { display: inline-flex; justify-content: flex-start; gap: 0.3rem; margin-right: 0; }
table.lb.sv tr.det .pk { margin-right: 1.1rem; }
table.lb tr.gone td, table.lb tr.gone td:nth-child(2) { color: var(--dim); font-weight: 400; }
.ser.sg { grid-template-columns: minmax(0, 1fr) 11rem; }
.ser.sg .st { grid-column: auto; text-align: right; }
@media (max-width: 40rem) { .ser.sg { grid-template-columns: 1fr; } .ser.sg .st { grid-column: 1 / -1; text-align: left; } }
.tbtn .hm { font-size: 0.68rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); margin-left: 0.3rem; }
.tbtn.on .hm, .tbtn:hover:not([disabled]) .hm { color: inherit; opacity: 0.8; }
.linkbtn { border: 0; padding: 0 0.2rem; background: none; color: var(--ink); font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.linkbtn:hover, .linkbtn:focus-visible { background: var(--y); color: var(--on-y); text-decoration: none; }

/* ---- the land acknowledgement, at the foot of every pool page (as on the site's home page) ---- */
footer.land { padding: 0 var(--gutter) 3rem; max-width: calc(78rem + 2 * var(--gutter)); margin: clamp(4rem, 10vw, 7rem) auto 0;
  color: var(--dim); font-size: 0.8rem; line-height: 1.55; }
footer.land p { max-width: 44rem; margin: 0; padding-top: 1.5rem; border-top: 1px solid var(--rule); }

/* admin: deleting a pool */
button.danger { border-color: var(--bad); color: var(--bad); }
button.danger:hover, button.danger:focus-visible { background: var(--bad); color: var(--bg); }
tr.delrow td { text-align: left; white-space: normal; }
.delask { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.25rem 0; }
.delask .ctrl { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.delask input { width: 12rem; max-width: 100%; }
