/* SlateAtlasPro web. Colors come from the logo: the navy globe, its grid lines, the blue wordmark and
   the cyan orbit. Cyan is reserved for live information (the next lock); blue is for actions.
   The one bold element is the lock-wave band; everything below it stays quiet. */
:root {
  --abyss: #061330;      /* page, sidebar, top band: the dark side of the globe */
  --ocean: #0c1f47;      /* the working sheet */
  --ocean-dark: #0c1f47; /* the sheet color inside the navy frame, in either theme */
  --deep: #051029;       /* inset tables and fields */
  --meridian: #1d3a72;   /* lines, the globe's grid */
  --line: #18305f;       /* hairlines on the sheet */
  --atlas: #1f6fe8;      /* actions (the wordmark blue, darkened for white text) */
  --atlas-hi: #5ea4ff;   /* links and highlights on dark */
  --orbit: #40d6ff;      /* live: next lock, countdown, focus */
  --polar: #e8f0ff;      /* text: the continents */
  --mist: #93a9d1;       /* secondary text */
  --open: #39d98a;
  --soon: #ffb547;
  --locked: #ff7088;
  --grid: rgba(80, 140, 255, 0.07);
  --row-alt: rgba(255, 255, 255, 0.018);
  --row-hover: rgba(94, 164, 255, 0.09);
  --best: rgba(64, 214, 255, 0.10);
  --font: "Archivo", "Segoe UI", system-ui, -apple-system, "Noto Sans", sans-serif;
  color-scheme: dark;
}
/* Light working sheet for people who prefer it; the brand band stays navy. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --ocean: #f5f8fe; --deep: #ffffff; --line: #d6e0f1; --polar-sheet: #0a1a3d;
    --atlas-hi: #1462e6; --mist-sheet: #4f6390; --row-alt: rgba(10, 26, 61, 0.025);
    --row-hover: rgba(20, 98, 230, 0.07); --best: rgba(0, 145, 199, 0.10); --orbit-sheet: #0078a8;
    --open-sheet: #12865a; --soon-sheet: #a8640a; --locked-sheet: #c23652;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --ocean: #f5f8fe; --deep: #ffffff; --line: #d6e0f1; --polar-sheet: #0a1a3d;
  --atlas-hi: #1462e6; --mist-sheet: #4f6390; --row-alt: rgba(10, 26, 61, 0.025);
  --row-hover: rgba(20, 98, 230, 0.07); --best: rgba(0, 145, 199, 0.10); --orbit-sheet: #0078a8;
  --open-sheet: #12865a; --soon-sheet: #a8640a; --locked-sheet: #c23652;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--abyss); color: var(--polar);
  font: 400 15px/1.5 var(--font); font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }
img { display: block; }
h1, h2 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.muted { color: var(--mist); }
.small { font-size: 13px; }
.error { color: var(--locked); min-height: 1.3em; margin: 0; }
:focus-visible { outline: 2px solid var(--orbit); outline-offset: 2px; }

/* --- the wordmark (Slate and Pro in the text color, Atlas in the logo blue) --- */
.wordmark { font-weight: 800; font-stretch: 115%; letter-spacing: -0.02em; color: var(--polar); white-space: nowrap; }
.wordmark span { color: #3b8bff; }

/* --- controls --- */
button, input, select { font: inherit; color: inherit; }
button {
  min-height: 38px; padding: 0 16px; border: 1px solid var(--meridian); border-radius: 8px;
  background: transparent; font-weight: 600; cursor: pointer; white-space: nowrap;
}
button:hover { border-color: var(--atlas); background: rgba(31, 111, 232, 0.12); }
button.primary { background: var(--atlas); border-color: var(--atlas); color: #fff; }
button.primary:hover { background: #2a7fff; border-color: #2a7fff; }
button.link { min-height: 0; border: 0; padding: 4px 2px; background: none; color: var(--atlas-hi); font-weight: 500;
  text-decoration: underline; text-underline-offset: 3px; }
button:disabled { opacity: 0.5; cursor: progress; }
a.button { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border: 1px solid var(--meridian);
  border-radius: 8px; font-weight: 600; text-decoration: none; color: inherit; white-space: nowrap; }
a.button.primary { background: var(--atlas); border-color: var(--atlas); color: #fff; }
a.button.primary:hover { background: #2a7fff; border-color: #2a7fff; }
a.button[target="_blank"]::after { content: " \2197"; margin-left: 6px; }
ol.steps-list { margin: 10px 0 6px; padding-left: 22px; line-height: 1.6; }
.odds-book { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-width: 19rem; max-width: 30rem; }
.odds-book input.tiny { width: 5.6rem; }
.odds-out { white-space: normal; flex-basis: 100%; }
.odds-out:empty { display: none; }
.odds-out.good { color: var(--open-sheet, var(--open)); font-weight: 700; }
p.rg { margin-top: 18px; }
/* beta: badge, header actions, small dialogs */
.beta-badge { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #fff;
  background: var(--atlas); border-radius: 999px; padding: 2px 8px; margin-left: 6px; }
.top-actions { display: flex; gap: 14px; align-items: center; }
.small-dialog { max-width: 560px; width: calc(100% - 32px); border: 1px solid var(--line); border-radius: 14px;
  background: var(--ocean); color: var(--polar-sheet, var(--polar)); padding: 22px 24px; }
.small-dialog::backdrop { background: rgba(3, 10, 28, 0.72); }
.small-dialog h2 { margin: 0 0 10px; font-size: 22px; }
.small-dialog h3 { margin: 16px 0 6px; font-size: 16px; }
.small-dialog label { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.small-dialog label.check { flex-direction: row; align-items: center; gap: 8px; }
.small-dialog textarea { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--deep); color: inherit; resize: vertical; }
.small-dialog .stack { border-top: 1px solid var(--line); margin-top: 12px; }
ul.beta-terms { padding-left: 20px; line-height: 1.55; margin: 8px 0 14px; }
.err-details { white-space: pre-wrap; font-size: 12px; max-width: 70ch; max-height: 240px; overflow: auto; margin: 6px 0 0; }
td.wrap { white-space: normal; min-width: 22rem; max-width: 40rem; }
.drop-overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(3, 10, 28, 0.78); border: 3px dashed var(--orbit); }
.drop-overlay > div { font-size: 24px; font-weight: 800; color: #fff; padding: 24px 32px; border-radius: 14px;
  background: rgba(31, 111, 232, 0.25); }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select {
  min-height: 38px; padding: 0 10px; border: 1px solid var(--meridian); border-radius: 8px;
  background: var(--deep); color: var(--polar);
}
input[type="file"] { font-size: 13px; color: var(--mist); }
input[type="file"]::file-selector-button {
  margin-right: 10px; min-height: 34px; padding: 0 12px; border: 1px solid var(--meridian); border-radius: 8px;
  background: transparent; color: var(--polar); font: 600 13px var(--font); cursor: pointer;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--atlas); width: 16px; height: 16px; }
input.tiny { width: 5rem; } input.short { width: 8rem; } input.mid { width: 14rem; }

/* --- login --- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background-color: var(--abyss);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
}
.login-box { width: min(23rem, 100%); display: grid; gap: 10px; text-align: center; }
.login-box .login-mark { width: 168px; height: 168px; margin: 0 auto 4px; }
.login-box .wordmark { font-size: 34px; line-height: 1.1; }
.login-box > p.muted { margin: 0 0 18px; }
.login-box label { text-align: left; color: var(--mist); font-size: 13px; }
.login-box input { width: 100%; }

/* --- app frame --- */
#app {
  display: grid; min-height: 100vh;
  grid-template-columns: 236px minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  grid-template-areas: "top top" "board board" "steps main";
}
.top { grid-area: top; display: flex; align-items: center; gap: 14px; padding: 12px 24px; border-bottom: 1px solid var(--meridian); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand .wordmark { font-size: 21px; }
.version { color: var(--mist); font-size: 12px; align-self: flex-end; padding-bottom: 3px; }
.slate-line { flex: 1; color: var(--mist); font-size: 14px; padding-left: 14px; border-left: 1px solid var(--meridian); }
/* the slate menu: site, sport, contest type, then the saved slate of that kind */
.picker { display: flex; align-items: flex-end; gap: 8px; padding-left: 14px; border-left: 1px solid var(--meridian); }
.picker label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--mist); }
.picker select { min-height: 32px; padding: 0 28px 0 10px; border-radius: 8px; border: 1px solid var(--meridian);
  background-color: var(--ocean-dark); color: var(--polar); font: 600 14px/1 var(--font); color-scheme: dark; }
.picker select:focus-visible { outline: 2px solid var(--orbit); outline-offset: 1px; }
.picker .pk-slate select { max-width: 240px; }
.group.guide { border: 1px solid var(--orbit-sheet, var(--orbit)); border-radius: 12px; padding: 16px 20px; }
.group.mvp { border-top: 0; padding: 4px 0 6px; }
.group.mvp .row { align-items: baseline; }
.group.mvp p { margin: 4px 0 0; }
input.mvp-pct { width: 4.2rem; padding-top: 4px; padding-bottom: 4px; }
p.note { margin: 10px 0 0; padding: 8px 12px; border-left: 3px solid var(--orbit-sheet, var(--orbit)); }
.guide h3 { margin: 12px 0 6px; font-size: 15px; }
.guide .chips li { padding-right: 12px; }
.top button.link { color: var(--polar); }

/* --- the lock-wave band: tonight's games, grouped by tip time, across a globe grid --- */
.board {
  grid-area: board; display: grid; grid-template-columns: minmax(0, 1fr) auto; border-bottom: 1px solid var(--meridian);
  background-color: var(--abyss);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
}
.waves { list-style: none; margin: 0; padding: 16px 0 18px 24px; display: flex; overflow-x: auto; scrollbar-width: thin; }
.wave { flex: 0 0 auto; min-width: 176px; padding-right: 18px; }
.wave-head { position: relative; padding: 0 0 16px; }
.wave-head::after { content: ""; position: absolute; left: 0; right: -18px; bottom: 6px; height: 1px; background: var(--meridian); }
.wave-head::before {
  content: ""; position: absolute; left: 0; bottom: 2px; width: 9px; height: 9px; border-radius: 50%; z-index: 1;
  background: var(--abyss); border: 1.5px solid var(--mist);
}
.wave-time { font-weight: 800; font-stretch: 85%; font-size: 19px; letter-spacing: 0.01em; }
.wave-note { color: var(--mist); font-size: 12px; margin-left: 8px; }
.wave.next .wave-time, .wave.next .wave-note { color: var(--orbit); }
.wave.next .wave-head::before { background: var(--orbit); border-color: var(--orbit); box-shadow: 0 0 0 4px rgba(64, 214, 255, 0.18), 0 0 14px rgba(64, 214, 255, 0.55); }
.wave.locked .wave-head::before { background: var(--meridian); border-color: var(--meridian); }
.wave.locked .wave-time { color: var(--mist); }
.wave-games { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.game { border: 1px solid var(--meridian); border-left: 3px solid var(--open); border-radius: 6px; background: rgba(12, 31, 71, 0.85); }
.game-btn {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; width: 100%; min-height: 0;
  padding: 6px 10px; border: 0; border-radius: 0 5px 5px 0; background: none; color: inherit; font-weight: inherit; text-align: left;
}
.game-btn:hover { background: rgba(64, 214, 255, 0.08); }
.game .teams { font-weight: 700; font-size: 14px; white-space: nowrap; }
.game .state { color: var(--mist); font-size: 12px; white-space: nowrap; text-align: right; }
.game .score { grid-column: 1 / -1; font-weight: 800; font-stretch: 85%; font-size: 17px; letter-spacing: 0.01em; white-space: pre; }
.game.soon { border-left-color: var(--soon); }
.game.soon .state { color: var(--soon); }
.game.locked { border-left-color: var(--locked); opacity: 0.6; }
.game.live { border-left-color: var(--orbit); border-color: rgba(64, 214, 255, 0.45); opacity: 1; }
.game.live .state { color: var(--orbit); font-weight: 700; }
.game.final { border-left-color: var(--mist); }
.waves > .game { min-width: 200px; display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; }  /* "no slate yet" */

.clock { padding: 16px 24px 18px; border-left: 1px solid var(--meridian); min-width: 220px; text-align: right; background: rgba(6, 19, 48, 0.75); }
.clock-label, .clock-sub { color: var(--mist); font-size: 13px; }
.clock-digits { margin: 2px 0; font-weight: 800; font-stretch: 75%; font-size: 48px; line-height: 1; letter-spacing: 0.01em; color: var(--orbit); }
.board.empty .clock-digits { color: var(--mist); }

/* --- steps: the sequence of the night, ticked as each one is done --- */
.steps { grid-area: steps; align-self: start; position: sticky; top: 0; display: flex; flex-direction: column; gap: 2px; padding: 20px 14px; }
.steps button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 12px;
  border: 0; border-radius: 8px; background: none; color: var(--mist); font-weight: 500; text-align: left;
}
.steps button:hover { background: rgba(31, 111, 232, 0.10); color: var(--polar); }
.steps .n {
  flex: 0 0 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--meridian);
  border-radius: 50%; font-size: 12px; font-weight: 700;
}
.steps button.done .n { background: var(--atlas); border-color: var(--atlas); color: #fff; }
.steps button.on { background: var(--ocean-dark); color: var(--polar); font-weight: 600; }
.steps button.on .n { border-color: var(--orbit); color: var(--orbit); background: transparent; box-shadow: 0 0 0 3px rgba(64, 214, 255, 0.15); }
.steps button.on.done .n { background: var(--atlas); color: #fff; }

/* --- the working sheet --- */
main {
  grid-area: main; min-width: 0; padding: 26px 34px 64px; background: var(--ocean); color: var(--polar-sheet, var(--polar));
  border-top-left-radius: 18px;
}
main .muted { color: var(--mist-sheet, var(--mist)); }
.view { max-width: 1480px; }
.view-title { font-size: 30px; font-weight: 800; font-stretch: 112%; line-height: 1.15; margin: 0 0 18px; }
.group { padding: 22px 0 10px; border-top: 1px solid var(--line); }
.view-title + .group { border-top: 0; padding-top: 2px; }
.group h2, details.group > summary, main h2 { font-size: 19px; font-weight: 700; font-stretch: 108%; margin: 0 0 12px; }
main h2.spaced, #trend-more h2 { margin-top: 28px; }
details.group > summary { cursor: pointer; margin-bottom: 0; }
details.group[open] > summary { margin-bottom: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; margin: 0 0 14px; }
.row label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--mist-sheet, var(--mist)); }
.row label > input, .row label > select { color: var(--polar-sheet, var(--polar)); }
.row label.check { flex-direction: row; align-items: center; gap: 8px; min-height: 38px; font-size: 14px; color: var(--polar-sheet, var(--polar)); }
.row label.grow { flex: 1; min-width: 12rem; }
.row label.grow input { width: 100%; }
.row .label { align-self: center; font-size: 17px; font-weight: 700; font-stretch: 108%; color: var(--polar-sheet, var(--polar)); }
.row label:has(> input + input) { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 6px; }
details.inline { align-self: center; }
details.inline > summary { cursor: pointer; color: var(--atlas-hi); font-weight: 500; }
details.inline[open] { flex-basis: 100%; }
details.inline > .row { margin: 10px 0 0; }
.summary { max-width: 82ch; white-space: pre-line; margin: 4px 0 14px; }
.spaced { margin-top: 14px; }
main input[type="text"], main input[type="password"], main input[type="number"], main input[type="date"],
main input[type="search"], main select { border-color: var(--line); color: var(--polar-sheet, var(--polar)); }
main button { border-color: var(--line); }
main input[type="file"]::file-selector-button { border-color: var(--line); color: var(--polar-sheet, var(--polar)); }
.board, .top, .steps, .login { color-scheme: dark; }
main button:hover { border-color: var(--atlas); }
main button.primary { border-color: var(--atlas); }

/* --- progress and notices --- */
.jobbar { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--deep); }
#job-label { font-weight: 600; }
.track { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.fill { height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--atlas), var(--orbit)); transition: width 0.4s ease; }
.notice {
  margin: 0 0 18px; padding: 12px 16px; border: 1px solid rgba(64, 214, 255, 0.28); border-left: 3px solid var(--orbit-sheet, var(--orbit));
  border-radius: 10px; background: rgba(64, 214, 255, 0.06); white-space: pre-line; max-width: 110ch;
}
.notice.bad { border-color: rgba(255, 112, 136, 0.35); border-left-color: var(--locked-sheet, var(--locked)); background: rgba(255, 112, 136, 0.07); }
#swap-single { margin-bottom: 14px; }

/* --- tables: inset into the sheet --- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--deep); }
.table-wrap.tall { max-height: 70vh; }
table.data { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.data th, table.data td { padding: 8px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.data th { position: sticky; top: 0; z-index: 1; background: var(--deep); color: var(--mist-sheet, var(--mist)); font-size: 12.5px; font-weight: 600; }
table.data td.num, table.data th.num { text-align: right; }
table.data tbody tr:nth-child(even) { background: var(--row-alt); }
table.data tbody tr:hover { background: var(--row-hover); }
table.data td.best { background: var(--best); color: var(--orbit-sheet, var(--orbit)); font-weight: 700; }
table.sortable th { cursor: pointer; }
table.sortable th:hover { color: var(--polar-sheet, var(--polar)); }
table.sortable th[aria-sort="ascending"]::after { content: " \25B2"; font-size: 0.7em; }
table.sortable th[aria-sort="descending"]::after { content: " \25BC"; font-size: 0.7em; }
table.data input { min-height: 30px; padding: 0 8px; }
table.data td .sub { color: var(--mist-sheet, var(--mist)); font-size: 12px; margin-left: 4px; }
td.flag { color: var(--soon-sheet, var(--soon)); }
td.out { color: var(--locked-sheet, var(--locked)); font-weight: 600; }
.empty-note { padding: 18px; color: var(--mist-sheet, var(--mist)); caption-side: top; text-align: left; }
td.pick input { width: 17px; height: 17px; }

/* --- picks --- */
/* position and team filters above player tables */
.filters { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.fbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.flabel { width: 68px; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--mist-sheet, var(--mist)); }
.fgame { display: inline-flex; gap: 4px; padding-right: 8px; margin-right: 2px; border-right: 1px solid var(--line); }
.fgame:last-child { border-right: 0; }
button.fbtn { min-height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--deep);
  color: var(--polar-sheet, var(--polar)); font-size: 13px; font-weight: 600; }
button.fbtn[aria-pressed="true"] { background: var(--atlas); border-color: var(--atlas); color: #fff; }
.fcount { margin: 0; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; background: var(--deep); }
.chips li.warn { border-color: var(--soon); }
.chips button { min-height: 0; border: 0; padding: 0 6px; background: none; color: var(--mist-sheet, var(--mist)); font-size: 16px; line-height: 1; }
.chips .empty-note { padding: 0; border: 0; background: none; }

/* --- reports --- */
.reports { list-style: none; margin: 0; padding: 0; max-height: 18rem; overflow: auto; font-size: 13.5px; }
.reports li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.reports time { color: var(--mist-sheet, var(--mist)); margin-right: 10px; }
.report-text { white-space: pre-wrap; font: 13.5px/1.55 var(--font); margin: 14px 0 0; max-width: 100ch; }

/* --- one game's live box score --- */
.game-dialog {
  width: min(1240px, 96vw); max-height: 90vh; padding: 0; border: 1px solid var(--meridian); border-radius: 14px;
  background: var(--ocean); color: var(--polar-sheet, var(--polar));
}
.game-dialog::backdrop { background: rgba(3, 10, 28, 0.72); }
.gd-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px;
  padding: 18px 22px 14px; background: var(--ocean); border-bottom: 1px solid var(--line);
}
#gd-title { font-size: 26px; font-weight: 800; font-stretch: 112%; white-space: pre; }
.gd-status { font-weight: 700; color: var(--mist-sheet, var(--mist)); }
.gd-status.live { color: var(--orbit-sheet, var(--orbit)); }
#gd-close { margin-left: auto; color: var(--atlas-hi); }
.gd-body { padding: 6px 22px 22px; }
.gd-team h3 { margin: 18px 0 8px; font-size: 18px; font-weight: 800; font-stretch: 108%; }
.game-dialog table.data td.fp { font-weight: 700; }
/* the player panel (click a name) */
.player-dialog { max-width: 1100px; }
#pd-title { font-size: 26px; font-weight: 800; font-stretch: 112%; }
.pd-controls { margin: 12px 0 0; align-items: center; }
.pd-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.pd-facts dt { color: var(--mist-sheet, var(--mist)); }
.pd-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
button.name-link { all: unset; cursor: pointer; color: inherit; font-weight: 600; border-bottom: 1px dotted var(--mist-sheet, var(--mist)); }
button.name-link:hover, button.name-link:focus-visible { color: var(--atlas-hi); border-bottom-color: var(--atlas-hi); outline: none; }
/* wide tables: Pick and Name stay in view while the numbers scroll sideways; a scroll bar on top as well */
.pin-cols table.data th:nth-child(1), .pin-cols table.data td:nth-child(1) { position: sticky; left: 0; z-index: 1; min-width: 34px; }
.pin-cols table.data th:nth-child(2), .pin-cols table.data td:nth-child(2) { position: sticky; left: var(--pin-left, 58px); z-index: 1; }
.pin-cols table.data td:nth-child(1), .pin-cols table.data td:nth-child(2) { background: var(--deep); }
.pin-cols table.data tbody tr:nth-child(even) td:nth-child(-n+2) { background: linear-gradient(var(--row-alt), var(--row-alt)), var(--deep); }
.pin-cols table.data tbody tr:hover td:nth-child(-n+2) { background: linear-gradient(var(--row-hover), var(--row-hover)), var(--deep); }
.pin-cols table.data th:nth-child(-n+2) { z-index: 2; }
.pin-cols table.data td:nth-child(2) { box-shadow: 1px 0 0 var(--line); }
.hscroll { overflow-x: auto; overflow-y: hidden; height: 14px; margin: 0 0 4px; }
.hscroll > div { height: 1px; }

/* the two views of a game: preview (before tip) and box score (live and final) */
.gd-tabs { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--deep); align-self: center; }
.gd-tabs button {
  min-height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: none; font-weight: 700; font-size: 13.5px;
  color: var(--mist-sheet, var(--mist));
}
.gd-tabs button[aria-selected="true"] { background: var(--atlas); color: #fff; }
.gd-line { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 6px 0 16px; }
.gd-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--deep); }
.gd-tile .k { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mist-sheet, var(--mist)); }
.gd-tile .v { font-size: 24px; font-weight: 800; font-stretch: 110%; font-variant-numeric: tabular-nums; }
.gd-tile .sub { font-size: 12.5px; color: var(--mist-sheet, var(--mist)); }
.gd-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 14px; align-items: start; }
table.compare { font-size: 13.5px; }
table.compare th, table.compare td { padding: 6px 10px; white-space: nowrap; }
table.compare tbody th { position: static; background: none; }
.gd-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.gd-card h3 { margin: 0 0 8px; font-size: 15px; font-weight: 800; font-stretch: 108%; }
.gd-card .small { margin: 8px 0 0; }
table.compare th[scope="row"] { font-weight: 600; text-align: left; color: var(--mist-sheet, var(--mist)); white-space: nowrap; }
.gd-list { list-style: none; margin: 0; padding: 0; font-size: 13.5px; max-height: 21rem; overflow: auto; }
.gd-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.gd-list li:last-child { border-bottom: 0; }
.gd-list li.none { display: block; color: var(--mist-sheet, var(--mist)); }
.gd-list .tag {
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--mist-sheet, var(--mist));
}
.gd-list li.up .tag { color: var(--open-sheet, var(--open)); border-color: currentColor; }
.gd-list li.down .tag { color: var(--locked-sheet, var(--locked)); border-color: currentColor; }
.game-dialog td.up { color: var(--open-sheet, var(--open)); font-weight: 700; }
.game-dialog td.down { color: var(--locked-sheet, var(--locked)); font-weight: 700; }
.game-dialog tr.out td { opacity: 0.5; }
.game-dialog tr.out td.pick { opacity: 1; }
@media (max-width: 1100px) { .gd-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* --- narrow screens: steps become a scrolling bar under the band --- */
@media (max-width: 900px) {
  #app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "board" "steps" "main"; }
  .top { flex-wrap: wrap; padding: 10px 16px; gap: 6px 12px; }
  .slate-line { flex-basis: 100%; order: 4; padding-left: 0; border-left: 0; font-size: 13px; }
  .picker { flex-basis: 100%; order: 3; padding-left: 0; border-left: 0; flex-wrap: wrap; }
  .picker label { flex: 1 1 40%; }
  .picker select, .picker .pk-slate select { width: 100%; max-width: none; }
  .flabel { width: 100%; }
  .version { display: none; }
  .top-actions { margin-left: auto; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .waves { padding: 12px 0 14px 16px; }
  .wave { min-width: 150px; }
  .clock { border-left: 0; border-top: 1px solid var(--meridian); text-align: left; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 10px 16px; }
  .clock-digits { font-size: 38px; }
  .game-dialog { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
  .gd-head, .gd-body { padding-left: 14px; padding-right: 14px; }
  #gd-title { font-size: 21px; }
  .gd-grid { grid-template-columns: minmax(0, 1fr); }
  .gd-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gd-tabs { order: 4; }
  .steps { position: sticky; top: 0; z-index: 5; flex-direction: row; overflow-x: auto; padding: 8px 12px; gap: 4px; background: var(--abyss); border-bottom: 1px solid var(--meridian); }
  .steps button { width: auto; flex: 0 0 auto; min-height: 38px; padding: 0 10px; gap: 8px; }
  .steps .n { flex-basis: 22px; height: 22px; font-size: 11px; }
  main { border-radius: 0; padding: 18px 16px 48px; }
  .view-title { font-size: 25px; }
  input.mid { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .fill { transition: none; } }
