/*==============================================================
# CONSTELLATION — кардинальный редизайн
# Метафора: P2P без VPN = сеть узлов. Тёмный космос, живые связи.
# Палитра: #060914→#0b1228 база · #6ea8ff узлы · #9be7d8 mint · #8b7dff violet · #ff5d6c danger
==============================================================*/

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
    --c-void: #050811;
    --c-deep: #060914;
    --c-mid: #0a1024;
    --c-soft: #0b1228;
    --c-node: #6ea8ff;
    --c-node-bright: #9cc4ff;
    --c-mint: #9be7d8;
    --c-violet: #8b7dff;
    --c-danger: #ff5d6c;
    --c-ink: #eaf1ff;
    --c-ink-dim: rgba(196, 212, 244, 0.6);
    --c-glass: rgba(13, 21, 44, 0.62);
    --c-glass-2: rgba(10, 16, 36, 0.72);
    --c-brd: rgba(120, 162, 255, 0.2);
    --c-brd-strong: rgba(140, 178, 255, 0.42);

    --font-display: 'Space Grotesk', 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-mono: 'Space Mono', ui-monospace, 'SF Mono', monospace;

    /* перекрытие старой темы */
    --body-bg:
        radial-gradient(1100px 760px at 12% -8%, rgba(110, 168, 255, 0.16), transparent 55%),
        radial-gradient(900px 700px at 92% 8%, rgba(139, 125, 255, 0.14), transparent 52%),
        radial-gradient(760px 600px at 50% 112%, rgba(155, 231, 216, 0.1), transparent 48%),
        linear-gradient(168deg, #060914 0%, #080d20 46%, #060a17 100%);
    --accent: #6ea8ff;
    --accent-2: #9be7d8;
    --navbar-bg: rgba(8, 13, 28, 0.72);
}

/* анимируемый угол для текучих рамок */
@property --c-ang {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

html,
body {
    background: var(--body-bg);
}

/*--------------------------------------------------------------
# Живой фон-холст
--------------------------------------------------------------*/
#constellation-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    /* мягкая виньетка поверх частиц для глубины */
}

/* лёгкое «дыхание» свечения базового фона */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(60% 50% at 50% 0%, rgba(110, 168, 255, 0.06), transparent 70%),
        radial-gradient(50% 45% at 100% 100%, rgba(139, 125, 255, 0.05), transparent 70%);
    animation: c-bgbreathe 16s ease-in-out infinite alternate;
}

@keyframes c-bgbreathe {
    from {
        opacity: 0.55;
    }
    to {
        opacity: 1;
    }
}

/*==============================================================
# 1. ЗАГРУЗОЧНЫЙ ЭКРАН  (#loadingDiv + .loading-spinner)
==============================================================*/

/* Загрузка: парящий формирующийся орб с «сонар»-кольцами, без коробки */
#loadingDiv {
    z-index: 9999;
    padding: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    position: relative;
    overflow: visible;
    text-align: center;
    animation: c-cardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#loadingDiv h1 {
    font-family: var(--font-display) !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.32em !important;
    text-transform: uppercase;
    text-indent: 0.32em;
    margin: 2.6rem 0 0.7rem !important;
    background: linear-gradient(110deg, var(--c-node-bright) 0%, #fff 45%, var(--c-mint) 90%) !important;
    background-size: 220% 100% !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
    animation: c-textSweep 3.6s ease-in-out infinite;
}

#loadingDiv pre {
    font-family: var(--font-mono) !important;
    font-size: 0.82rem !important;
    letter-spacing: 0.03em !important;
    line-height: 1.7 !important;
    color: var(--c-ink-dim) !important;
}

@keyframes c-textSweep {
    0%,
    100% {
        background-position: 0% 0;
    }
    50% {
        background-position: 100% 0;
    }
}

/* формирующееся орб-ядро в центре */
.loading-spinner {
    width: 170px !important;
    height: 170px !important;
    margin: 0 auto !important;
    border-radius: 50% !important;
    background:
        radial-gradient(circle 22px at 46% 42%, rgba(155, 231, 216, 0.95) 0%, rgba(110, 168, 255, 0) 60%),
        radial-gradient(circle 40px at 50% 50%, #6d5cff 0%, #3aa0ff 45%, rgba(58, 160, 255, 0) 74%) !important;
    animation: c-orbPulse 2.6s ease-in-out infinite !important;
}
@keyframes c-orbPulse {
    0%,
    100% {
        filter: drop-shadow(0 0 16px rgba(110, 168, 255, 0.5));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(155, 231, 216, 0.7));
        transform: scale(1.06);
    }
}

.spinner-logo {
    display: none !important;
}

/* «сонар»: расходящиеся кольца — поиск узла связи */
.spinner-ring {
    inset: 0 !important;
    border: 1.5px solid rgba(110, 168, 255, 0.55) !important;
    animation: c-sonar 2.8s ease-out infinite !important;
}
.spinner-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(155, 231, 216, 0.45);
    animation: c-sonar 2.8s ease-out infinite;
    animation-delay: 0.9s;
}
.loading-spinner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(139, 125, 255, 0.4);
    animation: c-sonar 2.8s ease-out infinite;
    animation-delay: 1.8s;
}
/* одна орбитальная точка для «жизни» */
.loading-spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c-mint);
    box-shadow: 0 0 12px var(--c-mint);
    animation: c-orbit-a 4.2s linear infinite;
}

@keyframes c-sonar {
    0% {
        transform: scale(0.42);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.95);
        opacity: 0;
    }
}
@keyframes c-orbit-a {
    from {
        transform: translate(-50%, -50%) rotate(0) translateY(-92px);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg) translateY(-92px);
    }
}
@keyframes c-borderspin {
    to {
        --c-ang: 360deg;
    }
}
@keyframes c-cardIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0);
    }
}

/* QR-подсказка в одном стиле */
#qrRoomPopupContainer {
    border-radius: 20px;
}
#qrText {
    font-family: var(--font-display);
    color: var(--c-ink-dim);
}

/*==============================================================
# 2. ЭКРАН ВХОДА  (.swal2-popup.init-modal-size)
==============================================================*/

.swal2-container.swal2-backdrop-show {
    background: rgba(4, 7, 16, 0.66) !important;
    backdrop-filter: blur(4px);
}

.swal2-popup.init-modal-size {
    padding: 1.6rem 1.6rem 1.45rem !important;
    border-radius: 26px !important;
    border: 1px solid var(--c-brd) !important;
    background:
        radial-gradient(120% 80% at 50% -10%, rgba(110, 168, 255, 0.16), transparent 60%),
        linear-gradient(168deg, rgba(13, 21, 44, 0.96) 0%, rgba(8, 13, 28, 0.98) 100%) !important;
    box-shadow:
        0 32px 90px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(110, 168, 255, 0.12) inset,
        0 0 70px rgba(110, 168, 255, 0.12) !important;
    /* ВАЖНО: не задаём здесь animation — иначе она перебивает анимацию
       закрытия SweetAlert (animate__fadeOutUp) и модалка не удаляется из DOM.
       Вход/выход обрабатывают showClass/hideClass самого SweetAlert. */
}

/* верхняя сияющая линия → constellation */
.swal2-popup.init-modal-size::before {
    height: 3px !important;
    background: linear-gradient(90deg, var(--c-node), var(--c-mint), var(--c-violet), var(--c-node)) !important;
    background-size: 220% 100% !important;
    box-shadow: 0 0 18px rgba(110, 168, 255, 0.5);
    animation: initModalBar 6s linear infinite !important;
}

/* текучая рамка-сигнатура */
.swal2-popup.init-modal-size::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 26px;
    padding: 1.5px;
    background: conic-gradient(
        from var(--c-ang),
        transparent 0deg,
        var(--c-node) 80deg,
        var(--c-mint) 150deg,
        transparent 230deg,
        var(--c-violet) 320deg,
        transparent 360deg
    );
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: c-borderspin 8s linear infinite;
    pointer-events: none;
    opacity: 0.7;
    z-index: 1;
}

.swal2-popup.init-modal-size .swal2-title {
    font-family: var(--font-display) !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
    background: linear-gradient(110deg, #fff 0%, var(--c-node-bright) 55%, var(--c-mint) 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
}

/* превью ВАШЕГО орба перед входом */
.init-orb-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 0.1rem 0 1.1rem;
}
.init-orb-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    animation: c-orbFloat 4.6s ease-in-out infinite;
}
.init-orb-caption {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--c-ink-dim);
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@keyframes c-orbFloat {
    0%,
    100% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 0 26px rgba(110, 168, 255, 0.35));
    }
    50% {
        transform: translateY(-4px) scale(1.02);
        filter: drop-shadow(0 0 42px rgba(155, 231, 216, 0.45));
    }
}

/* кнопки устройств — круглые узлы */
.swal2-popup.init-modal-size .init-user button {
    border-radius: 50% !important;
    width: 52px !important;
    flex: 0 0 52px !important;
    margin: 0 auto !important;
}
.swal2-popup.init-modal-size .initComands {
    justify-content: center !important;
}

/* превью видео — рамка-узел */
.swal2-popup.init-modal-size .init-video-container {
    border-radius: 18px;
    box-shadow:
        0 0 0 1px rgba(110, 168, 255, 0.4),
        0 16px 44px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(110, 168, 255, 0.12);
}

/* кнопки-устройства как узлы */
.swal2-popup.init-modal-size .init-user button {
    height: 52px;
    border-radius: 14px !important;
    background: rgba(110, 168, 255, 0.08) !important;
    border: 1px solid var(--c-brd) !important;
    color: var(--c-ink) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    transition:
        transform 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease !important;
}
.swal2-popup.init-modal-size .init-user button:hover {
    transform: translateY(-2px);
    background: rgba(110, 168, 255, 0.2) !important;
    border-color: var(--c-brd-strong) !important;
    box-shadow:
        0 8px 24px rgba(110, 168, 255, 0.25),
        0 0 0 1px var(--c-brd-strong) inset !important;
}
.swal2-popup.init-modal-size .init-user button.red,
.swal2-popup.init-modal-size .init-user button:hover.red {
    background: rgba(255, 93, 108, 0.16) !important;
    border-color: rgba(255, 93, 108, 0.5) !important;
    color: var(--c-danger) !important;
}

/* селекты-эндпоинты */
.swal2-popup.init-modal-size .init-user select {
    font-family: var(--font-display) !important;
    border-radius: 14px !important;
    color: var(--c-ink) !important;
    background-color: rgba(8, 13, 28, 0.92) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236ea8ff' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 14px !important;
    border: 1px solid var(--c-brd) !important;
}
.swal2-popup.init-modal-size .init-user select:hover {
    border-color: var(--c-brd-strong) !important;
    background-color: rgba(13, 21, 44, 0.95) !important;
}
.swal2-popup.init-modal-size .init-user select:focus {
    border-color: var(--c-node) !important;
    box-shadow: 0 0 0 3px rgba(110, 168, 255, 0.2) !important;
}
.swal2-popup.init-modal-size .init-user select option {
    background: #0a1024 !important;
    color: var(--c-ink) !important;
}

/* номер комнаты / имя — как «координата» (mono) */
.swal2-popup.init-modal-size .swal2-input {
    font-family: var(--font-mono) !important;
    letter-spacing: 0.04em !important;
    border-radius: 14px !important;
    color: var(--c-ink) !important;
    background: rgba(110, 168, 255, 0.07) !important;
    border: 1px solid var(--c-brd) !important;
    box-shadow: inset 0 0 0 1px rgba(110, 168, 255, 0.08) !important;
}
.swal2-popup.init-modal-size .swal2-input::placeholder {
    color: rgba(155, 231, 216, 0.5);
}
.swal2-popup.init-modal-size .swal2-input:focus {
    background: rgba(110, 168, 255, 0.12) !important;
    border-color: var(--c-node) !important;
    box-shadow: 0 0 0 3px rgba(110, 168, 255, 0.22) !important;
}

/* кнопка присоединения — узловой коннект */
.swal2-popup.init-modal-size .swal2-confirm {
    position: relative;
    overflow: hidden;
    font-family: var(--font-display) !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    border-radius: 14px !important;
    border: none !important;
    color: #06122a !important;
    background: linear-gradient(110deg, var(--c-node) 0%, var(--c-mint) 100%) !important;
    box-shadow:
        0 10px 30px rgba(110, 168, 255, 0.35),
        0 0 0 1px rgba(155, 231, 216, 0.3) inset !important;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease !important;
}
.swal2-popup.init-modal-size .swal2-confirm::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
    transform: translateX(-120%);
    animation: c-shimmer 3.4s ease-in-out infinite;
}
.swal2-popup.init-modal-size .swal2-confirm:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow:
        0 16px 40px rgba(110, 168, 255, 0.45),
        0 0 0 1px rgba(155, 231, 216, 0.45) inset !important;
}

@keyframes c-shimmer {
    0%,
    100% {
        transform: translateX(-120%);
    }
    55%,
    70% {
        transform: translateX(120%);
    }
}

/*==============================================================
# 3. КАРТОЧКИ УЧАСТНИКОВ  (.Camera / .Screen)
==============================================================*/

/* контейнер прозрачен — живой фон-сеть просвечивает за орбами */
#videoMediaContainer,
#videoMediaContainer.mouse-light {
    background: transparent !important;
}

/* Старый индикатор громкости (зелёный pitch-bar) больше не нужен —
   реакцию на голос теперь несёт сам орб (см. orbAudio.js / --level) */
.speechbar {
    display: none !important;
}

.Camera,
.Screen {
    border-radius: 18px !important;
    background: linear-gradient(160deg, rgba(13, 21, 44, 0.96) 0%, rgba(7, 11, 26, 0.92) 100%) !important;
    border: 1px solid var(--c-brd) !important;
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(110, 168, 255, 0.06) inset !important;
    animation:
        c-tileIn 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        c-tileBreathe 7s ease-in-out infinite 0.55s !important;
}

/* текучая рамка-сигнатура на карточке */
.Camera::after,
.Screen::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: conic-gradient(
        from var(--c-ang),
        transparent 0deg,
        rgba(110, 168, 255, 0.9) 70deg,
        rgba(155, 231, 216, 0.85) 140deg,
        transparent 220deg,
        rgba(139, 125, 255, 0.8) 310deg,
        transparent 360deg
    );
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: c-borderspin 9s linear infinite;
    pointer-events: none;
    opacity: 0.55;
    z-index: 9;
    transition: opacity 0.3s ease;
}
.Camera:hover::after,
.Screen:hover::after {
    opacity: 1;
}

@keyframes c-tileIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(18px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
@keyframes c-tileBreathe {
    0%,
    100% {
        box-shadow:
            0 16px 48px rgba(0, 0, 0, 0.45),
            0 0 0 1px rgba(110, 168, 255, 0.06) inset,
            0 0 0 0 rgba(110, 168, 255, 0);
    }
    50% {
        box-shadow:
            0 18px 54px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(110, 168, 255, 0.1) inset,
            0 0 36px rgba(110, 168, 255, 0.14);
    }
}

/* говорящий участник — яркое сетевое свечение */
.speaking {
    box-shadow:
        0 0 0 2px rgba(155, 231, 216, 0.7),
        0 0 34px rgba(110, 168, 255, 0.5) !important;
    animation: c-speakPulse 1.1s ease-in-out infinite !important;
}
@keyframes c-speakPulse {
    0%,
    100% {
        box-shadow:
            0 0 0 2px rgba(155, 231, 216, 0.55),
            0 0 26px rgba(110, 168, 255, 0.4);
    }
    50% {
        box-shadow:
            0 0 0 3px rgba(155, 231, 216, 0.9),
            0 0 44px rgba(110, 168, 255, 0.6);
    }
}

/* ОРБ — главный герой. Большой, парящий; свечение раздувается от голоса (--level) */
.videoAvatarImage {
    border-radius: 50% !important;
    width: min(64cqmin, 460px) !important;
    height: min(64cqmin, 460px) !important;
    filter: drop-shadow(
        0 0 calc(46px + var(--level, 0) * 120px) rgba(130, 185, 255, calc(0.3 + var(--level, 0) * 0.55))
    ) !important;
    animation: c-avatarBreathe 5s ease-in-out infinite;
    transition: filter 0.08s linear;
}
@keyframes c-avatarBreathe {
    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.03);
    }
}

/* Реактивный ореол: расходится волной за орбом в такт голосу */
.Camera:has(.videoAvatarImage[style*='block'])::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(64cqmin, 460px);
    height: min(64cqmin, 460px);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(calc(1 + var(--level, 0) * 0.65));
    background: radial-gradient(
        circle,
        rgba(155, 231, 216, calc(var(--level, 0) * 0.55)) 0%,
        rgba(110, 168, 255, calc(var(--level, 0) * 0.28)) 45%,
        transparent 68%
    );
    opacity: calc(0.22 + var(--level, 0) * 0.78);
    filter: blur(16px);
    pointer-events: none;
    z-index: 6;
    transition:
        transform 0.08s linear,
        opacity 0.08s linear;
}

/* Карточка БЕЗ камеры: «коробки» нет — орб парит на фоне-сети */
.Camera:has(.videoAvatarImage[style*='block']) {
    background:
        radial-gradient(58% 58% at 50% 46%, rgba(110, 168, 255, 0.05), transparent 72%),
        transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
    animation: c-tileIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
/* текучая рамка скрыта без камеры, мягко проявляется на hover (для контролов) */
.Camera:has(.videoAvatarImage[style*='block'])::after {
    opacity: 0 !important;
}
.Camera:has(.videoAvatarImage[style*='block']):hover::after {
    opacity: 0.3 !important;
}

/* имя участника */
.videoPeerName {
    font-family: var(--font-display) !important;
    border-radius: 12px !important;
    background: rgba(8, 13, 28, 0.78) !important;
    border: 1px solid var(--c-brd) !important;
    backdrop-filter: blur(12px) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* навбар карточки */
.navbar {
    background: linear-gradient(180deg, rgba(8, 13, 28, 0.82) 0%, rgba(8, 13, 28, 0) 100%) !important;
}
.navbar button {
    border-radius: 12px !important;
    border: 1px solid var(--c-brd) !important;
    background: rgba(8, 13, 28, 0.6) !important;
    backdrop-filter: blur(10px) !important;
}
.navbar button:hover {
    background: rgba(110, 168, 255, 0.3) !important;
    border-color: var(--c-brd-strong) !important;
    transform: translateY(-1px);
}

/*--------------------------------------------------------------
# Орб-«паспорт»: публичная инфа участника под сферой
--------------------------------------------------------------*/
.orb-id {
    position: absolute;
    left: 50%;
    top: calc(50% + min(35cqmin, 260px));
    transform: translateX(-50%);
    width: min(98cqmin, 720px);
    max-width: 96%;
    z-index: 8;
    display: none;
    pointer-events: none;
    text-align: center;
}
/* показываем только когда камера выключена (виден орб) */
.Camera:has(.videoAvatarImage[style*='block']) .orb-id {
    display: block;
    animation: c-idIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.orb-id-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.orb-id-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.25rem, 3cqmin, 1.9rem);
    letter-spacing: -0.01em;
    background: linear-gradient(110deg, #fff 0%, var(--c-node-bright) 60%, var(--c-mint) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.orb-id-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--c-ink-dim);
    padding: 5px 14px 5px 11px;
    border: 1px solid var(--c-brd);
    border-radius: 999px;
    background: rgba(110, 168, 255, 0.06);
}
.orb-id-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c-mint);
    box-shadow: 0 0 0 0 rgba(155, 231, 216, 0.6);
    animation: c-dotPulse 1.8s ease-out infinite;
}

.orb-id-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    pointer-events: auto;
}
.orb-id-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    text-align: left;
    border-radius: 18px;
    background: rgba(13, 21, 44, 0.6);
    border: 1px solid var(--c-brd);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
    animation: c-idItemIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(0.12s + var(--i) * 0.08s);
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}
.orb-id-item:hover {
    transform: translateY(-3px);
    border-color: var(--c-brd-strong);
    background: rgba(110, 168, 255, 0.14);
    box-shadow:
        0 12px 34px rgba(0, 0, 0, 0.3),
        0 0 22px rgba(110, 168, 255, 0.18);
}
.orb-id-ic {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 1.1rem;
    color: var(--c-node-bright);
    background: rgba(110, 168, 255, 0.12);
    border: 1px solid var(--c-brd);
}
.orb-id-kv {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 3px;
    line-height: 1.2;
}
.orb-id-k {
    font-family: var(--font-display);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(155, 231, 216, 0.72);
}
.orb-id-v {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--c-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes c-idIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
@keyframes c-idItemIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
@keyframes c-dotPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(155, 231, 216, 0.55);
    }
    70%,
    100% {
        box-shadow: 0 0 0 7px rgba(155, 231, 216, 0);
    }
}

/* видео-кружок (круговая раскладка) */
.videoCircle {
    box-shadow:
        0 0 0 2px rgba(110, 168, 255, 0.5),
        0 0 48px rgba(155, 231, 216, 0.22) !important;
}

/*==============================================================
# 4. НИЖНЯЯ ПАНЕЛЬ — плавающий док узлов  (#bottomButtons)
==============================================================*/

#bottomButtons {
    padding: 9px 12px !important;
    gap: 9px !important;
    border-radius: 24px !important;
    border: 1px solid var(--c-brd) !important;
    background: linear-gradient(165deg, rgba(13, 21, 44, 0.78) 0%, rgba(7, 11, 26, 0.86) 100%) !important;
    backdrop-filter: blur(24px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(160%) !important;
    box-shadow:
        0 20px 56px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(110, 168, 255, 0.12) inset,
        0 0 40px rgba(110, 168, 255, 0.08) !important;
    overflow: visible;
}

/* текучая рамка-сигнатура дока */
#bottomButtons::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1.5px;
    background: conic-gradient(
        from var(--c-ang),
        transparent 0deg,
        var(--c-node) 80deg,
        var(--c-mint) 150deg,
        transparent 240deg,
        var(--c-violet) 330deg,
        transparent 360deg
    );
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: c-borderspin 10s linear infinite;
    pointer-events: none;
    opacity: 0.55;
}

/* одиночные кнопки-узлы */
#bottomButtons > button {
    width: 52px !important;
    height: 52px !important;
    font-size: 1.2rem !important;
    color: var(--c-ink) !important;
    background: rgba(110, 168, 255, 0.08) !important;
    border: 1px solid var(--c-brd) !important;
    border-radius: 16px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
#bottomButtons > button:hover {
    background: rgba(110, 168, 255, 0.22) !important;
    border-color: var(--c-brd-strong) !important;
    box-shadow:
        0 0 26px rgba(110, 168, 255, 0.3),
        0 6px 18px rgba(0, 0, 0, 0.3) !important;
    transform: translateY(-4px) scale(1.05) !important;
}

/* капсула split-кнопок */
#bottomButtons .split-btn {
    border-radius: 18px !important;
    background: rgba(110, 168, 255, 0.06) !important;
    border: 1px solid var(--c-brd) !important;
}
#bottomButtons .split-btn > button:first-child {
    width: 52px !important;
    min-width: 52px !important;
    height: 52px !important;
    font-size: 1.2rem !important;
    color: var(--c-ink) !important;
}
#bottomButtons .split-btn .device-dropdown-toggle {
    height: 52px !important;
    border-left: 1px solid var(--c-brd) !important;
    color: var(--c-mint) !important;
}
#bottomButtons .split-btn > button:hover,
#bottomButtons .split-btn .device-dropdown-toggle:hover {
    background: rgba(110, 168, 255, 0.26) !important;
}

/* активный микрофон — мягкий пульс «в эфире» */
#bottomButtons #audioBtn:not(.fa-microphone-slash) {
    animation: c-micLive 2.6s ease-in-out infinite;
}
@keyframes c-micLive {
    0%,
    100% {
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.05),
            0 0 0 0 rgba(155, 231, 216, 0);
    }
    50% {
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.05),
            0 0 20px rgba(155, 231, 216, 0.28);
    }
}

/* кнопка выхода — коралловый узел-акцент */
#bottomButtons #leaveRoomBtn {
    color: #fff !important;
    background: linear-gradient(135deg, rgba(255, 93, 108, 0.95), rgba(225, 56, 92, 0.95)) !important;
    border: 1px solid rgba(255, 93, 108, 0.6) !important;
    box-shadow: 0 8px 24px rgba(255, 93, 108, 0.32) !important;
}
#bottomButtons #leaveRoomBtn::before {
    /* убираем красный цвет иконки от старого правила */
    color: #fff !important;
}
#bottomButtons #leaveRoomBtn:hover {
    background: linear-gradient(135deg, #ff6b78, #ef3b5e) !important;
    box-shadow:
        0 0 30px rgba(255, 93, 108, 0.5),
        0 8px 22px rgba(0, 0, 0, 0.3) !important;
    transform: translateY(-4px) scale(1.06) !important;
}

/* состояния «выключено» → коралл вместо ярко-красного */
.fa-phone-slash,
.fa-microphone-slash,
.fa-video-slash {
    color: var(--c-danger) !important;
}
#bottomButtons > button.fa-microphone-slash,
#bottomButtons > button.fa-video-slash {
    background: rgba(255, 93, 108, 0.14) !important;
    border-color: rgba(255, 93, 108, 0.42) !important;
}

/* выпадающие меню устройств */
#bottomButtons .dropup .dropdown-menu {
    border: 1px solid var(--c-brd) !important;
    border-radius: 16px !important;
    background: rgba(10, 16, 36, 0.96) !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5) !important;
}

/* счётчик участников — узловой бейдж */
#participantsCountBadge {
    background: linear-gradient(135deg, var(--c-node), var(--c-mint)) !important;
    color: #06122a !important;
    font-family: var(--font-mono) !important;
    font-weight: 700 !important;
    box-shadow: 0 0 12px rgba(110, 168, 255, 0.5);
}

/*==============================================================
# Доступность: уважение к prefers-reduced-motion
==============================================================*/
@media (prefers-reduced-motion: reduce) {
    #loadingDiv::after,
    .swal2-popup.init-modal-size::after,
    .Camera::after,
    .Screen::after,
    #bottomButtons::after,
    .loading-spinner::before,
    .loading-spinner::after,
    .spinner-ring,
    .spinner-ring::before,
    .spinner-logo,
    .videoAvatarImage,
    body::after,
    #bottomButtons #audioBtn,
    .swal2-popup.init-modal-size .swal2-confirm::after,
    .Camera,
    .Screen {
        animation: none !important;
    }
}
