:root { --bg: #0f1216; --fg: #eef1f4; --muted: #95a0ab; --card: #1a1f26; --acc: #2e86de; --danger: #d64541; --ok: #2ecc71; --line: #2a313a; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all; }
.screen { position: fixed; inset: 0; }
.center { display: flex; align-items: center; justify-content: center; padding: 16px; }
.card { background: var(--card); border-radius: 14px; padding: 28px; width: 100%; max-width: 380px; text-align: center; box-shadow: 0 10px 40px #0006; }
.card h1 { margin: 0 0 18px; font-size: 22px; }
label { display: block; text-align: left; margin: 10px 0 4px; color: var(--muted); font-size: 13px; }
input, select { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: #11151a; color: var(--fg); font-size: 15px; }
button { cursor: pointer; border: 0; border-radius: 8px; padding: 8px 14px; background: #2a313a; color: var(--fg); font-size: 14px; }
button:hover { filter: brightness(1.15); }
button.primary { background: var(--acc); } button.danger { background: var(--danger); }
button.big { width: 100%; margin-top: 14px; padding: 14px; font-size: 17px; }
.spinner { width: 40px; height: 40px; border: 4px solid #fff3; border-top-color: var(--acc); border-radius: 50%; margin: 0 auto 14px; animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.tvname { font-size: 20px; margin-top: 12px; }

#stage { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
#toolbar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 8px; background: #000a; padding: 8px; border-radius: 14px; }
#toolbar button { font-size: 20px; width: 46px; height: 46px; padding: 0; border-radius: 50%; }
#toolbar, .menu-btn, .qbadge { transition: opacity .4s; }
body.idle #toolbar, body.idle .qbadge { opacity: 0; pointer-events: none; }
body.idle:not(.tv) .menu-btn { opacity: .25; }
#toolbar button.off { background: var(--danger); } #toolbar button.on { background: var(--ok); }
.rec { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: #000a; color: #ff5a52; padding: 4px 10px; border-radius: 8px; font-weight: 600; }
.qbadge { position: absolute; top: 12px; right: 64px; background: #0008; color: var(--muted); padding: 3px 8px; border-radius: 8px; font-size: 12px; }
.qbadge:empty { display: none; }
.panel { position: absolute; top: 56px; right: 12px; width: min(340px, calc(100% - 24px)); max-height: calc(100% - 140px); overflow: auto; background: #151a20ee; border-radius: 12px; padding: 12px; }
.panel h3 { margin: 4px 0 8px; font-size: 15px; }
.panel ul { list-style: none; margin: 0; padding: 0; }
.panel li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.panel li span:first-child { flex: 1; } .panel li .ic { font-size: 12px; }
.panel li button { padding: 4px 8px; font-size: 12px; }
#rec-ctl { display: flex; gap: 8px; margin-top: 10px; }

.menu-btn { position: fixed; right: 12px; top: 12px; z-index: 20; width: 42px; height: 42px; border-radius: 50%; font-size: 20px; padding: 0; background: #000a; }
body.tv .menu-btn { top: auto; bottom: 16px; right: 16px; opacity: .45; }     /* Linux-ТВ: кнопка «Настройки» в правом нижнем углу */
body.tv .menu-btn:hover, body.tv .menu-btn:focus { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 100%); z-index: 30; background: #141920f5; display: flex; flex-direction: column; box-shadow: -6px 0 30px #0008; }
.drawer header, .drawer footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.drawer header h2 { margin: 0; font-size: 18px; }
.drawer nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px; }
.drawer nav button { font-size: 12px; padding: 6px 10px; } .drawer nav button.active { background: var(--acc); }
.drawer .tab { padding: 4px 16px; overflow: auto; flex: 1; }
.drawer .tab label input[type=radio], .drawer .tab label input[type=checkbox] { width: auto; margin-right: 8px; }
.drawer .tab label { color: var(--fg); font-size: 14px; }
.drawer .tab button { margin-top: 8px; }
.meter { height: 8px; background: #222; border-radius: 4px; margin: 6px 0; overflow: hidden; } #mic-level { height: 100%; width: 0; background: var(--ok); }
#preview { width: 100%; border-radius: 8px; background: #000; margin: 6px 0; max-height: 160px; }
.tv-off { width: 80vw; height: 80vh; font-size: min(8vw, 64px); background: var(--danger); border-radius: 24px; }
.tv-off small { font-size: 40%; opacity: .8; }
#toast { position: fixed; left: 50%; top: 18px; transform: translate(-50%, -80px); background: #000d; padding: 10px 16px; border-radius: 10px; transition: .3s; z-index: 50; max-width: 90%; }
#toast.on { transform: translate(-50%, 0); }
