*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #050505;
    animation: colorchange 4s linear infinite;
}
@keyframes colorchange{
    0%,100%{
        filter: hue-rotate(200deg);
    }
    50%{
        filter: hue-rotate(360deg);
    }
}
.cube{
    position: relative;
    width: 400px;
    height: 100px;
    transform-style: preserve-3d;
    animation: animate 4s linear infinite;
}
.cube:hover{
    animation-play-state: paused;
    cursor: pointer;

}
@keyframes animate{
    0%{
        transform: rotateX(-30deg) rotateY(0deg);
    }
    100%{
        transform: rotateX(-30deg) rotateY(360deg);
    }
}
.cube .box{
    position: absolute;
    top: 0px;
    left: 0;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}
.cube .box span{

    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(23,23,25,1),rgb(246, 13, 13));
    transform-style: preserve-3d;
    transform: rotateY(calc(90deg * var(--i))) translateZ(200px);
}
.top{
    top: 0;
    left: 0;
    width: 400px;
    height:400px;
    background: #222;
    transform-style: preserve-3d;
    transform: rotateX(90deg) translateZ(200px);
    display: flex;
    justify-content: center;
    align-items: center;
}
i{
    position: absolute;
    font-size: 15em;
    color: rgba(255, 6, 6, 1);
    text-shadow: 0 0 50px rgba(255, 6, 6, .25),
    0 0 100px rgba(255, 6, 6, .5),
    0 0 200px rgba(255, 6, 6, .75),
    0 0 300px rgba(255, 6, 6, 0.1);
}
.top::before{
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 400px;
    height: 400px;
    background: rgba(255, 6, 6, 1);
    transform: translateZ(-250px);
    opacity: .75;
    box-shadow: 0 0 120px rgba(255, 6, 6, 0.2),
    0 0 200px rgba(255, 6, 6, 0.4),
    0 0 300px rgba(255, 6, 6, 0.6),
    0 0 400px rgba(255, 6, 6, 0.8),
    0 0 500px rgba(255, 6, 6, 1);

}
