.pyro {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    display: none;

}

.pyro.active {
    display: block;
    animation: fadeOut 5s forwards;
}

.pyro>.before,
.pyro>.after {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    box-shadow: 0 0 #fff;
    animation: bang 1s ease-out infinite backwards,
        gravity 1s ease-in infinite backwards,
        position 5s linear infinite backwards;
}

.pyro>.after {
    animation-delay: 1.25s, 1.25s, 1.25s;
    animation-duration: 1.25s, 1.25s, 6.25s;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        display: none;
    }
}

@keyframes bang {
    to {
        box-shadow: -116px -235px #ff00ea, 12px -345px #00ff40, 245px -12px #ff4000,
            -200px -150px #00ffff, 150px -280px #ffff00, -80px -10px #ff0080,
            210px -190px #0000ff, -50px -400px #ffffff, 180px -50px #ffaa00,
            -130px -310px #00ffaa;
    }
}

@keyframes gravity {
    to {
        transform: translateY(200px);
        opacity: 0;
    }
}

@keyframes position {

    0%,
    19.9% {
        margin-top: 10%;
        margin-left: 40%;
    }

    20%,
    39.9% {
        margin-top: 40%;
        margin-left: 30%;
    }

    40%,
    59.9% {
        margin-top: 20%;
        margin-left: 70%;
    }

    60%,
    79.9% {
        margin-top: 30%;
        margin-left: 20%;
    }

    80%,
    99.9% {
        margin-top: 30%;
        margin-left: 80%;
    }
}