[hidden] { display: none !important; }
:root {
  --navy: #0C2340;
  --navy-2: #173a63;
  --red: #D50032;
  --red-soft: #fbe5ea;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #13213a;
  --muted: #5d6b82;
  --line: #dfe4ec;
  --open: #1f7a4d;
  --open-bg: #e8f5ee;
  --open-solid: #0C2340;
  --open-solid-hover: #173a63;
  --avail-bg: #eaf1fb;
  --avail: #2b5d9b;
  --taken-bg: #eef1f5;
  --shadow: 0 1px 2px rgba(12, 35, 64, .06), 0 4px 14px rgba(12, 35, 64, .06);
  --radius: 12px;
}
/* Dark theme is opt-in via the toggle (html[data-theme="dark"]); light is the default. */
:root[data-theme="dark"] {
  color-scheme: dark;
  & {
    --bg: #0b1422;
    --surface: #132033;
    --text: #e8edf5;
    --muted: #97a4b8;
    --line: #26354c;
    --open: #5fd39a;
    --open-bg: #133a2a;
    --taken-bg: #1a2839;
    --red-soft: #3a1520;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 15px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
code { font-size: .9em; }

/* Header */
.top { background: var(--navy); color: #fff; border-bottom: 4px solid var(--red); }
.top-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 18px; }
.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #aebdd2; }
.top h1 { font-size: clamp(22px, 4vw, 32px); font-weight: 800; }
.sync { font-size: 12px; color: #aebdd2; white-space: nowrap; }
.sync.err { color: #ffb3c1; }

.demo-banner { background: #fff4d6; color: #5c4400; font-size: 13px; padding: 8px 0; border-bottom: 1px solid #f0dca0; }
:root[data-theme="dark"] .demo-banner { background: #3a300f; color: #f5dd98; border-color: #5a4a14; }

/* On the clock */
.clock {
  margin: 20px 0;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 6px solid var(--red);
  padding: 16px 20px;
}
.clock-label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.clock-name { font-size: clamp(26px, 5vw, 38px); font-weight: 800; margin: 2px 0; }
.clock-meta { color: var(--muted); font-size: 14px; }
.clock.done { border-left-color: var(--open); }
.clock.done .clock-label { color: var(--open); }
.clock.paused { border-left-color: #b7791f; }
.clock.paused .clock-label { color: #b7791f; }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 12px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.dot.open { background: var(--open-solid); border: 1.5px solid var(--open-solid); }
.dot.taken { background: var(--taken-bg); border: 1.5px solid var(--line); }

/* Board */
.series { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.series-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 12px 16px; background: var(--navy); color: #fff; }
/* Month / series name stays at the top while you scroll its games.
   overflow: clip (not hidden) keeps the rounded corners without breaking sticky. */
.series { overflow: clip; }
.series-head { position: sticky; top: 0; z-index: 4; }
/* below the phone tab bar (6px gap + 52px bar + 6px cover) */
@media (max-width: 860px) { .series-head { top: 64px; } }
.series-head h3 { font-size: 16px; font-weight: 700; }
.series-head .price { font-size: 13px; color: #c9d5e5; white-space: nowrap; }
.game { display: grid; grid-template-columns: minmax(0, 1fr) repeat(var(--cols, 2), minmax(0, 1.2fr)); gap: 8px; align-items: center; padding: 10px 12px 10px 16px; border-top: 1px solid var(--line); }
.game:first-of-type { border-top: 0; }
.game-name { font-weight: 600; }
.game-sub { font-size: 12px; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.cond { display: inline-block; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--taken-bg); border-radius: 4px; padding: 1px 6px; }
.cond.hf { color: var(--navy-2); background: #e3ecf7; }
:root[data-theme="dark"] .cond.hf { color: #b9d2f0; background: #1c3350; }

.seat {
  font: inherit;
  border-radius: 9px;
  padding: 8px 10px;
  min-height: 52px;
  text-align: left;
  border: 1.5px solid var(--line);
  background: var(--taken-bg);
  color: var(--text);
  display: flex; flex-direction: column; justify-content: center;
}
.seat .s-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.seat .s-val { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat.open { background: var(--open-solid); border-color: var(--open-solid); color: #fff; cursor: pointer; transition: transform .08s, box-shadow .12s, background .12s; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seat.open .s-label { color: rgba(255,255,255,.85); }
.seat.open .s-val { color: #fff; font-size: 15px; font-weight: 800; }
.seat.open .s-val::after { content: " →"; font-weight: 700; }
.seat.open:hover { background: var(--open-solid-hover); box-shadow: 0 0 0 3px color-mix(in srgb, var(--open-solid) 30%, transparent); }
/* Taken seats recede */
.seat.taken { background: var(--taken-bg); border-color: transparent; border-style: dashed; }
.seat.taken .s-label { opacity: .75; }
.seat.taken .s-val { color: var(--muted); font-weight: 600; }
.seat.taken .s-val::before { content: "✓ "; }
/* Open but not pickable right now (paused) */
.seat:not(.open):not(.taken) { background: var(--avail-bg); border-color: var(--avail); }
.seat:not(.open):not(.taken) .s-val { color: var(--avail); }
.seat.open:active { transform: scale(.98); }
.seat.open:focus-visible { outline: 3px solid var(--navy-2); outline-offset: 2px; }
.seat.just { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { background: var(--red-soft); border-color: var(--red); } 100% { } }

@media (max-width: 520px) {
  .game { grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); padding: 10px 12px; }
  .game-info { grid-column: 1 / -1; }
}

/* Side cards */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 16px; }
.card h2 { margin-bottom: 10px; }
.upcoming, .log { margin: 0; padding: 0; list-style: none; }
.upcoming li { display: flex; justify-content: space-between; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.upcoming li:first-child { border-top: 0; font-weight: 700; color: var(--red); }
.upcoming .meta, .log .meta { color: var(--muted); font-size: 12px; }
.log { max-height: 320px; overflow: auto; }
.log li { padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.log li:first-child { border-top: 0; }
.log b { font-weight: 600; }
.empty { color: var(--muted); font-size: 13px; }
.totals { width: 100%; border-collapse: collapse; font-size: 14px; }
.totals th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding-bottom: 6px; }
.totals td { padding: 6px 0; border-top: 1px solid var(--line); }
.totals .num { text-align: right; font-variant-numeric: tabular-nums; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 4px 0; }

.foot { color: var(--muted); font-size: 12px; padding-top: 12px; padding-bottom: 32px; }

/* Dialogs */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(8, 20, 38, .55); }
dialog form { padding: 20px; display: grid; gap: 14px; }
dialog h3 { font-size: 20px; }
.pick-item { background: var(--open-bg); border: 1.5px solid var(--open); border-radius: 10px; padding: 12px; }
.pick-item .pi-title { font-weight: 700; }
.pick-item .pi-sub { color: var(--muted); font-size: 14px; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
select, input, #swap-dialog textarea { font: inherit; font-size: 16px; color: var(--text); background: var(--bg); border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; }
select:focus, input:focus { outline: 2px solid var(--navy-2); outline-offset: 1px; }
.hint { margin: 0; color: var(--muted); font-size: 14px; }
.form-error { margin: 0; color: var(--red); font-size: 14px; font-weight: 600; min-height: 1em; }
.form-error:empty { display: none; }
.actions { display: flex; justify-content: flex-end; gap: 10px; }
.btn { font: inherit; font-weight: 700; border-radius: 9px; padding: 10px 16px; border: 1.5px solid transparent; cursor: pointer; }
.btn.primary { background: var(--red); color: #fff; }
.btn.danger { background: var(--navy); color: #fff; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn:disabled { opacity: .6; cursor: wait; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.25); font-size: 14px; max-width: calc(100vw - 32px); z-index: 10; }

.tool { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.tool h4 { margin: 0; font-size: 15px; }
.tool .btn { justify-self: start; }
dialog { max-height: calc(100vh - 32px); overflow: auto; }

.upcoming li.out, .upcoming li.out:first-child { color: var(--muted); font-weight: 400; }
.upcoming li.out s, .totals tr.out s { text-decoration-thickness: 2px; }
.totals tr.out td { color: var(--muted); }
.side-links { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); font-weight: 500; }
label.check input { width: auto; }

.btn.drop { display: block; width: 100%; margin-bottom: 16px; background: var(--red); color: #fff; padding: 12px 16px; font-size: 15px; }
.btn.drop:hover { filter: brightness(1.08); }
.btn.drop:focus-visible { outline: 3px solid var(--navy-2); outline-offset: 2px; }
.btn.drop-m { display: none; }
@media (max-width: 860px) { .btn.drop-m { display: block; margin: 18px 0 8px; } }

/* Turn alerts */
.me-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -8px 0 18px; font-size: 14px; color: var(--muted); }
.me-bar label { display: inline; font-size: 14px; font-weight: 500; }
.me-bar select { width: auto; min-width: 180px; padding: 7px 10px; font-size: 15px; }
.turn-alert { position: sticky; top: 0; z-index: 5; background: var(--red); color: #fff; font-weight: 700; font-size: 16px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.turn-alert.next { background: var(--navy-2); font-weight: 600; font-size: 15px; }
.turn-alert-inner { display: flex; align-items: center; gap: 10px; padding-top: 12px; padding-bottom: 12px; }
.turn-alert-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; flex: none; animation: pulse-dot 1.2s ease-in-out infinite; }
.turn-alert.next .turn-alert-dot { animation: none; opacity: .8; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.clock.mine { border-left-color: var(--red); animation: pulse-ring 1.6s ease-in-out infinite; }
.clock.mine .clock-name { color: var(--red); }
@keyframes pulse-ring { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 45%, transparent); } 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--red) 0%, transparent); } }
.upcoming li.me span:first-child::after { content: " (you)"; color: var(--muted); font-weight: 500; }
@media (prefers-reduced-motion: reduce) {
  .turn-alert-dot, .clock.mine { animation: none; }
}

/* Theme toggle */
.top-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.theme-btn { font: inherit; font-size: 13px; font-weight: 600; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 5px 12px; cursor: pointer; white-space: nowrap; }
.theme-btn:hover { background: rgba(255,255,255,.18); }
.theme-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Loading state */
.clock.loading { border-left-color: var(--line); }
.clock.loading .clock-label { color: var(--muted); }
.loader { display: inline-flex; gap: 8px; align-items: center; height: 46px; }
.loader i { width: 14px; height: 14px; border-radius: 50%; background: var(--red); animation: bounce 1.1s ease-in-out infinite; }
.loader i:nth-child(2) { background: var(--navy-2); animation-delay: .15s; }
.loader i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0) scale(.8); opacity: .5; } 40% { transform: translateY(-10px) scale(1); opacity: 1; } }
.mini-spin { display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.sk { background: linear-gradient(90deg, var(--taken-bg) 0%, color-mix(in srgb, var(--taken-bg) 40%, var(--surface)) 50%, var(--taken-bg) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 6px; }
.sk-dark { background: linear-gradient(90deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,.28) 50%, rgba(255,255,255,.12) 100%); background-size: 200% 100%; }
.sk-line { height: 12px; margin: 5px 0; }
.sk-seat { height: 52px; border-radius: 9px; }
.sk-game { display: grid; grid-template-columns: minmax(0, 1fr) repeat(2, minmax(0, 1.2fr)); gap: 8px; align-items: center; padding: 10px 12px 10px 16px; border-top: 1px solid var(--line); }
.sk-series .series-head { padding: 16px; }
.w30 { width: 30%; } .w40 { width: 40%; } .w60 { width: 60%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (max-width: 520px) { .sk-game { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sk-game > div:first-child { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .sk, .loader i, .mini-spin { animation: none; } }

/* Cached board shown while live data loads */
body.stale .seat:not(.taken) { opacity: .7; }

.log-time { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Slow pick: over an hour on the clock */
.slow-clock { display: inline-flex; vertical-align: middle; margin-left: 8px; color: var(--muted); opacity: .8; }
.slow-clock svg { width: 20px; height: 20px; }

/* Turns beyond the seats left: only happen if someone ahead drops out */
.upcoming li.standby { color: var(--muted); }
.upcoming li.standby .meta { font-style: italic; }

/* ---------- Draft switcher (header tabs) ---------- */
.top-inner { padding-bottom: 12px; }
.draft-switch { display: flex; gap: 4px; overflow-x: auto; padding-top: 0; padding-bottom: 0; }
.draft-switch button { font: inherit; font-size: 14px; font-weight: 700; color: #aebdd2; background: transparent; border: 0; border-radius: 9px 9px 0 0; padding: 10px 16px 11px; cursor: pointer; white-space: nowrap; }
.draft-switch button:hover { color: #fff; }
.draft-switch button[aria-current="page"] { background: var(--bg); color: var(--text); }
.draft-switch button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.top { border-bottom-width: 0; }
.top::after { content: ""; display: block; height: 4px; background: var(--red); }

/* ---------- Regular season filters ---------- */
.rs-filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.rs-filters .frow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fchip { font: inherit; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 6px 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.fchip:hover { border-color: var(--navy-2); }
.fchip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .fchip[aria-pressed="true"] { background: #e8edf5; border-color: #e8edf5; color: #0b1422; }
.rs-filters .selects label { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; }
.rs-filters .selects select { width: auto; padding: 6px 8px; font-size: 14px; }
.fcount { margin-left: auto; font-size: 13px; color: var(--muted); }

/* ---------- Regular season game rows ---------- */
.rsg { display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(130px, 200px); gap: 12px; align-items: center; padding: 10px 12px 10px 14px; border-top: 1px solid var(--line); }
.rs-month .series-head + .rsg { border-top: 0; }
.rsg-date { display: flex; flex-direction: column; align-items: center; line-height: 1.05; border-radius: 9px; padding: 6px 0; background: var(--taken-bg); }
.rsg-date .mon { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rsg-date .dnum { font-size: 22px; font-weight: 800; }
.rsg-date .dow { font-size: 12px; font-weight: 600; color: var(--muted); }
.rsg-date.wknd { background: #e3ecf7; }
:root[data-theme="dark"] .rsg-date.wknd { background: #1c3350; }
.rsg-info { min-width: 0; }
.rsg.is-taken .rsg-info .game-name { color: var(--muted); }
.rsg.hl-holiday { box-shadow: inset 4px 0 0 var(--red); }
.rsg.hl-day { box-shadow: inset 4px 0 0 #d39b1c; }
.cond.tag-opener { background: var(--navy); color: #fff; }
.cond.tag-holiday { background: var(--red-soft); color: var(--red); }
.cond.tag-day { background: #fff4d6; color: #8a5a00; }
.cond.tag-promo { background: #e3ecf7; color: var(--navy-2); }
:root[data-theme="dark"] .cond.tag-day { background: #3a300f; color: #f5dd98; }
:root[data-theme="dark"] .cond.tag-promo { background: #1c3350; color: #b9d2f0; }
:root[data-theme="dark"] .cond.tag-opener { background: #e8edf5; color: #0b1422; }
@media (max-width: 520px) {
  .rsg { grid-template-columns: 52px minmax(0, 1fr); }
  .rsg-act { grid-column: 1 / -1; }
}

.notice-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; color: var(--muted); line-height: 1.55; }
.notice-card strong { color: var(--text); }

/* ---------- Past drafts ---------- */
.archive-view { margin-top: 20px; }
.arch { padding: 0; overflow: hidden; }
.arch summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: baseline; padding: 14px 16px; cursor: pointer; list-style: none; }
.arch summary::-webkit-details-marker { display: none; }
.arch summary::before { content: "▸"; color: var(--muted); margin-right: 4px; }
.arch[open] summary::before { content: "▾"; }
.arch-title { font-weight: 700; font-size: 16px; margin-right: auto; }
.arch .tbl { overflow-x: auto; border-top: 1px solid var(--line); }
.arch-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
.arch-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 12px; background: var(--taken-bg); }
.arch-table td { padding: 7px 12px; border-top: 1px solid var(--line); }
.arch-table tr.dim td { color: var(--muted); }

.btn.danger.armed { background: var(--red); }
@media (max-width: 520px) { .draft-switch button { padding: 9px 11px 10px; font-size: 13px; } }

/* Prices sent from the Season Ticket Manager */
.price-banner { background: #e6f2ea; color: #134a2c; border-color: #b9dbc5; }
:root[data-theme="dark"] .price-banner { background: #12301f; color: #bfe8cf; border-color: #1f4d33; }
.price-banner .link-btn { font-weight: 700; }
.price-list { list-style: none; margin: 0 0 10px; padding: 0; }
.price-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid rgba(127,127,127,.25); }
.price-list em { font-style: normal; opacity: .65; font-size: 12px; }

/* ---------- Commissioner setup (Firebase) ---------- */
.setup-view { margin-top: 20px; padding-bottom: 90px; }
.setup-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.setup-head h2 { font-size: 22px; text-transform: none; letter-spacing: 0; color: var(--text); }
.eyebrow-dark { margin: 0 0 2px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.sc { display: grid; gap: 12px; padding: 16px 18px; }
.sc h3 { font-size: 17px; }
.sc .hint { margin: 0; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.sf { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sf small { font-weight: 400; font-size: 12px; }
.sf.inline { display: inline-flex; align-items: center; gap: 8px; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.sc input, .sc select, .sc textarea { font-size: 15px; padding: 8px 10px; }
.sc textarea { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--bg); color: var(--text); border: 1.5px solid var(--line); border-radius: 8px; }
.tbl { overflow-x: auto; }
.stable { width: 100%; border-collapse: collapse; }
.stable th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 4px 6px; }
.stable td { padding: 3px 4px; vertical-align: middle; }
.stable input { width: 100%; min-width: 90px; padding: 6px 8px; font-size: 14px; }
.stable .pin-in { min-width: 70px; width: 90px; }
.stable .num-in { min-width: 60px; width: 80px; }
.stable .email-in { min-width: 190px; }
.stable .date-in { min-width: 112px; }
.stable .time-in { min-width: 80px; width: 100px; }
.stable .id-in { min-width: 110px; }
.stable.games td:nth-child(2) input { min-width: 150px; }
.stable tr.picked td { background: var(--open-bg); }
.acts { white-space: nowrap; text-align: right; }
.icon-btn { font: inherit; font-size: 14px; width: 30px; height: 30px; border-radius: 7px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; margin-left: 3px; }
.icon-btn:hover:not(:disabled) { border-color: var(--navy-2); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.slots { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.slots li { display: flex; align-items: center; gap: 6px; }
.slots select { width: auto; min-width: 200px; flex: 0 1 280px; }
.slot-no { width: 28px; text-align: right; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.warn { margin: 0; padding: 8px 12px; border-radius: 8px; background: #fff4d6; color: #8a5a00; font-size: 14px; }
:root[data-theme="dark"] .warn { background: #3a300f; color: #f5dd98; }
.save-bar { position: sticky; bottom: 0; z-index: 4; display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); }
.save-bar .btn { box-shadow: 0 6px 20px rgba(0,0,0,.18); }

/* Email & push alerts */
.btn:not(.primary):not(.danger):not(.ghost):not(.drop) { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn.small { padding: 7px 12px; font-size: 14px; font-weight: 600; }
.me-bar #notify-btn { margin-left: 0; }
.me-status { font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { .me-bar #notify-btn { margin-left: 0; } }
.actions.left { justify-content: flex-start; }
#notify-dialog form { display: grid; gap: 12px; }
#notify-who, #notify-settings { display: grid; gap: 12px; }
#notify-who[hidden], #notify-settings[hidden] { display: none; }
.nset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 14px; margin: 0; display: grid; gap: 10px; }
.nset legend { font-weight: 700; font-size: 14px; padding: 0 6px; }
.nset .hint { margin: 0; }
.nset .btn { justify-self: start; }
.notify-for { margin: 0; font-size: 14px; }
.nsec { display: grid; gap: 10px; }
.nsec + .nsec { border-top: 1px solid var(--line); padding-top: 12px; }
#pin-sec { border-top: 1px solid var(--line); padding-top: 12px; }
#pin-open { justify-self: start; }
.nsec h4 { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.push-on { color: var(--open); font-weight: 600; }

/* Emails sent from the Season Ticket Manager */
.email-map { display: grid; gap: 8px; }
.email-map .em-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.email-map .em-row:last-child { border-bottom: none; }
.email-map .em-who { font-weight: 600; font-size: 14px; }
.email-map .em-addr { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.email-map select { padding: 7px 10px; font-size: 15px; }
.email-map .em-row.is-new { background: var(--open-bg); margin: 0 -8px; padding: 8px; border-radius: 8px; }
.email-map .em-note { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.email-map label.check { font-size: 13px; margin-top: 4px; }
.email-map label.check s { color: var(--muted); }
.sync-where { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
@media (max-width: 560px) { .email-map .em-row { grid-template-columns: 1fr; } }
#sync-body { display: grid; gap: 10px; }
#sync-body .btn { justify-self: start; }
.email-map .em-row { grid-template-columns: minmax(0, 1fr) 190px; }
.email-map label.check { align-items: flex-start; }
.email-map label.check input { margin-top: 2px; }
@media (max-width: 560px) { .email-map .em-row { grid-template-columns: 1fr; } }

.opt { font-weight: 400; color: var(--muted); }
.checks.reminders { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Setup tab + ⚙ commissioner tools */
.draft-switch .cog-btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 12px 11px; color: #aebdd2; }
.draft-switch .cog-btn:hover { color: #fff; }
.setup-lock { max-width: 460px; margin: 8px auto 0; display: grid; gap: 10px; }
.setup-lock h2 { font-size: 20px; text-transform: none; letter-spacing: 0; color: var(--text); }
.lock-row { display: flex; gap: 8px; }
.lock-row input { flex: 1; }
.setup-head { align-items: center; }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.subtabs button { font: inherit; font-size: 14px; font-weight: 700; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.subtabs button[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .subtabs button[aria-current="page"] { background: #e8edf5; border-color: #e8edf5; color: #0b1422; }
.setup-intro { margin-bottom: 12px; }
.sgrid { align-items: start; }
.sf .opt { font-weight: 400; }
.sf.inline.off { opacity: .55; }
.stable input.ro, .stable input:disabled { background: var(--taken-bg); color: var(--muted); border-color: transparent; }
.stable tr.inactive td { opacity: .6; }
.stable tr.inactive input.ro { text-decoration: line-through; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--taken-bg); color: var(--muted); margin-left: 4px; }
.stable td:nth-child(2) .tag { margin-top: 4px; }
.dlg-sub { font-weight: 500; color: var(--muted); font-size: 15px; }
.sync-card { border: 1.5px solid var(--open); }
.site-updated { display: block; margin-top: 4px; }
.slots .slot-main { flex: 1; padding: 6px 8px; }
.slots .slot-name { font-weight: 600; }
.slots li.inactive .slot-name { color: var(--muted); text-decoration: line-through; }
.show-post { padding-top: 14px; padding-bottom: 14px; }
.big-check { align-items: flex-start; }
.big-check input { margin-top: 3px; width: 18px; height: 18px; }
.big-check span { display: grid; gap: 2px; }
.big-check strong { font-size: 15px; }
.big-check small { color: var(--muted); font-size: 13px; font-weight: 400; }

#notify-btn, #swap-notify-btn { display: inline-flex; align-items: center; gap: 7px; }
#notify-btn .bell, #swap-notify-btn .bell { flex: none; }

/* Regular season months fold up (closed by default on phones) */
.month-toggle { width: 100%; border: 0; font: inherit; text-align: left; cursor: pointer; align-items: center; }
.month-toggle:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.month-toggle h3 { display: flex; align-items: center; gap: 8px; }
.month-toggle .chev { display: inline-block; font-size: 13px; transition: transform .15s; }
.rs-month.closed .chev { transform: rotate(-90deg); }
.rs-month.closed { margin-bottom: 10px; }
.month-body[hidden] { display: none; }
.rs-month .month-body > .rsg:first-child { border-top: 0; }
.month-all { font-size: 13px; white-space: nowrap; }

/* Phones and small tablets: tabs for Games / Draft Order / Pick Log / Members */
.mtabs { display: none; }
@media (max-width: 860px) {
  /* Navy bar like the header, so it reads as the page's main navigation. */
  .mtabs { display: flex; gap: 4px; margin: 0 0 14px; padding: 5px; background: var(--navy); border-radius: 14px; position: sticky; top: 6px; z-index: 5; box-shadow: 0 0 0 6px var(--bg), 0 10px 18px rgba(12, 35, 64, .28); }
  .mtabs[hidden] { display: none; }
  .mtabs button { position: relative; flex: 1; font: inherit; font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, .78); background: transparent; border: 0; border-radius: 10px; padding: 11px 4px; cursor: pointer; white-space: nowrap; }
  .mtabs button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
  .mtabs button[aria-current="page"] { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
  .mtabs button[aria-current="page"]::after { content: ""; position: absolute; left: 28%; right: 28%; bottom: 4px; height: 3px; border-radius: 2px; background: var(--red); }
  .mtabs button:focus-visible { outline: 3px solid #fff; outline-offset: 1px; }
  :root[data-theme="dark"] .mtabs { background: #16294a; border: 1px solid #2b4268; box-shadow: 0 0 0 6px var(--bg), 0 10px 18px rgba(0, 0, 0, .5); }
  .m-hide { display: none !important; }
  .layout { gap: 0; }
}

/* ✓ when notifications are on */
#notify-btn .nb-check, #swap-notify-btn .nb-check { display: none; flex: none; color: var(--open); margin-left: 2px; }
#notify-btn.is-on .nb-check, #swap-notify-btn.is-on .nb-check { display: inline-block; }

/* Ticket Swap */
.tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; line-height: 1; vertical-align: 1px; }
.tab-badge[hidden] { display: none; }
.swap-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 16px; }
.swap-head h2 { font-size: 22px; text-transform: none; letter-spacing: 0; color: var(--text); margin-bottom: 4px; }
.swap-head .hint { max-width: 640px; }
.swap-btns { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#sw-notify .link-btn { margin: -4px 0 8px 30px; display: inline-block; }
#sw-notify p .link-btn { margin: 0; }
#swap-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
#swap-list > .notice-card, #swap-list > .empty { grid-column: 1 / -1; }
.swap-card { display: grid; gap: 8px; }
.swap-card.mine { --mine: #2b5d9b; background: #eef4fb; border: 1.5px solid var(--mine); border-left-width: 6px; }
:root[data-theme="dark"] .swap-card.mine { --mine: #6fa4e8; background: #16263d; }
.tag.mine { background: var(--mine, #2b5d9b); color: #fff; }
:root[data-theme="dark"] .tag.mine { color: #0b1422; }
.sw-sec { grid-column: 1 / -1; margin: 6px 0 -4px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sw-sec ~ .sw-sec { margin-top: 14px; }
.sw-none { grid-column: 1 / -1; }
.sw-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sw-who { font-weight: 800; font-size: 16px; }
.sw-icons { display: inline-flex; gap: 6px; color: var(--muted); }
.sw-ico { display: inline-flex; }
.sw-when { margin-left: auto; font-size: 12px; color: var(--muted); }
.sw-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: 14px; }
.sw-k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.gchips { display: flex; flex-wrap: wrap; gap: 5px; }
.gchip { display: inline-block; font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--open-bg); color: var(--text); border: 1px solid var(--line); }
.sw-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.sw-actions .hint { margin-right: auto; font-size: 13px; }
.sw-note { white-space: pre-wrap; }
.btn.primary.small { padding: 7px 12px; font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#swap-dialog form { display: grid; gap: 12px; }
#swap-dlg-body { display: grid; gap: 12px; }
#swap-dlg-actions { flex-wrap: wrap; }
.sw-checks { display: grid; gap: 6px; max-height: 220px; overflow-y: auto; padding-right: 4px; }
.sw-inline { display: flex; gap: 8px 18px; flex-wrap: wrap; }
.tag.want { background: var(--open-bg); color: var(--open); }
.tag.new { background: var(--red); color: #fff; }
.offer { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.offer.new { border-color: var(--red); }
.tag.ok { background: var(--open); color: var(--surface); }
.offer-accepted { border-color: var(--open); }
.offer-rejected { opacity: .6; }
.gchip.other { background: transparent; border-style: dashed; }
.sw-decide { display: inline-flex; gap: 8px; }
.sw-all { justify-self: end; margin: -6px 0 -4px; font-size: 14px; }
@media (max-width: 520px) { #swap-list { grid-template-columns: minmax(0, 1fr); } .sw-row { grid-template-columns: 84px minmax(0, 1fr); } }
.swap-view { padding-top: 6px; }
.swap-view .swap-head { margin-top: 4px; }

/* Test mode */
.test-banner { background: #ffc41f; color: #1d1600; border-color: #e0a800; }
:root[data-theme="dark"] .test-banner { background: #ffc41f; color: #1d1600; border-color: #e0a800; }
.test-banner a { color: inherit; font-weight: 700; }
.test-card { border: 1.5px dashed #9c7ae0; }

/* List / Calendar toggle (regular season) */
.vtoggle { display: inline-flex; align-self: flex-start; padding: 3px; gap: 2px; background: var(--taken-bg); border: 1px solid var(--line); border-radius: 10px; }
.vtoggle button { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 700; color: var(--muted); background: transparent; border: 0; border-radius: 8px; padding: 6px 14px; cursor: pointer; }
.vtoggle button[aria-pressed="true"] { background: var(--red); color: #fff; box-shadow: 0 1px 3px rgba(213, 0, 50, .3); }
/* A thin rule separates the view switch from the filters below it. */
.rs-filters .vtoggle { margin-bottom: 6px; }
.rs-filters .vtoggle + .frow { border-top: 1px solid var(--line); padding-top: 12px; }

/* Calendar view: month grids like the printed schedule */
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend .cl { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cl.open { background: var(--navy); }
.cl.taken { background: #c9ced6; }
.cl.mine { background: var(--red); }
.cal-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 0 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; padding: 8px; }
.cal-w { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-align: center; color: var(--muted); padding: 2px 0 4px; }
.cal-d { position: relative; min-height: 54px; border-radius: 6px; background: var(--taken-bg); padding: 3px 4px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; font: inherit; color: var(--muted); border: 0; text-align: center; overflow: hidden; }
.cal-d.blank { background: transparent; }
.cal-d .cn { position: absolute; top: 3px; left: 5px; font-size: 10px; font-weight: 700; opacity: .75; }
.cal-d .cstar { position: absolute; top: 2px; right: 4px; font-size: 10px; }
.cal-d .ct { font-size: 13px; font-weight: 800; letter-spacing: .02em; line-height: 1.1; }
.cal-d .cw { font-size: 10px; font-weight: 600; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-d.g { color: #fff; background: var(--navy); }
.cal-d.g .cn { opacity: .9; }
.cal-d.open { cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .0); transition: transform .08s ease, box-shadow .12s ease; }
.cal-d.open:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(12, 35, 64, .4); }
.cal-d.open:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.cal-d.taken { background: #c9ced6; color: #2a3445; }
.cal-d.taken.mine { background: var(--red); color: #fff; }
.cal-d.dim { opacity: .28; }
.cal-d.just { animation: cal-just 1.2s ease; }
@keyframes cal-just { 0% { transform: scale(1.12); } 100% { transform: none; } }
:root[data-theme="dark"] .cal-d.taken { background: #3a4659; color: #e8edf5; }
:root[data-theme="dark"] .cl.taken { background: #3a4659; }
:root[data-theme="dark"] .cal-d.g:not(.taken), :root[data-theme="dark"] .cl.open { background: #2b5d9b; }
@media (max-width: 420px) {
  .cal-months { grid-template-columns: 1fr; }
  .cal-grid { padding: 6px; gap: 2px; }
  .cal-d { min-height: 50px; padding: 3px 2px; }
  .cal-d .ct { font-size: 12px; }
}

.board-col.cal-mode .section-head .legend { display: none; }
:root[data-theme="dark"] .cal-d.taken.mine { background: var(--red); color: #fff; }

/* Month with no games left to pick: gray bar instead of navy. */
.series.full .series-head { background: #7b8696; }
.series.full .series-head .price { color: #eef1f5; }
:root[data-theme="dark"] .series.full .series-head { background: #3a4659; }

/* "Up next" is an extra on top of the methods above, not a method itself. */
.nextup-opt { margin: -2px 0 0 14px; padding: 4px 0 2px 14px; border-left: 3px solid var(--line); display: grid; gap: 6px; }
.nextup-opt .nextup-k { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.nextup-opt .hint { margin: 0; font-size: 12.5px; }
.nextup-opt.off label.check { opacity: .55; }

/* Notification & PIN settings on wider screens: two columns instead of one long scroll.
   Left: how to reach you. Right: drafts and Ticket Swap. Save and PIN run across the bottom. */
@media (min-width: 900px) {
  #notify-dialog.wide { width: min(980px, calc(100vw - 48px)); }
  #notify-dialog.wide form { padding: 24px 28px; }
  #notify-dialog.wide #notify-settings:not([hidden]) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "for for" "reach drafts" "reach swap" "actions actions" "pin pin";
    column-gap: 32px; row-gap: 14px; align-items: start;
  }
  #notify-dialog.wide .notify-for { grid-area: for; }
  #notify-dialog.wide #nsec-reach { grid-area: reach; }
  #notify-dialog.wide #nsec-drafts { grid-area: drafts; border-top: 0; padding-top: 0; }
  #notify-dialog.wide #nsec-swap { grid-area: swap; }
  #notify-dialog.wide #notify-actions { grid-area: actions; border-top: 1px solid var(--line); padding-top: 14px; }
  #notify-dialog.wide #pin-sec { grid-area: pin; }
  /* PIN fields side by side */
  #notify-dialog.wide #pin-fields:not([hidden]) { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 14px; align-items: end; }
  #notify-dialog.wide #pin-fields legend, #notify-dialog.wide #pin-fields .form-error, #notify-dialog.wide #pin-fields .actions { grid-column: 1 / -1; }
  #notify-dialog.wide > form > .hint { max-width: 760px; }
}

/* Your own rows in Draft Order and the Pick Log (the name chosen for on-screen alerts) */
.upcoming li.me, .log li.me { --me: #2b5d9b; background: #eaf1fb; padding-left: 12px; padding-right: 8px; border-radius: 8px; border-left: 4px solid var(--me); }
.upcoming li.me span:first-child, .log li.me b { color: var(--me); font-weight: 800; }
.upcoming li.me:first-child span:first-child { color: var(--red); }
.upcoming li.me + li, .log li.me + li { border-top-color: transparent; }
:root[data-theme="dark"] .upcoming li.me, :root[data-theme="dark"] .log li.me { --me: #8bb8f0; background: #16263d; }

/* "Who are you?" button next to Notification & PIN settings */
#who-btn { display: inline-flex; align-items: center; gap: 7px; }
#who-btn svg { flex: none; }
#who-btn.is-set { color: #2b5d9b; border-color: #b9cfe9; background: #eef4fb; }
:root[data-theme="dark"] #who-btn.is-set { color: #8bb8f0; border-color: #2b4268; background: #16263d; }

/* Pick buttons are navy; dark mode uses a brighter blue so they stand out. */
:root[data-theme="dark"] { --open-solid: #2b5d9b; --open-solid-hover: #3a6fb0; --avail-bg: #16263d; --avail: #8bb8f0; }

/* Your own games are green: list view seat + row stripe, calendar cell, legend. */
.seat.taken.mine { background: var(--open-bg); border: 1.5px solid var(--open); border-style: solid; }
.seat.taken.mine .s-val { color: var(--open); font-weight: 800; }
.rsg.is-mine { box-shadow: inset 4px 0 0 var(--open); }
.dot.mine { background: var(--open); border: 1.5px solid var(--open); }
.cl.mine { background: var(--open) !important; }
.cal-d.taken.mine, :root[data-theme="dark"] .cal-d.taken.mine { background: var(--open); color: #fff; }
:root[data-theme="dark"] .cal-d.taken.mine { color: #0b1422; }
