/* BioCortexAI palette: electric blue -> azure gradient, steel greys, deep navy */
:root {
  --bg: #060a13; --bg2: #0a1222; --panel: #0e1626; --panel2: #152033; --line: #22314a; --text: #e9eef6; --muted: #8d9ab0;
  --brand: #0a7cff; --brand2: #00c2ff; --grad: linear-gradient(120deg, #0a7cff 0%, #00c2ff 100%);
  --steel: #c5cad0; --steel2: #5a6372;
  --accent: #1e90ff; --accent-soft: #1e90ff22; --on-accent: #fff;
  --hot: #ff2d55; --ok: #2fd39a; --warn: #ffb020; --bad: #ff4d5e; --love: #ff5fa2; --gold: #ffc94d;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: Sora, Inter, system-ui, sans-serif;
  --r: 14px;
}
:root[data-theme="light"] { --bg: #f3f5f9; --panel: #fff; --panel2: #eef2f8; --line: #d6dde8; --text: #18202c; --muted: #5d6878; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { background: var(--bg); }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand2); }
h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand2); }
h4 { margin: 10px 0 6px; font-size: 13px; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.neg { color: #ff7b7b; } .pos { color: #8bd48e; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
textarea, #tab-direct input:not([type]), .box > input { width: 100%; margin: 3px 0; }
.row { display: flex; gap: 6px; align-items: center; margin: 4px 0; }
.row.wrap { flex-wrap: wrap; }
.row input:not([type="number"]):not([type="checkbox"]) { flex: 1; min-width: 0; }
.btn { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block; color: var(--text); }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--grad); color: var(--on-accent); border-color: transparent; font-weight: 600; }
.btn[hidden] { display: none; }
.btn.primary:disabled { background: var(--panel2); color: var(--muted); border-color: var(--line); cursor: default; }
.btn.ok { border-color: var(--ok); color: var(--ok); }
.btn.ghost { background: transparent; }
.btn.warn { border-color: var(--warn); color: var(--warn); }
.btn.danger { border-color: var(--bad); color: #ff8a80; }
.btn.hot { background: var(--hot); border-color: var(--hot); color: #fff; }
.btn.tiny { padding: 1px 6px; font-size: 11px; }
.pill { padding: 3px 10px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46ch; }
.pill.hot { background: var(--hot); border-color: var(--hot); color: #fff; animation: pulse 1.4s infinite; }
.pill.bad { border-color: var(--bad); color: #ff8a80; }
.badge { font-size: 10px; padding: 1px 6px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); }
.badge.hot { background: var(--hot); color: #fff; border-color: var(--hot); }
@keyframes pulse { 50% { opacity: .65; } }

.topbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #050912; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 8px; }
.logo { font: 800 22px/1 var(--display); letter-spacing: .06em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .2em; }
.live { color: var(--hot); font-weight: 700; font-size: 12px; animation: pulse 1.4s infinite; }
.clock { font-variant-numeric: tabular-nums; font-weight: 600; }
.spacer { flex: 1; }
.tog { font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 0; }
.box { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.box h4 { margin-top: 0; }
.mapwrap { position: relative; background: #0d0e14; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; }
.mapwrap canvas { width: 100%; height: 100%; display: block; cursor: pointer; }
.dot { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 12px; flex: none; }
.dot.big { width: 38px; height: 38px; font-size: 18px; }
.dot.huge { width: 90px; height: 90px; font-size: 44px; margin: 10px auto; display: flex; }
.nm { color: var(--c); font-weight: 600; }
.bar { display: inline-block; width: 54px; height: 6px; background: #000a; border-radius: 3px; overflow: hidden; vertical-align: middle; }
.bar.wide { width: 140px; }
.bar i { display: block; height: 100%; }

/* ---------- producer ---------- */
.producer { overflow: hidden; }
.prod-grid { display: grid; grid-template-columns: minmax(380px, 1.25fr) minmax(320px, 1fr) minmax(360px, 1fr); gap: 10px; padding: 10px; height: calc(100vh - 52px); }
.col-map { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.col-map .mapwrap { flex: 1.3; min-height: 260px; }
.col-map .panel { flex: 1; overflow: auto; }
.col-feed { display: flex; flex-direction: column; }
.feedhead { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: 2px 9px; cursor: pointer; font-size: 12px; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.feed { flex: 1; overflow-y: auto; font-size: 13px; padding-right: 4px; }
.ev { padding: 3px 4px; border-bottom: 1px solid #ffffff08; position: relative; }
.ev .t { color: var(--muted); font-size: 11px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.ev.priv { background: #ffffff05; }
.ev.cut { opacity: .35; text-decoration: line-through; }
.ev .act { color: var(--muted); }
.thought { color: #b39ddb; font-style: italic; }
.confess { color: #ffab91; }
.confess-q { color: var(--accent); font-style: italic; }
.activity { color: var(--muted); font-size: 12px; }
.secretline { color: #80cbc4; }
.prod { color: #90caf9; }
.scene-sep { margin: 10px 0 2px; color: var(--accent); font-size: 12px; font-weight: 600; border-top: 1px dashed var(--line); padding-top: 6px; }
.scene-sum { color: #c5e1a5; font-size: 12px; }
.drama { font-size: 10px; border: 1px solid #c5e1a5; border-radius: 99px; padding: 0 5px; }
.sysline { color: var(--accent); }
.sysline.imp { font-weight: 700; }
.sysline.love { color: var(--love); font-weight: 600; }
.sysline.slap { color: var(--hot); font-weight: 700; }
.sysline.prank { color: #ffb300; }
.sysline.prank.imp { font-weight: 700; }
.sysline.game { color: #8fd18a; }
.cutbtn { position: absolute; right: 2px; top: 2px; background: var(--hot); color: #fff; border: 0; border-radius: 4px; font-size: 10px; padding: 1px 5px; cursor: pointer; }
.col-side { display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 8px; flex-wrap: wrap; }
.tabs button { background: transparent; border: 0; padding: 6px 9px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tab { display: none; overflow-y: auto; overflow-x: hidden; flex: 1; padding-right: 4px; }
.tab.on { display: block; }
.people { display: grid; gap: 4px; }
.pcard { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 8px; background: var(--panel2); border: 1px solid transparent; cursor: pointer; }
.pcard.sel { border-color: var(--accent); }
.pcard.ev { opacity: .4; }
.pinfo { flex: 1; min-width: 0; }
.pinfo .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minibars { display: grid; gap: 2px; }
.minibars .bar { width: 40px; height: 4px; }
.mood { font-size: 18px; }
.detail .dhead, .dhead { display: flex; gap: 10px; align-items: center; }
.detail h3 { color: var(--text); text-transform: none; letter-spacing: 0; font-size: 16px; margin: 0; }
.needs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; font-size: 12px; margin: 8px 0; }
.needs .bar { width: 70px; }
table.rel { width: 100%; font-size: 12px; border-collapse: collapse; }
table.rel td, table.rel th { padding: 2px 4px; text-align: left; border-bottom: 1px solid #ffffff10; }
.mem { padding-left: 16px; margin: 4px 0; font-size: 12px; max-height: 220px; overflow-y: auto; }
.mem .t { color: var(--muted); font-size: 11px; }
.scene { padding: 6px 0; border-bottom: 1px solid var(--line); }
.scene details { font-size: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 6px 0; }
.chk { display: flex; gap: 4px; align-items: center; font-size: 13px; cursor: pointer; }
table.matrix { border-collapse: collapse; font-size: 12px; margin: 6px 0; }
table.matrix th { padding: 3px; font-weight: 500; }
table.matrix td { width: 38px; height: 28px; text-align: center; border: 1px solid #ffffff12; cursor: pointer; }
table.matrix td.self { background: #0006; cursor: default; }
table.matrix td.sel { outline: 2px solid var(--accent); }
.pantry { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pitem { display: flex; justify-content: space-between; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; }
.pitem.low { border-color: var(--bad); }
.pitem.low b { color: #ff8a80; }
.vote { display: flex; gap: 8px; align-items: center; margin: 3px 0; }
.win { font-size: 18px; color: var(--accent); }
.sug { background: var(--panel2); border-radius: 8px; padding: 8px; margin: 6px 0; }
.danger-zone { border-color: #e5393555; }
/* producer: task queue, poll */
.tq { background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
.tq.live { border-left-color: var(--hot); box-shadow: 0 0 16px #ff2d5522; }
.tq-h { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.tq-h .muted { margin-left: auto; }
.tq-text { margin: 4px 0 6px; }
.tq-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; margin-bottom: 4px; }
.tq-acts .btn { padding: 4px 9px; }
.tqh { padding: 3px 0; border-bottom: 1px solid #ffffff0a; }
.stake { font-size: 12px; padding: 3px 9px; border-radius: 8px; line-height: 1.35; border: 1px solid var(--line); }
.pollbox { border-color: #ff2d5555; }
#taskForm summary { cursor: pointer; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--panel2); border: 1px solid var(--accent); padding: 8px 16px; border-radius: 8px; transition: transform .25s; z-index: 50; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.bad { border-color: var(--bad); }
.err { padding: 40px; font-size: 18px; }

/* ---------- viewer: a live reality show in the BioCortexAI colours ---------- */
.viewer { display: flex; flex-direction: column; min-height: 100vh; font-size: 15px;
  background:
    radial-gradient(1200px 600px at 85% -10%, #0a7cff2e, transparent 60%),
    radial-gradient(900px 500px at -10% 30%, #00c2ff14, transparent 60%),
    linear-gradient(180deg, #060a13, #070d19 40%, #060a13);
  background-attachment: fixed; }
/* the rhombi of the logo as a faint lattice */
.viewer::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .5;
  background-image: repeating-linear-gradient(45deg, #ffffff05 0 1px, transparent 1px 46px), repeating-linear-gradient(-45deg, #ffffff05 0 1px, transparent 1px 46px); }
.viewer .panel { background: linear-gradient(180deg, #111b2ee6, #0c1424e6); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px;
  box-shadow: 0 10px 30px #0006, inset 0 1px 0 #ffffff0a; }
.viewer h2 { font: 700 22px/1.2 var(--display); margin: 0; letter-spacing: -.01em; }
.viewer h3 { font: 700 17px/1.3 var(--display); text-transform: none; letter-spacing: -.01em; color: var(--text); margin: 2px 0 8px; }
.kicker { font: 700 11px/1.2 var(--font); text-transform: uppercase; letter-spacing: .16em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kicker.hot { background: none; color: var(--hot); }
.viewer input, .viewer select, .viewer textarea { background: #0a1220; border-color: var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; margin: 4px 0; }
.viewer input:focus, .viewer select:focus, .viewer textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px #0a7cff33; }
.viewer .btn { border-radius: 10px; padding: 9px 16px; font-weight: 600; }
.viewer .btn.primary { box-shadow: 0 6px 20px #0a7cff40; }
.viewer .btn.primary:not(:disabled):hover { filter: brightness(1.1); }

/* header */
.vtop { position: sticky; top: 0; z-index: 30; gap: 14px; padding: 10px 20px; padding-top: max(10px, env(safe-area-inset-top));
  background: #060a13d9; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid #ffffff12; }
.vtop .brand { align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-ic { height: 30px; width: auto; display: block; filter: drop-shadow(0 2px 8px #0a7cff55); }
.brand-tx { display: flex; flex-direction: column; line-height: 1; }
.vtop .logo { font-size: 23px; letter-spacing: .02em; background: none; color: #fff; text-transform: uppercase; }
.vtop .logo em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-tx small { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.onair { display: inline-flex; align-items: center; gap: 6px; background: var(--hot); color: #fff; font: 800 11px/1 var(--font); letter-spacing: .14em;
  padding: 6px 10px 6px 9px; border-radius: 6px; box-shadow: 0 0 18px #ff2d5566; }
.onair i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.2s infinite; }
body.off-air .onair { background: var(--steel2); box-shadow: none; }
body.off-air .onair i { animation: none; }
/* "Test broadcast" next to LIVE: only while on air, never on the off-air page */
.testcast { font: 700 10px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: #ffd27a;
  border: 1px solid #ffd27a77; background: #ffd27a14; padding: 5px 8px; border-radius: 6px; white-space: nowrap; }
body.offair-page .testcast { display: none; }
.vtop .clock { font: 600 14px/1 var(--font); color: var(--steel); font-variant-numeric: tabular-nums; }
.vtop .clock b { color: #fff; }
.vtop .pill { background: #0a7cff1f; border-color: #0a7cff55; color: #cfe6ff; padding: 5px 12px; font-weight: 600; }
.vtop .pill.hot { background: var(--hot); border-color: var(--hot); color: #fff; }
.pantry-mini { display: flex; gap: 6px; font-size: 13px; }
.pantry-mini span { background: #ffffff0a; border: 1px solid #ffffff12; border-radius: 99px; padding: 3px 9px; white-space: nowrap; }
.pantry-mini span.low { border-color: #ff4d5e88; color: #ffb3ba; }

/* stage + side column */
.view-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; padding: 16px 20px; align-items: start; max-width: 1840px; width: 100%; margin: 0 auto; }
.v-map { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.v-map .mapwrap { aspect-ratio: 16 / 9; max-height: calc(100vh - 150px); border-radius: 18px; border: 1px solid #ffffff14;
  box-shadow: 0 0 0 1px #0a7cff22, 0 20px 60px #000a, 0 0 80px #0a7cff1a; }
.v-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ticker { display: flex; align-items: center; gap: 10px; min-height: 42px; background: linear-gradient(90deg, #0d1729, #0a1222); border: 1px solid var(--line);
  border-left: 3px solid var(--brand2); border-radius: 12px; padding: 8px 14px; font-weight: 600; color: #e6f3ff; }
.tick-tag { flex: none; background: var(--hot); color: #fff; font: 800 10px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; padding: 5px 7px; border-radius: 5px; }
.ticker.show span:last-child { animation: fadein .6s; }
.tick-kiss, .tick-couple, .tick-love { color: var(--love); }
.tick-slap { color: #ff8a9f; }
.tick-prank { color: var(--warn); }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } }

/* avatars: the portrait, the initial in the contestant's colour underneath */
.ava { --s: 34px; position: relative; flex: none; width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c) 70%, #fff), var(--c)); box-shadow: 0 0 0 2px var(--c), 0 0 0 4px #0008; }
.ava b { color: #fff; font: 700 calc(var(--s) * .45) / 1 var(--display); }
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ava.xs { --s: 20px; box-shadow: 0 0 0 1.5px var(--c); }
.ava.sm { --s: 28px; }
.ava.lg { --s: 64px; }
.ava.xl { --s: 104px; box-shadow: 0 0 0 3px var(--c), 0 0 40px color-mix(in srgb, var(--c) 50%, transparent); }
.ava.huge { --s: 150px; margin: 14px auto 6px; display: flex; box-shadow: 0 0 0 4px var(--c), 0 0 60px color-mix(in srgb, var(--c) 60%, transparent); }
.ava.fill { --s: 100%; width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
.ava.fill b { font-size: 64px; }

/* on camera */
.camera { border-top: 3px solid var(--hot) !important; }
.camhead { display: flex; gap: 8px; align-items: center; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: var(--steel); }
.rec { display: inline-flex; align-items: center; gap: 5px; color: var(--hot); font-weight: 800; }
.rec::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--hot); animation: pulse 1.2s infinite; }
.camhead { flex-wrap: wrap; }
.campeople { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 0 auto; text-transform: none; letter-spacing: 0; color: var(--text); }
.camp { display: inline-flex; gap: 6px; align-items: center; background: #ffffff08; border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); border-radius: 99px; padding: 2px 10px 2px 2px; font-weight: 600; font-size: 13px; }
.subs { min-height: 120px; max-height: 220px; margin-top: 8px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.subs .sub { padding: 6px 0; border-bottom: 1px solid #ffffff0a; animation: fadein .4s; font-size: 15px; line-height: 1.45; }
.subs .sub.old { animation: none; }
.subs .sub { text-transform: none; letter-spacing: 0; color: var(--text); }
.sub.q { color: #9fd8ff; font-style: italic; }
.sub.q b { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin-right: 4px; }
.sub i { color: var(--muted); }

/* the official vote (nominees) */
.votepanel { border: 1px solid #ff2d5566 !important; box-shadow: 0 0 40px #ff2d5522, 0 10px 30px #0006 !important; }
.votecards { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }
.votecard { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; background: #ffffff06; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; color: var(--text); font: inherit; transition: transform .15s, border-color .15s; }
.votecard:hover:not([disabled]) { border-color: var(--hot); transform: translateY(-2px); }
.votecard.voted { border-color: var(--brand2); background: #00c2ff14; }
.votecard[disabled] { cursor: default; }
.votecard .small { color: var(--muted); }

/* the live poll */
.pollpanel h3 { margin-bottom: 2px; }
.pollrows { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 10px; }
.pollrow { display: grid; grid-template-columns: auto 6.5em 1fr 3.2em; align-items: center; gap: 10px; width: 100%; padding: 6px 10px 6px 6px; min-height: 44px;
  background: #ffffff05; border: 1px solid #ffffff10; border-radius: 12px; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.pollrow:hover:not([disabled]) { border-color: #ffffff30; background: #ffffff0a; }
.pollrow[disabled] { cursor: default; }
.pollrow.pick { border-color: var(--hot); background: #ff2d5514; box-shadow: 0 0 0 1px var(--hot) inset; }
.pollrow.mine { border-color: var(--brand2); background: #00c2ff12; }
.pr-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-name .small { color: var(--brand2); font-weight: 600; }
.pr-bar { height: 8px; border-radius: 99px; background: #ffffff10; overflow: hidden; }
.pr-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, #fff0), var(--c)); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.pollrow.lead .pr-bar i { background: linear-gradient(90deg, #ff2d5588, var(--hot)); box-shadow: 0 0 12px #ff2d5588; }
.pr-pc { text-align: right; font-variant-numeric: tabular-nums; }
.pollfoot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pollfoot .btn.primary:not(:disabled) { background: linear-gradient(120deg, #ff2d55, #ff6a3d); box-shadow: 0 6px 20px #ff2d5544; }

/* sections under the stage */
.sect { max-width: 1840px; width: 100%; margin: 0 auto; padding: 8px 20px 16px; }
.secthead { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 10px 0 14px; }
.cast { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 14px; }
.castcard { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; transition: transform .2s, border-color .2s, box-shadow .2s; }
.castcard:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 70%, transparent); box-shadow: 0 14px 34px #0008, 0 0 30px color-mix(in srgb, var(--c) 25%, transparent); }
.cc-photo { position: relative; aspect-ratio: 1; background: #0a1220; }
.cc-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, #060a13f0); pointer-events: none; }
.cc-photo::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c); z-index: 2; }
.cc-name { position: absolute; left: 12px; right: 12px; bottom: 9px; z-index: 2; display: flex; align-items: baseline; gap: 6px; }
.cc-name b { font: 700 19px/1 var(--display); }
.cc-name .age { margin-left: auto; color: var(--steel); font-weight: 600; }
.cc-photo .badge, .cc-photo .stamp { position: absolute; top: 10px; left: 10px; z-index: 2; font-size: 11px; font-weight: 700; padding: 3px 8px; }
.badge.cam { background: #000a; border-color: var(--hot); color: #fff; }
.stamp { border: 2px solid var(--hot); color: var(--hot); background: #060a13cc; border-radius: 6px; text-transform: uppercase; letter-spacing: .12em; transform: rotate(-6deg); }
.stamp.gold { border-color: var(--gold); color: var(--gold); }
.cc-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.cc-job { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-now { font-size: 13px; color: var(--steel); min-height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #ffffff0d; border: 1px solid #ffffff14; white-space: nowrap; }
.tag.love { color: #ffc2dc; border-color: #ff5fa255; }
.tag.poll { color: #ffb3c1; border-color: #ff2d5555; }
.castcard.ev { opacity: .5; }
.castcard.ev .ava img { filter: grayscale(1); }
.castcard.nom { border-color: var(--hot); box-shadow: 0 0 24px #ff2d5533; }
.castcard.win { border-color: var(--gold); box-shadow: 0 0 30px #ffc94d44; }

.trio { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; align-items: start; }
.tasks { display: flex; flex-direction: column; gap: 10px; }
.task { background: #ffffff05; border: 1px solid #ffffff12; border-radius: 12px; padding: 12px 14px; }
.task.now { border-color: var(--hot); box-shadow: 0 0 24px #ff2d5522; }
.task-h { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.task-h b { font: 700 15px/1.3 var(--display); }
.task p { margin: 6px 0 8px; color: var(--steel); }
.task-who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.who { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px 2px 2px; border-radius: 99px; background: #ffffff0a; }
.stakes { display: flex; gap: 6px; flex-wrap: wrap; }
.stake { font-size: 12px; padding: 4px 10px; border-radius: 8px; line-height: 1.35; }
.stake span { font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: .1em; margin-right: 2px; }
.stake.win { background: #2fd39a14; border: 1px solid #2fd39a44; color: #a8f0d3; }
.stake.lose { background: #ff4d5e12; border: 1px solid #ff4d5e44; color: #ffb3ba; }
.tasklog { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: 12px; }
.tasklog span { padding: 2px 8px; border-radius: 99px; background: #ffffff08; }
.tasklog .ok { color: var(--ok); } .tasklog .bad { color: var(--bad); }
.log { display: flex; flex-direction: column; }
.log .feed { height: 420px; flex: none; }
.viewer .ev { padding: 5px 2px; border-bottom: 1px solid #ffffff0a; }
.viewer .sysline { color: #9fd8ff; }
.viewer .scene-sep { color: var(--brand2); }

.vfoot { margin-top: auto; border-top: 1px solid #ffffff10; padding: 22px 20px calc(26px + env(safe-area-inset-bottom)); display: flex; gap: 24px; align-items: center; flex-wrap: wrap; justify-content: center; text-align: center; }
.vfoot p { max-width: 640px; margin: 0; }
.vfoot-brand { display: flex; align-items: center; gap: 10px; }
.vfoot-brand img { height: 30px; }
.vfoot-brand .wm { height: 18px; }

.m-cta { display: none; }
.mapwrap:fullscreen { aspect-ratio: auto; max-height: none; border-radius: 0; border: 0; }
.mapwrap:-webkit-full-screen { aspect-ratio: auto; max-height: none; border-radius: 0; border: 0; }
.viewmodes button[hidden] { display: none; }

.overlay { position: fixed; inset: 0; background: #02050bd9; backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.overlay[hidden], .modal[hidden] { display: none; }
.offline { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 50; max-width: calc(100vw - 32px);
  background: var(--panel2); color: var(--text); border: 1px solid var(--warn); border-radius: 10px; padding: 9px 14px;
  box-shadow: 0 6px 24px #0008; font-size: 13px; text-align: center; }
.offline[hidden] { display: none; }
.result { text-align: center; background: linear-gradient(180deg, #121d33, #0b1323); border: 1px solid var(--line); border-radius: 22px; padding: 26px 34px; width: min(440px, 100%);
  box-shadow: 0 0 0 1px #ff2d5544, 0 30px 80px #000c, 0 0 90px #ff2d5522; animation: pop .5s ease-out; }
.result.final { box-shadow: 0 0 0 1px #ffc94d66, 0 30px 80px #000c, 0 0 90px #ffc94d33; }
.result h1 { margin: 4px 0; font: 800 30px/1.15 var(--display); }
.res-verdict { font: 600 17px var(--display); color: var(--steel); margin-bottom: 14px; }
.resrow { display: grid; grid-template-columns: auto 6em 1fr 3.5em; gap: 10px; align-items: center; margin: 6px 0; text-align: left; }
.resrow .bar { width: 100%; height: 8px; background: #ffffff10; border-radius: 99px; }
.modal { position: fixed; inset: 0; background: #02050bcc; backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 45; padding: 16px; }
.modalbox { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; max-width: 560px; width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; }
.modalbox .x { position: absolute; right: 12px; top: 12px; border-radius: 99px; width: 38px; height: 38px; padding: 0; }
.bio { border-top: 4px solid var(--c); box-shadow: 0 30px 80px #000c; }
.bio-head { display: flex; gap: 18px; align-items: center; margin: 4px 0 12px; padding-right: 40px; }
.bio-head h2 { margin: 4px 0; }
.bio p { line-height: 1.6; }
.obs-only { display: none; }
body.obs .obs-only { display: block; }
body.obs .obs-hide { display: none !important; }
#qr img, #qr canvas { background: #fff; padding: 6px; border-radius: 6px; }

/* OBS browser source: one screen, stage + side, no page sections */
body.obs { height: 100vh; overflow: hidden; }
body.obs .vtop { position: static; }
body.obs .view-grid { flex: 1; min-height: 0; max-width: none; grid-template-rows: minmax(0, 1fr); }
body.obs .v-map { height: 100%; }
body.obs .v-map .mapwrap { aspect-ratio: auto; max-height: none; flex: 1; min-height: 0; }
body.obs .v-side { height: 100%; overflow: hidden; }
body.obs .sect, body.obs .vfoot { display: none; }
body.obs .v-side > * { flex-shrink: 0; }
body.obs .v-side .panel { padding: 10px 14px; }
body.obs #pollSub, body.obs .task p, body.obs .task-who, body.obs .tasklog { display: none; }
body.obs .pollrows { gap: 4px; margin: 8px 0 6px; }
body.obs .pollrow { min-height: 0; padding: 3px 10px 3px 4px; }
body.obs .pollrow .ava.sm { --s: 24px; }
body.obs .task { padding: 8px 10px; }
body.obs .tasks .task:nth-child(n+3) { display: none; }
body.obs #qrPanel { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; }
body.obs #qrPanel h3 { grid-column: 2; grid-row: 1; align-self: end; margin: 0; }
body.obs #qr { grid-row: 1 / 3; }
body.obs #qrUrl { grid-column: 2; align-self: start; font-weight: 600; color: var(--brand2); }

/* tablets */
@media (max-width: 1200px) {
  .view-grid { grid-template-columns: minmax(0, 1fr) 330px; }
  .cast { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pantry-mini { display: none; }
}
/* phones: one column, the stage first, everything thumb-sized */
@media (max-width: 900px) {
  .viewer { font-size: 15px; }
  .vtop { gap: 8px 10px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
  .brand-ic { height: 24px; }
  .vtop .logo { font-size: 18px; }
  .brand-tx small { display: none; }
  .vtop .clock { margin-left: auto; font-size: 13px; }
  .vtop .spacer { display: none; }
  .vtop .pill { order: 9; flex: 1 1 100%; max-width: none; text-align: center; padding: 4px 10px; }
  .view-grid { grid-template-columns: 1fr; padding: 0 0 12px; gap: 12px; }
  .v-map { gap: 8px; }
  /* the stage edge to edge, as tall as the screen allows */
  .v-map .mapwrap { border-radius: 0; border-left: 0; border-right: 0; max-height: 62vh; box-shadow: none; }
  .ticker { margin: 0 12px; border-radius: 10px; min-height: 40px; font-size: 14px; }
  .v-map > .camera { margin: 0 12px; }
  .subs { min-height: 0; max-height: 34vh; }
  .v-side { padding: 0 12px; gap: 12px; }
  .viewer .panel { padding: 12px 14px; border-radius: 14px; }
  .subs { min-height: 0; max-height: 34vh; }
  .subs .sub { font-size: 15px; }
  .sect { padding: 4px 12px 12px; }
  .secthead { margin: 6px 0 10px; }
  .viewer h2 { font-size: 19px; }
  /* the housemates: a swipeable row of cards */
  .cast { display: flex; overflow-x: auto; gap: 10px; scroll-snap-type: x mandatory; margin: 0 -12px; padding: 2px 12px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .cast::-webkit-scrollbar { display: none; }
  .castcard { flex: 0 0 44%; scroll-snap-align: start; }
  .castcard:hover { transform: none; }
  .cc-name b { font-size: 16px; }
  .trio { grid-template-columns: 1fr; gap: 12px; }
  .log .feed { height: 50vh; }
  .pollrow { grid-template-columns: auto 5.5em 1fr 3em; min-height: 48px; }
  .viewer input, .viewer select, .viewer textarea { font-size: 16px; } /* no zoom on focus (iOS) */
  .viewer .btn { min-height: 44px; }
  .votecards { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
  .bio-head { flex-direction: column; text-align: center; padding-right: 0; }
  .bio-head .cc-tags { justify-content: center; }
  .modal { align-items: flex-end; padding: 0; }
  .modalbox { border-radius: 20px 20px 0 0; max-height: 88vh; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .result { padding: 20px 18px; }
  .ava.huge { --s: 120px; }
  .resrow { grid-template-columns: auto 5em 1fr 3.2em; }
  /* a floating "vote" button until the viewer has voted */
  .m-cta { display: flex; position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 35;
    align-items: center; gap: 8px; padding: 13px 22px; border-radius: 99px; white-space: nowrap; text-decoration: none; color: #fff; font-weight: 700;
    background: linear-gradient(120deg, #ff2d55, #ff6a3d); box-shadow: 0 10px 30px #ff2d5566, 0 0 0 1px #ffffff22 inset; }
  .m-cta[hidden] { display: none; }
  .vfoot { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .offline { top: 60px; }
}
@media (max-width: 420px) {
  .castcard { flex-basis: 58%; }
  .onair { padding: 5px 8px; font-size: 10px; }
  .testcast { padding: 4px 6px; font-size: 9px; letter-spacing: .08em; }
}
@media (prefers-reduced-motion: reduce) {
  .onair i, .rec::before, .pill.hot { animation: none; }
  .castcard, .votecard { transition: none; }
}
html { scroll-behavior: smooth; scroll-padding-top: 70px; }

/* ---------- 3D stage ---------- */
.stagewrap { display: flex; }
.stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 30%, #2a3550, #0d0e14 70%); }
.stage[hidden] { display: none; }
.stagewrap > canvas#map { flex: 1; }
.mapwrap canvas[hidden] { display: none; }
.panel.camera { overflow: hidden; flex-shrink: 0; }
.stage-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; outline: none; }
.stage-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.stage-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-weight: 600; letter-spacing: .04em; z-index: 3; }
.spin { width: 18px; height: 18px; border: 3px solid #ffffff22; border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.s-tag { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: auto; cursor: pointer; transform-origin: 50% 100%; transition: opacity .3s; will-change: transform; }
.s-tag.dim { opacity: .35; }
.s-name { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 4px; border-radius: 99px; background: #0b0d14cc; color: #fff; font: 600 12px/1.3 var(--font); white-space: nowrap; box-shadow: 0 2px 8px #0006; border: 1px solid #ffffff1c; backdrop-filter: blur(3px); }
.s-name i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 6px var(--c); }
.s-bubble { display: none; max-width: 260px; padding: 7px 11px; border-radius: 14px; background: #fffdf8; color: #1d1d22; font: 500 13px/1.35 var(--font); box-shadow: 0 6px 20px #0007; border-bottom: 3px solid var(--c); position: relative; text-align: left; }
.s-bubble.on { display: block; animation: pop .25s ease-out; }
.s-bubble::after { content: ""; position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--c); }
@keyframes pop { from { transform: scale(.7) translateY(6px); opacity: 0; } }
.stage-lower { position: absolute; left: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 2px; padding: 8px 14px 8px 12px; border-left: 4px solid var(--hot); background: linear-gradient(90deg, #0b0d14e6, #0b0d1400); color: #fff; opacity: 0; transform: translateX(-14px); transition: all .4s; pointer-events: none; max-width: 70%; }
.stage-lower.on { opacity: 1; transform: none; }
/* a couple under the duvet on air: soft pink vignette */
.stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s;
  background: radial-gradient(ellipse at 50% 50%, transparent 45%, rgba(255, 70, 150, .32) 100%); }
.stage.love-shot::after { opacity: 1; }
.stage-lower b { font-size: 12px; line-height: 1.4; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.stage-lower span { font-size: 15px; line-height: 1.4; font-weight: 600; }
/* "Powered by BioCortexAI" bottom right, the mirror of the lower third and exactly as tall:
   8px + caption 12px*1.4 + 2px + line 15px*1.4 + 8px */
.stage { --lt-in: calc(12px * 1.4 + 2px + 15px * 1.4); }
.stage-brand { position: absolute; right: 18px; bottom: 18px; z-index: 2; box-sizing: border-box; height: calc(var(--lt-in) + 16px);
  display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 22px; border-right: 4px solid #0a84ff;
  background: linear-gradient(270deg, #0b0d14e6, #0b0d1400); text-decoration: none; cursor: pointer; transition: filter .15s; }
.stage-brand:hover { filter: brightness(1.2); }
.stage-brand:focus-visible { outline: 2px solid var(--brand2); outline-offset: 2px; }
.stage-brand .ic { height: var(--lt-in); width: auto; display: block; }
.stage-brand .tx { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.stage-brand b { font-size: 12px; line-height: 1.4; letter-spacing: .14em; text-transform: uppercase; color: #8fd0ff; }
.stage-brand .wm { height: 17px; margin: 2px 0; width: auto; display: block; }
.stage.branded .stage-lower { max-width: calc(100% - 300px); }
.viewmodes { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; z-index: 4; background: #0b0d14b3; padding: 4px; border-radius: 10px; border: 1px solid #ffffff1a; backdrop-filter: blur(4px); }
.viewmodes button { background: transparent; color: #cfd2e0; border: 0; border-radius: 7px; padding: 5px 10px; font: 600 12px var(--font); cursor: pointer; white-space: nowrap; }
.viewmodes button.on { background: var(--grad); color: #fff; }
/* sound: a button top left, the three levels unfold under it on hover */
.snd { position: absolute; top: 10px; left: 10px; z-index: 4; background: #0b0d14b3; padding: 4px; border-radius: 10px; border: 1px solid #ffffff1a; backdrop-filter: blur(4px); color: #cfd2e0; }
.snd-btn { background: transparent; color: inherit; border: 0; border-radius: 7px; padding: 5px 9px; font: 600 12px var(--font); cursor: pointer; white-space: nowrap; }
.snd.wait .snd-btn { background: var(--grad); color: #fff; animation: sndpulse 2s ease-in-out infinite; }
@keyframes sndpulse { 50% { opacity: .65; } }
.snd-pop { display: none; flex-direction: column; gap: 4px; padding: 4px 6px 6px; font: 600 11px var(--font); }
.snd.on:hover .snd-pop { display: flex; }
.snd-pop label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.snd-pop input { width: 90px; accent-color: var(--accent); }
body.obs .snd, body.rec .snd, body.hl.obs .snd { display: none; }
/* pranks (public/js/3d/pranks3d.js): a pin over every armed trap, the list of the waiting ones, the comic card */
.trap-pins { position: absolute; inset: 0; pointer-events: none; }
.trap-pin { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 4px; padding: 3px 9px 3px 5px; border-radius: 99px;
  background: #1a1206e6; border: 2px solid #ffb300; color: #ffe2a3; font: 700 11px var(--font); white-space: nowrap; transform-origin: 50% 100%;
  box-shadow: 0 0 0 0 #ffb30088; animation: trappulse 1.8s ease-out infinite; pointer-events: auto; }
.trap-pin::after { content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -5px; border: 5px solid transparent; border-top-color: #ffb300; border-bottom: 0; }
.trap-pin b { font-size: 16px; line-height: 1; }
@keyframes trappulse { 0% { box-shadow: 0 0 0 0 #ffb30088; } 70% { box-shadow: 0 0 0 10px #ffb30000; } 100% { box-shadow: 0 0 0 0 #ffb30000; } }
.trap-list { position: absolute; top: 54px; right: 10px; z-index: 3; display: none; flex-direction: column; gap: 3px; max-width: 46%; padding: 7px 10px;
  border-radius: 10px; background: #0b0d14c4; border: 1px solid #ffb30055; color: #e8e2d0; font: 600 12px var(--font); pointer-events: none; backdrop-filter: blur(4px); }
.trap-list.on { display: flex; }
.trap-list b { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #ffb300; }
.trap-list i { font-style: normal; margin-right: 5px; }
.trap-list span { color: #a9a39a; font-weight: 500; }
.prank-card { position: absolute; left: 50%; top: 18%; z-index: 1200; pointer-events: none; transform: translate(-50%, -50%) scale(.2) rotate(-12deg); opacity: 0; transition: opacity .25s; }
.prank-card.on { opacity: 1; animation: cardpop 4.6s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.pc-burst { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 34px 18px; background: #ffd23f; color: #1b1300;
  clip-path: polygon(50% 0, 61% 12%, 77% 5%, 80% 21%, 97% 22%, 90% 38%, 100% 50%, 90% 62%, 97% 78%, 80% 79%, 77% 95%, 61% 88%, 50% 100%, 39% 88%, 23% 95%, 20% 79%, 3% 78%, 10% 62%, 0 50%, 10% 38%, 3% 22%, 20% 21%, 23% 5%, 39% 12%);
  min-width: 260px; text-align: center; filter: drop-shadow(0 6px 0 #0006); }
.pc-burst i { font-style: normal; font-size: 40px; line-height: 1; }
.pc-burst b { font: 900 34px/1 var(--font); letter-spacing: .02em; text-transform: uppercase; -webkit-text-stroke: 1px #1b1300; }
.pc-burst span { font: 700 13px/1.25 var(--font); max-width: 300px; }
.b-busted .pc-burst, .b-spotted .pc-burst { background: #ff8fab; }
.b-mishap .pc-burst { background: #9be8ff; }
.b-alarm .pc-burst { background: #ff3b3b; color: #fff; }
.b-alarm .pc-burst b { -webkit-text-stroke: 1px #600; }
.b-blackout .pc-burst { background: #2b2f45; color: #ffe066; }
.b-blackout .pc-burst b { -webkit-text-stroke: 0; }
.b-sprinkler .pc-burst { background: #5ec8ff; }
@keyframes cardpop { 0% { transform: translate(-50%, -50%) scale(.2) rotate(-12deg); } 12% { transform: translate(-50%, -50%) scale(1.08) rotate(3deg); }
  18% { transform: translate(-50%, -50%) scale(1) rotate(-2deg); } 85% { transform: translate(-50%, -50%) scale(1) rotate(-2deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(.9) rotate(-2deg); opacity: 0; } }
.sysline.prank.setup { color: #c9a24a; font-style: italic; }
@media (max-width: 600px) {
  .trap-list { top: 44px; font-size: 10px; padding: 5px 7px; }
  .pc-burst { min-width: 180px; padding: 10px 22px 12px; }
  .pc-burst i { font-size: 26px; }
  .pc-burst b { font-size: 22px; }
  .pc-burst span { font-size: 11px; max-width: 200px; }
}
body.obs .v-map .mapwrap { min-height: 0; }
@media (max-width: 800px) {
  .viewmodes { top: 6px; right: 6px; }
  .viewmodes button { padding: 4px 7px; font-size: 11px; }
  .s-bubble { max-width: 180px; font-size: 12px; }
  .stage-lower { left: 8px; bottom: 8px; max-width: 90%; }
  .stage-brand { right: 8px; bottom: 8px; }
  /* no room for both side by side: the lower third sits above the brand */
  .stage.branded .stage-lower { max-width: 90%; bottom: calc(var(--lt-in) + 16px + 14px); }
}
/* small phones: the stage is only ~220 px tall – the lower third and the brand shrink so the villa stays visible */
@media (max-width: 600px) {
  .stage-brand { transform: scale(.68); transform-origin: right bottom; right: 6px; bottom: 6px; }
  .stage-lower { transform-origin: left bottom; left: 6px; }
  .stage-lower.on { transform: scale(.78); }
  .stage.branded .stage-lower { bottom: calc((var(--lt-in) + 16px) * .68 + 10px); max-width: 120%; }
  .viewmodes button { padding: 6px 9px; font-size: 13px; }
  .viewmodes .lbl { display: none; }   /* icons only on small phones */
  .s-name { font-size: 11px; }
  .s-bubble { max-width: 150px; font-size: 11px; padding: 5px 8px; }
}

@media (max-width: 1100px) {
  .producer { overflow: auto; }
  .prod-grid { grid-template-columns: 1fr; height: auto; }
  .col-map .mapwrap { min-height: 320px; }
  .col-feed { height: 60vh; }
  .col-side { height: 80vh; }
}

/* ---------- highlights player (highlights.html) ---------- */
/* in a replay the player draws names, bubbles and captions into its own canvas */
.stage.replay .stage-overlay, .stage.replay .stage-lower { visibility: hidden; }
.stage.replay::after { display: none; }
body.hl { margin: 0; overflow: hidden; background: #000; }
.hl-stage { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; }
body.rec .hl-stage { width: 1920px; height: 1080px; }
.hl-out { position: fixed; inset: 0; width: 100vw; height: 100vh; object-fit: contain; pointer-events: none; background: #000; display: block; }
.hl-ui { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; }
body.ui-show .hl-ui, body.rec .hl-ui { opacity: 1; }
body.ui-off .hl-ui, body.hl.obs .hl-ui { display: none; }
.hl-ui > * { pointer-events: auto; }
.hl-bar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 6px; align-items: center; padding: 8px 10px;
  background: #0b0d14d9; border: 1px solid #ffffff22; border-radius: 12px; backdrop-filter: blur(6px); max-width: calc(100vw - 32px); flex-wrap: wrap; }
.hl-status { color: #e8e6e3; font-size: 13px; padding: 0 6px; font-variant-numeric: tabular-nums; }
.hl-list { position: absolute; right: 16px; top: 16px; width: 330px; max-height: calc(100vh - 140px); overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
  background: #0b0d14d9; border: 1px solid #ffffff22; border-radius: 12px; padding: 8px; backdrop-filter: blur(6px); }
.hl-item { text-align: left; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; color: var(--text); cursor: pointer;
  display: flex; flex-wrap: wrap; gap: 2px 8px; font: 13px/1.35 var(--font); }
.hl-item:hover { border-color: var(--line); }
.hl-item.on { border-color: var(--accent); background: var(--accent-soft); }
.hl-item i { font-style: normal; margin-right: 2px; }
.hl-help { position: absolute; left: 16px; top: 16px; max-width: 360px; background: #0b0d14b3; padding: 6px 10px; border-radius: 8px; }
.hl-cover { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #07080dcc; z-index: 10; padding: 16px; }
.hl-cover[hidden] { display: none; }
.hl-coverbox { text-align: center; max-width: 620px; }
.hl-coverbox h1 { font-size: 42px; margin: 0 0 10px; color: var(--accent); }
.hl-coverbox p { line-height: 1.6; }
.btn.big { font-size: 18px; padding: 12px 22px; }
@media (max-width: 800px) { .hl-list { display: none; } .hl-help { display: none; } }

/* producer: highlights tab */
.hlclip { display: grid; grid-template-columns: auto 1fr auto; gap: 2px 8px; align-items: center; padding: 5px 6px; border-bottom: 1px solid var(--line); font-size: 12px; }
.hlclip.inreel { background: var(--accent-soft); }
.hlclip.hidden { opacity: .45; }
.hlclip .acts { display: flex; gap: 3px; }
.hlclip .sum { grid-column: 2 / 4; color: var(--muted); }
.hlcat { border: 1px solid var(--line); border-radius: 8px; margin: 4px 0; padding: 4px 8px; }
.hlcat summary { cursor: pointer; display: flex; gap: 6px; align-items: center; list-style: none; }
.hlcat summary::-webkit-details-marker { display: none; }
.hlcat .opts { display: flex; flex-wrap: wrap; gap: 2px 4px; margin: 4px 0 6px; }
.hlcat .opts label { font-size: 11px; border: 1px solid var(--line); border-radius: 99px; padding: 1px 7px; cursor: pointer; display: inline-flex; gap: 3px; align-items: center; }
.hlcat .opts label:has(input:checked) { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.hlcat .opts input { display: none; }
.hlcat h5 { margin: 6px 0 0; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ---------------------------------------------------------------- off-air page (viewer.js setOffAir) */
body.offair-page .view-grid { display: none; }
.offair { max-width: 1840px; width: 100%; margin: 0 auto; padding: 16px 20px 4px; display: flex; flex-direction: column; gap: 16px; }
.offair[hidden] { display: none; }
.oa-hero { text-align: center; padding: 28px 20px !important; background: radial-gradient(120% 140% at 50% 0%, #0a7cff2e, transparent 60%),
  linear-gradient(180deg, #111b2ee6, #0c1424e6) !important; }
.oa-hero h1 { font: 800 clamp(24px, 4vw, 40px)/1.15 var(--display); margin: 8px 0 10px; letter-spacing: -.02em; }
.oa-sched { font-size: 17px; margin: 0 0 6px; color: var(--steel); }
.oa-sched b { color: #fff; font-variant-numeric: tabular-nums; }
.oa-next { margin: 0 0 6px; font-size: 15px; }
.oa-next b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.oa-tech { margin: 14px auto 0; max-width: 640px; font-size: 14px; color: var(--steel); }
.oa-tech a { color: var(--brand2); font-weight: 700; text-decoration: none; border-bottom: 1px solid #00c2ff66; }
.oa-tech a:hover { border-bottom-color: var(--brand2); }
.oa-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.oa-grid .oa-video[hidden] + .oa-poll { grid-column: 1 / -1; max-width: 560px; width: 100%; justify-self: center; }
.oa-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.oa-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.oa-frame:empty { display: none; }
.oa-poll .pollpanel { border-color: #ff2d5555 !important; }

/* ---------------------------------------------------------------- inside the villa: relationships, supplies, emotions */
.insights { padding: 0 !important; overflow: hidden; }
.itabs { display: flex; gap: 4px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.itabs button { font: 600 14px var(--font); color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; cursor: pointer; white-space: nowrap; }
.itabs button.on { color: var(--text); border-bottom-color: var(--brand2); }
.itabs button:focus-visible { outline: 2px solid var(--brand2); outline-offset: -2px; border-radius: 6px; }
.ipane { display: none; padding: 14px 16px 16px; }
.ipane.on { display: block; }

.relwrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.relgraph svg { width: 100%; height: auto; max-height: 560px; display: block; }
.rnode { cursor: pointer; }
.rnode:focus { outline: none; }
.rnode:focus-visible circle:first-child { stroke: #fff; }
.rinit { font: 700 20px var(--display); fill: #fff; }
.rname { font: 600 13px var(--font); fill: var(--text); paint-order: stroke; stroke: #060a13; stroke-width: 4px; }
.relmode { display: inline-flex; gap: 2px; padding: 3px; background: #ffffff08; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
.relmode button { font: 600 13px var(--font); color: var(--muted); background: none; border: 0; border-radius: 7px; padding: 7px 12px; cursor: pointer; }
.relmode button.on { background: var(--grad); color: #fff; }
.relinfo { max-height: 420px; overflow-y: auto; }
.relheads { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.relheads li { background: #ffffff06; border: 1px solid #ffffff10; border-radius: 10px; padding: 8px 12px; }
.relme { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.relme .btn { margin-left: auto; padding: 5px 10px; font-size: 12px; }
.relrow { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #ffffff0a; }
.relrow .small { line-height: 1.4; }
.rdir { color: var(--brand2); font-weight: 700; }
.relnum { font: 700 14px var(--font); font-variant-numeric: tabular-nums; }
.pos { color: var(--ok); } .neg { color: var(--bad); }
.rellegend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.rellegend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.rellegend i.dash { background: repeating-linear-gradient(90deg, #ffb020 0 5px, transparent 5px 9px); }

.supgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.supitem { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; background: #ffffff05; border: 1px solid #ffffff10; border-radius: 12px; padding: 10px 12px; }
.supitem.low { border-color: #ff4d5e66; background: #ff4d5e0d; }
.sup-ic { font-size: 26px; grid-row: 1 / 3; }
.sup-tx { display: flex; flex-direction: column; min-width: 0; }
.sup-tx span { font-size: 12px; color: var(--muted); }
.sup-tx b { font: 700 20px/1.2 var(--display); font-variant-numeric: tabular-nums; }
.sup-tx b small { font: 500 12px var(--font); color: var(--muted); }
.sup-tx b.small { font: 600 13px/1.3 var(--font); }
.sup-hid { color: var(--warn) !important; font-weight: 600; }
.sup-bar { height: 5px; border-radius: 99px; background: #ffffff10; overflow: hidden; }
.sup-bar i { display: block; height: 100%; background: var(--grad); border-radius: inherit; }
.supitem.low .sup-bar i { background: var(--bad); }
.sup-h { margin: 18px 0 8px; font: 700 15px var(--display); }
.supcaches, .suplockers { display: flex; flex-direction: column; gap: 8px; }
.cache { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #ffffff05; border: 1px solid #ffffff10; }
.cache.open { border-color: #ffb02066; background: #ffb0200d; }
.cache.closed { opacity: .7; }
.cache-ic { font-size: 24px; }
.cache-tx .small { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.cache-st { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 99px; background: #ffffff0d; white-space: nowrap; }
.cache.open .cache-st { background: var(--warn); color: #1a1200; }
.locker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-radius: 12px; background: #ffffff05; border: 1px solid #ffffff10; }

.emokey { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.emochip { display: inline-flex; align-items: center; gap: 6px; font: 500 13px var(--font); color: var(--text); background: #ffffff06; border: 1px solid #ffffff14;
  border-left: 3px solid var(--c); border-radius: 99px; padding: 4px 10px 4px 4px; cursor: pointer; }
.emochip.on { background: color-mix(in srgb, var(--c) 22%, transparent); border-color: var(--c); }
.emochip .muted { font-size: 12px; }
.emochart { position: relative; }
.emochart svg { display: block; touch-action: pan-y; }
.emochart .gl { stroke: #ffffff10; } .emochart .zero { stroke: #ffffff30; stroke-dasharray: 3 4; }
.emochart .gap { stroke: #ffffff18; stroke-dasharray: 2 4; }
.emochart .ax { font: 11px var(--font); fill: var(--muted); }
.emochart .hint { opacity: .7; }
.emochart .cursor { stroke: #ffffff60; }
.emotip { position: absolute; top: 6px; min-width: 150px; background: #0a1220f2; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; pointer-events: none; box-shadow: 0 8px 24px #0008; }
.emotip[hidden] { display: none; }
.emotip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.emostrips { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.strip-h { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 4px; }
.strip-h > span { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; }
.sw i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 3px; vertical-align: -1px; }
.strip { display: grid; grid-template-columns: 6em 1fr; gap: 8px; align-items: center; }
.strip-n { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-c { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: #ffffff06; }
.strip-c i { flex: 1 1 0; min-width: 0; }

@media (max-width: 1200px) { .oa-grid { grid-template-columns: minmax(0, 1fr) 330px; } }
@media (max-width: 900px) {
  .offair { padding: 12px 12px 0; gap: 12px; }
  .oa-hero { padding: 20px 14px !important; }
  .oa-grid { grid-template-columns: 1fr; }
  .relwrap { grid-template-columns: 1fr; }
  .relinfo { max-height: none; }
  .ipane { padding: 12px; }
  .supgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sup-tx b { font-size: 17px; }
  .strip { grid-template-columns: 4.5em 1fr; }
}
