/* Позиции через % контейнера — не прыгают от адресной строки (dvh) */
@keyframes float {
    0% {
        top: 110%;
        transform: translateX(0px) var(--initial-scale, scale(1));
        opacity: 0;
    }
    3% {
        top: 100%;
        transform: translateX(0px) var(--initial-scale, scale(1));
        opacity: 0.6;
    }
    10% {
        top: 90%;
        transform: translateX(5px);
        opacity: 0.6;
    }
    20% {
        top: 80%;
        transform: translateX(-10px);
        opacity: 0.6;
    }
    30% {
        top: 70%;
        transform: translateX(10px);
        opacity: 0.6;
    }
    40% {
        top: 60%;
        transform: translateX(-5px);
        opacity: 0.6;
    }
    50% {
        top: 50%;
        transform: translateX(8px);
        opacity: 0.6;
    }
    60% {
        top: 40%;
        transform: translateX(-8px);
        opacity: 0.6;
    }
    70% {
        top: 30%;
        transform: translateX(5px);
        opacity: 0.6;
    }
    80% {
        top: 20%;
        transform: translateX(-10px);
        opacity: 0.6;
    }
    90% {
        top: 10%;
        transform: translateX(8px);
        opacity: 0.6;
    }
    100% {
        top: -20%;
        transform: translateX(0px);
        opacity: 0.6;
    }
}

.bubble {
    position: absolute;
    left: 0;
    border-radius: 50%;
    box-shadow: 0 0 150px var(--bubble-color, red), 0 0 30px rgba(255, 0, 0, 0.3);
    opacity: 0.6;
    cursor: pointer;
    pointer-events: auto !important;
    z-index: 3;
    animation-timing-function: linear;
    will-change: transform, opacity, top;
    transform: var(--initial-scale, scale(1));
}

/* fixed + lvh: не сжимается при появлении/скрытии адресной строки */
.bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100lvh;
    min-height: 100lvh;
    pointer-events: none;
    overflow: hidden;
    z-index: 2;
}

.bubbles-under {
    z-index: 2;
}

.bubbles-over {
    z-index: 1000;
}

.bubbles-middle {
    z-index: 5;
}

.bubble-under {
    z-index: 2;
}

.bubble-over {
    z-index: 1001;
}

.bubble-middle {
    z-index: 6;
}

.bubble.popped {
    animation: pop 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards !important;
}

@keyframes pop {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    40% {
        transform: scale(1.4) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

.particle {
    position: absolute;
    pointer-events: none;
    z-index: 4;
    animation: explode linear forwards;
    opacity: 1;
}

@keyframes explode {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--vx), var(--vy)) scale(0);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    @keyframes float {
        0% {
            top: 110%;
            transform: translateX(0px) scale(0.7);
            opacity: 0;
        }
        3% {
            top: 100%;
            transform: translateX(0px) scale(0.7);
            opacity: 0.5;
        }
        20% { top: 85%; transform: translateX(3px); opacity: 0.5; }
        40% { top: 65%; transform: translateX(-3px); opacity: 0.5; }
        60% { top: 45%; transform: translateX(3px); opacity: 0.5; }
        80% { top: 25%; transform: translateX(-3px); opacity: 0.5; }
        100% {
            top: -20%;
            transform: translateX(0px) scale(0.7);
            opacity: 0.5;
        }
    }

    .bubbles-container {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100lvh !important;
        min-height: 100lvh !important;
        pointer-events: none !important;
        overflow: hidden !important;
        transition: none !important;
        z-index: 2 !important;
    }

    .bubble {
        z-index: 3;
    }

    .particle {
        transform: scale(0.7);
    }
}
