/* Draft Night - group-chat-first dark theme.
   Self-hosted fonts, no external dependencies. Deliberately avoids newer CSS
   (color-mix, :has, container queries, backdrop-filter) so older smart-TV
   browsers render everything. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/fonts/barlow-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #070b10;
  --bg2: #0b1016;
  --panel: #10161e;
  --panel2: #171f29;
  --line: #222d3a;
  --line2: #2c3a4a;
  --text: #eef4fa;
  --muted: #8ba1b7;
  --gold: #f2b13e;
  --gold2: #ffd57a;
  --green: #3ecf8e;
  --red: #e2574c;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --cell-h: 52px;
  --name-fs: 14px;
  --sub-fs: 10px;
  --head-fs: 13px;
  --preview-rail-h: 82px;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 50% -10%, rgba(43, 62, 84, 0.25), rgba(0, 0, 0, 0) 60%);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body.scrollable { overflow: auto; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #26313f; border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #34435656; background: #344356; }

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

.btn {
  display: inline-block;
  padding: 9px 15px;
  border-radius: 10px;
  background: linear-gradient(180deg, #1b2531, #151d27);
  border: 1px solid var(--line2);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.08s ease, border-color 0.15s ease, filter 0.15s ease;
}
.btn:hover { border-color: #3d4f63; filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, #2d6cc4, #2258a5);
  border-color: #3d7fd6;
}
.btn.gold {
  background: linear-gradient(180deg, var(--gold2), var(--gold));
  border-color: var(--gold);
  color: #201503;
  box-shadow: 0 2px 10px rgba(242, 177, 62, 0.25);
}
.btn.gold:hover { filter: brightness(1.05); }
.btn.danger { background: linear-gradient(180deg, #8a3434, #6e2626); border-color: #9c3a3a; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { border-color: var(--line2); background: rgba(255, 255, 255, 0.03); }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: 0.4; cursor: default; }

.input {
  width: 100%;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0a0f15;
  color: var(--text);
  transition: border-color 0.15s ease;
}
.input:hover { border-color: var(--line2); }
.input:focus { outline: 2px solid #2f74d0; outline-offset: 0; border-color: transparent; }

/* ---------- landing ---------- */
.landing {
  min-height: 100vh;
  overflow: auto;
  padding: 52px 20px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.016) 0 1px, rgba(0, 0, 0, 0) 1px 90px),
    radial-gradient(1200px 600px at 50% -10%, rgba(43, 62, 84, 0.3), rgba(0, 0, 0, 0) 60%);
}
.hero { text-align: center; margin-bottom: 36px; }
.hero .ball { font-size: 52px; filter: drop-shadow(0 6px 18px rgba(242, 177, 62, 0.25)); }
.hero h1 {
  font-family: var(--display);
  font-size: 64px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 10px;
  color: var(--gold);
  background: linear-gradient(180deg, #ffe1a3, var(--gold) 55%, #d99a26);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { color: var(--muted); margin-top: 12px; max-width: 480px; line-height: 1.6; }
.cards { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; width: 100%; max-width: 780px; }
.card {
  background: linear-gradient(180deg, #121924, var(--panel));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  flex: 1 1 300px;
  max-width: 380px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--line2);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}
.card h2 {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.field { margin-bottom: 13px; }
.field label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.55; }
.recent { margin-top: 30px; text-align: center; }
.recent .lbl { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; margin-bottom: 9px; }
.recent .btn { margin: 4px; }

/* ---------- room layout ---------- */
.room { height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  background: linear-gradient(180deg, #121924, var(--panel));
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  min-height: 54px;
  flex-wrap: nowrap;
  padding-top: calc(9px + env(safe-area-inset-top));
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}
.roomcode {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 13px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.roomcode:hover { border-color: var(--gold); color: var(--gold2); }
.statuspill {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 3px 11px;
  border-radius: 99px;
}
.statuspill.setup { background: #333e4d; }
.statuspill.live { background: #123c24; color: #7fe8b1; }
.statuspill.live::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--green);
  margin-right: 7px;
  vertical-align: 1px;
  animation: livedot 1.4s ease-in-out infinite;
}
@keyframes livedot { 50% { opacity: 0.35; } }
.statuspill.paused { background: #57430f; color: #fbd38d; }
.statuspill.done { background: #1e3a5f; color: #93c5fd; }
.statuspill.connecting,
.statuspill.reconnecting {
  background: #57430f;
  color: #fbd38d;
}
.statuspill.stale,
.statuspill.offline {
  background: #702b2b;
  color: #ffd1cc;
  border: 1px solid #bd4b43;
}
.connectionpill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid var(--line2);
  border-radius: 99px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.connectionpill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: currentColor;
}
.connectionpill.connected { color: #7fe8b1; border-color: #246c45; background: #0e2f1c; }
.connectionpill.test { color: #d8c4ff; border-color: #7755b8; background: #3b2861; }
.connectionpill.connecting,
.connectionpill.reconnecting { color: #fbd38d; border-color: #8a6a1a; background: #3b2e0d; }
.connectionpill.stale,
.connectionpill.offline { color: #ffd1cc; border-color: #bd4b43; background: #5a2424; }

.connection-alert {
  position: fixed;
  z-index: 120;
  top: 0;
  left: 0;
  right: 0;
  min-height: calc(34px + env(safe-area-inset-top));
  padding: calc(7px + env(safe-area-inset-top)) 16px 7px;
  text-align: center;
  background: #5a2424;
  border-bottom: 1px solid #d45d54;
  color: #fff1ef;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.13em;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
}
.connection-alert.connecting,
.connection-alert.reconnecting {
  background: #4a390f;
  border-bottom-color: #b78c28;
  color: #ffedbd;
}
.connection-alert[hidden] { display: none; }
body.connection-problem .room {
  padding-top: calc(34px + env(safe-area-inset-top));
}
.clockbox {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  font-size: 18px;
  padding: 2px 10px;
  border-radius: 8px;
  background: var(--panel2);
  border: 1px solid var(--line2);
}
.clockbox.low { color: #ffb4a8; border-color: #9c3a3a; animation: blink 1s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: 0.45; } }
.lastpick-mini { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 120px; min-width: 0; }
.lastpick-mini b { color: var(--text); }
.topbtns {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.topbtns::-webkit-scrollbar { display: none; }
.topbtns .btn { flex: 0 0 auto; }
.commish-chip {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 99px;
  border: 1px solid rgba(242, 177, 62, 0.65);
  background: rgba(242, 177, 62, 0.1);
  color: var(--gold2);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.statuspill.test {
  background: #3b2861;
  color: #d8c4ff;
  border: 1px solid #7755b8;
}

/* ---------- board ---------- */
.board-wrap { flex: 1 1 auto; overflow: auto; position: relative; }
.board {
  display: grid;
  gap: 3px;
  padding: 7px;
  min-width: 100%;
}
.bh, .rl, .cell { border-radius: 7px; overflow: hidden; }
.bh {
  background: linear-gradient(180deg, #1a2330, #141c26);
  border: 1px solid var(--line2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3px 4px;
  height: 40px;
  cursor: pointer;
  position: sticky;
  top: 7px;
  z-index: 3;
  transition: border-color 0.15s ease;
}
.bh:hover { border-color: #40536a; }
.bh .tname {
  font-family: var(--display);
  font-weight: 700;
  font-size: calc(var(--head-fs) + 3px);
  letter-spacing: 0.04em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bh .tnum { font-size: 9px; color: var(--muted); font-weight: 700; letter-spacing: 0.06em; }
.bh.claimed .tnum::after { content: " \2022 claimed"; color: var(--green); }
.bh.onclock { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 14px rgba(242, 177, 62, 0.25); }
.corner { background: transparent; border: none; cursor: default; box-shadow: none; }
.rl {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  height: var(--cell-h);
  position: sticky;
  left: 7px;
  z-index: 2;
}
.rl .arrow { font-size: 9px; opacity: 0.7; font-family: "Inter", sans-serif; }

.cell {
  height: var(--cell-h);
  border: 1px solid var(--line);
  background: #0d1319;
  position: relative;
  padding: 3px 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  transition: height 0.55s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.cell.empty { box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.35); }
.cell .pl {
  position: absolute;
  bottom: 3px;
  right: 6px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.55);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.cell.empty .pl { color: #3a4856; }
.cell .pn {
  font-weight: 800;
  font-size: var(--name-fs);
  line-height: 1.12;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.cell .ps {
  font-size: var(--sub-fs);
  font-weight: 700;
  opacity: 0.92;
  letter-spacing: 0.04em;
  padding-right: 32px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cell.commish-click { cursor: pointer; }
.cell.commish-click:hover { filter: brightness(1.12); }

/* position stickers: gradient + top highlight, like a real draft-kit label */
.cell.pos-QB { background: linear-gradient(180deg, #e05a66, #c93f4b); border-color: #e2707a; }
.cell.pos-RB { background: linear-gradient(180deg, #35b697, #27967c); border-color: #52bfa4; }
.cell.pos-WR { background: linear-gradient(180deg, #4a8bdb, #3670bd); border-color: #6499dc; }
.cell.pos-TE { background: linear-gradient(180deg, #e69549, #d17c2e); border-color: #e8a465; }
.cell.pos-K  { background: linear-gradient(180deg, #9a76d9, #8058c4); border-color: #a687dc; }
.cell.pos-DST { background: linear-gradient(180deg, #67788a, #52616f); border-color: #7a8794; }
.cell.pos-QB, .cell.pos-RB, .cell.pos-WR, .cell.pos-TE, .cell.pos-K, .cell.pos-DST {
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 2px 5px rgba(0, 0, 0, 0.3);
}
.cell.pos-QB .pl, .cell.pos-RB .pl, .cell.pos-WR .pl, .cell.pos-TE .pl, .cell.pos-K .pl, .cell.pos-DST .pl { color: rgba(255, 255, 255, 0.72); }

.cell.cur {
  outline: 3px solid var(--gold);
  outline-offset: -1px;
  animation: pulse 1.6s ease-in-out infinite;
  box-shadow: 0 0 18px rgba(242, 177, 62, 0.22);
}
.cell.cur .onclock-tag {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.14em;
}
@keyframes pulse { 50% { outline-color: rgba(242, 177, 62, 0.35); } }
.cell.pop { animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes pop { 0% { transform: scale(0.6); } 70% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* ---------- bottom bars ---------- */
.bottombar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(180deg, var(--panel), #0e141c);
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
.bottombar .obc { font-size: 14px; color: var(--muted); min-width: 0; }
.bottombar .obc b { color: var(--text); font-size: 15px; }
.bottombar.yourturn {
  background: linear-gradient(180deg, #3a2c0d, #2b2008);
  border-top: 2px solid var(--gold);
}
.bottombar.yourturn .obc { font-family: var(--display); letter-spacing: 0.08em; font-size: 16px; }
.bottombar.yourturn .obc b { color: var(--gold); font-size: 19px; }
.bbtns { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }

/* ---------- TV mode ---------- */
body.tv .topbar {
  min-height: 46px;
  padding: 5px 16px;
  padding: calc(5px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 5px calc(16px + env(safe-area-inset-left));
}
body.tv.hidecursor, body.tv.hidecursor * { cursor: none !important; }
.ticker {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  gap: 22px;
  padding: 14px 20px 12px;
  background: linear-gradient(180deg, #131a24, #0e141c);
  border-top: 2px solid var(--line2);
  min-height: 78px;
  position: relative;
}
body.tv .ticker { display: flex; }
.ticker .tprogress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #1a2330;
}
.ticker .tp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold2));
  box-shadow: 0 0 8px rgba(242, 177, 62, 0.5);
  transition: width 0.6s ease;
}
.ticker .sect { min-width: 0; padding-left: 12px; border-left: 3px solid var(--line2); }
.ticker .sect.grow { flex: 1 1 auto; border-left-color: var(--gold); }
.ticker .lbl {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 700;
}
.ticker .big {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticker .big .posdot { display: inline-block; width: 13px; height: 13px; border-radius: 3px; margin: 0 8px 2px 2px; vertical-align: middle; }
.ticker .prevpicks {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.ticker .nextup { font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker .nextup b { color: var(--text); }
.ticker .tclock {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 32px;
  font-weight: 800;
  padding: 3px 16px;
  border-radius: 12px;
  background: var(--panel2);
  border: 1px solid var(--line2);
}
.ticker .tclock.low { color: #ffb4a8; border-color: #9c3a3a; animation: blink 1s steps(2, start) infinite; }
@media (max-width: 900px) { .ticker .big { font-size: 22px; } .ticker .tclock { font-size: 24px; } }

/* ---------- group-chat strip (its own full-width stage, TV mode) ---------- */
.boothbar {
  display: none;
  flex: 0 0 auto;
  padding: 11px 20px 13px;
  min-height: 0;
  background: linear-gradient(180deg, #0d1420, #0a0f16);
  border-top: 1px solid var(--line2);
  transition: min-height 0.6s cubic-bezier(0.2, 0.8, 0.25, 1), padding 0.6s cubic-bezier(0.2, 0.8, 0.25, 1);
}
body.tv .boothbar.has { display: block; }
.boothbar.expanded.closing .booth { opacity: 0; transition: opacity 0.35s ease; }

/* Expanded chat cut-in: the strip grows and the board compresses above it. */
.boothbar.expanded {
  padding: 14px 26px 18px;
  min-height: 32vh;
  background: linear-gradient(180deg, #101a2a, #0a0f16 70%);
  border-top: 2px solid var(--gold);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45);
}
.cast-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.cast-head .cast-onclock { color: var(--gold2); }
.cast-head .cast-brand {
  font-size: 17px;
  letter-spacing: 0.24em;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(242, 177, 62, 0.35);
}
.cast-stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
  gap: 12px;
}
.cast-post {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 14px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  animation: castin 0.45s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes castin { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.cast-emblem {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  flex: 0 0 auto;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.45);
}
.cast-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cast-post .booth-tag { font-size: 13px; padding: 3px 10px; align-self: flex-start; }
.cast-text {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.38;
  color: var(--text);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
@media (max-width: 900px) {
  .cast-stage { grid-template-columns: 1fr; }
  .cast-text { font-size: 18px; }
  .cast-emblem { width: 42px; height: 42px; }
}
.booth {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  overflow: hidden;
}
.booth .booth-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  max-width: 100%;
}
.booth-emblem {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex: 0 0 auto;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}
.booth .booth-tag {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #201503;
  background: linear-gradient(180deg, var(--gold2), var(--gold));
  padding: 2px 9px;
  border-radius: 6px;
  flex: 0 0 auto;
  animation: boothin 0.4s ease;
}
.booth .booth-tag.live {
  background: linear-gradient(180deg, #ff7568, var(--red));
  color: #fff;
}
.booth .booth-tag.p-receipts { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #201503; }
.booth .booth-tag.p-integrity { background: linear-gradient(180deg, #6499dc, #3670bd); color: #fff; }
.booth .booth-tag.p-room { background: linear-gradient(180deg, #a884e8, #7755b8); color: #fff; }
.booth .booth-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 21px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  overflow-wrap: anywhere;
  animation: boothin 0.4s ease;
}
@media (max-width: 900px) {
  .booth .booth-text { font-size: 16px; }
}
@keyframes boothin { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

/* ---------- Presentation Test: fixed, unmistakable, and above pick reveals ---------- */
body.preview-mode .room {
  padding-bottom: var(--preview-rail-h);
  padding-bottom: calc(var(--preview-rail-h) + env(safe-area-inset-bottom));
}
body.preview-mode.hidecursor, body.preview-mode.hidecursor * { cursor: auto !important; }
body.preview-mode #toast {
  bottom: calc(var(--preview-rail-h) + 12px);
  bottom: calc(var(--preview-rail-h) + 12px + env(safe-area-inset-bottom));
}
.preview-rail {
  position: fixed;
  z-index: 95;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: var(--preview-rail-h);
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  padding: 10px calc(16px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  background: linear-gradient(180deg, #24173d, #151025);
  border-top: 2px solid #9b7bd3;
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.5);
}
.preview-id { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.preview-title {
  font-family: var(--display);
  color: #e3d3ff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.preview-note {
  color: #a891cb;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-count {
  color: #e3d3ff;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: right;
  white-space: nowrap;
}
.preview-count span { display: block; color: #a891cb; font-family: "Inter", sans-serif; font-size: 11px; letter-spacing: 0; }
.preview-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}
.preview-actions::-webkit-scrollbar { display: none; }
.preview-actions .btn { min-height: 44px; padding: 8px 12px; flex: 0 0 auto; }
.preview-scenarios { position: relative; flex: 0 0 auto; }
.preview-scenarios > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.preview-scenarios > summary::-webkit-details-marker { display: none; }
.preview-scenarios[open] > summary {
  color: #fff;
  border-color: #b596e8;
  background: #4a3374;
}
.preview-scenario-menu {
  position: fixed;
  z-index: 110;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(var(--preview-rail-h) + 10px + env(safe-area-inset-bottom));
  width: min(520px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  background: linear-gradient(180deg, #2e2049, #171126);
  border: 1px solid #9b7bd3;
  border-radius: 14px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.65);
}
.preview-scenario-title {
  grid-column: 1 / -1;
  color: #cbb5ed;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.preview-scenario-menu .btn {
  width: 100%;
  min-width: 0;
  white-space: normal;
  line-height: 1.15;
}
.pin-preview {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.pin-preview .hint { margin-top: 3px; }
.sp-test {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 99px;
  background: #3b2861;
  border: 1px solid #9b7bd3;
  color: #e3d3ff;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.13em;
  white-space: nowrap;
}

@media (min-width: 701px) and (max-width: 1000px) {
  .preview-rail {
    grid-template-columns: minmax(130px, 1fr) auto auto;
    gap: 8px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .preview-title { font-size: 15px; }
  .preview-note { display: none; }
  .preview-actions { gap: 4px; }
  .preview-actions .btn { padding: 7px 8px; font-size: 11px; }
}

/* ---------- overlay / sheets ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 8, 0.74);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.overlay[hidden] { display: none; }
.sheet {
  background: linear-gradient(180deg, #131a24, var(--panel));
  border: 1px solid var(--line2);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 570px;
  max-height: 86vh;
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -12px 50px rgba(0, 0, 0, 0.5);
  animation: sheetup 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes sheetup { from { transform: translateY(24px); opacity: 0.4; } to { transform: translateY(0); opacity: 1; } }
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 11px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.sheet-head::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  margin-left: -20px;
  width: 40px;
  height: 4px;
  border-radius: 99px;
  background: var(--line2);
}
.sheet-head h3 {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sheet-head .close { color: var(--muted); font-size: 22px; padding: 2px 8px; border-radius: 8px; }
.sheet-head .close:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.sheet-body {
  padding: 15px 18px 22px;
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
  overflow: auto;
}
.sheet-body .row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.sheet-body .row.right { justify-content: flex-end; }
.sheet-body h4 {
  font-family: var(--display);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 20px 0 9px;
}
.sheet-body h4:first-child { margin-top: 0; }
@media (min-width: 700px) {
  .overlay { align-items: center; }
  .sheet { border-radius: 20px; animation-name: sheetin; }
  @keyframes sheetin { from { transform: scale(0.97); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }
  .sheet-head::before { display: none; }
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--line2);
  background: var(--panel2);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  transition: border-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
}
.chip:hover { border-color: #3d4f63; color: var(--text); }
.chip.on { background: linear-gradient(180deg, #2d6cc4, #2258a5); border-color: #3d7fd6; color: #fff; }
.chip.ondeck { background: #33270b; border-color: var(--gold); color: var(--gold2); cursor: default; }

.results { margin-top: 10px; max-height: 44vh; overflow: auto; }
.rrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s ease;
}
.rrow:hover { background: var(--panel2); border-color: var(--line); }
.rrow .posdot { width: 13px; height: 13px; border-radius: 4px; flex: 0 0 auto; }
.rrow .rname { font-weight: 700; }
.rrow .rsub { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.rrow.taken { opacity: 0.38; cursor: default; }
.rrow.taken:hover { background: transparent; border-color: transparent; }
.rrow.custom { border: 1px dashed var(--line2); color: var(--muted); }
.posdot.pos-QB { background: #d94a56; }
.posdot.pos-RB { background: #2fa98c; }
.posdot.pos-WR { background: #3e7fd1; }
.posdot.pos-TE { background: #e08a3c; }
.posdot.pos-K { background: #8f6ad1; }
.posdot.pos-DST { background: #5d6b7a; }

.confirmbar {
  margin-top: 13px;
  padding: 13px;
  border-radius: 12px;
  background: var(--panel2);
  border: 1px solid var(--gold);
  box-shadow: 0 0 16px rgba(242, 177, 62, 0.12);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.confirmbar .posdot { width: 14px; height: 14px; border-radius: 4px; }
.confirmbar .who { font-weight: 800; font-size: 16px; }
.confirmbar .sub { color: var(--muted); font-size: 13px; }
.confirmbar .btn { margin-left: auto; }

.teamrow { display: flex; gap: 6px; align-items: center; margin-bottom: 7px; }
.teamrow .tr-num { width: 24px; text-align: right; color: var(--muted); font-size: 12px; font-weight: 700; flex: 0 0 auto; font-family: var(--display); font-size: 14px; }
.teamrow .input { flex: 1 1 auto; padding: 7px 10px; }
.teamrow .btn.small { padding: 6px 9px; }

.rosterlist { list-style: none; }
.rosterlist li { display: flex; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.rosterlist .rd {
  color: var(--muted);
  font-size: 13px;
  width: 46px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.rosterlist .empty-slot { color: #3a4856; }
.rcounts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.rcounts .chip { cursor: default; }

.claimrow { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.claimrow .nm { font-weight: 700; }
.claimrow .st { color: var(--muted); font-size: 12px; margin-left: auto; }
.claimrow .btn { flex: 0 0 auto; }
.claim-current {
  margin: 0 0 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}
.claim-code-help { margin: 0 0 14px; }
.claim-code-field { margin-bottom: 6px; }
.claim-code-entry { display: flex; align-items: stretch; gap: 8px; }
.claim-code-entry .input {
  min-width: 0;
  flex: 1 1 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px;
  letter-spacing: 0.18em;
}
.claim-code-error {
  min-height: 22px;
  margin: 3px 0 10px;
  color: #ffb4a8;
  font-size: 12px;
  line-height: 1.4;
}
@media (max-width: 520px) {
  .claimrow { align-items: flex-start; flex-wrap: wrap; }
  .claimrow .st { margin-left: auto; }
  .claimrow .btn { width: 100%; }
  .claim-code-entry .btn,
  .sheet-head .close { min-height: 44px; min-width: 44px; }
}

.pcrow {
  display: flex;
  justify-content: space-between;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.pcrow .pclbl { color: var(--muted); font-weight: 600; }
.pcfact {
  margin-top: 14px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #33270b;
  border: 1px solid var(--gold);
  color: var(--gold2);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(180deg, #274a77, #1f3c62);
  border: 1px solid #2f74d0;
  color: #fff;
  padding: 11px 20px;
  border-radius: 12px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 99;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: linear-gradient(180deg, #77302a, #5e211c); border-color: #9c3a3a; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 98; }

#askbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(2, 4, 8, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ask-inner {
  background: linear-gradient(180deg, #131a24, var(--panel));
  border: 1px solid var(--line2);
  border-radius: 16px;
  padding: 22px;
  max-width: 390px;
  width: 100%;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  animation: sheetin2 0.18s ease-out;
}
@keyframes sheetin2 { from { transform: scale(0.96); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }
.ask-msg { font-size: 15px; line-height: 1.55; margin-bottom: 17px; }
.ask-btns { display: flex; gap: 10px; justify-content: flex-end; }

.waiting {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  text-align: center;
  padding: 30px;
}
.waiting .ball { font-size: 44px; }

/* ---------- TV pick splash ---------- */
#splash {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: radial-gradient(900px 500px at 50% 40%, rgba(24, 32, 44, 0.97), rgba(4, 7, 11, 0.97));
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spfade 0.3s ease-out;
}
@keyframes spfade { from { opacity: 0; } to { opacity: 1; } }
.sp-inner { text-align: center; padding: 20px; max-width: 92vw; }
.sp-pre {
  font-family: var(--display);
  font-size: 8vw;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--gold);
  animation: sppulse 0.9s ease-in-out infinite;
  text-shadow: 0 0 40px rgba(242, 177, 62, 0.35);
}
@keyframes sppulse { 50% { opacity: 0.55; transform: scale(0.985); } }
.sp-lbl {
  font-family: var(--display);
  font-size: 2.3vw;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--muted);
}
.sp-name {
  font-family: var(--display);
  font-size: 7vw;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 1.6vh 0 0.6vh;
  animation: spname 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.55);
}
.sp-name .posdot { display: inline-block; width: 3.4vw; height: 3.4vw; border-radius: 0.7vw; margin-right: 1.6vw; vertical-align: middle; }
@keyframes spname { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.sp-sub { font-size: 2.4vw; font-weight: 700; color: var(--muted); letter-spacing: 0.14em; font-family: var(--display); }
.sp-fact { margin-top: 3vh; font-size: 1.9vw; color: var(--gold2); }
@media (max-width: 700px) {
  :root { --preview-rail-h: 154px; }
  .topbar {
    gap: 7px;
    min-height: 48px;
    padding: calc(6px + env(safe-area-inset-top)) 8px 6px;
  }
  .brand { max-width: 28vw; font-size: 18px; }
  .roomcode, .lastpick-mini { display: none; }
  .statuspill { font-size: 11px; padding: 3px 8px; }
  .topbtns { gap: 3px; }
  .topbtns .btn.small { min-height: 36px; padding: 5px 8px; font-size: 11px; }
  .commish-chip { font-size: 10px; padding: 4px 7px; }
  body.tv .ticker { gap: 8px; padding: 11px 10px 9px; min-height: 66px; }
  .ticker .sect:not(.grow) { display: none; }
  .ticker .sect.grow { padding-left: 9px; }
  .ticker .big { font-size: 22px; }
  .ticker .nextup { display: none; }
  .boothbar { padding: 9px 10px 11px; }
  .booth .booth-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 9px;
  }
  .booth .booth-text { grid-column: 1 / -1; font-size: 16px; line-height: 1.38; }
  .booth-emblem { width: 28px; height: 28px; }
  .preview-rail {
    grid-template-columns: minmax(0, 1fr) auto;
    align-content: center;
    gap: 7px 10px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }
  .preview-title { font-size: 15px; }
  .preview-note { font-size: 9px; }
  .preview-count { font-size: 13px; }
  .preview-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 0.9fr 1.15fr 1fr;
    gap: 5px;
    overflow: visible;
  }
  .preview-actions .btn {
    min-width: 0;
    width: 100%;
    min-height: 44px;
    font-size: 11px;
    padding: 6px 4px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .preview-scenarios { min-width: 0; }
  .preview-scenario-menu {
    right: 8px;
    bottom: calc(var(--preview-rail-h) + 8px + env(safe-area-inset-bottom));
    width: calc(100vw - 16px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 10px;
  }
  .preview-scenario-menu .btn {
    min-height: 46px;
    font-size: 12px;
  }
  .pin-preview { align-items: flex-start; flex-direction: column; }
  .sp-pre { font-size: 12vw; }
  .sp-lbl { font-size: 3.8vw; }
  .sp-name { font-size: 10vw; }
  .sp-name .posdot { width: 5vw; height: 5vw; }
  .sp-sub { font-size: 4.6vw; }
  .sp-fact { font-size: 3.8vw; }
}

/* Landing: the commissioner's create-room panel is collapsed by default.
   Only one person in the league ever needs it, and it was previously the
   first thing all twelve saw. */
.landing details.card { cursor: default; }
.landing details.card > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.landing details.card > summary::-webkit-details-marker { display: none; }
.landing details.card > summary h2 { display: inline; margin: 0; }
.landing details.card > summary::after {
  content: "＋";
  margin-left: auto;
  opacity: .55;
  font-weight: 700;
}
.landing details.card[open] > summary::after { content: "－"; }
.landing details.card[open] > summary { margin-bottom: .9rem; }
