/* Loading on page load -> build page */

#loadingForeground {
    display: -webkit-box;
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--back-color);
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    flex-direction: column;
    -webkit-box-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    align-items: center;
    z-index: 10000000;
}


/* LOADING */


/* Scene Switch */

#loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--back-color);
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    flex-direction: column;
    -webkit-box-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    align-items: center;
    z-index: 1001;
}

.loading:not(.vr) #loading {
    display: -webkit-box;
    display: flex;
}


/* Background */

#loadingBackground {
    display: -webkit-box;
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--back-color);
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    flex-direction: column;
    -webkit-box-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    align-items: center;
    z-index: 0;
}

.vr #loadingBackground {
    display: none;
}


/* VR LOADING */


/* Scene Switch */

#loadingVr {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--back-color);
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    flex-direction: column;
    -webkit-box-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    align-items: center;
    z-index: 1001;
}

.vr.loading #loadingVr {
    display: block;
}

#loadingVr1 {
    display: -webkit-box;
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    flex-direction: column;
    -webkit-box-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    align-items: center;
    z-index: 1001;
}

#loadingVr2 {
    display: -webkit-box;
    display: flex;
    position: fixed;
    top: 0;
    right: var(--vr);
    width: 50%;
    height: 100%;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    flex-direction: column;
    -webkit-box-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    align-items: center;
    z-index: 1001;
}


/* Background */

#loadingBackgroundVr {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--back-color);
    z-index: 0;
}

.vr #loadingBackgroundVr {
    display: -webkit-box;
    display: flex;
}

#loadingBackgroundVr1 {
    display: -webkit-box;
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    flex-direction: column;
    -webkit-box-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    align-items: center;
    z-index: 0;
}

#loadingBackgroundVr2 {
    display: -webkit-box;
    display: flex;
    position: fixed;
    top: 0;
    right: var(--vr);
    width: 50%;
    height: 100%;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    flex-direction: column;
    -webkit-box-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    align-items: center;
    z-index: 0;
}


/* TEXT & ANIMATION

/* Loading text + JavaScript warn text (+ vr enter / leave text) */

.loadingText {
    position: relative;
    left: 5px;
    margin: -5px;
    font-size: 20px;
}

#loadInfo {
    margin: 5px;
    font-size: 15px;
    opacity: 0;
    -webkit-transition: opacity 0.3s;
    transition: opacity 0.3s;
    -webkit-animation-name: showLoadInfo;
    animation-name: showLoadInfo;
    -webkit-animation-duration: 0.3s;
    animation-duration: 0.3s;
    -webkit-animation-delay: 5s;
    animation-delay: 5s;
    -webkit-animation-fill-mode: forwards;
    animation-fill-mode: forwards;
}


/* Loading animation*/

@-webkit-keyframes showLoadInfo {
    0% {
        opacity: 0
    }
    100% {
        opacity: 1;
    }
}

@keyframes showLoadInfo {
    0% {
        opacity: 0
    }
    100% {
        opacity: 1;
    }
}

.lds-facebook {
    display: inline-block;
    position: relative;
    width: 64px;
    height: 64px;
}

.lds-facebook div {
    display: inline-block;
    position: absolute;
    left: 6px;
    width: 13px;
    background: var(--text-color);
    -webkit-animation: lds-facebook 1.2s cubic-bezier(0, 0.5, 0.5, 1) infinite;
    animation: lds-facebook 1.2s cubic-bezier(0, 0.5, 0.5, 1) infinite;
}

.lds-facebook div:nth-child(1) {
    left: 6px;
    -webkit-animation-delay: -0.24s;
    animation-delay: -0.24s;
}

.lds-facebook div:nth-child(2) {
    left: 26px;
    -webkit-animation-delay: -0.12s;
    animation-delay: -0.12s;
}

.lds-facebook div:nth-child(3) {
    left: 45px;
    -webkit-animation-delay: 0;
    animation-delay: 0;
}

@-webkit-keyframes lds-facebook {
    0% {
        top: 6px;
        height: 51px;
    }
    50%,
    100% {
        top: 19px;
        height: 26px;
    }
}

@keyframes lds-facebook {
    0% {
        top: 6px;
        height: 51px;
    }
    50%,
    100% {
        top: 19px;
        height: 26px;
    }
}

@keyframes lds-facebook {
    0% {
        top: 6px;
        height: 51px;
    }
    50%,
    100% {
        top: 19px;
        height: 26px;
    }
}