:root {
  --bg: #0d0f14;
  --panel: #161a23;
  --panel-2: #1e2430;
  --text: #e7ebf3;
  --muted: #8b93a7;
  --accent: #ff4d6d;
  --accent-2: #6c5ce7;
  --ok: #2ecc71;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 70% -10%, #1b2030, var(--bg));
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  min-height: 100vh;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid #232936;
}
.brand { font-weight: 800; font-size: 20px; letter-spacing: .3px; }
.brand span { color: var(--accent); }
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.off { background: #e74c3c; }

main {
  display: grid; grid-template-columns: 1fr 320px; gap: 18px;
  padding: 18px; max-width: 1400px; margin: 0 auto;
}
@media (max-width: 900px) { main { grid-template-columns: 1fr; } }

.stage { min-width: 0; }
.video-wrap {
  position: relative; background: #000; border-radius: 14px; overflow: hidden;
  aspect-ratio: 16 / 9; border: 1px solid #232936;
}
video { width: 100%; height: 100%; display: block; background: #000; }
.overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.55); color: var(--muted); font-size: 18px;
  pointer-events: none; transition: opacity .25s;
}
.overlay.hidden { opacity: 0; }

.controls { display: flex; align-items: flex-end; gap: 10px; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.field span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
select, input {
  background: var(--panel); color: var(--text); border: 1px solid #2b3242;
  border-radius: 10px; padding: 10px 12px; font-size: 14px; outline: none;
}
select:focus, input:focus { border-color: var(--accent-2); }
.btn {
  background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 10px 16px; font-weight: 600; cursor: pointer; font-size: 14px;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--panel); border: 1px solid #2b3242; color: var(--text); padding: 10px 14px; }
.sync-badge {
  background: rgba(46,204,113,.12); color: var(--ok); border: 1px solid rgba(46,204,113,.35);
  padding: 10px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.sync-badge.wait { color: #f1c40f; border-color: rgba(241,196,15,.35); background: rgba(241,196,15,.1); }

.side { display: flex; flex-direction: column; gap: 14px; }
.chat {
  background: var(--panel); border: 1px solid #232936; border-radius: 14px;
  display: flex; flex-direction: column; height: 340px; overflow: hidden;
}
.chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { font-size: 14px; }
.msg b { color: var(--accent-2); }
.msg.sys { color: var(--muted); font-style: italic; font-size: 13px; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #232936; }
.chat-form input { flex: 1; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
