.mic_premium_container {
    position: fixed;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none;
    display: flex;
    justify-content: center;
    width: auto;
    transition: top 0.3s ease; /* Smooth transition when moving */
}

body.battle_active .mic_premium_container {
    top: 100px;
}

/* Fix for chat layout height calculation */
#chat_toping {
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    min-height: 0 !important;
}

.mic_bar_dock {
    background: #fff;
    border: 1px solid #1a73e8;
    border-radius: 50px;
    padding: 2px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    position: relative;
    height: 48px;
    min-width: 60px;
}

.mic_main_btn {
    width: 34px;
    height: 34px;
    background: #1a73e8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    position: relative;
}

.mic_has_request::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #ff0000;
    border-radius: 50%;
    border: 2px solid #fff;
}

.mic_slots_flex {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mic_slot_item {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mic_slot_empty {
    width: 34px;
    height: 34px;
    background: #f0f7ff;
    border: 1px solid #1a73e8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a73e8;
}

.mic_slot_empty i {
    font-size: 14px;
}

.mic_slot_index {
    position: absolute;
    top: -5px;
    left: -5px;
    font-size: 8px;
    color: #1a73e8;
    font-weight: 700;
    background: #fff;
    padding: 0 4px;
    border-radius: 10px;
    border: 1px solid #1a73e8;
    z-index: 10;
}

.mic_slot_name {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    color: #333;
    font-weight: bold;
    max-width: 50px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    text-align: center;
    background: rgba(255,255,255,0.8);
    padding: 1px 4px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mic_slot_avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #1a73e8;
    padding: 1px;
    background: #fff;
}

.mic_slot_status {
    position: absolute;
    top: -1px;
    right: -1px;
    background: #e74c3c;
    color: white;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    border: 1px solid #fff;
    z-index: 10;
}

.mic_talking {
    box-shadow: 0 0 10px #2ecc71;
    border-color: #2ecc71 !important;
}

.mic_toggle_btn {
    width: 24px;
    height: 24px;
    background: #1a73e8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    border: 2px solid #fff;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.mic_toggle_btn:hover {
    background: #1557b0;
}

.mic_bar_dock.collapsed .mic_slots_flex,
.mic_bar_dock.collapsed .mic_main_btn {
    display: none;
}

.mic_bar_dock.collapsed {
    width: 40px;
    height: 20px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.mic_toggle_btn.collapsed {
    transform: translateX(-50%) rotate(180deg);
}

.mic_music_info {
    position: absolute;
    bottom: -46px; /* Moved below the name */
    background: rgba(26, 115, 232, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 10px;
    color: #fff;
    white-space: nowrap;
    z-index: 50;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255,255,255,0.25);
    max-width: 140px;
    overflow: hidden;
    animation: mic-badge-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 6px;
}

@keyframes mic-badge-in {
    from { transform: scale(0.6) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.mic_music_info marquee {
    width: 100%;
}

.mic_music_info i {
    color: #ffd700;
    animation: music-spin 3s linear infinite, music-glow 1.5s ease-in-out infinite alternate;
}

@keyframes music-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes music-glow {
    from { text-shadow: 0 0 2px #fff; }
    to { text-shadow: 0 0 8px #ffd700, 0 0 12px #ffd700; }
}

#mic_yt_players {
    position: absolute;
    width: 1px;
    height: 1px;
    left: -10000px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Room Audio Mute Button Styles */
.mic_room_mute_btn {
    width: 34px;
    height: 34px;
    background: #f0f7ff;
    border: 1px solid #1a73e8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a73e8;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    margin-right: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.mic_room_mute_btn:hover {
    background: #e1f0ff;
    transform: scale(1.05);
}

.mic_room_mute_btn.mic_room_muted {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.4);
}

.mic_room_mute_btn.mic_room_muted:hover {
    background: #c0392b;
}

.mic_room_mute_btn i {
    font-size: 14px;
}

/* --- NEW MIC BATTLE PREMIUM STYLES --- */

.mic_battle_timer_container {
    position: fixed;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.mic_battle_timer {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 65, 108, 0.5);
    color: #fff;
    padding: 4px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4), 0 0 15px rgba(255, 65, 108, 0.3);
    pointer-events: auto;
    animation: battle-timer-pulse 2s infinite ease-in-out;
}

@keyframes battle-timer-pulse {
    0% { transform: scale(1); box-shadow: 0 5px 20px rgba(0,0,0,0.4), 0 0 10px rgba(255, 65, 108, 0.3); }
    50% { transform: scale(1.03); box-shadow: 0 8px 25px rgba(0,0,0,0.5), 0 0 20px rgba(255, 65, 108, 0.5); }
    100% { transform: scale(1); box-shadow: 0 5px 20px rgba(0,0,0,0.4), 0 0 10px rgba(255, 65, 108, 0.3); }
}

.battle_timer_val {
    font-family: 'Orbitron', 'Roboto Mono', monospace;
    font-size: 16px;
    color: #ff416c;
    text-shadow: 0 0 10px rgba(255, 65, 108, 0.8);
}

.mic_slot_score {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%) translateZ(0);
    background: linear-gradient(135deg, #ff416c, #ff9b05);
    color: #fff;
    font-weight: 800;
    font-size: 11px;
    padding: 2px 12px;
    border-radius: 15px;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 150;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s, box-shadow 0.3s;
    will-change: transform;
    backface-visibility: hidden;
    min-width: 40px;
    text-align: center;
}

.score_pulse {
    transform: translateX(-50%) scale(1.6) translateZ(0);
    background: #ff416c;
    color: #fff;
    box-shadow: 0 0 20px #ff416c;
}

/* Winner Card Styles */
.mic_battle_winner_msg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    width: 85%;
    max-width: 320px;
    padding: 30px;
    border-radius: 25px;
    border: 2px solid #ffd700;
    text-align: center;
    z-index: 99999;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
    animation: winner-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes winner-pop {
    from { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.winner_crown {
    font-size: 50px;
    margin-bottom: 15px;
    display: block;
    animation: crown-float 2s infinite ease-in-out;
}

@keyframes crown-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(10deg); }
}

/* Mobile specific fixes */
@media (max-width: 768px) {
    .mic_battle_timer_container {
        top: 52px;
        left: 50%;
        transform: translateX(-50%);
    }
    .mic_premium_container {
        top: 55px;
        transition: top 0.3s ease;
    }
    body.battle_active .mic_premium_container {
        top: 95px;
    }
    .mic_battle_timer {
        padding: 2px 15px;
        font-size: 11px;
    }
    .battle_timer_val {
        font-size: 14px;
    }
}

/* --- DOUBLE X2 MODE STYLES --- */
.mic_battle_timer.double_active {
    border-color: #ffd700 !important;
    background: linear-gradient(135deg, #ff416c, #ff9b05) !important;
    animation: double-pulse 0.5s infinite alternate !important;
}

@keyframes double-pulse {
    from { box-shadow: 0 0 10px #ffd700; transform: scale(1); }
    to { box-shadow: 0 0 25px #ff416c; transform: scale(1.1); }
}

.double_mode_badge {
    position: absolute;
    top: -25px; /* Positioned at top to avoid overlap */
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(to bottom, #ffd700, #ff9b05);
    color: #000;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 12px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    animation: bounce-x2 0.5s infinite alternate;
    z-index: 2100;
    text-transform: uppercase;
    border: 1px solid #fff;
    white-space: nowrap;
}

@keyframes bounce-x2 {
    from { transform: translateY(0) translateX(-50%); }
    to { transform: translateY(-3px) translateX(-50%); }
}

/* Floating X2 Animation for gifts */
.floating_x2 {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%) translateZ(0);
    font-size: 32px;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 15px #ff416c, 2px 2px 0 #000;
    z-index: 1000;
    pointer-events: none;
    will-change: transform, opacity;
    backface-visibility: hidden;
    animation: float-up-x2 1.5s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes float-up-x2 {
    0% { transform: translateX(-50%) scale(0.3) translateZ(0); opacity: 0; }
    30% { transform: translateX(-50%) scale(1.8) translateZ(0); opacity: 1; }
    100% { transform: translateX(-50%) translateY(-100px) scale(1) translateZ(0); opacity: 0; }
}

/* Golden Mic Premium Styling for ID 1 */
.golden_mic_slot {
    position: relative;
    border: 2px solid transparent !important;
    background: linear-gradient(#2c3e50, #1a252f) padding-box,
                linear-gradient(135deg, #ffe066, #f5b041, #ffd700, #f39c12) border-box !important;
    background-size: 200% 200% !important;
    animation: goldShimmer 4s ease infinite !important;
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.5), inset 0 0 8px rgba(255, 215, 0, 0.3) !important;
    border-radius: 12px;
}

@keyframes goldShimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Conic Gold Glow on Avatar Border for ID 1 */
.golden_mic_slot .mic_slot_avatar {
    border: 2px solid transparent !important;
    background: linear-gradient(#111, #111) padding-box,
                linear-gradient(to right, #ffe259, #ffa751) border-box !important;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.7) !important;
    transform: scale(1.05) translateZ(0) !important;
    will-change: transform;
}

/* Floating Gold Crown styling */
.golden_mic_crown {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    animation: crownFloat 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes crownFloat {
    0% { top: -16px; transform: translateX(-50%) rotate(0deg); }
    50% { top: -21px; transform: translateX(-50%) rotate(3deg); }
    100% { top: -16px; transform: translateX(-50%) rotate(0deg); }
}

/* Golden text gradient for ID 1 name */
.golden_mic_slot .mic_slot_name {
    background: linear-gradient(to right, #ffe259, #ffa751) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    font-weight: bold !important;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3) !important;
}

/* Glistening gold dust particle effects */
.golden_dust_container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.golden_dust_container span {
    position: absolute;
    display: block;
    width: 4px;
    height: 4px;
    background: #ffd700;
    border-radius: 50%;
    opacity: 0;
    animation: goldDustRise 3s infinite linear;
}

/* Varied durations and delay for particle organic flow */
.golden_dust_container span:nth-child(1) { left: 15%; animation-duration: 2.5s; animation-delay: 0.2s; }
.golden_dust_container span:nth-child(2) { left: 40%; animation-duration: 3s; animation-delay: 0.8s; }
.golden_dust_container span:nth-child(3) { left: 70%; animation-duration: 2.8s; animation-delay: 1.4s; }
.golden_dust_container span:nth-child(4) { left: 85%; animation-duration: 3.2s; animation-delay: 0.5s; }
.golden_dust_container span:nth-child(5) { left: 55%; animation-duration: 2.7s; animation-delay: 1.9s; }

@keyframes goldDustRise {
    0% {
        top: 100%;
        opacity: 0;
        transform: scale(0.5) translateX(0);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.2) translateX(5px);
    }
    100% {
        top: -10%;
        opacity: 0;
        transform: scale(0.3) translateX(-5px);
    }
}