:root {
    --black-color: black;
    --white-color: white;
    --red-span: red;
    --block-color: #ff00ff;
    --aqua-color: aqua;
    --invisible-bg: rgba(0, 0, 0, 0);
    --dimmed-bg: rgba(0, 0, 0, 0.5);
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Body styling */
body {
    background-image: linear-gradient(45deg, rgba(108, 108, 108, 1) 0%, rgba(255, 255, 255, 1) 100%);
    font-family: "DotGothic16", monospace;
    font-weight: 400;
    font-style: normal;
    color: var(--white-color);
}

/* Making sure the hands are in front of everything */
canvas {
    z-index: 1000 !important;
    position: absolute;
}

/* Webcam container */
#webcam {
    position: absolute;
    width: 100%;
    height: 100%;
}

/* Webcam box */
.webcambox {
    position: absolute;
    width: 100%;
    height: 100%;
}

.webcambox video {
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
    left: 0;
    top: 0;
}

.webcambox canvas {
    width: 100%;
    height: 100%;
    margin: 0 auto;
    transform: scaleX(-1);
    -webkit-transform: scaleX(-1);
    z-index: 1000 !important;
    position: absolute;
}

@keyframes appear {
    0% {
        opacity: 0
    }

    100% {
        opacity: 1
    }
}

/* Info box styling */
#infobox {
    animation: appear 2s;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: auto auto;
    padding: 0.5rem;
    font-size: small;
    z-index: 10;
    /* Ensure infobox is above low priority elements */
}

#infobox span {
    color: var(--black-color);
    text-align: center;
    font-size: 3rem;
    font-weight: bold;
    display: none;
}

/* Cube styling */
#cube {
    /* For fixing showing the cube at the beginning */
    display: none;

    position: absolute;
    width: 100px;
    height: 100px;
    background-color: var(--block-color);
    z-index: 5;
    /* Ensure cube is behind infobox but above lesser elements */
}

/* Buttons styling */
#buttons {
    position: absolute;
    display: flex;
    justify-content: center;
    bottom: 1.5em;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 1001 !important;
}

#buttons button {
    font-family: "DotGothic16", monospace;
    font-size: 3rem;
    background-color: var(--invisible-bg);
    color: var(--black-color);
    border: none;
}

/* Terms of service styling */
#tos {
    display: none;
    overflow-y: scroll;
    overflow-x: hidden;
    height: 100%;
    color: var(--black-color);
}

/* Tutorial styling */
#tutorial {
    animation: appear 2s;
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    transform: translate(-50%, -50%);
    z-index: 6;
    padding: 2em 4em;
    margin: 0;
    font-size: 2rem;
    color: var(--black-color);
    background-color: rgb(211, 211, 211);
    box-shadow: 20px 20px 25px rgba(0, 0, 0, 0.303);
}

#tutorial img {
    max-width: 25%;
}

#tutorial p:nth-last-child(1),
#tutorial p:nth-last-child(2) {
    text-align: center;
    font-weight: bold;
}

.background-overlay {
    background-color: rgba(255, 255, 255, 0.773);
}

/* Completion message styling */
#completed {
    animation: appear 1s;
    position: absolute;
    display: none;
    top: 40%;
    width: 100%;
    height: 10%;
    font-size: 8rem;
    font-weight: bold;
    text-align: center;

    z-index: 7;
}

/* Error message styling */
#errormsg {
    display: none;
}

/* Responsive adjustments */
@media only screen and (max-width: 1700px) {
    #tutorial {
        padding: 1em 2em;
    }

    #tutorial p {
        font-size: 1.4rem;
        font-weight: 500;
    }

    #infobox {
        padding: 1em 2em;
    }

    #infobox span {
        font-size: 3rem;
    }
}

@media only screen and (max-width: 1300px) {
    #tutorial p {
        font-size: 1.3rem;
    }

    #infobox {
        padding: 1em;
    }

    #infobox span {
        font-size: 2rem;
    }
}

@media only screen and (max-width: 1000px), (max-height: 500px) {
    .whole {
        display: none;
    }

    html,
    body {
        display: flex;
        justify-content: center;
        align-items: center;
        background-image: linear-gradient(45deg, rgb(255, 230, 230), rgb(254, 134, 134));
    }

    #errormsg {
        display: block;
        z-index: 5;
        /* Ensure the error message is on top */
        text-align: center;
        padding: 0.5em;
        font-size: 20rem;
        font-weight: normal;
        color: var(--black-color);
    }

    #errormsg p {
        font-size: 40px;
    }
}