/* Без blur/теней/анимаций — браузер почти не тратит видеокарту на интерфейс */
:root { --bg:#0f1115; --panel:#171a21; --panel2:#1f232c; --line:#2a2f3a; --text:#e6e8ec; --muted:#8b93a3; --green:#22c55e; --red:#ef4444; --blue:#3b82f6; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font: 14px/1.4 system-ui, "Segoe UI", sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; } .grow { flex: 1; }
.err { color: var(--red); min-height: 1.2em; margin: 0; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px; color: var(--text); }
.login { height: 100%; display: grid; place-items: center; padding: 16px; }
.login form { width: min(360px, 100%); display: flex; flex-direction: column; gap: 12px; }
.login h1 { margin: 0; font-size: 26px; }
label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); }
label.row { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
input, select { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; }
input[type=range] { padding: 0; accent-color: var(--green); }
input:focus, select:focus { outline: 2px solid var(--blue); outline-offset: -1px; }

.btn { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 14px; font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #3a4150; }
.btn.primary { background: var(--green); border-color: var(--green); color: #04130a; font-weight: 600; }
.btn.danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn.off { background: #3a1416; border-color: var(--red); }
.btn.on { background: var(--green); color: #04130a; border-color: var(--green); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }

.app { height: 100%; display: grid; grid-template-columns: 300px 1fr; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.people { list-style: none; margin: 0; padding: 8px; display: flex; flex-direction: column; gap: 2px; max-height: 45%; overflow: auto; }
.people li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; flex-wrap: wrap; }
.people li:hover { background: var(--panel2); }
.ava { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #334155; font-weight: 700; border: 2px solid transparent; flex: none; }
.speaking .ava { border-color: var(--green); }
.nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live { background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.pvol { width: 100%; margin: 0 0 0 38px; height: 14px; }
.people li:not(:hover) .pvol { display: none; }

.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--line); }
.msgs { flex: 1; overflow: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; word-break: break-word; }
.msg.sys { color: var(--muted); font-size: 12px; }
.chat-form { padding: 10px; } .chat-form input { width: 100%; }

.stage-wrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.stage { flex: 1; position: relative; background: #000; display: grid; place-items: center; min-height: 0; }
.stage video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.stage-empty { text-align: center; padding: 24px; max-width: 460px; }
.stage-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(0,0,0,.7); flex-wrap: wrap; }
.stage:fullscreen .stage-bar { opacity: 0; } .stage:fullscreen:hover .stage-bar { opacity: 1; }
.stats { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.vol { flex-direction: row; align-items: center; color: var(--text); } .vol input { width: 90px; }
.bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }

.dlg { width: min(460px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto; }
.dlg::backdrop { background: rgba(0,0,0,.6); }
.dlg form { display: flex; flex-direction: column; gap: 10px; }
.dlg h2 { margin: 0; } .dlg h3 { margin: 10px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.picker { width: min(860px, calc(100% - 32px)); }
.pick-tabs { display: flex; gap: 6px; margin: 10px 0; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; max-height: 60vh; overflow: auto; }
.pick-grid button { background: var(--panel2); border: 2px solid var(--line); border-radius: 8px; padding: 6px; color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.pick-grid button:hover { border-color: var(--green); }
.pick-grid img { width: 100%; aspect-ratio: 16/9; object-fit: contain; background: #000; border-radius: 4px; display: block; }
.pick-grid span { display: block; margin-top: 4px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { height: 8px; background: var(--panel2); border-radius: 4px; overflow: hidden; }
.meter > div { height: 100%; width: 0; background: var(--green); }
.dlg-foot { display: flex; justify-content: flex-end; margin-top: 8px; }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { max-height: 45vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .stage { min-height: 40vh; }
}
