/* Draft BBL. Direction: a night match under lights and the scorer's book.
   Quiet graphite chrome, one floodlight-amber accent, club colours and the scoreboard carry the colour.
   Redesign pass after "unslop" by Damir Sokolovsky (@heydamir), CC BY 4.0. */

:root {
  --deep: #ececea; --bg: #f6f6f4; --card: #ffffff; --raised: #f0f0ee; --raised-2: #e7e7e4;
  --ink: #171717; --secondary: #525252; --muted: #737373;
  --line: rgba(23, 23, 23, 0.08); --line-strong: rgba(23, 23, 23, 0.16);
  --accent: #e2a03a; --accent-text: #9a5b06; --on-accent: #1a1406;
  --btn-bg: #171717; --btn-ink: #ffffff;
  --pos: #16a34a; --neg: #dc2626;
  /* the scoreboard is the board at the ground: dark in both themes */
  --sb-bg: #161617; --sb-line: rgba(255, 255, 255, 0.08); --sb-ink: #ededed; --sb-muted: #8b8b91; --sb-accent: #f5b642;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --deep: #0f0f10; --bg: #141415; --card: #19191b; --raised: #232325; --raised-2: #2b2b2e;
    --ink: #ededed; --secondary: #a1a1a6; --muted: #85858b;
    --line: rgba(237, 237, 237, 0.08); --line-strong: rgba(237, 237, 237, 0.16);
    --accent: #f5b642; --accent-text: #f5b642; --on-accent: #1a1406;
    --btn-bg: #ededed; --btn-ink: #141415;
    --pos: #4cc38a; --neg: #e5484d;
    --sb-bg: #0f0f10;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/20px var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; }
main { max-width: 1200px; margin: 0 auto; padding: 24px 24px 64px; }
h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 500; line-height: 1.2; }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 16px; } h4 { font-size: 13px; color: var(--secondary); margin-top: 16px; }
small, .small { font-size: 12px; line-height: 16px; }
.muted { color: var(--muted); } .secondary { color: var(--secondary); }
.neg { color: var(--neg); font-weight: 500; }
.num, .fig { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.pad { padding: 12px 16px; }
.row { display: flex; align-items: center; } .gap { gap: 8px; } .gap4 { gap: 4px; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.r { text-align: right; } .nowrap { white-space: nowrap; }
pre { white-space: pre-wrap; overflow: auto; max-height: 520px; font-family: var(--mono); }
code { font-family: var(--mono); font-size: 12px; background: var(--raised); padding: 2px 4px; border-radius: 4px; }
.ic { flex-shrink: 0; vertical-align: -3px; }
.ic-ok { color: var(--pos); } .ic-todo { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- header + navigation ---------- */
.top { position: sticky; top: 0; z-index: 20; height: 56px; display: flex; align-items: center; gap: 24px; padding: 0 24px; background: var(--deep); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.mark { color: var(--ink); flex-shrink: 0; }
.tabsnav { display: flex; gap: 4px; height: 100%; flex: 1; }
.tabsnav a { display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--secondary); text-decoration: none; border-bottom: 2px solid transparent; transition: color 150ms var(--ease), border-color 150ms var(--ease); }
.tabsnav a:hover { color: var(--ink); }
.tabsnav a.on { color: var(--ink); border-bottom-color: var(--accent); }
.navicon { position: relative; display: inline-flex; }
.navbadge { position: absolute; top: -6px; right: -10px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font: 500 10px/16px var(--font); font-style: normal; text-align: center; }
.who { display: flex; align-items: center; gap: 4px; color: var(--secondary); white-space: nowrap; }
.whobtn { height: 32px; padding: 0 8px; border: 0; background: none; color: var(--secondary); gap: 6px; }
.whobtn span { max-width: 28vw; overflow: hidden; text-overflow: ellipsis; }
.whobtn:hover:not(:disabled) { color: var(--ink); }
.report { margin: 8px 0; font-size: 13px; }
.report h4 { margin: 12px 0 4px; }
.report ul { margin: 0; padding-left: 18px; color: var(--secondary); }
.report .err { color: var(--neg); }
.invite { white-space: pre-wrap; font: 13px/18px var(--mono); }
.wvrun { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.wvrun:last-child { border-bottom: 0; }
.wvplayer { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.wvplayer .bids { display: flex; flex-wrap: wrap; gap: 4px; }
.wvplayer .bid.won { color: var(--ink); font-weight: 500; border-color: var(--line-strong); }
.wvplayer .bid.lost, .wvplayer .bid.failed { color: var(--muted); }
@media (max-width: 760px) {
  .top { height: 48px; padding: 0 16px; gap: 12px; justify-content: space-between; }
  .brand span { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; }
  .tabsnav { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; gap: 0; background: var(--deep); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabsnav a { flex: 1; flex-direction: column; gap: 4px; padding: 8px 0; font-size: 11px; line-height: 12px; border-bottom: 0; border-top: 2px solid transparent; }
  .tabsnav a.on { border-top-color: var(--accent); }
  main { padding: 16px 16px 96px; }
}
.banner { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; font-size: 12px; text-decoration: none; }
.banner.test { background: var(--raised); color: var(--secondary); font-family: var(--mono); border-bottom: 1px solid var(--line); }
.banner.live { background: var(--accent); color: var(--on-accent); font-weight: 500; }
.banner.live .livedot { background: var(--on-accent); }
.livedot { display: inline-block; width: 6px; height: 6px; border-radius: 3px; background: var(--accent); margin-right: 4px; vertical-align: 1px; }
.live { color: var(--accent-text); }

/* ---------- surfaces and controls ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin: 12px 0; overflow: hidden; }
.cardhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 48px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cardhead h3 { margin: 0; font-size: 14px; }
.cardhead.flat { min-height: 0; padding: 0 0 8px; border: 0; }
.cardhead a { text-decoration: none; } .cardhead a:hover { color: var(--ink); }
.count { font-size: 12px; font-weight: 500; color: var(--accent-text); }

button, .btn { font: 500 14px/20px var(--font); height: 36px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--raised); color: var(--ink); border-radius: 8px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 120ms var(--ease); }
button:hover:not(:disabled), .btn:hover { background: var(--raised-2); }
button:active:not(:disabled), .btn:active { transform: scale(0.98); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.primary, .btn.primary { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
button.primary:hover:not(:disabled), .btn.primary:hover { background: var(--btn-bg); opacity: 0.88; }
button.danger, .small.danger { background: var(--neg); color: #fff; border-color: var(--neg); }
button.ghost, .btn.ghost { background: transparent; }
button.small, .btn.small, a.small.btn { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 6px; }
button.on { border-color: var(--accent); color: var(--accent-text); }
button.on .ic { fill: currentColor; }
button.icon-btn { width: 28px; padding: 0; }
button.link { height: auto; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); }
button.link:hover { text-decoration-color: currentColor; background: none; }
button.icon { width: 32px; height: 32px; padding: 0; border: 0; background: none; color: var(--muted); }
button.icon:hover:not(:disabled) { background: var(--raised); color: var(--ink); }
input, select, textarea { font: 400 14px/20px var(--font); width: 100%; min-height: 36px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); color: var(--ink); transition: border-color 150ms var(--ease); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; }
textarea.mono { font: 12px/16px var(--mono); }
label { display: block; margin: 12px 0; font-size: 13px; color: var(--secondary); }
label > input, label > select, label > textarea { margin-top: 4px; }
label.toggle { display: flex; align-items: center; gap: 8px; color: var(--ink); margin: 8px 0; }
label.toggle input { width: 16px; min-height: 0; height: 16px; accent-color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.filters input { flex: 2 1 200px; } .filters select { flex: 1 1 120px; width: auto; }
.hint { font-size: 13px; color: var(--muted); margin: 8px 0; }
.note { background: var(--raised); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.alert { border-radius: 8px; padding: 12px 16px; margin: 12px 0; font-size: 13px; }
.alert.bad { background: color-mix(in srgb, var(--neg) 8%, var(--card)); border: 1px solid color-mix(in srgb, var(--neg) 32%, transparent); }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 12px; background: var(--raised); border-radius: 10px; max-width: 100%; overflow-x: auto; }
.tabs button { height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--secondary); font-size: 13px; }
.tabs button:hover:not(:disabled) { background: transparent; color: var(--ink); }
.tabs button.on { background: var(--card); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 16px; }
@media (max-width: 640px) { .cols2 { grid-template-columns: 1fr; } }

/* ---------- tags ---------- */
.bbl { --c: #6b6b70; --t: #fff; display: inline-block; padding: 2px 6px; border-radius: 4px; background: var(--c); color: var(--t); font: 500 11px/16px var(--mono); }
.bbl.none { background: var(--raised); color: var(--muted); }
.pos { display: inline-block; padding: 1px 5px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--secondary); font: 400 11px/16px var(--mono); }
.chip { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); color: var(--secondary); font-size: 12px; line-height: 18px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.chip::before { content: none; width: 6px; height: 6px; border-radius: 3px; flex-shrink: 0; }
.chip.fa::before, .chip.completed::before { content: ''; background: var(--pos); }
.chip.wv::before { content: ''; border: 1px solid var(--muted); }
.chip.in::before, .chip.review::before, .chip.pending::before { content: ''; background: var(--accent); }
.chip.vetoed::before, .chip.failed::before, .chip.rejected::before { content: ''; background: var(--neg); }
.chip.countered::before, .chip.cancelled::before { content: ''; background: var(--muted); }
.chip.warn, .chip.unavailable, .chip.out { background: transparent; color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.chip.own.me { color: var(--ink); border-color: var(--line-strong); background: var(--card); }
.warn-t { color: var(--accent-text); font-size: 12px; }
.fx { display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.fx.complete { color: var(--secondary); } .fx.complete .ic { color: var(--pos); }
.fx.live { color: var(--accent-text); }

/* ---------- scorer's tracker ---------- */
.tracker { display: inline-flex; gap: 4px; align-items: center; }
.tk { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 4px; }
.tk.p { background: var(--ink); }
.tk.y { border: 1px solid var(--muted); }
.tk.s { background: var(--accent); }
.tk.d::after { content: ''; position: absolute; left: 3px; top: -1px; width: 1.5px; height: 10px; background: var(--neg); transform: rotate(35deg); border-radius: 1px; }

/* ---------- the scoreboard (home + matchup) ---------- */
.scoreboard { display: block; padding: 8px 20px; background: var(--sb-bg); color: var(--sb-ink); border: 1px solid var(--sb-line); border-radius: 12px; text-decoration: none; transition: border-color 150ms var(--ease); }
a.scoreboard:hover { border-color: rgba(255, 255, 255, 0.2); }
.sb-label { padding-top: 8px; font-size: 12px; color: var(--sb-muted); }
.sb-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 0; }
.sb-row + .sb-row { border-top: 1px solid var(--sb-line); }
.sb-name { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sb-name span { font-size: 16px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-name small { color: var(--sb-muted); margin-top: -4px; }
.sb-fig { font: 500 44px/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.sb-row.lead .sb-fig { color: var(--sb-accent); }
.scoreboard .tk.p { background: var(--sb-ink); }
.scoreboard .tk.y { border-color: var(--sb-muted); }
.scoreboard .tk.s { background: var(--sb-accent); }
.roundline { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.roundline h2 { margin: 0; }
.legend { margin: 8px 0 0; }

/* ---------- home ---------- */
.home { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: start; }
.home .col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.home .card { margin: 0; }
@media (max-width: 900px) {
  .home { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  .home .col { display: contents; }
  .o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; } .o5 { order: 5; } .o6 { order: 6; }
}
.alertrow, .notif, .daterow { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background-color 150ms var(--ease); }
.alertrow:last-child, .notif:last-child, .daterow:last-child { border-bottom: 0; }
.alertrow:hover, .notif:hover, .daterow:hover { background: var(--raised); }
.alertrow .ic { margin-top: 2px; }
.alertrow.bad { font-weight: 500; } .alertrow.bad .ic { color: var(--neg); }
.alertrow.warn .ic { color: var(--accent-text); }
.alertrow.info { color: var(--secondary); } .alertrow.info .ic { color: var(--muted); }
.notif { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: baseline; color: var(--secondary); }
.notif small { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.udot { width: 6px; height: 6px; border-radius: 3px; align-self: center; justify-self: center; }
.notif.unread { color: var(--ink); font-weight: 500; } .notif.unread .udot { background: var(--accent); }
.daterow { flex-direction: column; gap: 2px; }
.daterow small { color: var(--muted); } .daterow .when { color: var(--ink); font-weight: 500; }
.fxcard { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.fxcard:last-child { border-bottom: 0; }
.fxcard small { font-variant-numeric: tabular-nums; }

/* ---------- player line + lineup rows ---------- */
.pline { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pname { display: block !important; max-width: 100%; height: auto !important; padding: 0 !important; border: 0 !important; background: none !important; justify-content: flex-start !important; font-weight: 500 !important; text-align: left; text-decoration: none !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pname:hover { color: var(--accent-text); }
.pmeta { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.slotrow { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.slotrow:last-child { border-bottom: 0; }
.slotrow.click { cursor: pointer; transition: background-color 150ms var(--ease); } .slotrow.click:hover { background: var(--raised); }
.slotrow.gone { opacity: 0.4; text-decoration: line-through; }
.slot { flex-shrink: 0; width: 40px; padding: 2px 0; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); color: var(--secondary); font: 500 11px/16px var(--mono); text-align: center; }
.slot.sub { background: transparent; border-style: dashed; border-color: var(--line-strong); }
.spts { min-width: 48px; text-align: right; font: 500 15px/20px var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.spts.dim { color: var(--muted); font-weight: 400; }
.lockic { color: var(--muted); margin-right: 4px; vertical-align: -1px; }
.slotrow.subbed .pline { opacity: 0.5; }
.subin { margin-top: 4px; font-size: 12px; color: var(--secondary); }
.subin b { color: var(--ink); font-weight: 500; }
.cand { display: flex; width: 100%; height: auto; min-height: 56px; justify-content: flex-start; gap: 12px; padding: 8px 12px; margin: 4px 0; text-align: left; font-weight: 400; background: var(--card); }
.candmeta { text-align: right; color: var(--muted); white-space: nowrap; }
.pickable { cursor: pointer; margin: 0; color: var(--ink); } .pickable.on { background: var(--raised); }
.pickable input { width: 16px; min-height: 0; height: 16px; accent-color: var(--accent); }
details summary { padding: 12px 16px; cursor: pointer; color: var(--muted); font-size: 13px; }
.slotrow.bench { opacity: 0.85; }

/* ---------- team header, round picker ---------- */
.teamhead { display: flex; align-items: center; gap: 24px; padding: 16px 20px; flex-wrap: wrap; margin-top: 0; }
.teamhead > div:first-child { flex: 1; min-width: 160px; } .teamhead h2 { margin: 0 0 2px; }
.kv { text-align: right; } .kv span { display: block; font-size: 12px; color: var(--muted); } .kv b { font: 500 20px/28px var(--font); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .teamhead { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px; }
  .teamhead > div:first-child { grid-column: 1 / -1; }
  .kv { text-align: left; }
}
.roundpick { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.roundpick b { font-weight: 500; } .roundpick small { display: block; color: var(--muted); }

/* ---------- matchups ---------- */
.mlist { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.mcard { flex: 0 0 200px; height: auto; flex-direction: column; align-items: stretch; gap: 4px; padding: 12px; text-align: left; font-weight: 400; background: var(--card); border-color: var(--line); border-radius: 10px; }
.mcard.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--card); color: var(--ink); }
.mrow { display: flex; justify-content: space-between; gap: 8px; } .mrow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow b { font: 500 14px/20px var(--font); font-variant-numeric: tabular-nums; }
.win { color: var(--ink); font-weight: 500; }
.mrow b.win { color: var(--accent-text); }
.mlabel { display: block; font-size: 12px; font-weight: 500; color: var(--secondary); }
.h2h .mlabel { text-align: center; margin-top: 16px; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .sides { grid-template-columns: 1fr; } }
.side { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 12px; }
.side-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto auto; column-gap: 16px; row-gap: 4px; padding: 16px; background: var(--sb-bg); color: var(--sb-ink); text-decoration: none; }
.side-head b { font-weight: 500; font-size: 16px; } .side-head small { color: var(--sb-muted); grid-row: 2; }
.side-head .tracker { grid-row: 3; margin-top: 4px; }
.side-head .tk.p { background: var(--sb-ink); } .side-head .tk.y { border-color: var(--sb-muted); } .side-head .tk.s { background: var(--sb-accent); }
.side-head .big { grid-row: 1 / 4; grid-column: 2; align-self: center; font: 500 40px/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ---------- player list ---------- */
.plist .prow { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.plist .prow:last-child { border-bottom: 0; }
.prow.head { min-height: 36px; font-size: 12px; color: var(--muted); background: var(--raised); position: sticky; top: 0; }
.prow .num { width: 56px; text-align: right; flex-shrink: 0; font-size: 14px; }
.prow .num small { display: block; color: var(--muted); font-size: 11px; }
.prow .st { width: 120px; text-align: right; flex-shrink: 0; }
.prow .ac { width: 72px; text-align: right; flex-shrink: 0; display: flex; gap: 4px; justify-content: flex-end; }
.prow.head .sorthead { height: auto; padding: 0; border: 0; background: none; color: inherit; font: inherit; justify-content: flex-end; }
.prow.head .sorthead:hover { color: var(--ink); background: none; }
.prow.head .sorthead.on { color: var(--accent-text); }
.prow .num.on { color: var(--ink); font-weight: 500; }
.st-m { display: none; }
@media (max-width: 640px) {
  .plist .pname { white-space: normal; }
  .plist .pmeta small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .prow .num { width: 40px; font-size: 13px; }
  .prow .c-prev, .prow .c-cur:not(.on), .prow .st { display: none; }
  .st-m { display: inline; }
  .plist .grow { min-width: 112px; }
  .prow .ac { width: auto; }
  .plist .prow { padding: 8px 12px; gap: 8px; }
}

/* ---------- draft ---------- */
.draftbar { display: flex; align-items: center; gap: 16px; padding: 16px 20px; flex-wrap: wrap; }
.draftbar.myturn { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.onclock { font-size: 18px; line-height: 24px; font-weight: 500; }
.clock { font: 500 32px/1 var(--font); font-variant-numeric: tabular-nums; }
.clock.hot { color: var(--neg); }
.adminbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 8px 0 12px; }
.board-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.board { border-collapse: collapse; min-width: 720px; width: 100%; font-size: 12px; }
.board th, .board td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 8px; vertical-align: top; text-align: left; }
.board thead th { background: var(--raised); position: sticky; top: 0; font-weight: 500; color: var(--ink); }
.board th small { display: block; font-size: 11px; line-height: 16px; font-weight: 400; color: var(--muted); }
.board tbody th { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.board th.me { box-shadow: inset 0 -2px 0 var(--accent); }
.board td { min-width: 112px; background: var(--card); box-shadow: inset 3px 0 0 var(--pc, transparent); }
.board td b { display: block; font-weight: 500; } .board td small { color: var(--muted); }
.board td.now { box-shadow: inset 0 0 0 2px var(--accent); }
.board td.p-WK { --pc: #b39b52; } .board td.p-BAT { --pc: #5f86b0; } .board td.p-AR { --pc: #8a7fae; } .board td.p-BWL { --pc: #5e9c7a; }

/* ---------- tables and lists ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 500; background: var(--raised); }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl td.num { font-size: 13px; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--raised); }
.tbl.small td, .tbl.small th { padding: 6px 8px; font-size: 13px; }
.ladder a { text-decoration: none; } .ladder a:hover { text-decoration: underline; }
.ladder td.rank { width: 32px; color: var(--muted); }
.ladder tr.me td { background: var(--raised); }
.ladder tr.me td a { font-weight: 500; }
.ladder tr.cut td { border-bottom: 1px dashed var(--line-strong); }
.breakdown { background: var(--raised); font-size: 12px; } .breakdown span { display: inline-block; margin-right: 12px; }
.schedrow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; padding: 4px 0; }
.schedrow > span:last-child { text-align: right; } .schedrow .mlabel { grid-column: 1 / -1; }
.fxrow { display: grid; grid-template-columns: 40px 160px 120px 1fr; gap: 8px; align-items: center; padding: 6px 0; font-size: 13px; border-top: 1px dashed var(--line); }
.fxrow small:first-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.fxrow.complete { opacity: 0.6; }
@media (max-width: 640px) { .fxrow { grid-template-columns: 32px 1fr auto; } .fxrow small:last-child { display: none; } }
.txrow { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.txrow:last-child { border-bottom: 0; }
.txrow small { font-variant-numeric: tabular-nums; }
.txrow.trade span { font-weight: 500; }
.check { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; }
.check .ic { margin-top: 2px; }
.trade { padding: 16px; } .trade h4 { margin-top: 12px; }
.rules p { margin: 4px 0 12px; color: var(--secondary); } .rules p b { color: var(--ink); font-weight: 500; }
.rules h3 { margin-top: 16px; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; text-align: center; }
.stats3.four { grid-template-columns: repeat(4, 1fr); }
.stats3 > div { padding: 8px 4px; background: var(--raised); border-radius: 8px; }
.stats3 b { display: block; font: 500 22px/28px var(--font); font-variant-numeric: tabular-nums; } .stats3 small { color: var(--muted); }
.fxlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; font-size: 12px; }
.fxlist span { display: inline-block; width: 28px; color: var(--muted); } .fxlist small { color: var(--muted); }
.fxlist .complete { opacity: 0.6; }
.sparks { display: flex; flex-wrap: wrap; gap: 4px; }
.sparks span { padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--raised); font-size: 12px; line-height: 18px; font-variant-numeric: tabular-nums; }

/* ---------- trade messages ---------- */
.thread { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.msg { align-self: flex-start; max-width: 85%; padding: 8px 12px; border-radius: 12px 12px 12px 4px; background: var(--raised); font-size: 13px; white-space: pre-wrap; }
.msg.me { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: var(--card); border: 1px solid var(--line-strong); }
.msg small { display: block; color: var(--muted); font-size: 11px; }

/* ---------- modal, auth, toasts ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 32px 12px; overflow-y: auto; background: rgba(8, 8, 9, 0.56); animation: fade 200ms var(--ease); }
.modal { width: 100%; max-width: 560px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); animation: rise 240ms var(--ease); }
.modal.wide { max-width: 980px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 16px 20px 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.auth .card { width: 100%; max-width: 380px; padding: 24px; }
.auth button { width: 100%; margin-top: 8px; }
.brandline { display: flex; align-items: center; gap: 8px; font-size: 22px; }
.toasts { position: fixed; left: 50%; bottom: 88px; z-index: 100; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { padding: 10px 16px; border-radius: 10px; background: var(--btn-bg); color: var(--btn-ink); font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); animation: rise 240ms var(--ease); }
.toast.err { background: var(--neg); color: #fff; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
