/* sp.css: the one stylesheet for index.html, deck.html and crew.html (contract §7). Phone width first, 16 px
   gutters, no horizontal scroll at 390 px. Neon-sunset palette on near-black; system fonts only (no CDN).
   The overlays carry their own inline CSS (OBS browser sources load nothing else). */

:root {
  color-scheme: dark;
  --bg: #0b0710;
  --bg-2: #120a19;
  --card: #1a1023;
  --card-2: #221530;
  --line: #34224a;
  --text: #fff6fb;
  --muted: #d3c6df;
  --dim: #a596b6;
  --mag: #ff2e93;
  --orange: #ff8a2b;
  --teal: #19e6cf;
  --yellow: #ffd23f;
  --red: #ff5a5a;
  --green: #42f09a;
  --grad: linear-gradient(90deg, #ff2e93 0%, #ff8a2b 100%);
  --grad-v: linear-gradient(180deg, #ff2e93 0%, #ff8a2b 100%);
  --radius: 14px;
  --gutter: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Arial Black", "Segoe UI Black", "Helvetica Neue", Impact, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(120% 60% at 50% -10%, rgba(255, 46, 147, 0.22), transparent 60%),
    radial-gradient(80% 40% at 100% 0%, rgba(255, 138, 43, 0.16), transparent 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font: 16px/1.45 var(--font);
  overflow-wrap: anywhere;
  min-height: 100vh;
}

a { color: var(--teal); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- header ---------- */
.top { padding-top: 18px; padding-bottom: 8px; }
.brand {
  margin: 0;
  font: 900 34px/1 var(--font-display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand small { display: block; margin-top: 6px; font: 600 13px/1.2 var(--font); font-style: normal; letter-spacing: 0.14em; color: var(--muted); -webkit-text-fill-color: var(--muted); }

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted);
  font: 700 14px/1 var(--font); text-decoration: none; letter-spacing: 0.04em;
}
.badge .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dim); flex: none; }
.badge.live { color: #fff; border-color: var(--mag); background: rgba(255, 46, 147, 0.16); }
.badge.live .dot { background: var(--mag); box-shadow: 0 0 0 0 rgba(255, 46, 147, 0.7); animation: pulse 1.6s infinite; }
.badge.unknown .dot { background: transparent; border: 2px dashed var(--dim); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 46, 147, 0.7); } 70% { box-shadow: 0 0 0 9px rgba(255, 46, 147, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 46, 147, 0); } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.chip {
  display: inline-block; padding: 4px 10px; border-radius: 8px;
  font: 700 12px/1.3 var(--font); letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--card-2); color: var(--muted); border: 1px solid var(--line);
}
.chip.off { color: #ffd0d0; border-color: rgba(255, 90, 90, 0.6); background: rgba(255, 90, 90, 0.12); }
.chip.on { color: #06231f; background: var(--teal); border-color: var(--teal); }
.chip.hot { color: #2a0716; background: var(--grad); border-color: transparent; }

/* ---------- banners ---------- */
.banner {
  margin: 12px 0 0; padding: 12px 14px; border-radius: var(--radius);
  background: var(--card-2); border: 1px solid var(--line); color: var(--muted); font-weight: 600;
}
.banner.off { border-color: rgba(255, 90, 90, 0.65); background: rgba(255, 90, 90, 0.1); color: #ffe1e1; }
.banner.warn { border-color: rgba(255, 210, 63, 0.6); background: rgba(255, 210, 63, 0.08); color: #fff1c2; }
.banner strong { color: #fff; }

/* ---------- sections ---------- */
.card {
  margin: 14px 0; padding: 16px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
}
.card > h2, .card-h {
  margin: 0 0 12px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px;
  font: 900 15px/1.2 var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--orange);
}
.card > h2 .side, .card-h .side { margin-left: auto; font: 600 12px/1.2 var(--font); letter-spacing: 0.04em; text-transform: none; color: var(--dim); text-align: right; }
.card.is-off { opacity: 0.72; }
.off-note { margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 90, 90, 0.1); border: 1px solid rgba(255, 90, 90, 0.5); color: #ffe1e1; font-size: 14px; font-weight: 600; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------- the now line ---------- */
.now {
  margin: 14px 0 0; padding: 14px 16px; border-radius: var(--radius);
  background: rgba(255, 46, 147, 0.08); border: 1px solid rgba(255, 46, 147, 0.45);
  font-weight: 700; font-size: 17px;
}
.now .sep { color: var(--dim); padding: 0 6px; }
.now .ok { color: var(--green); }
.now .no { color: var(--red); }

/* ---------- scoreboard ---------- */
.score { display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.2fr) minmax(0, 1.05fr); gap: 8px; }
.stat { min-width: 0; padding: 12px 6px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); text-align: center; }
.stat .n { display: block; font: 900 26px/1.1 var(--font-display); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .n.long { font-size: 19px; line-height: 1.5; }
.stat .n.longer { font-size: 13px; line-height: 2.2; }
.stat.wide { grid-column: 1 / -1; order: -1; }
.stat.wide .n.longer { font-size: 22px; line-height: 1.3; }
.stat .n.stars { font-size: 16px; line-height: 1.7; letter-spacing: 0; color: var(--yellow); overflow: visible; text-overflow: clip; }
.stat .l { display: block; margin-top: 4px; font: 700 11px/1.2 var(--font); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.moments { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.moments li { padding: 4px 8px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.moments li b { color: var(--yellow); font-weight: 800; }

/* ---------- vote ---------- */
.q { margin: 0 0 10px; font: 900 22px/1.2 var(--font-display); }
.timer { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-weight: 800; }
.timer .t { font: 900 22px/1 var(--font-display); color: var(--yellow); min-width: 56px; }
.bar { flex: 1; height: 10px; border-radius: 99px; background: var(--bg); overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; width: 0; background: var(--grad); }
.opts { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.opt { position: relative; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.opt .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255, 46, 147, 0.18); transition: width 0.4s ease; }
.opt.lead { border-color: var(--teal); }
.opt.lead .fill { background: rgba(25, 230, 207, 0.2); }
.opt.won { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.opt .row { position: relative; display: flex; align-items: center; gap: 10px; }
.opt .num { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--grad); color: #2a0716; font: 900 16px/1 var(--font-display); }
.opt .txt { flex: 1; min-width: 0; font-weight: 700; }
.opt .tot { flex: none; font: 900 20px/1 var(--font-display); }
.opt .per { position: relative; margin: 6px 0 0 40px; font-size: 12px; color: var(--dim); }
.said { margin: 4px 0 0; padding: 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.said .k { font: 800 12px/1 var(--font); letter-spacing: 0.14em; color: var(--dim); text-transform: uppercase; }
.said .v { display: block; margin-top: 6px; font: 900 24px/1.15 var(--font-display); }
.said .s { display: block; margin-top: 8px; font-weight: 800; }
.said.ok { border-color: var(--green); }
.said.ok .s { color: var(--green); }
.said.wait .s { color: var(--yellow); }
.said.late { border-color: var(--red); }
.said.late .s { color: var(--red); }

/* ---------- ledger ---------- */
.ledger { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ledger li { padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--dim); }
.ledger li.ok { border-left-color: var(--green); }
.ledger li.no { border-left-color: var(--red); background: rgba(255, 90, 90, 0.07); }
.ledger .lq { font-weight: 700; }
.ledger .ls { margin-top: 4px; font-size: 14px; color: var(--muted); }
.ledger li.ok .lo { color: var(--green); font-weight: 800; }
.ledger li.no .lo { color: var(--red); font-weight: 800; }

/* ---------- bingo ---------- */
.grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.cell {
  position: relative; display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 74px; padding: 5px 3px; border-radius: 9px;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted);
  font: 600 10.5px/1.2 var(--font); hyphens: auto; -webkit-hyphens: auto; overflow: hidden;
}
.cell.on { color: #2a0716; background: var(--grad); border-color: transparent; font-weight: 800; }
.cell.in-line { box-shadow: 0 0 0 2px var(--teal); }
.claim { margin-top: 12px; display: grid; gap: 8px; }
.claim-msg { padding: 10px 12px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); font-weight: 600; }
.claim-msg.ok { border-color: var(--green); color: #d9ffe9; }
.claim-msg.no { border-color: var(--red); color: #ffe1e1; }

/* ---------- clips ---------- */
.clips { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.clip { padding: 10px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.clip .ch { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.clip .ct { font-weight: 700; min-width: 0; }
.clip .cw { flex: none; font-size: 12px; color: var(--dim); font-weight: 700; }
.embed { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.clip .cs { font-size: 14px; color: var(--muted); }
.clip.failed .cs { color: var(--red); }

/* ---------- chaos ---------- */
.chaos { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.chaos li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 138, 43, 0.1); border: 1px solid rgba(255, 138, 43, 0.5); font-weight: 700; }
.chaos li .t { flex: none; color: var(--yellow); font-variant-numeric: tabular-nums; }

/* ---------- buttons + inputs ---------- */
.btn {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card-2); color: var(--text);
  font: 800 17px/1.15 var(--font); letter-spacing: 0.02em; text-align: center;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active { transform: translateY(1px); filter: brightness(1.15); }
.btn[disabled] { opacity: 0.5; cursor: progress; }
.btn.hot { background: var(--grad); color: #2a0716; border-color: transparent; }
.btn.teal { background: var(--teal); color: #04221e; border-color: transparent; }
.btn.green { background: var(--green); color: #052414; border-color: transparent; }
.btn.danger { background: #c4122f; color: #fff; border-color: #ff5a5a; }
.btn.ghost { background: transparent; }
.btn.on { box-shadow: 0 0 0 3px var(--teal) inset; }
.btn.big { min-height: 68px; font-size: 22px; }
.btn.huge { min-height: 84px; font: 900 28px/1 var(--font-display); letter-spacing: 0.04em; }
.btn.wide { width: 100%; }
.btn small { display: block; font-size: 11px; font-weight: 700; opacity: 0.85; letter-spacing: 0.06em; }
.btn .stack { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.row5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.row5 .btn { padding: 8px 2px; font-size: 16px; }
.stack { display: grid; gap: 8px; }
.field { display: grid; gap: 6px; margin: 0 0 10px; }
.field label, .lbl { font: 800 12px/1.2 var(--font); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=tel], select {
  width: 100%; min-height: 52px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font: 600 17px/1.2 var(--font);
}
input::placeholder { color: var(--dim); }

.big-num { font: 900 44px/1 var(--font-display); text-align: center; color: #fff; }

/* the deck's answer bar: fixed at the thumb, shows the door's own words */
.answer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(11, 7, 16, 0.96); border-top: 2px solid var(--line);
  font-weight: 800; font-size: 16px;
}
.answer .in { max-width: 640px; margin: 0 auto; display: flex; gap: 10px; align-items: baseline; }
.answer .tag { flex: none; padding: 3px 8px; border-radius: 8px; font-size: 13px; background: var(--card-2); }
.answer.ok { border-top-color: var(--green); }
.answer.ok .tag { background: var(--green); color: #052414; }
.answer.no { border-top-color: var(--red); }
.answer.no .tag { background: var(--red); color: #2a0606; }
.answer.wait .tag { background: var(--yellow); color: #2a2206; }
.has-answer { padding-bottom: 96px; }

.squares { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.squares li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.squares li.on { border-color: var(--teal); background: rgba(25, 230, 207, 0.08); }
.squares .btn { min-height: 46px; font-size: 15px; padding: 6px 12px; }

.cues { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; }
.cues li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px; background: var(--bg); }
.cues .m { flex: none; font-weight: 800; color: var(--dim); }
.cues .m.ok { color: var(--green); }
.cues .m.no { color: var(--red); }

.foot { padding-top: 18px; padding-bottom: 40px; color: var(--dim); font-size: 13px; }
.foot .links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 10px; }
.foot .links a { font-weight: 700; }

@media (min-width: 560px) {
  .brand { font-size: 42px; }
  .cell { font-size: 12px; min-height: 86px; }
}

@media (prefers-reduced-motion: reduce) {
  .badge.live .dot { animation: none; }
  .opt .fill { transition: none; }
}
