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

:root {
  --bg: #070b16;
  --bg-soft: #0c1224;
  --panel: rgba(255, 255, 255, 0.038);
  --panel-strong: #111a30;
  --panel-solid: #0e1527;
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef1fa;
  --muted: #8e9ab8;
  --dim: #64708d;
  --aff: #34d399;
  --aff-soft: rgba(52, 211, 153, 0.13);
  --neg: #fb7185;
  --neg-soft: rgba(251, 113, 133, 0.13);
  --aud: #a78bfa;
  --aud-soft: rgba(167, 139, 250, 0.13);
  --judge: #fbbf24;
  --judge-soft: rgba(251, 191, 36, 0.13);
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(52, 211, 153, 0.10), transparent 60%),
    radial-gradient(900px 520px at 88% -6%, rgba(251, 113, 133, 0.10), transparent 62%),
    radial-gradient(800px 600px at 50% 110%, rgba(96, 165, 250, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  line-height: 1.5;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(96, 165, 250, 0.35); }

/* --------------------------------------------------------------- utilities */
.wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; color: var(--dim); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap-row { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.spacer { flex: 1; }
.hidden { display: none !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 11px;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.26); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 26px rgba(59, 130, 246, 0.32);
}
.btn.primary:hover { background: linear-gradient(135deg, #4b8df8, #7477f5); }
.btn.good { background: linear-gradient(135deg, #10b981, #059669); border-color: transparent; color: #04241a; }
.btn.good:hover { filter: brightness(1.08); }
.btn.danger { background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.4); color: #ffb3bf; }
.btn.danger:hover { background: rgba(251, 113, 133, 0.2); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
input[type="text"], input[type="number"], textarea, select {
  width: 100%;
  background: rgba(6, 10, 22, 0.72);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(96, 165, 250, 0.75);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
}
input::placeholder, textarea::placeholder { color: #5b6784; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(6px);
}
.card.tight { padding: 16px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.chip.aff { background: var(--aff-soft); color: var(--aff); border-color: rgba(52, 211, 153, 0.3); }
.chip.neg { background: var(--neg-soft); color: var(--neg); border-color: rgba(251, 113, 133, 0.3); }
.chip.audience { background: var(--aud-soft); color: var(--aud); border-color: rgba(167, 139, 250, 0.3); }
.chip.judge { background: var(--judge-soft); color: var(--judge); border-color: rgba(251, 191, 36, 0.32); }
.chip.system { background: rgba(255,255,255,0.06); color: var(--muted); }
.chip.live { background: rgba(52, 211, 153, 0.12); color: #6ee7b7; border-color: rgba(52, 211, 153, 0.35); }
.chip.live::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: pulse 1.8s infinite;
}
.chip.ended { background: rgba(255,255,255,0.06); color: var(--muted); }
.chip.lobby { background: var(--accent-soft); color: #93c5fd; border-color: rgba(96,165,250,0.32); }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ------------------------------------------------------------------ home */
.site-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 26px 0 6px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-size: 17px;
}
.logo-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(140deg, rgba(52,211,153,0.9), rgba(251,113,133,0.85));
  display: grid;
  place-items: center;
  color: #06121a;
  font-weight: 800;
  font-size: 15px;
}
.hero { padding: 46px 0 30px; }
.hero h1 {
  font-size: clamp(30px, 4.6vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  max-width: 17ch;
}
.hero h1 .grad {
  background: linear-gradient(120deg, #6ee7b7, #93c5fd 45%, #fda4af);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lede { color: var(--muted); margin-top: 16px; max-width: 62ch; font-size: 15.5px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  margin-top: 26px;
}
.section-title { margin: 40px 0 16px; display: flex; align-items: baseline; gap: 12px; }
.section-title h2 { font-size: 19px; }

.debate-list { display: grid; gap: 10px; }
.debate-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.debate-row:hover { border-color: var(--border-strong); background: rgba(255,255,255,0.055); }
.debate-row .topic { font-weight: 600; font-size: 14.5px; }
.debate-row .meta { color: var(--dim); font-size: 12.5px; margin-top: 3px; }
.debate-row .acts { display: flex; gap: 8px; margin-left: auto; }
.empty {
  border: 1px dashed var(--border-strong);
  border-radius: 13px;
  padding: 26px;
  text-align: center;
  color: var(--dim);
  font-size: 14px;
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 16px;
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.09);
  border: 1px solid rgba(251, 191, 36, 0.28);
  color: #fcd67a;
  font-size: 13px;
  line-height: 1.5;
}
.notice.info { background: rgba(96, 165, 250, 0.09); border-color: rgba(96, 165, 250, 0.26); color: #a9cdfb; }

/* ------------------------------------------------------------------ room */
.room { min-height: 100vh; display: flex; flex-direction: column; }
.room-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 12, 24, 0.82);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.room-head .brand-mini { font-weight: 750; font-size: 14px; letter-spacing: -0.01em; color: var(--muted); white-space: nowrap; }
.room-head .brand-mini:hover { color: var(--text); }
.head-main { min-width: 0; flex: 1; }
.head-main .eyebrow { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.head-main h1 {
  font-size: clamp(15px, 1.7vw, 20px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.head-side { display: flex; align-items: center; gap: 10px; }

.room-body {
  flex: 1;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 330px;
  gap: 16px;
  padding: 16px 22px 28px;
  align-items: start;
  width: min(1600px, 100%);
  margin: 0 auto;
}
.room-body.single { grid-template-columns: minmax(0, 1fr); }
.room-body.lobby { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }

.col-left, .col-right { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
.col-right { max-height: calc(100vh - 100px); overflow-y: auto; padding-bottom: 4px; }
.col-left { max-height: calc(100vh - 100px); overflow-y: auto; padding-bottom: 4px; }
.col-right::-webkit-scrollbar, .messages::-webkit-scrollbar { width: 7px; }
.col-right::-webkit-scrollbar-thumb, .messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

/* lobby stage */
.lobby-stage { display: flex; flex-direction: column; gap: 14px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}
.panel-body { padding: 14px 15px; }
.panel-body.tight { padding: 10px; }

/* phase stepper */
.stepper { display: flex; flex-direction: column; gap: 2px; }
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--dim);
  position: relative;
}
.step .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.16);
  flex: none;
}
.step.done { color: var(--muted); }
.step.done .dot { background: rgba(52, 211, 153, 0.6); }
.step.active { background: var(--accent-soft); color: #bfdbfe; font-weight: 650; }
.step.active .dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(96,165,250,0.18); }

.turn-card {
  padding: 15px;
  border-radius: 13px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015));
}
.turn-card .who { font-size: 17px; font-weight: 700; margin-top: 4px; }
.turn-card.aff { border-color: rgba(52,211,153,0.35); background: linear-gradient(160deg, rgba(52,211,153,0.14), rgba(52,211,153,0.03)); }
.turn-card.neg { border-color: rgba(251,113,133,0.35); background: linear-gradient(160deg, rgba(251,113,133,0.14), rgba(251,113,133,0.03)); }

.roster { display: flex; flex-direction: column; gap: 3px; }
.roster-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 13.5px;
}
.roster-item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-item .pos { margin-left: auto; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); font-weight: 700; white-space: nowrap; }
.roster-item.is-me { background: rgba(96, 165, 250, 0.14); }
.roster-item .you { font-size: 10px; letter-spacing: 0.08em; color: #93c5fd; font-weight: 700; }
.avatar {
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 800;
  background: rgba(255,255,255,0.07);
  color: var(--text);
  flex: none;
}
.avatar.aff { background: var(--aff-soft); color: var(--aff); }
.avatar.neg { background: var(--neg-soft); color: var(--neg); }
.avatar.audience { background: var(--aud-soft); color: var(--aud); }
.avatar.judge { background: var(--judge-soft); color: var(--judge); }

/* messages */
.stage-col { display: flex; flex-direction: column; min-height: calc(100vh - 130px); }
.messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 4px 4px 12px;
  max-height: calc(100vh - 250px);
  scroll-behavior: smooth;
}
.msg-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.phase-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 4px;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}
.phase-divider::before, .phase-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

.msg {
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: 0 13px 13px 0;
  background: rgba(255, 255, 255, 0.033);
  padding: 12px 16px;
}
.msg.enter { animation: rise 0.28s ease both; }
@keyframes rise { from { transform: translateY(6px); } to { transform: none; } }
.msg.aff { border-left-color: var(--aff); background: linear-gradient(90deg, rgba(52,211,153,0.09), rgba(255,255,255,0.025) 40%); }
.msg.neg { border-left-color: var(--neg); background: linear-gradient(90deg, rgba(251,113,133,0.09), rgba(255,255,255,0.025) 40%); }
.msg.judge { border-left-color: var(--judge); background: linear-gradient(90deg, rgba(251,191,36,0.09), rgba(255,255,255,0.025) 40%); }
.msg.system { border-left-color: rgba(255,255,255,0.2); background: transparent; }
.msg.system .msg-text { color: var(--muted); font-style: italic; }
.msg-head { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; flex-wrap: wrap; }
.msg-name { font-weight: 700; font-size: 14px; }
.msg-tag { font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase; font-weight: 700; }
.msg-tag.aff { color: var(--aff); }
.msg-tag.neg { color: var(--neg); }
.msg-tag.judge { color: var(--judge); }
.msg-time { font-size: 11px; color: var(--dim); margin-left: auto; font-variant-numeric: tabular-nums; }
.msg-text { font-size: 15.5px; line-height: 1.62; white-space: pre-wrap; word-break: break-word; }

.empty-stage {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--dim);
  font-size: 14px;
  padding: 40px;
}

/* composer */
.composer {
  border: 1px solid var(--border-strong);
  border-radius: 15px;
  background: rgba(10, 16, 32, 0.9);
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-top: 6px;
  backdrop-filter: blur(8px);
}
.composer textarea {
  border: none;
  background: transparent;
  resize: none;
  min-height: 46px;
  max-height: 180px;
  padding: 10px 8px;
  font-size: 15px;
  line-height: 1.5;
}
.composer textarea:focus { box-shadow: none; }
.composer .icon-btn {
  width: 42px; height: 42px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.05);
  display: grid; place-items: center;
  flex: none;
  color: var(--muted);
  transition: all 0.15s ease;
}
.composer .icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: rgba(255,255,255,0.09); }
.composer .icon-btn.recording { color: #fff; background: #e11d48; border-color: transparent; animation: rec 1.4s infinite; }
@keyframes rec { 0%,100% { box-shadow: 0 0 0 0 rgba(225,29,72,0.5); } 50% { box-shadow: 0 0 0 8px rgba(225,29,72,0); } }
.composer .send-btn {
  height: 42px;
  padding: 0 20px;
  border-radius: 11px;
  border: none;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  font-weight: 700;
  flex: none;
}
.composer .send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.composer-lock {
  margin-top: 6px;
  padding: 15px 18px;
  border-radius: 13px;
  border: 1px dashed var(--border-strong);
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
  background: rgba(255,255,255,0.02);
}
.composer-lock strong { color: var(--text); }
.turn-banner {
  margin-bottom: 8px;
  padding: 10px 15px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 9px;
}
.turn-banner.mine { background: rgba(52, 211, 153, 0.14); color: #a7f3d0; border: 1px solid rgba(52,211,153,0.35); }
.turn-banner.other { background: rgba(255,255,255,0.04); color: var(--muted); border: 1px solid var(--border); }

/* scoreboard */
.score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.score-row + .score-row { margin-top: 3px; }
.score-row.aff { background: rgba(52,211,153,0.07); }
.score-row.neg { background: rgba(251,113,133,0.07); }
.score-row .sc-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-row .sc-sub { font-size: 11px; color: var(--dim); }
.score-row .sc-val { margin-left: auto; font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; }
.score-row .sc-val.aff { color: var(--aff); }
.score-row .sc-val.neg { color: var(--neg); }

.score-block { border-top: 1px solid var(--border); padding: 12px 15px; }
.score-block:first-child { border-top: none; }
.score-target { margin-bottom: 12px; }
.score-target:last-child { margin-bottom: 0; }
.score-target .st-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 13px; }
.score-target .st-name { font-weight: 650; }
.judge-input { display: flex; gap: 7px; }
.judge-input input { padding: 8px 10px; border-radius: 9px; font-size: 14px; }
.judge-input .btn { padding: 8px 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip-btn {
  min-width: 34px;
  padding: 6px 0;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.05);
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  transition: all 0.12s ease;
}
.chip-btn:hover { background: rgba(167,139,250,0.22); border-color: rgba(167,139,250,0.5); }
.chip-btn:disabled { opacity: 0.5; cursor: default; }
.scored-tag { font-size: 11px; color: #86efac; font-weight: 700; letter-spacing: 0.04em; }

/* lobby / QR */
.qr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.qr-card {
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255,255,255,0.035);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
}
.qr-card img {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  display: block;
}
.qr-card .qr-title { font-weight: 700; font-size: 14.5px; }
.qr-card .qr-url { font-size: 10.5px; color: var(--dim); word-break: break-all; }
.qr-card .qr-count { font-size: 12px; color: var(--muted); }
.qr-card.aff { border-color: rgba(52,211,153,0.32); }
.qr-card.neg { border-color: rgba(251,113,133,0.32); }
.qr-card.audience { border-color: rgba(167,139,250,0.32); }
.qr-card.judge { border-color: rgba(251,191,36,0.32); }

.access-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.28em;
  font-size: 20px;
  font-weight: 700;
  color: var(--judge);
}

/* slot picker */
.slots { display: grid; gap: 8px; }
.slot-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  text-align: left;
  width: 100%;
  transition: all 0.14s ease;
}
.slot-opt:hover:not(:disabled) { border-color: var(--border-strong); background: rgba(255,255,255,0.07); }
.slot-opt .so-name { font-weight: 650; font-size: 14px; }
.slot-opt .so-sub { font-size: 11.5px; color: var(--dim); }
.slot-opt .so-who { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.slot-opt.selected { border-color: rgba(96,165,250,0.6); background: var(--accent-soft); }
.slot-opt:disabled { opacity: 0.55; cursor: not-allowed; }
.slot-opt .so-badge { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: #93c5fd; font-weight: 700; }

/* results */
.results-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.results-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-strong);
  font-weight: 700;
}
.results-table td { padding: 12px; border-bottom: 1px solid var(--border); }
.results-table tr:last-child td { border-bottom: none; }
.results-table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.results-table .total { font-size: 16px; font-weight: 750; }
.results-table tr.aff-row td:first-child { box-shadow: inset 3px 0 0 var(--aff); }
.results-table tr.neg-row td:first-child { box-shadow: inset 3px 0 0 var(--neg); }
.results-table tr.aud-row td:first-child { box-shadow: inset 3px 0 0 var(--aud); }
.rank-badge {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: rgba(255,255,255,0.07);
  font-size: 12.5px;
  font-weight: 750;
}
.rank-badge.top { background: rgba(251,191,36,0.18); color: #fcd34d; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.stat { padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid var(--border); }
.stat .v { font-size: 24px; font-weight: 750; letter-spacing: -0.02em; }
.stat .k { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); font-weight: 700; margin-top: 2px; }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: #17203a;
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  max-width: min(90vw, 520px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #3b1220; border-color: rgba(251,113,133,0.4); color: #ffc4cd; }

/* ------------------------------------------------- new: tabs & reminder */
.stage-tabs { margin-bottom: 10px; }
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
}
.tab {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s ease;
}
.tab:hover { color: var(--text); }
.tab.on { background: rgba(96, 165, 250, 0.18); color: #dbeafe; }
.tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #04122a;
  font-size: 11px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
}

.reminder {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border-radius: 12px;
  margin-bottom: 10px;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transition: transform 0.12s ease, filter 0.15s ease;
  animation: rise 0.3s ease both;
}
.reminder:hover { filter: brightness(1.12); }
.reminder:active { transform: translateY(1px); }
.reminder.mine {
  background: linear-gradient(120deg, rgba(16, 185, 129, 0.28), rgba(16, 185, 129, 0.1));
  border-color: rgba(52, 211, 153, 0.55);
  color: #d1fae5;
}
.reminder.side {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fde68a;
}
.reminder.open {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.4);
  color: #c7ddff;
}
.reminder .reminder-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: currentColor;
  flex: none;
  animation: pulse 1.7s infinite;
}
.reminder .reminder-text { flex: 1; }
.reminder .reminder-go {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
}

/* you panel + segmented switch */
.segmented { display: flex; gap: 5px; flex-wrap: wrap; }
.seg {
  flex: 1 1 auto;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.seg:hover:not(:disabled) { color: var(--text); border-color: var(--border-strong); }
.seg.on { background: var(--accent-soft); color: #bfdbfe; border-color: rgba(96, 165, 250, 0.5); }
.seg:disabled { opacity: 0.5; cursor: default; }

.member-btn {
  margin-left: auto;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-radius: 7px;
  width: 26px;
  height: 24px;
  line-height: 1;
  font-size: 13px;
  font-weight: 700;
  padding: 0;
}
.member-btn:hover { background: rgba(96, 165, 250, 0.25); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 15, 0.72);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 80;
}
.modal {
  width: min(380px, 100%);
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  animation: rise 0.2s ease both;
}
.modal-head { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.modal-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.msg.discuss { border-left-width: 2px; padding: 10px 14px; }
.msg.discuss .msg-text { font-size: 14.5px; }

/* ------------------------------------------------------- live captions */
.caption-bar {
  margin-top: 8px;
  padding: 10px 16px 13px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--border-strong);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(9, 14, 27, 0.94), rgba(6, 10, 20, 0.99));
  backdrop-filter: blur(10px);
}
.caption-bar.aff { border-left-color: var(--aff); }
.caption-bar.neg { border-left-color: var(--neg); }
.caption-bar.judge { border-left-color: var(--judge); }
.caption-top { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.caption-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.caption-name { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caption-hint { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.caption-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fca5a5;
}
.caption-live::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 1.2s infinite;
}
.caption-tools { margin-left: auto; display: flex; gap: 4px; flex: none; }
.cc-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  line-height: 1.4;
}
.cc-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.caption-text {
  margin-top: 6px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.45;
  color: #f4f7ff;
  word-break: break-word;
  min-height: 1.4em;
}
.cc-sm .caption-text { font-size: 16px; }
.cc-md .caption-text { font-size: 22px; }
.cc-lg .caption-text { font-size: 30px; line-height: 1.38; }
.cc-off { padding-bottom: 10px; }
.cc-off .caption-text { display: none; }
.caption-bar:not(.aff):not(.neg):not(.judge) .caption-text,
.caption-bar .caption-text:empty { display: none; }
.caption-bar:not(.aff):not(.neg):not(.judge) { padding-bottom: 10px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .room-body { grid-template-columns: 250px minmax(0, 1fr) 300px; gap: 12px; padding: 14px; }
  .col-left, .col-right { position: static; }
}
@media (max-width: 1000px) {
  .room-body { grid-template-columns: minmax(0, 1fr); }
  .room-body.lobby { grid-template-columns: minmax(0, 1fr); }
  .col-left { order: 2; }
  .col-right { order: 3; }
  .stage-col { order: 1; min-height: auto; }
  .messages { max-height: none; min-height: 320px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .col-left, .col-right { flex-direction: row; flex-wrap: wrap; }
  .col-left > .panel, .col-right > .panel { flex: 1 1 300px; }
  .room-head { padding: 12px 16px; gap: 12px; }
  .room-body { padding: 14px 14px 100px; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 28px); }
  .hero { padding: 28px 0 18px; }
  .qr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .qr-card { padding: 12px; }
  .card { padding: 17px; }
  .room-head .brand-mini { display: none; }
  .msg-text { font-size: 15px; }
  .debate-row { flex-wrap: wrap; }
  .debate-row .acts { width: 100%; margin-left: 0; }
  .btn.sm { flex: 1; }
  .results-table th:nth-child(4), .results-table td:nth-child(4) { display: none; }
}
