/* Milk Glass Mechanic */
.milk-container {
    position: relative;
    width: calc(100 * var(--px));
    height: calc(200 * var(--px));
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s ease;
}

.milk-glass {
    position: relative;
    width: calc(60 * var(--px));
    height: calc(200 * var(--px));
    background: rgba(0, 0, 0, 0.2);
    border: calc(4 * var(--px)) solid #000;
    border-radius: calc(4 * var(--px)) calc(4 * var(--px)) calc(12 * var(--px)) calc(12 * var(--px));
    overflow: hidden;
    /* Glass sheen */
    box-shadow: inset calc(-2 * var(--px)) 0 calc(5 * var(--px)) rgba(255, 255, 255, 0.1);
}

.milk-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Dynamic */
    background: #fff;
    /* transition: transform 0.1s linear;  <-- REMOVED to control via JS */
    transform-origin: bottom;
    transform: scaleY(0);
    border-top: calc(2 * var(--px)) solid #ddd;
}

/* Active State (Full) */
.milk-container.active {
    animation: bounce 0.5s infinite alternate;
}

.milk-container.active .milk-glass {
    box-shadow: 0 0 calc(15 * var(--px)) rgba(255, 255, 255, 0.8);
    border-color: #333;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(calc(-5 * var(--px)));
    }
}

/* Milk Splash Drops */
/* Milk Splash Drops */
.milk-drop {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10;
    top: calc(15 * var(--px));
    /* Near top lip of glass */
    /* Physics simulation */
    animation: drop-splash 0.6s cubic-bezier(0.5, 0, 1, 1) forwards;
    filter: drop-shadow(0 calc(1 * var(--px)) calc(2 * var(--px)) rgba(0, 0, 0, 0.1));
}

@keyframes drop-splash {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }

    15% {
        /* Initial upward/outward burst */
        transform: translate(var(--tx), calc(-20 * var(--px))) scale(1.1);
        opacity: 1;
        animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
    }

    100% {
        /* Fall down */
        transform: translate(calc(var(--tx) * 1.5), calc(120 * var(--px))) scale(0.5);
        opacity: 0;
    }
}