/* VOIC3 meetings (Section 10) — lobby, waiting room, stage, chat + whiteboard.
   Shares the NEXUS tokens from theme.css so both themes work unchanged. */

/* ---------- Meeting list ---------- */
.mtg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mtg-card { background: var(--bg-card); border: 1px solid var(--border-card); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.mtg-card b { font-size: 14px; }
.mtg-card small { color: var(--text-secondary); }
.mtg-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 2px; background: var(--bg-elevated); border: 1px dashed var(--border-strong); border-radius: 8px; padding: 4px 8px; display: inline-block; font-size: 13px; }
.mtg-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Full-screen meeting surface ---------- */
#voic3-meeting-root { position: fixed; inset: 0; z-index: 120; display: none; flex-direction: column; background: #05080F; color: #F1F5F9; }
#voic3-meeting-root.open { display: flex; }
.mtg-top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid rgba(148,163,184,0.16); background: rgba(9,14,26,0.9); }
.mtg-top .mtg-title { font-weight: 700; font-size: 14px; }
.mtg-top .mtg-sub { color: #94A3B8; font-size: 12px; }
.mtg-top .mtg-spacer { flex: 1; }
.mtg-pill { font-size: 11px; letter-spacing: .6px; text-transform: uppercase; border-radius: 999px; padding: 3px 9px; border: 1px solid rgba(148,163,184,0.3); color: #CBD5E1; }
.mtg-pill.live { border-color: rgba(239,68,68,0.6); color: #FCA5A5; background: rgba(239,68,68,0.12); }
.mtg-pill.rec { border-color: rgba(239,68,68,0.6); color: #FECACA; background: rgba(239,68,68,0.18); }
.mtg-pill.ok { border-color: rgba(16,185,129,0.5); color: #6EE7B7; background: rgba(16,185,129,0.12); }
.mtg-body { flex: 1; display: flex; min-height: 0; }
.mtg-stage-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mtg-stage { flex: 1; display: grid; gap: 10px; padding: 12px; min-height: 0; overflow: auto; }
.mtg-stage.grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); grid-auto-rows: minmax(160px, 1fr); }
.mtg-stage.spotlight { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
.mtg-stage.spotlight .mtg-tile.main { grid-row: 1; }
.mtg-stage.spotlight .mtg-strip { grid-row: 2; display: flex; gap: 8px; overflow-x: auto; }
.mtg-stage.spotlight .mtg-strip .mtg-tile { width: 180px; height: 108px; flex: 0 0 auto; }
.mtg-tile { position: relative; background: #0B1220; border-radius: 14px; overflow: hidden; border: 2px solid rgba(148,163,184,0.18); min-height: 140px; display: flex; align-items: center; justify-content: center; }
.mtg-tile.speaking { border-color: #22D3EE; box-shadow: 0 0 0 2px rgba(34,211,238,0.35), 0 0 24px rgba(34,211,238,0.25); }
.mtg-tile.spotlit::after { content: 'SPOTLIGHT'; position: absolute; top: 8px; left: 8px; font-size: 10px; letter-spacing: 1px; background: rgba(34,211,238,0.9); color: #04121A; padding: 2px 6px; border-radius: 6px; font-weight: 700; }
.mtg-tile video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.mtg-tile.mirror video { transform: scaleX(-1); }
.mtg-tile .mtg-avatar { width: 74px; height: 74px; border-radius: 50%; background: linear-gradient(135deg,#1E3A8A,#22D3EE); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 24px; }
.mtg-tile .mtg-name { position: absolute; left: 8px; bottom: 8px; font-size: 12px; background: rgba(2,6,14,0.7); padding: 2px 8px; border-radius: 999px; display: flex; gap: 6px; align-items: center; }
.mtg-tile .mtg-hand { position: absolute; right: 8px; top: 8px; font-size: 20px; animation: mtg-bob 1.4s ease-in-out infinite; }
.mtg-tile .mtg-muted { position: absolute; right: 8px; bottom: 8px; font-size: 13px; background: rgba(239,68,68,0.85); border-radius: 999px; padding: 2px 7px; }
.mtg-tile .mtg-screenshare { position: absolute; inset: 0; background: #05080F; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #94A3B8; }
@keyframes mtg-bob { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-6px) rotate(6deg); } }
.mtg-reactions { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mtg-float { position: absolute; bottom: 12px; font-size: 28px; animation: mtg-float 2.6s ease-out forwards; }
@keyframes mtg-float { 0% { opacity: 0; transform: translateY(0) scale(.6); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-220px) scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .mtg-float, .mtg-tile .mtg-hand { animation: none; } }

/* ---------- Toolbar ---------- */
.mtg-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid rgba(148,163,184,0.16); background: rgba(9,14,26,0.95); }
.mtg-tool { display: inline-flex; align-items: center; gap: 6px; border-radius: 10px; border: 1px solid rgba(148,163,184,0.28); background: #131F35; color: #E2E8F0; padding: 8px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.mtg-tool:hover { background: #1B2942; }
.mtg-tool.on { border-color: #22D3EE; color: #A5F3FC; background: rgba(34,211,238,0.14); }
.mtg-tool.danger { border-color: rgba(239,68,68,0.6); color: #FCA5A5; background: rgba(239,68,68,0.12); }
.mtg-tool.recording { border-color: #EF4444; color: #FECACA; background: rgba(239,68,68,0.22); }
.mtg-tool[disabled] { opacity: .5; cursor: not-allowed; }
.mtg-host-tools { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 14px; border-top: 1px dashed rgba(148,163,184,0.18); background: rgba(15,23,42,0.9); }

/* ---------- Lobby / waiting room ---------- */
.mtg-overlay { position: absolute; inset: 0; background: rgba(5,8,15,0.94); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 5; }
.mtg-overlay .mtg-panel { width: min(720px, 100%); background: #0B1220; border: 1px solid rgba(148,163,184,0.2); border-radius: 18px; padding: 20px; display: grid; gap: 14px; }
.mtg-lobby-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
@media (max-width: 760px) { .mtg-lobby-grid { grid-template-columns: 1fr; } }
.mtg-preview { position: relative; background: #000; border-radius: 14px; overflow: hidden; min-height: 210px; display: flex; align-items: center; justify-content: center; }
.mtg-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.mtg-preview .mtg-preview-off { font-size: 12px; color: #94A3B8; }
.mtg-lobby-fields { display: grid; gap: 10px; }
.mtg-lobby-fields label { display: grid; gap: 4px; font-size: 12px; color: #94A3B8; }
.mtg-lobby-fields select, .mtg-lobby-fields input { background: #131F35; color: #E2E8F0; border: 1px solid rgba(148,163,184,0.28); border-radius: 9px; padding: 8px 10px; font-size: 13px; }
.mtg-level { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #94A3B8; }
.mtg-level .mtg-meter { flex: 1; height: 6px; background: #1E293B; border-radius: 999px; overflow: hidden; }
.mtg-level .mtg-meter i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg,#22D3EE,#10B981); transition: width .12s linear; }
.mtg-waiting { text-align: center; display: grid; gap: 10px; place-items: center; }
.mtg-waiting .mtg-spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(34,211,238,0.25); border-top-color: #22D3EE; animation: mtg-spin 1s linear infinite; }
@keyframes mtg-spin { to { transform: rotate(360deg); } }
.mtg-waiting-list { display: grid; gap: 8px; width: 100%; }
.mtg-waiting-item { display: flex; align-items: center; gap: 10px; background: #131F35; border: 1px solid rgba(148,163,184,0.2); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.mtg-waiting-item .mtg-spacer { flex: 1; }

/* ---------- Slide-over chat + whiteboard ---------- */
.mtg-panel-backdrop { position: absolute; inset: 0; background: rgba(2,6,14,0.55); z-index: 6; }
.mtg-side { position: absolute; top: 0; right: 0; bottom: 0; width: min(430px, 100%); background: #0B1220; border-left: 1px solid rgba(148,163,184,0.2); z-index: 7; display: flex; flex-direction: column; }
.mtg-side-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid rgba(148,163,184,0.16); }
.mtg-side-head b { flex: 1; font-size: 13.5px; }
.mtg-tabs { display: flex; gap: 6px; padding: 10px 14px 0; }
.mtg-tabs button { flex: 1; border-radius: 9px; border: 1px solid rgba(148,163,184,0.25); background: transparent; color: #CBD5E1; padding: 7px 8px; font-size: 12px; cursor: pointer; }
.mtg-tabs button.active { border-color: #22D3EE; color: #A5F3FC; background: rgba(34,211,238,0.12); }
.mtg-chat-list { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.mtg-msg { background: #131F35; border-radius: 10px; padding: 7px 10px; font-size: 13px; max-width: 92%; }
.mtg-msg.mine { align-self: flex-end; background: rgba(34,211,238,0.16); border: 1px solid rgba(34,211,238,0.3); }
.mtg-msg small { display: block; color: #94A3B8; font-size: 10.5px; margin-bottom: 2px; }
.mtg-chat-form { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid rgba(148,163,184,0.16); }
.mtg-chat-form input { flex: 1; background: #131F35; border: 1px solid rgba(148,163,184,0.28); border-radius: 9px; color: #E2E8F0; padding: 9px 10px; font-size: 13px; }
.mtg-board-wrap { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; min-height: 0; }
.mtg-board-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: #94A3B8; }
.mtg-board-tools input[type=color] { width: 30px; height: 26px; border: none; background: none; }
.mtg-board-tools input[type=range] { width: 90px; }
.mtg-board { flex: 1; min-height: 220px; background: #F8FAFC; border-radius: 12px; touch-action: none; cursor: crosshair; width: 100%; }
.mtg-note { font-size: 11.5px; color: #94A3B8; }
.mtg-toast { position: absolute; left: 50%; transform: translateX(-50%); bottom: 88px; background: rgba(15,23,42,0.95); border: 1px solid rgba(148,163,184,0.3); border-radius: 10px; padding: 8px 14px; font-size: 12.5px; z-index: 9; }

/* ---------- stage tiles, reactions, recording (Section 10 front end) ---------- */
.mtg-tile { position: relative; background: #0B1220; border: 1px solid rgba(148,163,184,0.2); border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 130px; transition: border-color .15s, box-shadow .15s; }
.mtg-tile video { width: 100%; height: 100%; object-fit: cover; }
.mtg-tile.mirror video { transform: scaleX(-1); }
.mtg-tile.speaking { border-color: #22D3EE; box-shadow: 0 0 0 2px rgba(34,211,238,0.45); }
.mtg-tile.spotlit { border-color: #F59E0B; box-shadow: 0 0 0 2px rgba(245,158,11,0.45); }
.mtg-tile.main { min-height: 320px; }
.mtg-avatar { position: absolute; width: 62px; height: 62px; border-radius: 50%; background: #1E293B; color: #E2E8F0; display: grid; place-items: center; font-size: 20px; font-weight: 600; }
.mtg-name { position: absolute; left: 8px; bottom: 8px; background: rgba(2,6,14,0.7); color: #E2E8F0; font-size: 11.5px; padding: 3px 8px; border-radius: 999px; }
.mtg-hand { position: absolute; right: 8px; bottom: 8px; font-size: 18px; animation: mtg-hand-wave 1.4s ease-in-out infinite; }
@keyframes mtg-hand-wave { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(10deg); } }
.mtg-muted { position: absolute; right: 8px; top: 8px; font-size: 14px; opacity: .85; }
.mtg-screenshare { position: absolute; left: 8px; top: 8px; background: rgba(16,185,129,0.18); border: 1px solid rgba(16,185,129,0.5); color: #6EE7B7; font-size: 10.5px; padding: 2px 8px; border-radius: 999px; }
.mtg-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding: 10px 14px; max-height: 34%; overflow-y: auto; }
.mtg-reactions { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 8; }
.mtg-float { position: absolute; bottom: 90px; font-size: 28px; animation: mtg-float-up 2.6s ease-out forwards; }
@keyframes mtg-float-up { from { transform: translateY(0) scale(.7); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(-260px) scale(1.15); opacity: 0; } }

/* ---------- meeting list card (VOIC3 page) ---------- */
.mtg-list-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.mtg-row { display: flex; align-items: center; gap: 8px; }
.mtg-tile video { background: #000; }
.mtg-tile.main video { object-fit: contain; }
