/* Public draft-board mirror — vanilla styling only. No edge.css, no proprietary anything. */
:root {
  --bg: #0f1115; --panel: #171a21; --line: #262b36; --ink: #e8ebf0; --muted: #8b93a3;
  --accent: #3d7dff; --gone: #4a5162; --clock: #c07a1f;
  --good: #46a15e;   /* live/success green — was referenced but never defined */
  --cup: #e23b3b;    /* Solo-cup red — the league's identity mark */
  /* position color-coding (fantasy-cheat-sheet convention) */
  --qb: #e06c75; --rb: #57a773; --wr: #4a90d9; --te: #e0a458; --dst: #9b7ede; --k: #7f8896;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.topbar { display: flex; align-items: center; gap: 18px; padding: 10px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { font-weight: 700; }
.brand .tag { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 6px; }
/* a tiny abstract Solo cup before the league name — pure CSS, no markup change */
.brand::before { content: ""; display: inline-block; width: 9px; height: 13px; margin-right: 8px;
  background: linear-gradient(var(--cup) 0 78%, #f4f4f4 78%); border-radius: 2px 2px 3px 3px;
  transform: perspective(20px) rotateX(-8deg); vertical-align: -1px; }
.topbar nav { display: flex; gap: 14px; }
.topbar nav a { padding: 4px 8px; border-radius: 6px; }
.topbar nav a:hover { background: var(--line); }
.whoami { margin-left: auto; color: #7fdd9b; font-size: 12px; font-weight: 600; white-space: nowrap; }
.updated { color: var(--muted); font-size: 12px; white-space: nowrap; }
main { padding: 16px; }
.foot { color: var(--muted); font-size: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }

/* on-the-clock banner (sticky under the top bar, visible on every page) */
.clockbar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: #12151c;
  border-bottom: 1px solid var(--line); font-size: 13px; position: sticky; top: 44px; z-index: 15; }
.clockbar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--clock);
  box-shadow: 0 0 0 3px rgba(192,122,31,.25); animation: pulse 1.6s infinite; flex: none; }
.clockbar b { color: var(--clock); }
.clockbar .slot { color: var(--muted); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* search toolbar (Top 300) */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ta-wrap { position: relative; flex: 1; max-width: 440px; }
.toolbar input { width: 100%; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 14px; }
.toolbar input:focus { outline: none; border-color: var(--accent); }
.q-count { color: var(--muted); font-size: 12px; }
/* predictive typeahead dropdown */
.typeahead { position: absolute; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px;
  list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  max-height: 340px; overflow-y: auto; z-index: 30; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.typeahead[hidden] { display: none; }
.ta-item { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px; border-radius: 6px;
  cursor: pointer; border-left: 3px solid var(--pc, var(--muted)); }
.ta-item:hover, .ta-item.on { background: var(--line); }
.ta-rk { color: var(--muted); font-size: 11px; width: 32px; flex: none; }
.ta-nm { font-weight: 600; }
.ta-sub { color: var(--muted); font-size: 11px; margin-left: auto; padding-left: 10px; }
.ta-item.gone .ta-nm { text-decoration: line-through; color: var(--gone); }
.ta-item.gone .ta-sub { color: var(--good); }
.waiting { color: var(--muted); padding: 40px; text-align: center; font-size: 16px; }
.vh { font-size: 18px; margin: 0 0 14px; }
.vh .cnt { color: var(--muted); font-size: 13px; font-weight: 400; margin-left: 8px; }

/* position accents (badge + row border) */
.pos-QB { --pc: var(--qb); } .pos-RB { --pc: var(--rb); } .pos-WR { --pc: var(--wr); }
.pos-TE { --pc: var(--te); } .pos-DST { --pc: var(--dst); } .pos-K { --pc: var(--k); }

/* ---- Big board grid (sticky header + sticky round column, correctly layered) ----
   The grid scrolls INSIDE .board-scroll on both axes, so the sticky header and round
   column anchor to the board area itself — no fragile offset against the sticky topbar. */
.board-scroll { overflow: auto; max-height: calc(100vh - 150px); }
table.board { border-collapse: separate; border-spacing: 0; min-width: 100%; }
table.board th, table.board td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 5px 7px; text-align: left; vertical-align: top; background: var(--bg); }
/* Opaque backgrounds + explicit specificity so scrolled cells never bleed through. */
table.board thead th { position: sticky; top: 0; z-index: 3; background: var(--panel); font-size: 12px;
  color: var(--ink); white-space: nowrap; font-weight: 700; text-align: center; }
table.board .rnd-h, table.board td.rnd { position: sticky; left: 0; width: 34px; text-align: center;
  color: var(--muted); background: var(--panel); }
table.board td.rnd { z-index: 2; }
table.board thead th.rnd-h { z-index: 4; }   /* corner cell: above both the header row and the round column */
td.cell { min-width: 104px; height: 46px; }
td.cell.empty { background: var(--bg); }
.pname { font-weight: 600; font-size: 13px; }
.pmeta { color: var(--muted); font-size: 11px; }
.tradetag { color: var(--clock); font-size: 10px; margin-top: 2px; }
td.onclock { outline: 2px solid var(--clock); outline-offset: -2px; }
/* position color-coding on the board — the one grid view that lacked it — plus a ring on the
   pick that just landed. Static (no keyframes): the 1s #live swap would strobe an animation. */
td.cell.filled { border-left: 3px solid var(--pc, transparent);
  background: color-mix(in srgb, var(--pc, var(--bg)) 8%, var(--bg)); }
td.cell.latest { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---- By position ---- */
.pos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.pos-col { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  border-top: 3px solid var(--pc, var(--accent)); }
.pos-col h2 { margin: 0 0 8px; font-size: 14px; color: var(--pc, var(--accent)); }
.pos-col ol { margin: 0; padding-left: 20px; }
.pos-col li { margin: 5px 0; }
.sub { color: var(--muted); font-size: 11px; display: block; }

/* clickable player (opens the card) */
.pl { appearance: none; -webkit-appearance: none; background: none; border: 0; color: inherit;
  font: inherit; padding: 0; cursor: pointer; text-align: left; font-weight: 600; }
.pl:hover { text-decoration: underline; color: var(--accent); }

/* ---- Top 300 cheat sheet (4-column, color-coded, ESPN-style) ---- */
.cheat { columns: 4; column-gap: 22px; }
@media (max-width: 1100px) { .cheat { columns: 3; } }
@media (max-width: 820px) { .cheat { columns: 2; } }
@media (max-width: 540px) { .cheat { columns: 1; } }
.c-row { break-inside: avoid; display: flex; align-items: baseline; gap: 6px; padding: 2px 6px;
  border-left: 3px solid var(--pc, var(--muted)); margin-bottom: 2px; font-size: 13px; }
.c-row .rk { color: var(--muted); width: 30px; text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.c-row .pr { color: var(--pc, var(--muted)); font-size: 10px; width: 34px; flex: none; font-weight: 700; }
.c-row .nm { font-weight: 600; }
.c-row .tm { color: var(--muted); font-size: 11px; }
.c-row .by { margin-left: auto; color: var(--muted); font-size: 10px; flex: none; }
.c-row.gone .rk, .c-row.gone .pr { opacity: .5; }
.c-row.gone .nm, .c-row.gone .tm { text-decoration: line-through; color: var(--gone); }
.c-row .taken { margin-left: auto; color: var(--good); font-size: 10px; font-weight: 600; flex: none; }
.c-row.flash { animation: flash 1.4s ease-out; border-radius: 4px; }
@keyframes flash { 0% { background: rgba(61,125,255,.38); } 100% { background: transparent; } }

/* ---- Player card modal (public info only) ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: grid; place-items: center;
  z-index: 50; }
.modal-overlay[hidden] { display: none; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--pc, var(--accent));
  border-radius: 12px; padding: 20px 22px; width: min(360px, 92vw); position: relative; }
.mclose { position: absolute; top: 8px; right: 12px; background: none; border: 0; color: var(--muted);
  font-size: 22px; cursor: pointer; line-height: 1; }
.m-name { font-size: 20px; font-weight: 700; }
.m-sub { color: var(--pc, var(--muted)); font-size: 13px; margin: 2px 0 16px; font-weight: 600; }
.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.m-grid > div { display: flex; flex-direction: column; }
.m-grid span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.m-grid b { font-size: 17px; }
.m-links-h { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
  margin: 16px 0 8px; }
.m-links { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.m-link { text-decoration: none; font-size: 13px; font-weight: 600; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 8px;
  text-align: center; white-space: nowrap; }
.m-link.primary { grid-column: 1 / -1; border-color: var(--accent); color: var(--accent); }
.m-link:hover { border-color: var(--accent); color: var(--accent); background: rgba(61,125,255,.08); }
.m-note { color: var(--muted); font-size: 11px; margin-top: 16px; border-top: 1px solid var(--line);
  padding-top: 10px; }
/* floating variant: desktop hover — no screen dim, positioned near the name */
.modal-overlay.float { background: none; display: block; pointer-events: none; }
.modal-overlay.float .modal-card { position: fixed; width: 300px; pointer-events: auto;
  box-shadow: 0 10px 34px rgba(0,0,0,.55); }
.modal-overlay.float .mclose { display: none; }
/* the hover peek is a quick glance — no deep-links or draft affordance in the floating card */
.modal-overlay.float .m-links, .modal-overlay.float .m-links-h { display: none; }

/* ---- on-deck (your next pick, in the clock bar) ---- */
.clockbar .ondeck { color: var(--muted); margin-left: 6px; }
.clockbar .ondeck b { color: var(--ink); }
/* the loudest state in the app: it's YOUR pick. Inner element so the #onclock innerHTML swap keeps it. */
.clockbar .ondeck .you-up { background: var(--clock); color: #0f1115; padding: 2px 9px;
  border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .04em;
  animation: pulse 1.6s infinite; }

/* ---- Pick feed ---- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed-row { display: flex; align-items: center; gap: 12px; padding: 9px 11px; margin-bottom: 7px;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--pc, var(--muted));
  border-radius: 9px; }
.feed-row .fp-code { font: 600 12px/1 ui-monospace, Menlo, monospace; color: var(--muted);
  width: 38px; flex: none; text-align: center; font-variant-numeric: tabular-nums; }
.feed-row .fp-who { flex: 1 1 auto; min-width: 0; }
.feed-row .fp-who .pl { font-size: 15px; }
.feed-row .fp-meta { color: var(--muted); font-size: 12px; margin-left: 8px; }
.feed-row .fp-mgr { color: var(--muted); font-size: 12px; flex: none; }
.fp-react { display: flex; gap: 4px; flex: none; }
.react { font-size: 12px; line-height: 1; background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 7px; cursor: pointer; color: var(--muted); }
.react:hover:not(:disabled) { border-color: var(--muted); }
.react:disabled { cursor: default; opacity: .8; }
.react.mine { border-color: var(--clock); background: rgba(192,122,31,.14); color: var(--ink); }
.react .rn { font-variant-numeric: tabular-nums; font-weight: 600; }
/* the newest pick (feed is newest-first) reads as the headline — static, no strobing on poll */
.feed-row:first-child { border-color: var(--pc, var(--line)); background: #1b2029; }
.feed-row:first-child .fp-who .pl { font-size: 17px; }
.feed-row:first-child .fp-code { color: var(--ink); }

/* ---- League chat ---- */
.chatbar { display: flex; align-items: center; gap: 8px; padding: 10px 0 4px; }
.chatbar input { flex: 1 1 auto; max-width: 520px; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 14px; }
.chatbar input:focus { outline: none; border-color: var(--accent); }
.chat-spectator { color: var(--muted); padding: 12px 0; font-size: 13px; }
.chat-log { list-style: none; margin: 0; padding: 0; max-width: 680px; }
.chat-msg { padding: 8px 11px; margin-bottom: 6px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; font-size: 14px; line-height: 1.4; }
.chat-msg.mine { border-color: rgba(192,122,31,.4); background: rgba(192,122,31,.08); }
.chat-msg .cm-nm { font-weight: 700; font-size: 12px; color: var(--accent); margin-right: 8px; }
.chat-msg.mine .cm-nm { color: var(--clock); }
.chat-msg .cm-tx { color: var(--ink); overflow-wrap: anywhere; }

/* ---- My team ---- */
.mt-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.mt-counts .rc { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--panel);
  border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; }
.mt-counts .rc b { color: var(--ink); font-variant-numeric: tabular-nums; }
.mt-counts .rc.alt { color: var(--ink); }
.byeflag { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #e6b884;
  background: rgba(224,164,88,.12); border: 1px solid rgba(224,164,88,.35);
  border-radius: 9px; padding: 9px 12px; margin: 0 0 16px; }
.mt-slots { list-style: none; margin: 0; padding: 0; max-width: 620px; }
.mt-slots .slot { display: flex; align-items: center; gap: 11px; padding: 9px 11px; margin-bottom: 7px;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--pc, var(--muted));
  border-radius: 9px; }
.mt-slots .slot.empty { border-style: dashed; background: none; }
.mt-pos { font: 700 11px/1 -apple-system, sans-serif; width: 46px; flex: none; text-align: center;
  padding: 7px 0; border-radius: 6px; color: #0f1115; background: var(--pc, var(--muted)); }
.mt-pos.bench { background: var(--line); color: var(--muted); }
.slot.empty .mt-pos { background: var(--line); color: var(--muted); }
.mt-fill { flex: 1 1 auto; min-width: 0; }
.mt-fill .pl { font-size: 15px; }
.mt-fill .sub { display: block; }
.mt-fill .open { color: var(--muted); font-style: italic; }
.mt-bye { font: 600 12px/1 ui-monospace, Menlo, monospace; color: var(--muted); flex: none; }

/* ---- Cast-to-TV (chrome-free big screen) ---- */
.tvbody { background: radial-gradient(1200px 620px at 50% -5%, #16233c, var(--bg) 72%); }
.tv-wrap { max-width: 1100px; margin: 0 auto; padding: 32px 40px; }
.tv-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 22px; }
.tv-head .tv-brand { font-size: 22px; font-weight: 800; letter-spacing: .04em; }
.tv-head .tv-upd { color: var(--muted); font-size: 13px; margin-left: auto; }
.tv-otc { text-align: center; margin: 10px 0 34px; }
.tv-otc .tv-l { font: 800 13px/1 -apple-system, sans-serif; letter-spacing: .22em; text-transform: uppercase; color: var(--clock); }
.tv-otc .tv-big { font-size: clamp(40px, 7vw, 76px); font-weight: 800; letter-spacing: -.02em; margin: 14px 0 8px; }
.tv-otc .tv-s { font-size: 20px; color: var(--muted); font-weight: 600; }
.tv-recent { max-width: 760px; margin: 0 auto; }
.tv-recent .tv-rh { font: 800 12px/1 -apple-system, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.tv-row { display: flex; align-items: center; gap: 16px; padding: 10px 12px; font-size: 19px;
  border-left: 3px solid var(--pc, var(--muted)); border-bottom: 1px solid var(--line); }
.tv-row .c { font: 600 16px/1 ui-monospace, Menlo, monospace; color: var(--muted); width: 52px; flex: none; font-variant-numeric: tabular-nums; }
.tv-row .p { font-weight: 700; }
.tv-row .m { margin-left: auto; color: var(--muted); font-size: 15px; }

/* ---- Login ---- */
.login-body { display: grid; place-items: center; min-height: 100vh; }
form.login { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 28px 26px; width: min(360px, 90vw); text-align: center; }
form.login h1 { margin: 0 0 4px; }
form.login .sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
form.login input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); margin-bottom: 12px; }
form.login button { width: 100%; padding: 10px; border: 0; border-radius: 8px; background: var(--accent);
  color: #fff; font-weight: 600; cursor: pointer; }
form.login .err { color: #ff6b6b; font-size: 13px; margin-bottom: 12px; }

/* ---- who's-driving badge (viewers) ---- */
.driver-badge { font-size: 11px; color: var(--muted); border: 1px solid var(--line);
  padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.driver-badge.backup { color: var(--clock); border-color: var(--clock); font-weight: 700; }

/* ---- operator (backup board-runner) page ---- */
.op-main { padding: 16px; max-width: 720px; margin: 0 auto; }
.op-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 14px; }
.op-panel h2, .op-panel h3 { margin: 0 0 10px; }
.op-clock { background: #12151c; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.op-clock .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--clock); flex: none; }
.op-clock .slot { color: var(--muted); }
.op-inline { margin-left: auto; }
.op-btn { padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--accent);
  color: #fff; font-weight: 600; cursor: pointer; }
.op-btn:disabled { opacity: .4; cursor: not-allowed; background: var(--line); color: var(--muted); }
.op-btn.ghost { background: none; color: var(--ink); }
.op-btn.danger { background: var(--clock); }
.op-warn { background: rgba(192,122,31,.15); border: 1px solid var(--clock); color: var(--ink);
  padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.op-stale { color: var(--clock); font-weight: 600; }
.op-muted { color: var(--muted); font-size: 13px; }
.op-search { width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); margin-bottom: 10px; font-size: 14px; }
.op-avail { list-style: none; margin: 0; padding: 0; max-height: 440px; overflow-y: auto; }
.op-row { display: flex; align-items: center; gap: 10px; padding: 5px 4px 5px 8px;
  border-bottom: 1px solid var(--line); border-left: 3px solid var(--pc, var(--muted)); }
.op-row form { margin: 0; }
.op-draft { padding: 4px 10px; border: 0; border-radius: 6px; background: var(--good); color: #fff;
  font-size: 12px; font-weight: 600; cursor: pointer; }
.op-nm { font-weight: 600; }
.op-sub { color: var(--muted); font-size: 11px; }
.op-recent { list-style: none; margin: 0; padding: 0; }
.op-recent li { padding: 3px 0; border-bottom: 1px solid var(--line); }
.op-recent .rk { color: var(--muted); font-size: 11px; margin-right: 6px; }
.op-trade { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.op-trade label { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.op-trade input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--ink); width: 120px; }
.op-trade input[type=number] { width: 60px; }
details.op-panel summary { cursor: pointer; font-weight: 600; }

/* --- Your pick (remote drafting). Only rendered for a seat that opted in. --- */
.draftbar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
            padding: .5rem .8rem; background: #10151f; border-bottom: 1px solid #223; }
.draftbar .pill { font-size: .78rem; padding: .15rem .5rem; border-radius: 999px; white-space: nowrap; }
.draftbar .pill.live { background: #14361c; color: #7fdd9b; }
.draftbar .pill.down { background: #4a1f1f; color: #ff9a9a; }
.draftbar .pill.paused { background: #3d3413; color: #e8c46a; }
.draftbar #dq { flex: 1 1 180px; min-width: 140px; padding: .4rem .6rem; border-radius: 6px;
                border: 1px solid #2b3550; background: #0b0f17; color: #e8edf7; font-size: 1rem; }
.draftbar .dbtn { padding: .4rem .9rem; border-radius: 6px; border: 0; font-weight: 600;
                  background: var(--accent); color: #fff; font-size: 1rem; }
.draftbar .dbtn:disabled { background: #2b3550; color: #6b7690; }
.draftbar .dmsg { font-size: .82rem; color: #9fb0cc; }

/* Draft-from-card affordance: same one-tap intent as the bar, shown in the tapped player card. */
.m-draft { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.m-draft .dbtn { padding: .55rem 1rem; border-radius: 6px; border: 0; font-weight: 700;
                 background: #1e7d34; color: #fff; font-size: .95rem; cursor: pointer; }
.m-draft .dbtn:disabled { background: #2b3550; color: #6b7690; cursor: default; }
.m-draft .dmsg { font-size: .82rem; color: #9fb0cc; }

/* Log out sits to the right of the nav links, muted until hovered. */
.topbar nav a.logout { margin-left: auto; color: var(--muted); }
.topbar nav a.logout:hover { background: #4a1f1f; color: #ff9a9a; }

/* ---- chat unread badge + toast (shown on every page) ---- */
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 16px;
  height: 16px; padding: 0 4px; border-radius: 999px; background: #e23b3b; color: #fff;
  font: 700 10px/1 -apple-system, sans-serif; vertical-align: middle; margin-left: 2px; }
.nav-badge[hidden] { display: none; }   /* author display beats UA [hidden] — restore it, else the dot never clears */
.toast-wrap { position: fixed; top: 14px; right: 14px; z-index: 200; display: flex;
  flex-direction: column; gap: 8px; max-width: 330px; pointer-events: none; }
.toast.chat { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid #e23b3b;
  border-radius: 10px; padding: 10px 13px; font-size: 13px; line-height: 1.35; color: var(--ink);
  box-shadow: 0 12px 30px rgba(0,0,0,.5); animation: toastin .18s ease; word-break: break-word; }
.toast.chat b { color: #ff8a8a; }
@keyframes toastin { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* ==== Mobile (phones). Desktop/laptop above 640px renders exactly as before. ==== */
@media (max-width: 640px) {
  /* Top bar: stack it. Row 1 = brand (+ whoami right-aligned), row 2 = the nav as a
     full-width horizontal swipe strip. The bar stops being sticky on phones — a two-row
     header would eat too much of a small viewport; the clockbar takes over as the one
     sticky element (it is the thing you actually need pinned mid-draft). */
  .topbar { flex-wrap: wrap; gap: 4px 10px; padding: 8px 12px; position: static; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand .tag { display: none; }               /* "Draft Board" is chrome; buy the width back */
  .whoami { order: 1; margin-left: auto; }
  .updated { display: none; }                  /* still updated by JS, just not shown on phones */
  /* The nav is a 4-across grid of equal tiles — every destination visible at once, no
     horizontal scroll. grid-auto-rows:1fr keeps both rows the same height, so the tile whose
     label wraps to two lines ("Best Available") sizes its row and every tile matches it.
     With 7 links (no seat -> no "My Team") the grid just renders 4 + 3; no special-casing. */
  .topbar nav { order: 2; flex: 1 1 100%; display: grid;
    grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr;
    gap: 6px; margin: 6px 0 0; padding: 0; }
  .topbar nav a { display: flex; align-items: center; justify-content: center; gap: 4px;
    white-space: normal; text-align: center; min-height: 44px; padding: 4px 5px;
    font-size: 13px; line-height: 1.2; font-weight: 600;
    background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
  /* neutralize the desktop margin-left:auto — in a grid cell it would shrink the tile
     to fit-content and shove it right instead of filling its cell. */
  .topbar nav a.logout { margin-left: 0; }

  /* On-the-clock banner: the one sticky element on phones (the topbar above is static,
     so top:0 is correct here — no fragile offset against a variable-height header). */
  .clockbar { flex-wrap: wrap; row-gap: 2px; top: 0; }
  .clockbar .ondeck { margin-left: 0; flex-basis: 100%; padding-left: 16px; }

  main { padding: 12px 10px; }
  .foot { padding: 12px 10px; }

  /* Top-300 toolbar: search goes full width; 16px stops iOS Safari's focus-zoom (it never un-zooms) */
  .ta-wrap { max-width: none; }
  .toolbar input, .chatbar input { max-width: none; font-size: 16px; }

  /* Big board: .board-scroll stays the ONLY horizontal scroller; tighter cells so a
     phone sees more of the grid per swipe. */
  table.board th, table.board td { padding: 4px 5px; }
  td.cell { min-width: 88px; height: 42px; }

  /* Pick feed rows may wrap instead of squeezing the name to nothing */
  .feed-row { flex-wrap: wrap; gap: 6px 10px; }

  /* TV mode on a phone (someone will open it): just tighten the frame */
  .tv-wrap { padding: 20px 14px; }
}

@media (max-width: 400px) {
  .brand { font-size: 14px; }
  /* still 4 columns (everything stays visible) — just tighter type so ~80px tiles read fine */
  .topbar nav { gap: 4px; }
  .topbar nav a { font-size: 12px; padding: 3px 3px; min-height: 40px; }
  .whoami { display: none; }                   /* tiny screens: the nav + league name win */
  main { padding: 10px 8px; }
  td.cell { min-width: 80px; }
  .toast-wrap { left: 14px; max-width: none; } /* toasts span the screen instead of clipping */
  .clockbar { font-size: 12px; }
}
