/* Fullscreen loader overlay */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #020c1b;
    z-index: 99999;
}


/* Animation container */
.cube-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 300px;
}


/* Spinner */
.spinner {
    position: absolute;
    left: 0;
    right: 0;
    top: 80px;
    margin: auto;
    width: 20px;
    height: 20px;
}

.dot {
    position: absolute;
    width: 15px;
    height: 15px;
    background: #ffffff;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: dot-split 4s infinite ease-in-out, element-change 4s infinite;
}

/* Ball */
.ball {
    position: absolute;
    left: 0;
    right: 0;
    margin: auto;
    width: 15px;
    height: 15px;
    background: #0dd4ca;
    border-radius: 50%;
    bottom: 58px;
    animation: ball-move 4s infinite ease-in-out;
}

/* Line */
.line {
    position: absolute;
    left: 0;
    right: 0;
    margin: auto;
    bottom: 50px;
    width: 120px;
    height: 8px;
    background: #ffffff;
    border-radius: 4px;
    animation: line-move 4s infinite ease-in-out, element-change 4s infinite;
}

/* Background pulse */
@keyframes bg-change {
    0%,20% {
        background: #020c1b;
    }

    30%,70% {
        background: #ffffff;
    }

    80%,100% {
        background: #020c1b;
    }
}

/* Element color invert */
@keyframes element-change {
    0%,20% {
        background: #ffffff;
    }

    30%,70% {
        background: #020c1b;
    }

    80%,100% {
        background: #ffffff;
    }
}

@keyframes line-move {
    0% {
        bottom: 50px;
    }

    6% {
        bottom: 78px;
    }

    12% {
        bottom: 50px;
    }

    85% {
        bottom: 50px;
    }

    92% {
        bottom: 20px;
    }

    100% {
        bottom: 50px;
    }
}

@keyframes ball-move {
    0% {
        bottom: 58px;
        opacity: 1;
        transform: scale(1);
    }

    20% {
        bottom: 190px;
    }

    21%,79% {
        opacity: 0;
        transform: scale(0);
    }

    80% {
        opacity: 1;
        transform: scale(1);
    }

    85% {
        bottom: 58px;
    }
}

@keyframes dot-split {
    0%,20% {
        transform: translate(-50%, -50%) rotate(0);
    }

    30% {
        transform: rotate(calc(360deg/8 * var(--i))) translate(0,-30px);
    }

    70% {
        transform: rotate(calc(360deg/8 * var(--i) + 180deg)) translate(0,-30px);
    }

    80%,100% {
        transform: translate(-50%, -50%);
    }
}
