/* Fonts */
@font-face {
    font-family: 'Arad';
    src: url('/fonts/Arad-Regular.woff2') format('woff2');
    font-weight: normal;
}

@font-face {
    font-family: 'Arad';
    src: url('/fonts/Arad-Bold.woff2') format('woff2');
    font-weight: bold;
}

@font-face {
    font-family: 'Arad';
    src: url('/fonts/Arad-Light.woff2') format('woff2');
    font-weight: 300;
}

@font-face {
    font-family: 'Arad';
    src: url('/fonts/Arad-SemiBold.woff2') format('woff2');
    font-weight: 600;
}

@font-face {
    font-family: 'Arad';
    src: url('/fonts/Arad-ExtraBold.woff2') format('woff2');
    font-weight: 800;
}

/* Variables */
:root {
    /* Deep ocean-teal palette */
    --bg-deep: #050510;
    --bg-mid: #0a0a1a;
    --teal-900: #042f2e;
    --teal-700: #0d9488;
    --teal-500: #14b8a6;
    --teal-400: #2dd4bf;
    --teal-300: #5eead4;
    --teal-200: #99f6e4;
    --cyan-400: #22d3ee;
    --cyan-300: #67e8f9;
    --emerald-500: #10b981;
    --emerald-400: #34d399;
    --text-primary: #f0fdfa;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --red-400: #f87171;
    --red-500: #ef4444;
    --amber-400: #fbbf24;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Liquid Glass System - Ultra Transparent */
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-bg-mid: rgba(255, 255, 255, 0.04);
    --glass-bg-strong: rgba(255, 255, 255, 0.05);
    --glass-bg-hover: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-border-light: rgba(255, 255, 255, 0.1);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    --glass-border-active: rgba(20, 184, 166, 0.5);
    --glass-blur: 16px;
    --glass-blur-strong: 24px;
    --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --glass-shadow-glow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 40px rgba(20, 184, 166, 0.04);
    --glow-intensity: 0.12;
}

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

body {
    font-family: 'Arad', sans-serif;
    background: var(--bg-deep);
    min-height: 100vh;
    color: var(--text-primary);
    direction: rtl;
    overflow: hidden;
    position: relative;
}

/* Living Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 70% 50% at 10% 10%, rgba(59, 130, 246, 0.2), transparent),
        radial-gradient(ellipse 60% 50% at 90% 80%, rgba(168, 85, 247, 0.18), transparent),
        radial-gradient(ellipse 50% 60% at 50% 50%, rgba(239, 68, 68, 0.1), transparent),
        radial-gradient(ellipse 50% 40% at 80% 20%, rgba(16, 185, 129, 0.15), transparent),
        radial-gradient(ellipse 40% 50% at 20% 70%, rgba(59, 130, 246, 0.12), transparent),
        radial-gradient(ellipse 45% 40% at 60% 90%, rgba(168, 85, 247, 0.1), transparent),
        radial-gradient(ellipse 35% 35% at 30% 30%, rgba(236, 72, 153, 0.12), transparent),
        linear-gradient(180deg, #050510 0%, #0a0a1a 30%, #0d0512 60%, #050510 100%);
    z-index: 0;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.015) 1px, transparent 0);
    background-size: 40px 40px;
    z-index: 0;
    pointer-events: none;
}

/* Background Orbs */
.bg-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    will-change: transform;
    transition: transform 0.15s ease-out;
}

.orb-1 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.4), rgba(99, 102, 241, 0.15), transparent 70%);
    top: -250px;
    right: -250px;
    opacity: 0.85;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.35), rgba(236, 72, 153, 0.1), transparent 70%);
    bottom: -200px;
    left: -200px;
    opacity: 0.75;
}

.orb-3 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.3), rgba(34, 197, 94, 0.1), transparent 70%);
    top: 35%;
    left: 35%;
    opacity: 0.65;
}

.orb-4 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.25), rgba(236, 72, 153, 0.08), transparent 70%);
    top: 15%;
    left: 5%;
    opacity: 0.55;
}

.orb-5 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.28), transparent 70%);
    bottom: 15%;
    right: 5%;
    opacity: 0.55;
}

.orb-6 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.3), rgba(139, 92, 246, 0.1), transparent 65%);
    top: 55%;
    left: -150px;
    opacity: 0.45;
}

.orb-7 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.28), transparent 70%);
    top: 8%;
    right: 25%;
    opacity: 0.5;
}

/* Screens */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* Loading/Error Container */
.name-container {
    background: rgba(8, 24, 22, 0.85);
    backdrop-filter: blur(32px) saturate(1.2);
    -webkit-backdrop-filter: blur(32px) saturate(1.2);
    padding: 52px 60px;
    border-radius: 28px;
    text-align: center;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(20, 184, 166, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(20, 184, 166, 0.15);
    position: relative;
    overflow: hidden;
}

.name-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.name-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(20, 184, 166, 0.08), transparent 60%);
    pointer-events: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.name-container h1 {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.name-container p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.instruction-message {
    max-width: 520px;
    margin: 20px auto 0 !important;
    font-size: 1rem !important;
    line-height: 2;
}

.instruction-message code {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid rgba(45, 212, 191, 0.25);
    border-radius: 6px;
    background: rgba(20, 184, 166, 0.08);
    color: var(--teal-300);
    font-family: Consolas, monospace;
    direction: ltr;
}

/* Chat Wrapper */
.chat-wrapper {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 14px;
    gap: 12px;
}

.creator-card {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 120;
}

.creator-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(8, 24, 22, 0.7);
    border: 1px solid rgba(20, 184, 166, 0.15);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: 0.25s ease;
}

.creator-link:hover {
    transform: translateY(-2px);
    border-color: rgba(20, 184, 166, 0.35);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 18px rgba(20, 184, 166, 0.12);
    background: rgba(20, 184, 166, 0.08);
}

.github-icon {
    width: 18px;
    height: 18px;
    color: var(--teal-300);
    flex-shrink: 0;
}

/* User Info Panel - Liquid Glass */
.user-info-panel {
    background: linear-gradient(
        135deg,
        rgba(20, 184, 166, 0.08) 0%,
        rgba(255, 255, 255, 0.04) 50%,
        rgba(20, 184, 166, 0.06) 100%
    );
    backdrop-filter: blur(20px) saturate(1.4) brightness(1.1);
    -webkit-backdrop-filter: blur(20px) saturate(1.4) brightness(1.1);
    border-radius: 24px;
    padding: 16px 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top-color: rgba(255, 255, 255, 0.18);
    border-left-color: rgba(255, 255, 255, 0.14);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(20, 184, 166, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(255, 255, 255, 0.04),
        inset 1px 0 0 rgba(255, 255, 255, 0.06),
        inset -1px 0 0 rgba(255, 255, 255, 0.06);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.user-info-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.03) 50%,
        transparent 100%
    );
    border-radius: 24px 24px 0 0;
    pointer-events: none;
}

.user-info-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(20, 184, 166, 0.08),
        transparent 40%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 20px;
}

.user-info-panel:hover::after {
    opacity: 1;
}

.user-info-panel:hover {
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.28);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(20, 184, 166, 0.15),
        0 0 35px rgba(20, 184, 166, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

.user-info-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.user-info-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-large {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.user-info-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name-display {
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--text-primary);
}

.gradient-line {
    height: 1px;
    background: linear-gradient(90deg, var(--teal-500), transparent);
    width: 100%;
    opacity: 0.4;
}

.connection-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    width: fit-content;
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.2);
    color: var(--teal-400);
}

.connection-badge svg {
    width: 14px;
    height: 14px;
}

.user-info-left {
    display: flex;
    align-items: center;
}

.exit-btn {
    background: rgba(8, 24, 22, 0.6);
    border: 1px solid rgba(20, 184, 166, 0.1);
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-smooth);
    padding: 8px;
    border-radius: 12px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.exit-btn svg {
    width: 18px;
    height: 18px;
}

.exit-btn:hover {
    color: var(--red-400);
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.25);
}

.user-info-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    position: relative;
    z-index: 1;
}

.connection-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.connection-info svg {
    width: 14px;
    height: 14px;
    color: var(--teal-500);
}

.server-name {
    font-weight: bold;
    color: var(--teal-400);
}

.total-users {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.total-users svg {
    width: 14px;
    height: 14px;
    color: var(--teal-500);
}

/* Participants Grid */
.participants-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    overflow-y: auto;
    padding: 4px;
    align-content: start;
}

/* Participant Card - Liquid Glass */
.participant-card {
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(
        145deg,
        rgba(20, 184, 166, 0.07) 0%,
        rgba(255, 255, 255, 0.03) 40%,
        rgba(20, 184, 166, 0.05) 100%
    );
    backdrop-filter: blur(16px) saturate(1.4) brightness(1.1);
    -webkit-backdrop-filter: blur(16px) saturate(1.4) brightness(1.1);
    padding: 14px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.15);
    border-left-color: rgba(255, 255, 255, 0.12);
    animation: slideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 12px;
    transition: transform 0.15s ease, border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    transform-style: preserve-3d;
    will-change: transform;
    overflow: hidden;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(20, 184, 166, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(255, 255, 255, 0.04),
        inset 1px 0 0 rgba(255, 255, 255, 0.05),
        inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

.participant-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.02) 60%,
        transparent 100%
    );
    border-radius: 20px 20px 0 0;
    pointer-events: none;
}

.participant-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 18px;
    background: radial-gradient(
        400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(20, 184, 166, 0.12),
        transparent 40%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.participant-card:hover::after {
    opacity: 1;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.participant-card:hover {
    background: linear-gradient(
        145deg,
        rgba(20, 184, 166, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 40%,
        rgba(20, 184, 166, 0.08) 100%
    );
    border-color: rgba(255, 255, 255, 0.18);
    border-top-color: rgba(255, 255, 255, 0.25);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(20, 184, 166, 0.15),
        0 0 30px rgba(20, 184, 166, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

.participant-avatar-container {
    position: relative;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
}

.participant-avatar {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0.35;
    transition: opacity 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.participant-avatar.speaking {
    opacity: 1;
    border-color: var(--teal-500);
    box-shadow: 0 0 20px rgba(20, 184, 166, 0.35), 0 0 40px rgba(20, 184, 166, 0.1);
}

.online-dot {
    position: absolute;
    bottom: -2px;
    left: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--teal-500);
    border: 2px solid var(--bg-deep);
    box-shadow: 0 0 8px rgba(20, 184, 166, 0.6);
}

.participant-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.participant-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.participant-voice-icon {
    display: flex;
    align-items: center;
    color: var(--teal-400);
    flex-shrink: 0;
}

.participant-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.participant-badges {
    display: flex;
    gap: 4px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 600;
}

.badge-muted {
    background: rgba(248, 113, 113, 0.1);
    color: var(--red-400);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.volume-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.volume-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--teal-500), var(--teal-300));
    border-radius: 2px;
    transition: width 0.1s ease;
    box-shadow: 0 0 6px rgba(20, 184, 166, 0.4);
}

/* Per-user volume / ignore controls */
.participant-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.user-ignore-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    padding: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(20, 184, 166, 0.12);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.user-ignore-btn svg {
    width: 13px;
    height: 13px;
    color: var(--teal-400);
}

.user-ignore-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.user-ignore-btn.active {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.3);
}

.user-ignore-btn.active svg {
    color: var(--red-400);
}

.volume-slider {
    flex: 1;
    min-width: 0;
    height: 4px;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--teal-300);
    border: none;
    box-shadow: 0 0 6px rgba(20, 184, 166, 0.5);
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--teal-300);
    border: none;
    box-shadow: 0 0 6px rgba(20, 184, 166, 0.5);
    cursor: pointer;
}

.volume-value {
    flex-shrink: 0;
    min-width: 34px;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    direction: ltr;
}

.participant-card.ignored .participant-avatar {
    filter: grayscale(0.9) brightness(0.7);
}

.participant-card.ignored .participant-name {
    color: var(--text-secondary);
    text-decoration: line-through;
}

.participant-mic {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.participant-mic svg {
    width: 15px;
    height: 15px;
    color: var(--teal-400);
}

.participant-mic.muted svg {
    color: var(--red-400);
}

/* Sound Control Bar - Liquid Glass Dock */
.sound-control-bar {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(8, 24, 22, 0.9);
    backdrop-filter: blur(28px) saturate(1.2);
    -webkit-backdrop-filter: blur(28px) saturate(1.2);
    border: 1px solid rgba(20, 184, 166, 0.15);
    border-radius: 28px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(20, 184, 166, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: var(--transition-smooth);
    overflow: hidden;
}

.sound-control-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.sound-control-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 28px;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(20, 184, 166, 0.1),
        transparent 50%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sound-control-bar:hover::after {
    opacity: 1;
}

.sound-control-bar:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.5),
        0 0 50px rgba(20, 184, 166, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Global volume control inside the dock */
.master-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 50px;
    padding: 0 14px;
    border-radius: 16px;
    background: rgba(8, 24, 22, 0.6);
    border: 1px solid rgba(20, 184, 166, 0.1);
}

.master-volume-control svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.master-volume-control .volume-slider {
    flex: none;
    width: 96px;
}

.master-volume-value {
    flex-shrink: 0;
    min-width: 36px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    direction: ltr;
}

/* Control Item */
.control-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: rgba(8, 24, 22, 0.6);
    border: 1px solid rgba(20, 184, 166, 0.1);
    overflow: hidden;
}

.control-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    background: radial-gradient(
        200px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 255, 255, 0.1),
        transparent 40%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.control-item:hover::after {
    opacity: 1;
}

.control-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.control-item.locked {
    opacity: 0.55;
    cursor: not-allowed;
}

.control-item svg {
    width: 22px;
    height: 22px;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    position: relative;
    z-index: 1;
}

.control-item:hover svg {
    color: var(--text-primary);
}

.control-item.muted svg {
    color: var(--red-400);
}

/* Mic button - center, larger */
.mic-control {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    background: rgba(8, 24, 22, 0.7);
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.mic-control::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    background: radial-gradient(
        200px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(20, 184, 166, 0.2),
        transparent 40%
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.mic-control:hover::after {
    opacity: 1;
}

.mic-control:hover {
    background: rgba(20, 184, 166, 0.1);
    border-color: rgba(20, 184, 166, 0.3);
    box-shadow: 0 0 20px rgba(20, 184, 166, 0.15);
}

.mic-control svg {
    width: 28px;
    height: 28px;
    color: var(--teal-400);
}

.mic-control:hover svg {
    color: var(--teal-300);
}

.mic-control.muted {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.2);
}

.mic-control.muted:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.35);
    box-shadow: 0 0 24px rgba(248, 113, 113, 0.15);
}

.mic-control.muted svg {
    color: var(--red-400);
}

/* Disconnect button */
.disconnect-btn svg {
    color: var(--text-muted);
}

.disconnect-btn:hover {
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.2);
}

.disconnect-btn:hover svg {
    color: var(--red-400);
}

/* Sound Animation */
.sound-animation {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--teal-400);
    opacity: 0;
    pointer-events: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.sound-animation.active {
    animation: soundPulse 0.5s infinite ease;
}

@keyframes soundPulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(5); opacity: 0; }
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

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

/* Loading Spinner */
.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    border-top-color: var(--teal-400);
    border-right-color: var(--teal-500);
    animation: spin 1s ease-in-out infinite;
    margin: 24px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading-status {
    color: var(--text-secondary);
    font-size: 14px;
}

#error-screen {
    display: none;
}

#error-screen.active {
    display: flex;
}

#retry-btn {
    margin-top: 15px;
    padding: 12px 28px;
    background: rgba(8, 24, 22, 0.7);
    color: var(--text-primary);
    border: 1px solid rgba(20, 184, 166, 0.15);
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Arad', sans-serif;
    font-size: 0.9rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
}

#retry-btn:hover {
    background: rgba(20, 184, 166, 0.1);
    border-color: rgba(20, 184, 166, 0.3);
}

/* Ripple Effect */
.ripple-container {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out;
    pointer-events: none;
    z-index: 0;
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .chat-wrapper {
        padding: 8px;
        gap: 8px;
    }

    .user-info-panel {
        padding: 10px 14px;
    }

    .user-avatar-large {
        width: 36px;
        height: 36px;
    }

    .participants-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 8px;
    }

    .participant-card {
        padding: 10px 12px;
    }

    .participant-avatar-container {
        width: 40px;
        height: 40px;
    }

    .participant-avatar {
        width: 40px;
        height: 40px;
    }

    .sound-control-bar {
        padding: 8px 14px;
        gap: 8px;
    }

    .control-item {
        width: 46px;
        height: 46px;
    }

    .mic-control {
        width: 54px;
        height: 54px;
    }

    .master-volume-control {
        height: 46px;
        padding: 0 10px;
        gap: 6px;
    }

    .master-volume-control .volume-slider {
        width: 64px;
    }

    /* Icon-only creator button so it never overlaps the control bar */
    .creator-card {
        bottom: 18px;
        right: 12px;
    }

    .creator-link {
        padding: 10px;
        border-radius: 50%;
    }

    .creator-link span {
        display: none;
    }
}

@media (max-width: 480px) {
    .name-container {
        margin: 16px;
        padding: 36px;
    }

    .name-container h1 {
        font-size: 1.5rem;
    }

    .participants-grid {
        grid-template-columns: 1fr;
    }

    .sound-control-bar {
        bottom: 18px;
        padding: 6px 10px;
        gap: 5px;
        border-radius: 22px;
    }

    .control-item {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .mic-control {
        width: 50px;
        height: 50px;
        border-radius: 16px;
    }

    .master-volume-control {
        height: 42px;
        padding: 0 8px;
        gap: 5px;
        border-radius: 14px;
    }

    .master-volume-control svg {
        display: none;
    }

    .master-volume-control .volume-slider {
        width: 56px;
    }

    .master-volume-value {
        min-width: 32px;
        font-size: 0.65rem;
    }

    /* Keep the creator icon clear of the wider control bar */
    .creator-card {
        bottom: 80px;
    }
}

/* GPU Acceleration */
.participant-card,
.orb,
.sound-control-bar,
.user-info-panel {
    will-change: transform;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .orb {
        display: none;
    }

    .participant-card {
        transform: none !important;
    }
}
