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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #0f0f23 100%);
    color: #e5e7eb;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism background orbs */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}

body::before {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #3b82f6, #8b5cf6);
    top: -100px;
    left: -100px;
    animation: floatOrb1 15s ease-in-out infinite;
}

body::after {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #8b5cf6, #ec4899);
    bottom: -100px;
    right: -100px;
    animation: floatOrb2 18s ease-in-out infinite;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(100px, 50px) scale(1.1); }
    66% { transform: translate(50px, 100px) scale(0.95); }
}

@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-80px, -60px) scale(1.05); }
    66% { transform: translate(-60px, -100px) scale(0.9); }
}

/* ====== MAIN PAGE ====== */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.logo h1 {
    font-size: 3rem;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.3));
}

.subtitle {
    color: #94a3b8;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 6px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(139, 92, 246, 0.8));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.tab:not(.active):hover {
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.08);
}

.tab-content {
    display: none;
    width: 100%;
}

.tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #cbd5e1;
}

input[type="text"] {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

input[type="text"]:focus {
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), 0 4px 20px rgba(59, 130, 246, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

input[type="text"]::placeholder {
    color: #64748b;
}

.btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(99, 102, 241, 0.9));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(79, 70, 229, 0.95));
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-small {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
}

.btn-small:hover {
    color: #e5e7eb;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn.active {
    background: #10b981 !important;
}

.btn.active:hover {
    background: #059669 !important;
}

.btn-copy-room, .btn-share-room {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

.btn-copy-room:hover, .btn-share-room:hover {
    background: rgba(59, 130, 246, 0.3);
    color: #fff;
}

.btn-copy-room.copied {
    background: rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
}

.quick-join {
    margin-top: 40px;
    text-align: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.quick-join h3 {
    color: #9ca3af;
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quick-join p {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 6px;
}

.quick-join code {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 14px;
    letter-spacing: 1px;
}

/* ====== ROOM PAGE ====== */
.room-code-bar {
    background: rgba(59, 130, 246, 0.15);
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
    padding: 6px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    flex-wrap: wrap;
    gap: 4px;
}

.room-code-bar .room-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.room-code-bar code {
    background: rgba(59, 130, 246, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
}

.btn-copy-room {
    background: rgba(59, 130, 246, 0.4);
    border: 1px solid rgba(59, 130, 246, 0.6);
    color: #93c5fd;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.btn-copy-room:hover {
    background: rgba(59, 130, 246, 0.6);
    color: #fff;
}

.btn-copy-room.copied {
    background: rgba(16, 185, 129, 0.4);
    border-color: rgba(16, 185, 129, 0.6);
    color: #6ee7b7;
}

.btn-share-room {
    background: rgba(139, 92, 246, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.6);
    color: #c4b5fd;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.btn-share-room:hover {
    background: rgba(139, 92, 246, 0.6);
    color: #fff;
}

.participants-count {
    color: #9ca3af;
    font-size: 13px;
}

/* Видео-сетка (для screen share) */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 12px;
    padding: 12px;
    flex: 1;
    overflow-y: auto;
}

.video-grid.single-view {
    grid-template-columns: 1fr;
}

.video-container {
    position: relative;
    background: #1a1a2e;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    -webkit-playsinline: true;
    playsinline: true;
}

.video-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
}

/* Кнопка toggle видео */
.video-toggle-btn {
    position: absolute;
    top: 8px;
    right: 44px;
    background: rgba(0,0,0,0.6);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
    z-index: 10;
}

.video-toggle-btn:hover {
    background: rgba(59, 130, 246, 0.8);
    transform: scale(1.1);
}

.video-toggle-btn:active {
    transform: scale(0.95);
}

/* Thumbnail заглушка когда видео скрыто */
.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 48px;
    pointer-events: none;
}

/* Панель чата */
.chat-panel {
    width: 300px;
    background: #1a1a2e;
    border-left: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-panel.collapsed {
    width: 0;
    overflow: hidden;
    border: none;
}

.chat-header {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.chat-message {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.chat-message .sender {
    color: #60a5fa;
    font-weight: 600;
}

.chat-message .time {
    color: #6b7280;
    font-size: 11px;
}

.chat-message.system {
    color: #9ca3af;
    font-style: italic;
}

.chat-input {
    display: flex;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: #fff;
    outline: none;
}

.chat-input button {
    padding: 10px 16px;
    background: #3b82f6;
    color: #fff;
    border: none;
    cursor: pointer;
}

    background: #2563eb;
}

/* Макет */
.layout {
    display: flex;
    height: calc(100vh - 120px);
}

.layout.with-chat {
    flex-direction: row;
}

.layout.with-chat .video-grid {
    flex: 1;
}

/* ====== CONTROLS BAR ====== */
.controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(15, 15, 35, 0.6);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
}

.controls::-webkit-scrollbar {
    display: none;
}

/* Каждая пара кнопка+label — колонка, label СТРОГО под кнопкой */
.control-btn-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.control-label {
    font-size: 10px;
    color: #9ca3af;
    text-align: center;
    white-space: nowrap;
    user-select: none;
}

/* Обёртка для кнопки микрофона + стрелка устройств — label вне группы, под всей группой */
.mic-btn-wrapper {
    display: flex;
    align-items: center;
    gap: 2px;
}

.mic-group {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
}

/* Кнопка-стрелка выбора устройств */
.btn-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(107, 114, 128, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(107, 114, 128, 0.4);
    color: #d1d5db;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-arrow:hover {
    background: rgba(107, 114, 128, 0.4);
    border-color: rgba(107, 114, 128, 0.7);
    color: #fff;
    transform: scale(1.1);
}

.btn-arrow:active {
    transform: scale(0.95);
}

/* Основные кнопки управления — компактные круглые, БЕЗ текста внутри */
.controls .btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    max-width: 48px;
    flex: 0 0 auto;
    padding: 0;
    font-size: 16px;
    font-weight: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Иконка в кнопке — всегда по центру */
.controls .btn .fa {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

.controls .btn:hover {
    background: rgba(51, 65, 85, 0.8);
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.controls .btn:active {
    transform: scale(0.95);
}

.controls .btn.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.7), rgba(5, 150, 105, 0.7)) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: #6ee7b7 !important;
    border-color: rgba(16, 185, 129, 0.6) !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.controls .btn.active:hover {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.8), rgba(4, 120, 87, 0.8)) !important;
}

.controls .btn.danger {
    background: rgba(127, 29, 29, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(220, 38, 38, 0.4);
    color: #fca5a5;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.2);
}

.controls .btn.danger:hover {
    background: rgba(153, 27, 27, 0.8);
    border-color: rgba(239, 68, 68, 0.6);
    transform: scale(1.12);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.3);
}

.controls .btn.danger:active {
    transform: scale(0.95);
}

.controls .btn.muted-active {
    background: rgba(239, 68, 68, 0.4) !important;
    border-color: rgba(239, 68, 68, 0.6) !important;
    color: #fca5a5 !important;
}

.controls .btn.muted-active:hover {
    background: rgba(239, 68, 68, 0.6) !important;
    border-color: rgba(239, 68, 68, 0.8) !important;
    color: #fff !important;
}

.controls .btn.muted-active.danger {
    background: #7f1d1d !important;
    border-color: #dc2626 !important;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .chat-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        height: 70vh;
        z-index: 1000;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 20px 20px 0 0;
        transition: transform 0.3s ease;
        transform: translateY(100%);
        overflow: hidden;
        background: rgba(26, 26, 46, 0.95);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
    }
    .chat-panel:not(.collapsed) {
        transform: translateY(0);
    }
    .chat-panel.collapsed {
        transform: translateY(100%);
        pointer-events: none;
    }
    .chat-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 999;
    }
    .video-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile controls — УВЕЛИЧЕННЫЕ кнопки с glassmorphism */
    .controls {
        gap: 8px;
        padding: 12px 8px;
        flex-wrap: nowrap;
        justify-content: center;
        background: rgba(15, 15, 35, 0.8);
        backdrop-filter: blur(40px);
        -webkit-backdrop-filter: blur(40px);
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
        -webkit-overflow-scrolling: touch;
    }

    /* На мобильных каждая пара кнопка+label — колонка */
    .control-btn-wrap,
    #reactionBtnWrapper {
        flex-direction: column !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .control-label {
        font-size: 11px;
        padding: 0 2px;
        margin-top: 4px;
        color: #cbd5e1;
        font-weight: 500;
    }

    .btn-arrow {
        width: 44px !important;
        height: 44px !important;
        background: rgba(107, 114, 128, 0.25);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border: 1px solid rgba(107, 114, 128, 0.5);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    }

    .btn-arrow:hover {
        background: rgba(107, 114, 128, 0.45);
    }

    /* УВЕЛИЧЕННЫЕ кнопки на мобильных */
    .controls .btn {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        max-width: 50px !important;
        flex: none;
        padding: 0;
        font-size: 22px !important;
        background: rgba(30, 41, 59, 0.7) !important;
        backdrop-filter: blur(25px) !important;
        -webkit-backdrop-filter: blur(25px) !important;
        border: 2px solid rgba(255, 255, 255, 0.15) !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
		 flex-wrap: wrap;
    }

    .controls .btn .fa {
        font-size: 22px !important;
    }

    .controls .btn:hover {
        background: rgba(51, 65, 85, 0.9) !important;
        border-color: rgba(255, 255, 255, 0.3) !important;
        transform: scale(1.15) !important;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4) !important;
    }

    .controls .btn:active {
        transform: scale(0.95) !important;
    }

    .controls .btn.active {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.8), rgba(5, 150, 105, 0.8)) !important;
        border-color: rgba(16, 185, 129, 0.7) !important;
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.4) !important;
    }

    .controls .btn.danger {
        background: rgba(127, 29, 29, 0.7) !important;
        border: 2px solid rgba(220, 38, 38, 0.5) !important;
        box-shadow: 0 8px 24px rgba(220, 38, 38, 0.3) !important;
    }

    .controls .btn.danger:hover {
        background: rgba(153, 27, 27, 0.9) !important;
        border-color: rgba(239, 68, 68, 0.7) !important;
        box-shadow: 0 12px 32px rgba(220, 38, 38, 0.4) !important;
    }

    .room-code-bar {
        padding: 6px 12px;
        font-size: 12px;
        background: rgba(59, 130, 246, 0.2);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(59, 130, 246, 0.4);
    }

    .room-code-bar code {
        font-size: 13px;
        padding: 3px 8px;
    }

    .btn-copy-room, .btn-share-room {
        padding: 4px 10px;
        font-size: 12px;
        border-radius: 8px;
    }

    .participants-count {
        font-size: 12px;
    }
}

@media (max-width: 400px) {
    .controls {
        gap: 6px;
        padding: 6px 2px;
    }
    .btn-arrow {
        width: 28px;
        height: 28px;
    }
    .controls .btn {
        width: 64px;
        height: 64px;
        min-width: 0;
        max-width: none;
        flex: none;
        padding: 7px 3px;
        font-size: 8.5px;
        gap: 2px;
    }
    .controls .btn .fa {
        font-size: 14px;
    }
}

/* ==================== CHAT CLOSE BUTTON ==================== */
.chat-close-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 20px;
    padding: 6px 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}
.chat-close-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

/* ==================== SCREEN PREVIEW ==================== */
.screen-preview {
    position: fixed;
    bottom: 70px;
    right: 16px;
    width: 180px;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #3b82f6;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    background: #000;
}
.screen-preview video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    -webkit-playsinline: true;
    playsinline: true;
}
.screen-preview-label {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(59, 130, 246, 0.8);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

/* ==================== MOBILE CHAT ==================== */
@media (max-width: 768px) {
    .chat-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        height: 70vh;
        z-index: 1000;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.1);
        border-radius: 16px 16px 0 0;
        transition: transform 0.3s ease;
        transform: translateY(100%);
        overflow: hidden;
    }
    .chat-panel:not(.collapsed) {
        transform: translateY(0);
    }
    .chat-panel.collapsed {
        transform: translateY(100%);
        pointer-events: none;
    }
    .chat-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    .screen-preview {
        width: 120px;
        bottom: 60px;
        right: 8px;
    }
}

/* ==================== RETRY BUTTON ==================== */
.retry-btn {
    font-size: 11px;
    white-space: nowrap;
}

/* ==================== AUTO-TRIGGER MIC BUTTON ANIMATION ==================== */
.btn.auto-trigger {
    animation: autoPulse 2s ease-in-out infinite;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

@keyframes autoPulse {
    0%, 100% {
        background: #1e293b;
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.2);
    }
    50% {
        background: #1e3a5f;
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
    }
}

.btn.auto-trigger:hover {
    animation: none;
    background: #334155;
}
/* ==================== ICON STYLES FOR FAULTLESS DISPLAY ==================== */

/* Participant panel icons */
.participant-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.participant-item.muted .mic-icon {
    color: #ef4444;
}

.participant-item.no-cam .cam-icon {
    color: #6b7280;
}

/* Panel header icons */
.participants-header span i,
.chat-header span i {
    margin-right: 8px;
    color: #93c5fd;
}

/* Chat close button icons (FontAwesome) */
.chat-close-btn i {
    font-size: 16px !important;
}

/* System message icons in chat */
.chat-message.system i {
    margin-right: 4px;
    color: #9ca3af;
}

/* Device manager panel icons */
#devicePanel h3 i,
#devicePanel h4 i {
    margin-right: 8px;
    color: #93c5fd;
}

#devicePanel button i {
    margin-right: 6px;
}

/* Option elements with icons (device select dropdowns) */
#micSelect option,
#speakerSelect option {
    padding-left: 4px;
}

/* Button icon alignment in controls */
.controls .btn i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Waiting screen icon */
.waiting-screen i {
    font-size: 48px !important;
    color: #3b82f6 !important;
}
/* ====== EMOJI PICKER IN CHAT ====== */
.chat-input {
    display: flex;
    border-top: 1px solid rgba(255,255,255,0.1);
    position: relative; /* для позиционирования picker */
}

.emoji-toggle-btn {
    padding: 10px 14px;
    background: transparent;
    color: #9ca3af;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.emoji-toggle-btn:hover {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

.emoji-picker {
    position: absolute;
    bottom: calc(100% + 8px); /* над чат-панелью */
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: rgba(15, 15, 35, 0.97);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 8px 10px;
    display: none; /* скрыт по умолчанию */
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 9999 !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    min-width: 240px;
}

/* Показываем picker когда родитель активен */
.chat-input:focus-within .emoji-picker {
    display: flex !important;
    transform: translateX(-50%) scale(1);
}

.emoji-picker span {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s ease;
    user-select: none;
}

.emoji-picker span:hover {
    background: rgba(255,255,255,0.15);
    transform: scale(1.3);
}

.emoji-picker span:active {
    transform: scale(0.9);
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .chat-input:focus-within .emoji-picker {
        left: auto;
        right: 10px;
        bottom: calc(100% + 8px);
        transform: scale(0.9);
        min-width: 220px;
    }
}

@media (max-width: 400px) {
    .emoji-picker span {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}
