/* ==============================================
   LIVE ROOM - PREMIUM IMMERSIVE VISUALS
   ============================================== */

/* 1. Dynamic Ambient Background */
.live-room-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(125deg, #0f0f14 0%, #1a1a2e 40%, #16213e 100%);
    overflow: hidden;
}

.live-room-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(76, 29, 149, 0.15), transparent 60%),
        radial-gradient(circle at 80% 20%, rgba(243, 194, 106, 0.1), transparent 50%);
    animation: ambientShift 20s ease-in-out infinite alternate;
    opacity: 0.6;
}

@keyframes ambientShift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-50px, -20px) scale(1.1);
    }
}

/* 2. Active Speaker Glow */
.participant {
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
}

.participant.speaking {
    transform: scale(1.15);
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 2px rgba(243, 194, 106, 0.6),
        0 0 15px rgba(243, 194, 106, 0.4),
        0 0 30px rgba(243, 194, 106, 0.2);
    z-index: 10;
}

.participant.speaking::after {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    bottom: -4px;
    left: -4px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    opacity: 0;
    animation: ripple 1.5s infinite cubic-bezier(0, 0.2, 0.8, 1);
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* 3. Floating Reactions (Particles) */
.floating-reaction {
    position: fixed;
    pointer-events: none;
    animation: floatUp 2s ease-out forwards;
    z-index: 9999;
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(0.5) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
        transform: translateY(-20px) scale(1.2) rotate(10deg);
    }

    100% {
        transform: translateY(-150px) scale(1) rotate(-20deg);
        opacity: 0;
    }
}

/* 4. Mini Waveform in Header */
.mini-waveform {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 16px;
    margin-left: 8px;
    opacity: 0.6;
}

.mini-bar {
    width: 2px;
    height: 100%;
    background: var(--gold);
    border-radius: 1px;
    animation: miniWave 1s ease-in-out infinite;
}

.mini-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.mini-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.mini-bar:nth-child(4) {
    animation-delay: 0.3s;
}

@keyframes miniWave {

    0%,
    100% {
        height: 20%;
        opacity: 0.5;
    }

    50% {
        height: 100%;
        opacity: 1;
    }
}

/* 5. Premium Toast Notification */
.premium-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(20, 20, 30, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.premium-toast.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
    cursor: pointer;
}

.premium-toast i {
    color: var(--gold);
}

/* Warn toast — amber accent */
.premium-toast.toast-warn {
    border-color: rgba(255, 193, 7, 0.4);
}

.premium-toast.toast-warn i {
    color: #ffc107;
}

/* Error toast — red accent */
.premium-toast.toast-error {
    border-color: rgba(255, 59, 48, 0.4);
}

.premium-toast.toast-error i {
    color: #ff3b30;
}

/* Microphone Button */
.mic-btn {
    width: 48px;

    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.mic-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.mic-btn.recording {
    background: rgba(255, 59, 48, 0.2);
    border-color: rgba(255, 59, 48, 0.5);
    color: #ff3b30;
    animation: recording-pulse 1s infinite;
}

@keyframes recording-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(255, 59, 48, 0);
    }
}

/* Live Mode Visualizer Overlay */
.live-visualizer-overlay {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 4px;
    height: 120px;
    z-index: 50;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.live-visualizer-overlay.hidden {
    display: none;
}

.live-visualizer-overlay .v-bar {
    width: 6px;
    height: 10px;
    background: linear-gradient(to top, var(--pink) 0%, var(--gold) 100%);
    border-radius: 3px;
    box-shadow: 0 0 15px rgba(243, 194, 106, 0.3);
    transition: height 0.3s ease;
}

/* organic staggered animation */
.live-visualizer-overlay.is-speaking .v-bar {
    animation: live-bounce 1s ease-in-out infinite;
}

/* Symmetrical height distribution + staggered delay */
.live-visualizer-overlay .v-bar:nth-child(1),
.live-visualizer-overlay .v-bar:nth-child(14) {
    height: 15px;
    animation-duration: 1.1s;
}

.live-visualizer-overlay .v-bar:nth-child(2),
.live-visualizer-overlay .v-bar:nth-child(13) {
    height: 25px;
    animation-duration: 0.9s;
    animation-delay: 0.1s;
}

.live-visualizer-overlay .v-bar:nth-child(3),
.live-visualizer-overlay .v-bar:nth-child(12) {
    height: 40px;
    animation-duration: 1.3s;
    animation-delay: 0.2s;
}

.live-visualizer-overlay .v-bar:nth-child(4),
.live-visualizer-overlay .v-bar:nth-child(11) {
    height: 55px;
    animation-duration: 1.0s;
    animation-delay: 0.3s;
}

.live-visualizer-overlay .v-bar:nth-child(5),
.live-visualizer-overlay .v-bar:nth-child(10) {
    height: 70px;
    animation-duration: 1.2s;
    animation-delay: 0.4s;
}

.live-visualizer-overlay .v-bar:nth-child(6),
.live-visualizer-overlay .v-bar:nth-child(9) {
    height: 85px;
    animation-duration: 0.8s;
    animation-delay: 0.5s;
}

.live-visualizer-overlay .v-bar:nth-child(7),
.live-visualizer-overlay .v-bar:nth-child(8) {
    height: 100px;
    animation-duration: 1.4s;
    animation-delay: 0.6s;
}

@keyframes live-bounce {

    0%,
    100% {
        transform: scaleY(1);
        opacity: 0.7;
    }

    50% {
        transform: scaleY(1.5);
        opacity: 1;
        filter: brightness(1.2);
    }
}

/* ==============================================
   CHARACTER SELECTION GRID
   ============================================== */
.character-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 4px;
    margin-bottom: 12px;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
}

.character-grid::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome */
}