:root {
  --bg: #0b1020;
  --bg2: #111830;
  --panel: rgba(255,255,255,0.045);
  --panel-b: rgba(255,255,255,0.09);
  --text: #e8ecf5;
  --muted: #8d97b0;
  --gold: #f5c26b;
  --ai: #5eead4;
  --you: #fbbf24;
  --prop: #60a5fa;
  --opp: #f87171;
  --danger: #f87171;
  --radius: 14px;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
body {
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(94,234,212,0.08), transparent 60%),
    radial-gradient(1000px 700px at 90% 0%, rgba(245,194,107,0.07), transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--bg));
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--ai); }
.muted { color: var(--muted); font-weight: 400; }
small { font-size: 0.82em; }
.dragbar { position: fixed; top: 0; left: 0; right: 0; height: 30px; -webkit-app-region: drag; z-index: 50; }

.screen { position: absolute; inset: 0; padding: 38px 32px 24px; display: flex; flex-direction: column; overflow: auto; }

/* ---------- common ---------- */
.card { background: var(--panel); border: 1px solid var(--panel-b); border-radius: var(--radius); padding: 22px 24px; backdrop-filter: blur(8px); }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: 0.2px; }
h2 { font-size: 20px; margin: 0 0 14px; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin: 20px 0 8px; font-weight: 600; }
h3 small { text-transform: none; letter-spacing: 0; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; margin-top: 10px; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--gold); letter-spacing: 0.5px; }
.brand.big { font-size: 40px; justify-content: center; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, var(--gold), #c88a2e); box-shadow: 0 0 18px rgba(245,194,107,0.4); position: relative; }
.brand-mark::after { content: ""; position: absolute; left: 5px; right: 5px; bottom: 5px; height: 3px; background: var(--bg); border-radius: 2px; box-shadow: 0 -5px 0 var(--bg); }
.brand.big .brand-mark { width: 36px; height: 36px; border-radius: 9px; }
.brand.big .brand-mark::after { left: 8px; right: 8px; bottom: 8px; height: 5px; box-shadow: 0 -8px 0 var(--bg); }

.btn { background: rgba(255,255,255,0.07); border: 1px solid var(--panel-b); border-radius: 10px; padding: 9px 16px; cursor: pointer; transition: background .15s, transform .05s, border-color .15s; white-space: nowrap; }
.btn:hover { background: rgba(255,255,255,0.12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: linear-gradient(180deg, #f7cf86, #e0a645); color: #1b1305; border-color: transparent; font-weight: 650; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.subtle { background: transparent; }
.btn.danger { border-color: rgba(248,113,113,0.5); color: #fecaca; }
.btn.wide { width: 100%; padding: 12px; }
.btn.huge { font-size: 17px; padding: 14px 40px; border-radius: 12px; }
.icon-btn { background: none; border: 1px solid var(--panel-b); border-radius: 10px; width: 36px; height: 36px; font-size: 17px; cursor: pointer; -webkit-app-region: no-drag; }
.icon-btn:hover { background: rgba(255,255,255,0.08); }

input[type=text], input[type=password], input[type=number], select, textarea {
  background: rgba(0,0,0,0.25); border: 1px solid var(--panel-b); border-radius: 10px; padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: rgba(245,194,107,0.6); box-shadow: 0 0 0 3px rgba(245,194,107,0.12); }
textarea { resize: none; width: 100%; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.hint { color: var(--muted); font-size: 12.5px; }
.error { background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.35); color: #fecaca; padding: 9px 12px; border-radius: 10px; margin: 10px 0; font-size: 13px; }

.seg { display: flex; background: rgba(0,0,0,0.25); border: 1px solid var(--panel-b); border-radius: 11px; padding: 3px; gap: 3px; }
.seg button { flex: 1; background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; color: var(--muted); display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.seg button small { font-size: 11px; opacity: 0.8; }
.seg button:hover { color: var(--text); }
.seg button.on { background: rgba(245,194,107,0.16); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(245,194,107,0.35); }

.slider { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.slider input { flex: 1; accent-color: var(--gold); }
.slider output { width: 48px; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- key screen ---------- */
#screen-key { align-items: center; justify-content: center; }
.key-card { width: 460px; text-align: left; padding: 34px; }
.key-card .lede { text-align: center; color: var(--muted); margin: 10px 0 18px; font-size: 15px; }

/* ---------- setup ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; padding-left: 60px; }
.setup-grid { display: grid; grid-template-columns: 1.15fr 1fr; grid-template-rows: auto auto; gap: 18px; max-width: 1240px; width: 100%; margin: 0 auto; }
.audience-card { grid-column: 1 / -1; }
#motion { font-family: var(--serif); font-size: 18px; line-height: 1.4; }
#topic { flex: 1; }
.timings { display: flex; gap: 10px; align-items: flex-end; }
.timings label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); flex: 1; }
.timings input { width: 100%; font-size: 16px; text-align: center; font-variant-numeric: tabular-nums; }
.opponent-preview { display: flex; justify-content: center; margin: -6px 0 -8px; }
.preview-head { width: 170px; height: 190px; }
.audience-preview { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.aud-mini { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,0.18); border: 1px solid transparent; }
.aud-mini:hover { border-color: var(--panel-b); }
.aud-mini .avatar-svg { width: 38px; height: 38px; flex: none; }
.aud-mini b { display: block; font-size: 13px; font-weight: 600; }
.aud-mini span { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.setup-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 20px; }

/* ---------- debate ---------- */
#screen-debate { padding: 34px 22px 14px; gap: 12px; }
.stagebar { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 80px; }
.motion-title { font-family: var(--serif); font-size: 20px; text-align: center; max-width: 900px; line-height: 1.3; }
.pips { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; }
.pips li { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); padding: 4px 12px; border-radius: 99px; border: 1px solid var(--panel-b); }
.pips li.done { color: var(--text); border-color: rgba(255,255,255,0.2); }
.pips li.on { color: #1b1305; background: var(--gold); border-color: var(--gold); font-weight: 700; }

.stage { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.25fr 270px 1fr; gap: 16px; }
.podium { background: var(--panel); border: 1px solid var(--panel-b); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; overflow: hidden; position: relative; transition: border-color .3s, box-shadow .3s; }
.podium.active.ai { border-color: rgba(94,234,212,0.55); box-shadow: 0 0 0 1px rgba(94,234,212,0.25), 0 0 40px rgba(94,234,212,0.08); }
.podium.active.user { border-color: rgba(251,191,36,0.55); box-shadow: 0 0 0 1px rgba(251,191,36,0.25), 0 0 40px rgba(251,191,36,0.08); }
.nameplate { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 16px 6px; }
.nameplate .who { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.podium.ai .who { color: var(--ai); }
.podium.user .who { color: var(--you); }
.side { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; padding: 3px 10px; border-radius: 99px; }
.side.prop { color: var(--prop); background: rgba(96,165,250,0.12); }
.side.opp { color: var(--opp); background: rgba(248,113,113,0.12); }

.head-wrap { position: relative; flex: 1 1 52%; min-height: 160px; display: flex; justify-content: center; align-items: flex-end; }
#head { height: 100%; aspect-ratio: 400 / 470; max-width: 100%; position: relative; z-index: 1; }
.head-svg { width: 100%; height: 100%; display: block; }
.spot { position: absolute; bottom: 0; left: 10%; right: 10%; height: 30px; background: radial-gradient(closest-side, rgba(0,0,0,0.4), transparent); }
.captions { flex: 1 1 40%; overflow-y: auto; padding: 14px 18px 18px; border-top: 1px solid var(--panel-b); font-family: var(--serif); font-size: 16.5px; line-height: 1.55; scroll-behavior: smooth; background: rgba(0,0,0,0.12); }
.captions .placeholder { color: var(--muted); font-family: var(--sans); font-size: 13.5px; }
.captions .sent { color: rgba(232,236,245,0.38); transition: color .25s; }
.captions .sent.spoken { color: rgba(232,236,245,0.78); }
.captions .sent.now { color: #fff; background: linear-gradient(transparent 62%, rgba(94,234,212,0.18) 62%); }
.captions .past { border-left: 2px solid var(--panel-b); padding-left: 10px; margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
.captions .past b { color: var(--text); font-family: var(--sans); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; display: block; }

.center { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 6px; }
.timer { position: relative; width: 210px; height: 210px; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 7; }
.timer .track { stroke: rgba(255,255,255,0.08); }
.timer .prog { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 0; transition: stroke-dashoffset .25s linear, stroke .3s; }
.timer.ai .prog { stroke: var(--ai); }
.timer.you .prog { stroke: var(--you); }
.timer.warn .prog { stroke: #fb923c; }
.timer.over .prog { stroke: var(--danger); }
.timer-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#timer-time { font-size: 48px; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.timer.over #timer-time { color: var(--danger); animation: pulse 1s infinite; }
.timer-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); }
@keyframes pulse { 50% { opacity: 0.45; } }
.status { text-align: center; color: var(--text); min-height: 44px; font-size: 14px; padding: 0 6px; }
.status .dots::after { content: "…"; animation: dots 1.2s steps(4) infinite; display: inline-block; width: 1em; text-align: left; overflow: hidden; vertical-align: bottom; }
@keyframes dots { 0% { width: 0; } 100% { width: 1.2em; } }
.actions { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.actions .btn { width: 100%; }
.room-meter { margin-top: auto; width: 100%; padding: 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--panel-b); }
.rm-labels { display: flex; justify-content: space-between; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.rm-labels span:first-child { color: var(--prop); }
.rm-labels span:last-child { color: var(--opp); }
.rm-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; margin: 6px 0; background: rgba(255,255,255,0.06); }
.rm-bar div { transition: width .8s cubic-bezier(.2,.8,.2,1); }
.rm-prop { background: var(--prop); width: 0; }
.rm-und { background: rgba(255,255,255,0.18); width: 100%; }
.rm-opp { background: var(--opp); width: 0; }
.rm-caption { font-size: 11.5px; color: var(--muted); text-align: center; }

.user-log { max-height: 34%; overflow-y: auto; padding: 0 16px; }
.user-log .past { border-left: 2px solid rgba(251,191,36,0.35); padding: 2px 0 2px 10px; margin: 6px 0 10px; color: var(--muted); font-size: 13px; white-space: pre-wrap; }
.user-log .past b { color: var(--text); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; display: block; }
.speech-box { flex: 1; display: flex; flex-direction: column; padding: 8px 16px 16px; min-height: 0; }
#user-speech { flex: 1; min-height: 120px; font-family: var(--serif); font-size: 17px; line-height: 1.55; padding: 14px; }
#user-speech:disabled { opacity: 0.55; }
.speech-tools { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.mic { display: inline-flex; align-items: center; gap: 9px; background: rgba(251,191,36,0.12); border: 1px solid rgba(251,191,36,0.4); color: var(--you); border-radius: 99px; padding: 8px 18px 8px 14px; cursor: pointer; font-weight: 600; }
.mic:disabled { opacity: 0.4; cursor: default; }
.mic-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--you); }
.mic.live { background: rgba(248,113,113,0.16); border-color: rgba(248,113,113,0.6); color: #fecaca; }
.mic.live .mic-dot { background: var(--danger); animation: pulse 1s infinite; box-shadow: 0 0 0 4px rgba(248,113,113,0.25); }
.wordcount { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.audience-strip { display: grid; grid-template-columns: repeat(10, 1fr); gap: 8px; }
.seat { position: relative; display: flex; flex-direction: column; align-items: center; padding: 8px 4px 8px; border-radius: 12px; background: var(--panel); border: 1px solid var(--panel-b); }
.seat .avatar-svg { width: 40px; height: 40px; transition: transform .3s; }
.seat.react .avatar-svg { animation: hop .5s; }
@keyframes hop { 40% { transform: translateY(-5px); } }
.seat .nm { font-size: 11.5px; font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.seat .rl { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lean { display: flex; gap: 3px; margin-top: 6px; }
.lean i { width: 9px; height: 5px; border-radius: 2px; background: rgba(255,255,255,0.1); transition: background .4s; }
.lean i.p { background: var(--prop); }
.lean i.o { background: var(--opp); }
.lean i.u { background: rgba(255,255,255,0.45); }
.bubble { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(6px); width: 190px; background: #f8fafc; color: #0f172a; font-size: 12px; line-height: 1.35; padding: 8px 10px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.35); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; z-index: 5; }
.bubble::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: #f8fafc; }
.seat.show .bubble, .seat:hover .bubble:not(:empty) { opacity: 1; transform: translateX(-50%) translateY(0); }
.seat:first-child .bubble { left: 0; transform: translateY(6px); }
.seat:first-child .bubble::after { left: 30px; }
.seat:first-child.show .bubble, .seat:first-child:hover .bubble:not(:empty) { transform: translateY(0); }
.seat:last-child .bubble { left: auto; right: 0; transform: translateY(6px); }
.seat:last-child .bubble::after { left: auto; right: 24px; }
.seat:last-child.show .bubble, .seat:last-child:hover .bubble:not(:empty) { transform: translateY(0); }

/* ---------- verdict ---------- */
.verdict { max-width: 1180px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.verdict-motion { font-family: var(--serif); color: var(--muted); font-size: 16px; text-align: center; max-width: 820px; }
.verdict h1 { font-size: 40px; margin: 8px 0 18px; text-align: center; }
.verdict h1.win { color: var(--you); }
.verdict h1.lose { color: var(--ai); }
.tally { display: grid; grid-template-columns: 140px 1fr 140px; align-items: center; gap: 20px; width: 100%; max-width: 760px; }
.tally-side { text-align: center; }
.tally-n { font-size: 52px; font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
.tally-side.you .tally-n { color: var(--you); }
.tally-side.ai .tally-n { color: var(--ai); }
.tally-l { font-size: 13px; color: var(--muted); margin-top: 4px; }
.tally-l small { display: block; text-transform: uppercase; letter-spacing: 1px; font-size: 10.5px; }
.tally-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,0.07); }
.tally-bar div { width: 0; transition: width .6s cubic-bezier(.2,.8,.2,1); }
#v-bar-you { background: var(--you); }
#v-bar-ai { background: var(--ai); margin-left: auto; }
.v-sub { color: var(--muted); margin: 14px 0 6px; min-height: 20px; text-align: center; }
.vote-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; width: 100%; margin-top: 12px; }
.vote { display: flex; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--panel-b); opacity: 0.5; transition: opacity .4s, border-color .4s, transform .4s; }
.vote.in { opacity: 1; }
.vote.you { border-color: rgba(251,191,36,0.35); }
.vote.ai { border-color: rgba(94,234,212,0.35); }
.vote .avatar-svg { width: 46px; height: 46px; flex: none; }
.vote-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vote-head b { font-size: 14px; }
.vote-head .role { color: var(--muted); font-size: 12px; }
.chip { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; padding: 2px 9px; border-radius: 99px; margin-left: auto; }
.chip.you { background: rgba(251,191,36,0.16); color: var(--you); }
.chip.ai { background: rgba(94,234,212,0.14); color: var(--ai); }
.chip.wait { background: rgba(255,255,255,0.06); color: var(--muted); }
.vote p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.45; color: #cfd6e6; }
.vote .meta { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.conf { letter-spacing: 2px; color: var(--gold); }
.verdict-actions { display: flex; gap: 12px; margin: 24px 0 14px; }
.transcript { width: 100%; margin-bottom: 30px; background: var(--panel); border: 1px solid var(--panel-b); border-radius: 12px; padding: 12px 18px; }
.transcript summary { cursor: pointer; color: var(--muted); }
.transcript .sp { margin: 16px 0; }
.transcript .sp h4 { margin: 0 0 4px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.transcript .sp.you h4 { color: var(--you); }
.transcript .sp.ai h4 { color: var(--ai); }
.transcript .sp p { margin: 0; font-family: var(--serif); font-size: 15px; white-space: pre-wrap; color: #d6dcea; }

/* ---------- modal & toast ---------- */
.modal { background: #151c33; color: var(--text); border: 1px solid var(--panel-b); border-radius: 16px; padding: 24px 26px; width: 480px; box-shadow: 0 30px 80px rgba(0,0,0,0.5); }
.modal::backdrop { background: rgba(4,7,16,0.6); backdrop-filter: blur(3px); }
.modal h2 { margin-top: 0; }
.toast { position: fixed; left: 50%; top: 46px; transform: translateX(-50%); background: #f8fafc; color: #0f172a; padding: 10px 18px; border-radius: 10px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,0.4); z-index: 100; max-width: 70vw; text-align: center; }
.toast.err { background: #fecaca; color: #450a0a; }

@media (max-width: 1240px) {
  .stage { grid-template-columns: 1.1fr 230px 1fr; }
  .timer { width: 180px; height: 180px; }
  #timer-time { font-size: 40px; }
}
@media (max-height: 800px) {
  .seat .rl { display: none; }
  .seat .avatar-svg { width: 32px; height: 32px; }
}

/* ---------- recording ---------- */
.check { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; cursor: pointer; }
.check input { accent-color: var(--gold); width: 16px; height: 16px; margin: 2px 0 0; flex: none; }
.check span { display: flex; flex-direction: column; }
.check small { color: var(--muted); }
.rec-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; padding-left: 26px; }
.rec-sub.off { opacity: 0.4; pointer-events: none; }
.name-field { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.name-field input { width: 130px; padding: 5px 9px; }
.rec-badge { position: absolute; top: 36px; right: 26px; display: flex; align-items: center; gap: 7px; font-size: 12px; letter-spacing: 1px; color: #fecaca; background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.4); padding: 4px 12px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); animation: pulse 1.2s infinite; }
.stagebar { position: relative; }
.video-bar { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 1000px; margin: 14px 0 4px; padding: 12px 14px 12px 16px; border-radius: 14px; background: rgba(245,194,107,0.08); border: 1px solid rgba(245,194,107,0.3); }
.video-bar .video-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--gold); color: #1b1305; display: flex; align-items: center; justify-content: center; font-size: 14px; flex: none; }
.video-bar.busy .video-icon { animation: pulse 1s infinite; }
.video-bar .grow { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- camera & live captions ---------- */
.check-row { display: flex; align-items: flex-start; gap: 8px; }
.check-row .check { flex: 1; }
.check-row select { padding: 5px 28px 5px 9px; font-size: 12.5px; margin-top: 4px; }
.btn.small { padding: 5px 10px; font-size: 12.5px; margin-top: 4px; }
.name-field { margin: 8px 0 0 26px; }
.self-view { position: relative; margin: 0 16px 8px; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; max-height: 30%; flex: none; }
.self-view video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.self-tag { position: absolute; left: 10px; bottom: 8px; font-size: 11px; letter-spacing: 0.8px; text-transform: uppercase; background: rgba(0,0,0,0.55); color: #fff; padding: 3px 8px; border-radius: 99px; }
.podium.user.has-cam .user-log { max-height: 18%; }
.podium.user.has-cam #user-speech { min-height: 90px; }
.live-caption { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: rgba(251,191,36,0.08); border: 1px dashed rgba(251,191,36,0.35); color: #fde68a; font-family: var(--serif); font-size: 16px; line-height: 1.45; max-height: 5.2em; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.live-caption::before { content: "Hearing… "; font-family: var(--sans); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--you); opacity: 0.8; }
.mic-meter { width: 34px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.12); position: relative; overflow: hidden; }
.mic-meter::after { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--lvl, 0)); background: currentColor; transition: transform .08s linear; }

/* ---------- caption engine & fallback ---------- */
.cap-engine { display: flex; gap: 8px; margin: 2px 0 0 26px; }
.cap-engine select { padding: 5px 28px 5px 9px; font-size: 12.5px; }
.cap-engine #cap-engine { flex: 1; min-width: 0; }
.model-status { margin: 6px 0 0 26px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 10px; min-height: 18px; }
.model-status .bar { flex: 1; max-width: 220px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.1); overflow: hidden; }
.model-status .bar i { display: block; height: 100%; background: var(--gold); width: 0; transition: width .3s; }
.model-status .ok { color: #86efac; }
.model-status .bad { color: #fecaca; }
.model-status button { padding: 3px 10px; font-size: 12px; }
.cap-status { margin-top: 8px; font-size: 12.5px; padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,0.05); color: var(--muted); }
.cap-status.bad { background: rgba(248,113,113,0.12); color: #fecaca; }
.cap-status.ok::before { content: "● "; color: #86efac; }
.rescue { border: 1px solid rgba(251,191,36,0.6) !important; box-shadow: 0 0 0 3px rgba(251,191,36,0.15); }

/* ---------- audience feedback ---------- */
.vote .fb { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.vote .fb > div { font-size: 13px; line-height: 1.45; color: #cfd6e6; padding: 7px 10px; border-radius: 8px; background: rgba(0,0,0,0.2); }
.vote .fb b { display: block; font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 2px; }
.vote .fb-you b { color: var(--you); }
.vote .fb-ai b { color: var(--ai); }

/* ---------- translated versions ---------- */
.export-panel { width: 100%; max-width: 1000px; margin: 6px 0 4px; padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--panel-b); }
.xp-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 13px; }
.xp-head b { font-size: 15px; }
.xl { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid rgba(255,255,255,0.05); flex-wrap: wrap; }
.xl .check { margin: 0; width: 110px; }
.xv { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.xv select { padding: 4px 26px 4px 8px; font-size: 12.5px; }
.xs { font-size: 12.5px; color: var(--gold); margin-left: auto; }
#export-go { margin-top: 10px; }

/* ---------- opponent picker ---------- */
.opponent-preview { display: flex; align-items: center; gap: 18px; justify-content: flex-start; margin: -4px 0 6px; }
.preview-head { width: 170px; height: 200px; flex: none; }
.opp-info { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.opp-name { font-family: var(--serif); font-size: 22px; color: var(--ai); }
.opp-era { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); }
.opp-blurb { font-size: 13px; color: var(--muted); max-width: 300px; }
.opp-info .check { margin: 4px 0; font-size: 13px; }
.opp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; max-height: 214px; overflow-y: auto; padding: 4px; border-radius: 10px; background: rgba(0,0,0,0.18); }
.opp-grid h4 { grid-column: 1 / -1; margin: 6px 2px 0; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.opp-tile { border: 1px solid transparent; border-radius: 10px; background: rgba(255,255,255,0.03); padding: 0; cursor: pointer; aspect-ratio: 400 / 470; overflow: hidden; }
.opp-tile:hover { border-color: var(--panel-b); }
.opp-tile.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245,194,107,0.3); }
.opp-tile svg { width: 100%; height: 100%; display: block; }

/* ---------- ElevenLabs option ---------- */
.xp-engine { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 6px; }
.xp-engine .check { margin: 4px 0; max-width: 430px; }
.xi-box { padding: 10px 12px; margin: 4px 0 8px; border-radius: 10px; background: rgba(94,234,212,0.06); border: 1px solid rgba(94,234,212,0.25); font-size: 13px; }
.xi-status { margin-bottom: 4px; }
.xi-status .bad { color: #fecaca; }
.xi-sample, .xi-est { color: var(--muted); font-size: 12.5px; margin: 2px 0; }
.xi-box .check { font-size: 13px; }

/* camera backgrounds */
.bg-row { margin: 2px 0 12px 30px; }
.bg-row.off { opacity: .45; pointer-events: none; }
.bg-head { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.bg-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.bg-tile { position: relative; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: #1b2236; cursor: pointer; padding: 0; color: #dfe6f5; font: inherit; }
.bg-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bg-tile .lbl { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; padding: 2px 4px; background: linear-gradient(transparent, rgba(0,0,0,.75)); text-align: left; }
.bg-tile.sel { border-color: var(--you); }
.bg-tile .ico { position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; opacity: .85; }
.bg-tile.blur .ico { background: radial-gradient(circle at 50% 45%, #c9a27a 0 18%, transparent 19%), linear-gradient(135deg, #5a6d8f, #8fa3b8 50%, #6f7f5e); filter: blur(2px); }
.bg-tile.blur-strong .ico { background: linear-gradient(135deg, #5a6d8f, #8fa3b8 50%, #6f7f5e); filter: blur(5px); }
.bg-preview { position: relative; margin-top: 8px; border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.bg-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.bg-note { position: absolute; left: 8px; bottom: 6px; font-size: 11px; color: #fff; text-shadow: 0 1px 2px #000; }

/* take-home messages */
.coach { width: 100%; margin-top: 14px; padding: 14px 18px; border-radius: 12px; background: var(--panel); border: 1px solid var(--panel-b); }
.coach-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.coach-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; font-size: 13.5px; line-height: 1.45; color: #cfd6e6; }
.coach-body h5 { margin: 0 0 4px; font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.coach-body ul { margin: 0; padding-left: 18px; }
.coach-body li { margin-bottom: 4px; }
.coach-body .summary { grid-column: 1 / -1; color: #e6ebf5; }

.fb-menu { position: relative; }
.fb-pop { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 20; display: flex; flex-direction: column; min-width: 260px; padding: 6px; border-radius: 10px; background: #1a2135; border: 1px solid var(--panel-b); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.fb-pop[hidden] { display: none; }
.fb-pop button { text-align: left; background: none; border: 0; color: #e6ebf5; font: inherit; font-size: 13.5px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.fb-pop button:hover { background: rgba(255,255,255,.08); }

/* ElevenLabs set-up before the debate */
.pre-xi { margin: 4px 0 10px 30px; padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,.18); border: 1px solid var(--panel-b); display: flex; flex-direction: column; gap: 8px; }
.pre-xi-credits { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: #dfe6f5; }
.pre-xi-key { display: flex; gap: 8px; }
.pre-xi-key input { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--panel-b); background: #0e1426; color: #e6ebf5; font: inherit; font-size: 13px; }
.xi-checks { list-style: none; margin: 0; padding: 0; font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; }
.xi-checks li::before { content: '•'; display: inline-block; width: 16px; color: var(--muted); }
.xi-checks li.ok::before { content: '✓'; color: #4ade80; }
.xi-checks li.bad::before { content: '✗'; color: #f87171; }
.xi-checks li.unk::before { content: '?'; color: #fbbf24; }
.xi-checks b { font-weight: 600; color: #e6ebf5; }
.xi-checks span { color: var(--muted); }
.pre-xi-langs { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.pre-xi-langs label { display: flex; gap: 6px; align-items: center; }
.small-note { font-size: 12px; line-height: 1.4; }
.xi-credits-row { display: flex; align-items: center; gap: 8px; }

/* title card before the first speech */
.intro-card { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(6,10,22,.88); backdrop-filter: blur(6px); }
.intro-card[hidden] { display: none; }
.intro-inner { max-width: 900px; padding: 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.intro-kicker { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold, #f5c26b); font-weight: 700; }
.intro-motion { font-family: "New York", "Iowan Old Style", Georgia, serif; font-size: 40px; line-height: 1.2; color: #eef2fa; }
.intro-vs { display: flex; gap: 14px; align-items: baseline; font-family: "New York", Georgia, serif; font-size: 26px; }
.intro-vs .you { color: var(--you); } .intro-vs .ai { color: #5eead4; } .intro-vs .vs { font-size: 16px; color: var(--muted); font-family: inherit; }
.intro-count { font-size: 18px; color: #dfe6f5; }
.intro-hint { font-size: 13px; color: var(--muted); max-width: 560px; }
.rec-badge.paused { opacity: .6; }
.good { color: #4ade80; }
.xv[hidden] { display: none; }

.fair { margin-top: 14px; border-top: 1px solid var(--panel-b); padding-top: 10px; }
.fair h3 { margin-top: 0; }
.fair-strength { margin-left: 30px; }
.fairness { width: 100%; margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: rgba(255,255,255,.03); border: 1px dashed var(--panel-b); font-size: 13px; line-height: 1.5; color: #cfd6e6; }
.fairness b { color: #e6ebf5; }
.fair-strength.off { opacity: .45; pointer-events: none; }
.ls-box { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 4px; }
[hidden] { display: none !important; }

/* accounts and presence */
.acct-bar { display: flex; align-items: center; gap: 10px; }
.chip-btn { border: 1px solid var(--panel-b); background: rgba(255,255,255,.04); color: #e6ebf5; font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip-btn:hover { background: rgba(255,255,255,.08); }
.online-chip .dot, .online-list-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 8px #4ade80; display: inline-block; }
.online-wrap { position: relative; }
.online-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 300px; padding: 10px; border-radius: 12px; background: #1a2135; border: 1px solid var(--panel-b); box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.pop-head { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
#online-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow: auto; }
#online-list li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 6px 6px; border-radius: 8px; }
#online-list li:hover { background: rgba(255,255,255,.05); }
#online-list .nm { flex: 1; min-width: 0; }
#online-list .nm small { display: block; color: var(--muted); font-size: 11.5px; }
#online-list .sc { color: var(--you); font-variant-numeric: tabular-nums; font-size: 12.5px; }
#online-list .debating .online-list-dot { background: #fbbf24; box-shadow: 0 0 8px #fbbf24; }
.acct-modal { width: min(720px, 94vw); }
.acct-wrap { display: flex; flex-direction: column; gap: 10px; }
.acct-top { display: flex; justify-content: space-between; align-items: center; }
.acct-top h2 { margin: 0; }
.acct-wrap .row input { flex: 1; }
.acct-hello { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.score-card { display: flex; gap: 18px; align-items: center; padding: 12px 16px; border-radius: 12px; background: rgba(251,191,36,.07); border: 1px solid rgba(251,191,36,.25); }
.big-score { font-family: "New York", Georgia, serif; font-size: 44px; color: var(--you); font-variant-numeric: tabular-nums; }
.score-parts { font-size: 13px; color: #cfd6e6; line-height: 1.5; }
.acct-list { max-height: 330px; overflow: auto; font-size: 13px; }
.acct-list table { width: 100%; border-collapse: collapse; }
.acct-list th { text-align: left; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); padding: 6px 6px; position: sticky; top: 0; background: #151b2d; }
.acct-list td { padding: 6px; border-top: 1px solid rgba(255,255,255,.05); vertical-align: top; }
.acct-list td.win { color: #4ade80; } .acct-list td.loss { color: #f87171; }
.seg.small button { font-size: 12.5px; padding: 6px 12px; }

/* difficulty */
.diff { margin: 10px 0 6px; padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,.18); border: 1px solid var(--panel-b); display: flex; flex-direction: column; gap: 8px; }
.diff-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13.5px; }
.diff-scale { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.diff-bar { position: relative; flex: 1; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #22c55e, #64748b 50%, #ef4444); }
.diff-bar .mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: rgba(255,255,255,.4); }
.diff-bar .mark { position: absolute; top: -5px; width: 4px; height: 20px; margin-left: -2px; border-radius: 2px; }
.diff-bar .mark.raw { background: #fff; opacity: .55; }
.diff-bar .mark.after { background: var(--you); box-shadow: 0 0 8px var(--you); }
.diff-text { font-size: 13px; color: #dfe6f5; line-height: 1.45; }
.acct-list td.win, .acct-list td.loss { white-space: nowrap; }
.gsw-note { flex-basis: 100%; font-size: 11.5px; }

body.web .desktop-only { display: none !important; }
