/* ================= MUTE_ALL ================= */
/* Шрифты лежат на нашем же сервере (скачиваются скриптом scripts/get-fonts.js).
   Внешние источники запрещены политикой безопасности. Если файлов нет — системные шрифты. */
@font-face { font-family: 'PS2P Local'; src: url('/fonts/PressStart2P-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Inter Local'; src: url('/fonts/Inter.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'JBM Local'; src: url('/fonts/JetBrainsMono.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #0c0a12;
  --bg-grid: rgba(255, 255, 255, 0.025);
  --panel: #17141f;
  --panel-2: #1d1928;
  --panel-3: #241f31;
  --input: #120f19;
  --line: #2a2438;
  --line-2: #3a3150;
  --text: #ece8f6;
  --text-2: #a9a1bd;
  --text-3: #6f6787;
  --accent: #5b5cf0;      /* кнопка «Создать» */
  --accent-hi: #6d6ef7;
  --violet: #a855f7;
  --violet-2: #7c3aed;
  --violet-soft: rgba(168, 85, 247, 0.14);
  --pink: #ff4d8d;
  --green: #3ee08f;
  --yellow: #fbbf24;
  --red: #f43f5e;
  --radius: 10px;
  --radius-lg: 18px;
  --font: 'Inter Local', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --pixel: 'PS2P Local', 'Press Start 2P', 'JetBrains Mono', monospace;
  --mono: 'JBM Local', 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px),
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(124, 58, 237, 0.10), transparent 70%);
  background-size: 28px 28px, 28px 28px, 100% 100%;
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.ic { flex: none; display: block; }
[data-ic] { display: inline-flex; }
.mono { font-family: var(--mono); }
::selection { background: rgba(168, 85, 247, 0.4); }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.noscript { padding: 40px; text-align: center; }
.boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; background: #0c0a12; color: #ece8f6; font-family: system-ui, sans-serif; z-index: 100; }
.boot-title { font-size: 20px; font-weight: 700; }
.boot-help { max-width: 520px; color: #a9a1bd; line-height: 1.6; font-size: 15px; animation: boot-in 0s 2.5s both; }
@keyframes boot-in { from { visibility: hidden; } }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--radius);
  border: 1px solid transparent; background: var(--panel-3);
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s, opacity .15s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-pixel { font-family: var(--pixel); font-size: 11px; letter-spacing: .5px; text-transform: uppercase; font-weight: 400; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 24px -8px rgba(91, 92, 240, .8), inset 0 -2px 0 rgba(0,0,0,.18); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hi); }
.btn-outline { background: rgba(124, 58, 237, .14); border-color: rgba(168, 85, 247, .55); color: #fff; }
.btn-outline:hover:not(:disabled) { background: rgba(124, 58, 237, .26); box-shadow: 0 0 22px -6px rgba(168,85,247,.7); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-2); font-weight: 500; }
.btn-ghost:hover:not(:disabled) { border-color: var(--line-2); color: var(--text); background: var(--panel-2); }
.btn-danger { background: var(--red); color: #fff; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent;
  display: inline-grid; place-items: center; color: var(--text-2);
}
.icon-btn:hover { background: var(--panel-3); color: var(--text); }

/* ---------- Лендинг ---------- */
.landing { min-height: 100%; display: flex; flex-direction: column; align-items: center; padding: 48px 16px 32px; }
.hero { text-align: center; margin-bottom: 36px; }
.logo { display: inline-flex; align-items: center; gap: 14px; margin: 0 0 18px; }
.logo-mic { width: 54px; height: 54px; display: inline-block; filter: drop-shadow(0 0 14px rgba(124, 92, 255, .55)); }
.logo-mic.sm { width: 26px; height: 26px; }
.logo-text { font-family: var(--pixel); font-size: clamp(26px, 5vw, 42px); font-weight: 400; letter-spacing: 1px; color: #fff; text-shadow: 0 0 24px rgba(168, 85, 247, .35); }
.logo-us { color: var(--violet); }
.hero-sub { text-wrap: balance; margin: 0 0 22px; color: var(--text-2); font-size: 17px; line-height: 1.7; }
.chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(23, 20, 31, .7); font-size: 12px; color: var(--text-2); }
.chip .ic { width: 14px; height: 14px; color: var(--violet); }

.card {
  width: 100%; max-width: 770px; padding: 32px;
  background: linear-gradient(180deg, #1b1724, #16131e);
  border: 1px solid rgba(168, 85, 247, .28); border-radius: var(--radius-lg);
  box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 20px 80px -20px rgba(124, 58, 237, .45), 0 0 40px -10px rgba(168, 85, 247, .25);
}
.invite-note { display: flex; align-items: center; gap: 10px; margin: -8px 0 22px; padding: 10px 14px; border-radius: var(--radius); background: var(--violet-soft); border: 1px solid rgba(168,85,247,.35); font-size: 13px; color: #e2d4ff; }
.invite-note .ic { color: var(--violet); }
.step + .step { margin-top: 30px; }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.step-num { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; background: rgba(91, 92, 240, .18); color: #8486ff; font: 10px/1 var(--pixel); }
.step-label { font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-2); }

.field { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; background: var(--input); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s; }
.field:focus-within { border-color: rgba(168,85,247,.6); box-shadow: 0 0 0 3px rgba(168,85,247,.15); }
.field.error { border-color: var(--red); animation: shake .35s; }
.field-ic .ic { width: 16px; height: 16px; color: var(--text-3); }
.field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 15px; }
.field input::placeholder { color: var(--text-3); }
.field-count { font: 11px var(--mono); color: var(--text-3); }
.field-error { margin-top: 8px; font-size: 13px; color: #ff8aa3; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.avatars { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 10px; }
.ava-btn {
  position: relative; aspect-ratio: 1; border-radius: 10px; padding: 8px;
  background: var(--input); border: 1px solid var(--line);
  transition: border-color .15s, transform .12s, background .15s;
}
.ava-btn svg { filter: grayscale(1) brightness(.75); transition: filter .15s, transform .15s; }
.ava-btn:hover { border-color: var(--line-2); transform: translateY(-2px); }
.ava-btn:hover svg { filter: grayscale(.4) brightness(.95); }
.ava-btn[aria-checked="true"] { border: 2px solid var(--violet); background: rgba(168,85,247,.12); box-shadow: 0 0 20px -4px rgba(168,85,247,.7); }
.ava-btn[aria-checked="true"] svg { filter: none; animation: bob 1.4s steps(2) infinite; }
.ava-btn .tick { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; background: var(--violet); color: #fff; display: none; place-items: center; box-shadow: 0 0 0 3px #1a1623; }
.ava-btn .tick .ic { width: 12px; height: 12px; stroke-width: 3; }
.ava-btn[aria-checked="true"] .tick { display: grid; }
@keyframes bob { 50% { transform: translateY(-2px); } }

.start { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; }
.start-box { padding: 20px; border-radius: 14px; background: rgba(12, 10, 18, .45); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.start-box h2 { margin: 0; font-size: 14px; font-weight: 700; }
.start-box p { margin: -6px 0 4px; font-size: 13px; color: var(--text-2); line-height: 1.6; }
#create-btn, #join-btn { margin-top: auto; }
.start-or { display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; color: var(--text-3); font: 600 12px var(--font); }
.start-or::before { content: ''; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.start-or span { position: relative; background: #191521; padding: 8px 0; }
.link-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.mono-input { height: 44px; padding: 0 12px; width: 100%; min-width: 0; border-radius: var(--radius); border: 1px solid var(--line); background: var(--input); font: 12.5px var(--mono); color: var(--text-2); outline: 0; }
.mono-input:focus { border-color: rgba(168,85,247,.6); }
.mono-input::placeholder { color: var(--text-3); }
#created-link.ready { color: #fff; border-color: rgba(168,85,247,.55); }
.foot { margin-top: 40px; font-size: 12px; color: var(--text-3); }

/* ---------- Прелоадер ---------- */
.loader { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(9, 7, 14, .92); backdrop-filter: blur(6px); text-align: center; padding: 20px; }
.loader-mic { position: relative; width: 96px; height: 96px; }
.loader-mic-art { width: 100%; height: 100%; animation: wobble 1.1s steps(4) infinite; filter: drop-shadow(0 0 18px rgba(124, 92, 255, .6)); }
.zz { position: absolute; right: -14px; top: 6px; font: 12px var(--pixel); color: var(--violet); opacity: 0; animation: zz 2.4s infinite; }
.z2 { animation-delay: .8s; right: -26px; top: -6px; font-size: 14px; }
.z3 { animation-delay: 1.6s; right: -40px; top: -20px; font-size: 18px; }
@keyframes wobble { 0%,100% { transform: rotate(-6deg) translateY(0); } 25% { transform: rotate(0) translateY(-4px); } 50% { transform: rotate(6deg) translateY(0); } 75% { transform: rotate(0) translateY(-2px); } }
@keyframes zz { 0% { opacity: 0; transform: translate(0, 6px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(10px, -16px); } }
.loader-title { font: 13px/1.6 var(--pixel); color: #fff; margin-top: 10px; }
.loader-joke { color: var(--text-2); font-size: 14px; min-height: 21px; }
.mini-loader { width: 36px; height: 36px; display: inline-block; animation: wobble 1.1s steps(4) infinite; }

/* ---------- Плашка сети и тосты ---------- */
.net-banner { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 24px); padding: 10px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 500; box-shadow: 0 10px 40px -10px rgba(0,0,0,.8); }
.net-banner.warn { background: #3a2a0a; border: 1px solid #a16207; color: #fde68a; }
.net-banner.bad { background: #3b0f1c; border: 1px solid #be123c; color: #fecdd3; }
.net-banner.ok { background: #0b3324; border: 1px solid #15803d; color: #bbf7d0; }
.net-banner .mini-loader { width: 22px; height: 22px; }
.toasts { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); z-index: 85; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100% - 24px); }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; background: #231d31; border: 1px solid var(--line-2); font-size: 13.5px; box-shadow: 0 10px 30px -8px rgba(0,0,0,.7); animation: toast-in .2s ease-out; }
.toast.error { border-color: #be123c; background: #2c1220; }
.toast.ok .ic { color: var(--green); }
.toast.error .ic { color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Комната ---------- */
.room { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 1fr 340px; }
.room.chat-hidden { grid-template-columns: 1fr 0; }
.room.chat-hidden .chat { display: none; }
.room-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.room-top { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: rgba(12,10,18,.6); }
.room-brand { display: flex; align-items: center; gap: 8px; }
.room-brand-text { font: 12px var(--pixel); }
.room-code { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font: 12px var(--mono); color: var(--text-2); }
.room-code:hover { border-color: rgba(168,85,247,.55); color: #fff; }
.room-code .ic { width: 14px; height: 14px; color: var(--violet); }
.room-meta { margin-left: auto; display: flex; align-items: center; gap: 6px; font: 12px var(--mono); color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.warn { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.dot.bad { background: var(--red); box-shadow: 0 0 8px var(--red); }

.stage { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 26px; }
.tiles { width: 100%; max-width: 1100px; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); justify-content: center; }
.tiles[data-n="1"] { grid-template-columns: minmax(0, 360px); }
.tiles[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 340px)); }
.tile {
  position: relative; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--c) 22%, transparent), transparent 60%), var(--panel);
  border: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  transition: border-color .12s, box-shadow .12s;
}
.tile.remote { cursor: pointer; }
.tile.remote:hover { border-color: var(--line-2); }
.tile.speaking { border-color: var(--green); box-shadow: 0 0 0 3px rgba(62,224,143,.18), 0 0 30px -6px rgba(62,224,143,.6); }
.tile-ava { width: 44%; max-width: 140px; aspect-ratio: 1; transition: transform .1s; }
.tile.speaking .tile-ava { animation: talk .3s steps(2) infinite; }
@keyframes talk { 50% { transform: translateY(-3px) scale(1.03); } }
.tile.offline .tile-ava, .tile.connecting .tile-ava { opacity: .45; filter: grayscale(.6); }
.tile-name { position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 64px); padding: 4px 10px; border-radius: 8px; background: rgba(9,7,14,.75); font-size: 13px; font-weight: 600; }
.tile-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-name .ic { width: 14px; height: 14px; color: var(--red); }
.tile-you { color: var(--text-3); font-weight: 500; }
.tile-vol { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(9,7,14,.75); color: var(--text-2); border: 1px solid transparent; }
.tile.remote:hover .tile-vol { border-color: rgba(168,85,247,.5); color: #fff; }
.tile-vol.muted { color: var(--red); background: rgba(244,63,94,.15); }
.tile-vol .pct { position: absolute; top: -8px; right: -6px; padding: 0 4px; border-radius: 4px; background: var(--violet); color: #fff; font: 8px/14px var(--pixel); }
.tile-status { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: center; }
.tile-status span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; background: rgba(9,7,14,.8); color: var(--yellow); }
.tile-status.bad span { color: #ff8aa3; }
.tile-status .ic { width: 13px; height: 13px; }
.tile-badge { position: absolute; top: 10px; right: 10px; font: 8px/1 var(--pixel); padding: 5px 6px; border-radius: 5px; background: var(--violet-soft); color: #d8c2ff; }

.alone { text-align: center; color: var(--text-2); }
.alone p { margin: 0 0 12px; }
.ptt-hint { position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%); padding: 6px 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.ptt-hint.on { color: #bbf7d0; border-color: #15803d; background: #0b3324; }
.ptt-hint kbd { font: 11px var(--mono); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--panel-3); }

.controls { display: flex; justify-content: center; gap: 10px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(12,10,18,.7); }
.ctl { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 76px; padding: 10px 12px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text-2); transition: all .12s; }
.ctl:hover { background: var(--panel-3); color: #fff; border-color: var(--line-2); }
.ctl .ic { width: 22px; height: 22px; }
.ctl-label { font-size: 11.5px; font-weight: 500; }
.ctl.off { background: rgba(244,63,94,.14); border-color: rgba(244,63,94,.5); color: #ff8aa3; }
.ctl.active { background: rgba(168,85,247,.14); border-color: rgba(168,85,247,.5); color: #e2d4ff; }
.ctl-danger { background: var(--red); border-color: var(--red); color: #fff; }
.ctl-danger:hover { background: #e11d48; border-color: #e11d48; }
.badge { position: absolute; top: 4px; right: 12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--pink); color: #fff; font: 700 11px/18px var(--font); }

/* ---------- Чат ---------- */
.chat { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: #110e18; }
.chat-head { display: flex; align-items: center; justify-content: space-between; height: 61px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.chat-list { flex: 1; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 2px; }
.chat-empty { margin: auto 10px; text-align: center; font-size: 13px; color: var(--text-3); }
.msg { display: grid; grid-template-columns: 30px 1fr; gap: 0 10px; padding: 6px 6px; border-radius: 8px; }
.msg:hover { background: rgba(255,255,255,.025); }
.msg.cont { padding-top: 0; }
.msg.cont .msg-ava, .msg.cont .msg-meta { display: none; }
.msg.cont .msg-text { grid-column: 2; }
.msg-ava { width: 30px; height: 30px; border-radius: 8px; padding: 3px; background: var(--panel-3); grid-row: span 2; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; }
.msg-name { font-weight: 700; font-size: 13.5px; }
.msg-time { font-size: 11px; color: var(--text-3); }
.msg-text { font-size: 14px; color: #d9d3e8; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-text a { color: #b794ff; }
.msg.sys { display: block; text-align: center; font-size: 12px; color: var(--text-3); padding: 6px; }
.msg.pending .msg-text { opacity: .55; }
.chat-form { display: flex; align-items: flex-end; gap: 8px; margin: 10px 12px 14px; padding: 6px 6px 6px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--input); }
.chat-form:focus-within { border-color: rgba(168,85,247,.55); }
.chat-form textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; max-height: 120px; padding: 7px 0; line-height: 1.45; }
.chat-form .send { color: var(--violet); }

/* ---------- Поповер громкости ---------- */
.vol-pop { position: fixed; z-index: 70; width: 290px; padding: 14px; border-radius: 14px; background: #1f1a2b; border: 1px solid rgba(168,85,247,.4); box-shadow: 0 20px 60px -10px rgba(0,0,0,.8), 0 0 30px -10px rgba(168,85,247,.5); }
.vol-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.vol-ava { width: 32px; height: 32px; padding: 3px; border-radius: 8px; background: var(--panel-3); }
.vol-name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vol-row { display: flex; align-items: center; gap: 10px; }
.vol-row .icon-btn.muted { color: var(--red); background: rgba(244,63,94,.12); }
.vol-val { width: 44px; text-align: right; font: 12px var(--mono); color: var(--text-2); }
.vol-presets { display: flex; gap: 6px; margin-top: 10px; }
.vol-presets button { flex: 1; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); font: 11px var(--mono); color: var(--text-2); }
.vol-presets button:hover { border-color: var(--violet); color: #fff; }
.vol-note { margin: 10px 0 0; font-size: 12px; color: var(--text-3); }

input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--violet) var(--p, 50%), var(--panel-3) var(--p, 50%)); outline: 0; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 4px; background: #fff; border: 3px solid var(--violet); box-shadow: 0 0 10px rgba(168,85,247,.6); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 4px; background: #fff; border: 3px solid var(--violet); cursor: pointer; }

/* ---------- Модальные окна ---------- */
.modal { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 16px; background: rgba(5, 4, 9, .72); backdrop-filter: blur(4px); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal-box { width: 100%; max-width: 440px; max-height: calc(100dvh - 32px); overflow: auto; padding: 26px; border-radius: var(--radius-lg); background: #1a1623; border: 1px solid rgba(168,85,247,.3); box-shadow: 0 30px 80px -20px rgba(124,58,237,.5); text-align: center; }
.modal-wide { max-width: 600px; text-align: left; padding: 0; }
.modal-art { width: 72px; height: 72px; margin: 0 auto 14px; }
.modal-box h2 { margin: 0 0 10px; font: 13px/1.6 var(--pixel); color: #fff; }
.modal-text { color: var(--text-2); font-size: 14px; line-height: 1.6; }
.modal-text ol, .modal-text ul { text-align: left; padding-left: 20px; margin: 10px 0 0; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.modal-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 14px 24px; background: #1a1623; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
.settings-body { padding: 8px 24px 24px; }
.set-group { padding: 18px 0; border-bottom: 1px solid var(--line); }
.set-group:last-child { border-bottom: 0; }
.set-group h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-2); }
.set-group h3 .ic { width: 16px; height: 16px; color: var(--violet); }
.row { display: flex; gap: 10px; }
select { width: 100%; height: 42px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--input); color: var(--text); outline: 0; }
select:focus { border-color: rgba(168,85,247,.6); }
.hint { margin: 8px 0 0; font-size: 12.5px; color: var(--text-3); }
.meter { position: relative; height: 10px; margin-top: 12px; border-radius: 5px; background: var(--panel-3); overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), #a3e635 70%, var(--yellow)); transition: width .06s linear; }
.meter-fill.closed { background: var(--text-3); }
.meter-thr { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #fff; box-shadow: 0 0 6px #fff; }
.toggle { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.tg { flex: none; position: relative; width: 38px; height: 22px; margin-top: 1px; border-radius: 11px; background: var(--panel-3); border: 1px solid var(--line-2); transition: background .15s; }
.tg::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 4px; background: var(--text-3); transition: transform .15s, background .15s; }
.toggle input:checked + .tg { background: var(--violet-2); border-color: var(--violet); }
.toggle input:checked + .tg::after { transform: translateX(16px); background: #fff; }
.toggle input:focus-visible + .tg { outline: 2px solid var(--violet); outline-offset: 2px; }
.toggle b { display: block; font-size: 14px; font-weight: 600; }
.toggle small { display: block; font-size: 12.5px; color: var(--text-3); }
.gate-row { display: flex; align-items: center; gap: 12px; padding: 0 0 8px 50px; }
.gate-row .hint { margin: 0; }
.gate-row.disabled { opacity: .4; pointer-events: none; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 12px; background: var(--input); border: 1px solid var(--line); }
.seg input { position: absolute; opacity: 0; }
.seg3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.set-sub { padding: 4px 0 12px; }
.set-sub-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.set-sub-head b { font-weight: 600; }
.tag { font: 8px/1 var(--pixel); padding: 5px 6px; border-radius: 5px; background: var(--violet-soft); color: #d8c2ff; }
.tag.warn { background: rgba(251,191,36,.14); color: var(--yellow); }
.seg span { display: block; padding: 9px 6px; border-radius: 8px; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg input:checked + span { background: var(--violet-2); color: #fff; box-shadow: 0 0 16px -4px rgba(168,85,247,.8); }
.seg input:focus-visible + span { outline: 2px solid var(--violet); }
.ptt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; }
.ptt-row .hint { flex-basis: 100%; margin: 0; }
.keycap { min-width: 64px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); border-bottom-width: 3px; background: var(--panel-3); font: 12px var(--mono); color: #fff; }
.keycap.listening { border-color: var(--violet); color: var(--violet); animation: pulse 1s infinite; }
.ptt-row.disabled { opacity: .4; pointer-events: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(168,85,247,.25); } }

/* ---------- Адаптив ---------- */
@media (max-width: 1000px) {
  .room { grid-template-columns: 1fr; }
  .room.chat-hidden { grid-template-columns: 1fr; }
  .chat { position: fixed; inset: 0 0 0 auto; width: min(380px, 100%); z-index: 60; box-shadow: -20px 0 60px rgba(0,0,0,.6); }
}
@media (max-width: 720px) {
  .landing { padding-top: 28px; }
  .card { padding: 20px 16px; }
  .avatars { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .start { grid-template-columns: 1fr; }
  .start-or { flex-direction: row; height: 20px; }
  .start-or::before { top: 50%; bottom: auto; left: 0; right: 0; width: auto; height: 1px; }
  .start-or span { padding: 0 10px; }
  .hero-sub br { display: none; }
  .room-top { padding: 10px 12px; gap: 8px; }
  .room-brand-text { display: none; }
  .stage { padding: 12px; justify-content: flex-start; }
  .tiles, .tiles[data-n="1"], .tiles[data-n="2"] { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tiles[data-n="1"] { grid-template-columns: minmax(0, 260px); }
  .ctl { min-width: 0; flex: 1; padding: 8px 4px 6px; }
  .ctl-label { font-size: 10.5px; }
  .gate-row { padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
