:root {
  --bg-app: #05070b;
  --bg-surface: #0b0e14;
  --bg-card: #17191f;
  --bg-card-hover: #1d2027;
  --bg-input: #10131a;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --accent: #2f8fff;
  --accent-light: #5ec8ff;
  --accent-gradient: linear-gradient(90deg, #ffffff 0%, #2f8fff 55%, #5ec8ff 100%);
  --accent-soft-bg: rgba(47, 143, 255, 0.14);
  --warn-amber: #f2a65a;
  --success-green: #35c26a;
  --danger-red: #ef4444;
  --text-primary: #f5f7fa;
  --text-secondary: #9aa3b2;
  --text-tertiary: #6b7280;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.35);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg-app);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.brand .brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent-gradient);
  color: #05070b; font-weight: 900; font-size: 17px;
  display: grid; place-items: center; flex: none;
  box-shadow: 0 4px 14px rgba(47, 143, 255, 0.35);
}
.brand .brand-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-size: 14px; font-weight: 600;
  padding: 11px 18px; border-radius: var(--radius-md);
  border: 1px solid transparent; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-light); }

.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-subtle); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-card-hover); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-card); color: var(--text-primary); }

.btn-danger { background: var(--danger-red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #ff5a5a; }

.btn-success { background: var(--success-green); color: #07130b; }
.btn-success:hover:not(:disabled) { background: #4ede7f; }

.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-icon { padding: 9px; width: 40px; height: 40px; border-radius: var(--radius-md); }

/* ---------- Forms ---------- */
.input, .textarea, select.input {
  width: 100%; font-family: var(--font); font-size: 14px; color: var(--text-primary);
  background: var(--bg-input); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 11px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--text-tertiary); }
.input:focus, .textarea:focus, select.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 143, 255, 0.18);
}
.label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.hint { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }

.checkbox-line { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-secondary); cursor: pointer; user-select: none; }
.checkbox-line input { width: 17px; height: 17px; accent-color: var(--accent); }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 20px 24px; box-shadow: var(--shadow-card);
}
.card-label { font-size: 13px; color: var(--accent-light); display: flex; align-items: center; gap: 6px; }
.card-value { font-size: 28px; font-weight: 700; color: var(--text-primary); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 3px 9px; border-radius: var(--radius-pill); line-height: 1.4;
}
.badge-accent { background: var(--accent-soft-bg); color: var(--accent-light); }
.badge-green { background: rgba(53, 194, 106, 0.15); color: var(--success-green); }
.badge-red { background: rgba(239, 68, 68, 0.15); color: #ff8080; }
.badge-amber { background: rgba(242, 166, 90, 0.15); color: var(--warn-amber); }
.badge-gray { background: rgba(255, 255, 255, 0.07); color: var(--text-secondary); }

/* ---------- Avatar ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--bg-card-hover); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Login page ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 20% -10%, rgba(47, 143, 255, 0.16), transparent 60%),
    radial-gradient(800px 500px at 110% 110%, rgba(94, 200, 255, 0.08), transparent 60%),
    var(--bg-app);
}
.auth-card { width: 100%; max-width: 420px; padding: 36px 32px; }
.auth-card .brand { justify-content: center; margin-bottom: 8px; }
.auth-sub { text-align: center; color: var(--text-secondary); font-size: 14px; margin-bottom: 26px; }
.auth-field { margin-bottom: 16px; }
.auth-btn { width: 100%; margin-top: 6px; padding: 13px; font-size: 15px; }
.auth-hint {
  margin-top: 20px; padding: 12px 14px; border-radius: var(--radius-md);
  background: rgba(242, 166, 90, 0.1); border: 1px solid rgba(242, 166, 90, 0.25);
  color: var(--warn-amber); font-size: 13px;
}
.auth-error {
  display: none; margin-bottom: 16px; padding: 11px 14px; border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ff8080; font-size: 13px;
}
.auth-error.visible { display: block; }
.auth-foot { text-align: center; margin-top: 22px; font-size: 12px; color: var(--text-tertiary); }

/* ---------- Admin dashboard layout ---------- */
.dash { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex: none; background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; padding: 20px 16px; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { font-size: 17px; margin: 2px 8px 18px; }
.side-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-tertiary); font-weight: 700; margin: 14px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: var(--radius-md); color: var(--text-secondary);
  font-weight: 600; font-size: 14px; cursor: pointer; border: none; background: none;
  width: 100%; text-align: left; font-family: var(--font); transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active { background: var(--accent-soft-bg); color: var(--accent-light); }
.nav-item svg { flex: none; }
.sidebar-spacer { flex: 1; }
.sidebar-logout { color: #ff8080; }
.sidebar-logout:hover { background: rgba(239, 68, 68, 0.1); color: #ff8080; }

.dash-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 16px;
  padding: 14px 28px; border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface); position: sticky; top: 0; z-index: 20;
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  padding: 6px 14px 6px 6px; font-size: 13px; color: var(--text-secondary);
}
.user-chip .avatar { width: 28px; height: 28px; font-size: 12px; }
.user-chip b { color: var(--text-primary); font-weight: 600; }

.dash-content { padding: 28px; flex: 1; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.page-sub { color: var(--text-secondary); font-size: 14px; margin-bottom: 26px; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card { display: flex; flex-direction: column; gap: 10px; }
.stat-icon {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  background: var(--accent-soft-bg); color: var(--accent-light);
  display: grid; place-items: center;
}

/* Meetings */
.meeting-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.meeting-card { display: flex; flex-direction: column; gap: 12px; }
.meeting-card .meeting-name { font-size: 17px; font-weight: 700; }
.meeting-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.meeting-id {
  font-family: "Consolas", "Cascadia Code", monospace; font-size: 12px;
  background: var(--bg-input); border: 1px solid var(--border-subtle);
  padding: 3px 8px; border-radius: var(--radius-sm); color: var(--accent-light);
}
.meeting-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.meeting-actions .btn { flex: 1; }
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 48px 20px; text-align: center; color: var(--text-tertiary);
}
.empty-state .empty-icon {
  width: 56px; height: 56px; border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  display: grid; place-items: center; color: var(--text-tertiary);
}

/* Logs */
.log-toolbar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.log-toolbar .input { max-width: 320px; }
.log-toolbar select.input { width: auto; min-width: 200px; }
.log-table-wrap { overflow: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-card); }
table.log-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
.log-table th, .log-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
.log-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); font-weight: 700; background: var(--bg-surface); position: sticky; top: 0; }
.log-table tr:last-child td { border-bottom: none; }
.log-table td.detail { white-space: normal; min-width: 260px; color: var(--text-secondary); }
.log-time { color: var(--text-tertiary); font-size: 12px; font-family: "Consolas", monospace; }

/* Admins */
.admins-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-table-wrap { overflow: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-card); }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); }
.admin-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); font-weight: 700; background: var(--bg-surface); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .row-admin { display: flex; align-items: center; gap: 12px; }
.admin-table .row-admin .info { display: flex; flex-direction: column; }
.admin-table .row-admin .info b { font-size: 14px; }
.admin-table .row-admin .info span { font-size: 12px; color: var(--text-tertiary); }
.admin-table .row-actions { display: flex; gap: 8px; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(3, 5, 9, 0.75); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-backdrop.visible { display: flex; }
.modal {
  width: 100%; max-width: 460px; max-height: 88vh; overflow: auto;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-card);
}
.modal-title { font-size: 18px; font-weight: 800; margin-bottom: 4px; letter-spacing: -0.01em; }
.modal-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal .field { margin-bottom: 14px; }

/* Toast */
#toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast {
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent); border-radius: var(--radius-md);
  padding: 12px 16px; font-size: 13px; color: var(--text-primary);
  box-shadow: var(--shadow-card); animation: toast-in 0.2s ease;
}
.toast.success { border-left-color: var(--success-green); }
.toast.error { border-left-color: var(--danger-red); }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- Meeting room ---------- */
.room { display: flex; flex-direction: column; height: 100vh; background: var(--bg-app); }

.room-top {
  display: flex; align-items: center; gap: 14px; padding: 12px 20px;
  background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle);
}
.room-top .room-title { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.room-top .room-title small { display: block; font-size: 12px; font-weight: 500; color: var(--text-tertiary); }
.room-top .spacer { flex: 1; }
.copy-invite { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

.room-body { flex: 1; display: flex; min-height: 0; }

.stage-area { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 20px 20px 16px; min-height: 0; }
.stage-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.stage-header { display: flex; align-items: center; gap: 12px; }
.stage-header .stage-title { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.stage-header .stage-title svg { color: var(--accent-light); }
.stage-count { color: var(--text-tertiary); font-size: 13px; }

.stage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; width: 100%; }

.tile {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.tile video.visible { display: block; }
.tile .tile-avatar { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-secondary); padding: 0 10px; }
.tile .tile-avatar .avatar { width: 56px; height: 56px; }
.tile .tile-avatar .tile-name { font-size: 14px; font-weight: 700; color: var(--text-primary); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .tile-avatar.self { color: var(--accent-light); }
.tile-footer {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px;
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.1));
  font-size: 12px; font-weight: 600;
}
.tile-footer .tile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.tile-footer .badge { flex: none; }
.tile-footer .muted-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--danger-red); color: #fff; display: grid; place-items: center; flex: none; }
.tile-local .ring { position: absolute; inset: 0; border-radius: var(--radius-lg); pointer-events: none; }
.tile-local.self-live .ring { box-shadow: inset 0 0 0 2px var(--accent); }

/* Listeners bar */
.listeners-bar { flex: none; border-top: 1px solid var(--border-subtle); padding-top: 14px; }
.listeners-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); font-weight: 700; margin-bottom: 10px; }
.listeners-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.listener-chip {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px;
  background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-pill);
  font-size: 12px; color: var(--text-secondary); flex: none;
  transition: border-color 0.15s ease;
}
.listener-chip .avatar { width: 26px; height: 26px; }
.listener-chip .name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text-primary); }
.listener-chip.raised { border-color: var(--accent); }
.listener-chip .hand-icon { color: var(--accent-light); flex: none; }

.room-side { width: 340px; flex: none; display: flex; flex-direction: column; border-left: 1px solid var(--border-subtle); background: var(--bg-surface); }
.side-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.side-tabs { display: flex; border-bottom: 1px solid var(--border-subtle); }
.side-tab {
  flex: 1; padding: 12px; background: none; border: none; cursor: pointer;
  color: var(--text-tertiary); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 2px solid transparent; font-family: var(--font);
}
.side-tab.active { color: var(--accent-light); border-bottom-color: var(--accent); }
.side-tab .count { color: var(--text-tertiary); font-size: 11px; margin-left: 4px; }

/* Chat */
.chat-view { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-empty { color: var(--text-tertiary); font-size: 13px; text-align: center; margin-top: 40px; }
.chat-msg { display: flex; flex-direction: column; gap: 2px; }
.chat-msg .msg-head { display: flex; align-items: baseline; gap: 8px; }
.chat-msg .msg-author { font-size: 13px; font-weight: 700; }
.chat-msg .msg-author.admin { color: var(--accent-light); }
.chat-msg .msg-time { font-size: 11px; color: var(--text-tertiary); }
.chat-msg .msg-text { font-size: 14px; color: var(--text-secondary); word-break: break-word; white-space: pre-wrap; }
.chat-msg.self .msg-text { color: var(--text-primary); }

.poll-card { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-card); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.poll-card .poll-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.poll-card .poll-q { font-weight: 700; font-size: 14px; }
.poll-option { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; color: var(--text-secondary); transition: border-color 0.15s ease, background 0.15s ease; }
.poll-option:hover { border-color: var(--accent); }
.poll-option.selected { border-color: var(--accent); background: var(--accent-soft-bg); color: var(--text-primary); }
.poll-option input { accent-color: var(--accent); }
.poll-option .poll-bar { flex: 1; }
.poll-actions { display: flex; gap: 8px; }

.chat-input-wrap { border-top: 1px solid var(--border-subtle); padding: 12px; display: flex; gap: 8px; align-items: flex-end; }
.chat-input-wrap textarea { flex: 1; resize: none; min-height: 40px; max-height: 120px; }

/* Participants */
.parts-view { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.parts-scroll { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.parts-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); font-weight: 700; margin: 8px 4px 2px; }
.part-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); background: var(--bg-card); border: 1px solid var(--border-subtle); }
.part-row .part-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.part-row .part-info b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part-row .part-info small { font-size: 11px; color: var(--text-tertiary); }
.part-row.raised { border-color: var(--accent); }
.hand-icon { color: var(--accent-light); flex: none; }
.part-actions { display: flex; gap: 6px; }

/* Hand queue */
.hand-queue { display: flex; flex-direction: column; gap: 8px; }
.queue-empty { color: var(--text-tertiary); font-size: 13px; text-align: center; padding: 12px; }

/* Control bar */
.room-controls {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 20px;
  background: var(--bg-surface); border-top: 1px solid var(--border-subtle);
}
.ctrl-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: var(--radius-pill); border: 1px solid var(--border-subtle);
  background: var(--bg-card); color: var(--text-primary); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  font-family: var(--font);
}
.ctrl-btn:hover { background: var(--bg-card-hover); }
.ctrl-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ctrl-btn:disabled:hover { background: var(--bg-card); }
.ctrl-btn.off { color: var(--text-tertiary); background: var(--bg-input); }
.ctrl-btn.off svg { color: var(--text-tertiary); }
.ctrl-btn.danger { background: var(--danger-red); border-color: var(--danger-red); color: #fff; }
.ctrl-btn.danger:hover { background: #ff5a5a; }
.ctrl-btn.raised { background: var(--accent); border-color: var(--accent); color: #fff; animation: pulse 1.6s infinite; }
.ctrl-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.ctrl-btn.active svg { color: #fff; }
.ctrl-btn .ctrl-label { font-size: 12px; }
.ctrl-sep { width: 1px; height: 32px; background: var(--border-subtle); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(47, 143, 255, 0.5); } 50% { box-shadow: 0 0 0 8px rgba(47, 143, 255, 0); } }

/* Lobby */
.lobby {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 20% -10%, rgba(47, 143, 255, 0.16), transparent 60%),
    radial-gradient(800px 500px at 110% 110%, rgba(94, 200, 255, 0.08), transparent 60%),
    var(--bg-app);
}
.lobby-card { width: 100%; max-width: 440px; }
.lobby-head { text-align: center; margin-bottom: 22px; }
.lobby-head .lobby-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.lobby-head .lobby-id { color: var(--text-tertiary); font-size: 13px; margin-top: 4px; }
.lobby-badge { display: flex; justify-content: center; margin-bottom: 14px; }

/* Room closed */
.room-closed { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.room-closed .closed-card { max-width: 420px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.room-closed .closed-icon { width: 64px; height: 64px; border-radius: 50%; background: rgba(239, 68, 68, 0.12); color: #ff8080; display: grid; place-items: center; }

/* Result modal */
.result-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.result-row .result-info { flex: 1; }
.result-row .result-count { font-size: 13px; font-weight: 700; color: var(--accent-light); }
.result-bar-track { height: 8px; border-radius: var(--radius-pill); background: var(--bg-input); overflow: hidden; margin-top: 4px; }
.result-bar { height: 100%; background: var(--accent); border-radius: var(--radius-pill); }
.result-names { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

@media (max-width: 900px) {
  .room-side { width: 100%; position: fixed; inset: auto 0 0 0; height: 55vh; z-index: 30; display: none; }
  .room-side.open { display: flex; }
  .stage-area { padding-bottom: 90px; }
  .ctrl-label { display: none; }
  .sidebar { width: 72px; }
  .sidebar .brand span, .sidebar .nav-item span, .side-label { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .dash-content { padding: 18px; }
}
