:root {
    --bg: #101418;
    --card: #1a2027;
    --line: #2a323c;
    --text: #e6edf3;
    --dim: #8b98a5;
    --accent: #3fb68b;
    --danger: #e5534b;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.hidden { display: none !important; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 28px;
    width: min(92vw, 360px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

h1 { font-size: 26px; letter-spacing: .4px; }
.hint { color: var(--dim); margin-top: -8px; }

input, select, button { font: inherit; border-radius: 9px; padding: 10px 12px; }
input, select { background: var(--bg); color: var(--text); border: 1px solid var(--line); }

button {
    background: var(--accent);
    border: 0;
    color: #08110d;
    font-weight: 600;
    cursor: pointer;
}
button.danger { background: var(--danger); color: #fff; }
button.off { background: var(--line); color: var(--text); }
button.icon { background: none; color: var(--dim); font-size: 20px; padding: 4px 8px; }
button.icon:hover { color: var(--text); }
button.small { padding: 6px 10px; font-size: 14px; }

.err { color: var(--danger); min-height: 1.4em; }

#call { width: min(94vw, 560px); display: flex; flex-direction: column; gap: 14px; }
#call header { display: flex; align-items: center; gap: 10px; color: var(--dim); }
#roomName { color: var(--text); font-weight: 600; }
#status { flex: 1; }

#people { display: flex; flex-direction: column; gap: 8px; }

.person {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 10px 14px;
    transition: border-color .12s, box-shadow .12s;
}
.person.speaking { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.person .name { flex: 1; }
.person .you { color: var(--dim); font-size: 13px; }
.person .muted { color: var(--danger); font-size: 13px; }
.person input[type=range] { width: 110px; accent-color: var(--accent); }

/* индикатор «в эфире» — гейт открыт, звук уходит в комнату */
.air-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--line);
    flex-shrink: 0;
    transition: background .1s;
}
.person.on-air .air-dot { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

#call footer { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
#pttBtn { touch-action: none; user-select: none; -webkit-user-select: none; }

/* --- настройки --- */

dialog {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 24px;
    width: min(92vw, 380px);
}
dialog::backdrop { background: rgba(0, 0, 0, .55); }
dialog h2 { font-size: 20px; margin-bottom: 14px; }
dialog .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
dialog .field small { margin-top: -2px; }
dialog .row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; cursor: pointer; }
dialog fieldset { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin-bottom: 12px; }
dialog legend { color: var(--dim); padding: 0 6px; }
dialog .range-row { display: flex; align-items: center; gap: 10px; }
dialog input[type=range] { flex: 1; accent-color: var(--accent); padding: 0; }
dialog input[type=checkbox], dialog input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
#thrVal { color: var(--dim); min-width: 52px; text-align: right; }
#settingsClose { width: 100%; margin-top: 6px; }
