/* FONTS */
.work-sans-main {
    font-family: "Work Sans", sans-serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
}

.lexend-deca {
    font-family: "Lexend Deca", sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
  }

/* HTML AND BODY */

html, body {
    overflow: hidden;
    touch-action: none;
}

body {
    margin: 0;
    background-color: black;
}

/* BUTTON ANIMATION */

.button-animation {
    transition: transform 0.2s;
    
}

.button-animation:active {
    transform: scale(0.9);
}

/* POPUP */

.popup {

    position: absolute;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;

    width: 300px;
    height: 200px;
    background-color: rgb(29, 29, 29);
    border-radius: 5px;

    z-index: 4;
    white-space: nowrap;

}

.popup-title {

    color: white;
    font-size: 2rem;
    text-align: center;

}

.close-popup-button {
    
    position: absolute;
    top: 10px;
    right: 10px;
    
    height: 15px;
    filter: invert(1); /* turns black to white */

}

/* LEADERBOARD */

#leaderboard-popup {
    display: none;
    padding: 0 20px;
    height: auto;
    padding-bottom: 20px;
}

#leaderboard-list {
    color: white;
    font-size: 1.5rem;
}

/* NICKNAME MENU */

#change-nickname-popup {
    display: none;
}

#nickname-input {
    position: absolute;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;

    width: 200px;
    height: 30px;
    border-radius: 5px;
    font-size: 1.5rem;
    text-align: center;
    border: 0;
}

#nickname-input:focus {
    outline: 0;
}

#change-nickname-confirm-button-container {
    position: absolute;
    transform: translateX(-50%);
    bottom: 15%;
    left: 50%;
}

#change-nickname-confirm-button {
    width: 100px;
    height: 30px;
    font-size: 1rem;
    border-radius: 5px;
    background-color: rgb(248, 248, 248);
    border: 0;
}

/* #nickname-title {
    color: white;
    font-size: 2rem;

    position: absolute;
    transform: translateX(-50%);
    top: 15%;
    left: 50%;
} */




/* MENU */

#menu {

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;

    position: absolute;
    width: 250px;
    height: 100dvh;
    background-color: rgb(29, 29, 29);
    z-index: 3;
    transform: translateX(-100%);
    padding-top: 25px;

}

#menu.opening {
    animation-name: openMenu;
    animation-duration: 0.5s;
    animation-fill-mode: forwards;
}

#menu.closing {
    animation-name: closeMenu;
    animation-duration: 0.5s;
    animation-fill-mode: forwards;
}

@keyframes openMenu {
    from {transform: translateX(-100%);}
    to {transform: translateX(0);}
}

@keyframes closeMenu {
    from {transform: translateX(0);}
    to {transform: translateX(-100%);}
}

#close-menu-button {
    position: absolute;
    top: 10px;
    right: 10px;
    
    height: 15px;
    filter: invert(1); /* turns black to white */
}

#exit-menu-area {
    display: none;
    position: absolute;
    width: 100dvw;
    height: 100dvh;
    z-index: 2;
}

#menu span {
    width: 200px;
    color: white;
    font-size: 20px;

    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;

}


.menu-button {

    position: relative;
    width: 200px;
    height: 50px;

    outline: 1px solid rgb(80, 80, 80);
    border-radius: 5px;
    background-color: rgb(235, 235, 235);
    font-size: 20px;
    border: 0;


}



/* GAME ELEMENTS */

#game {
    width: 100dvw;
    height: 100dvh;
}

#bottom {
    display: none;
}



/* NAVIGATION BAR */

#nav-bar {
    position: relative;
    width: 100%;
    height: 50px;
}

#nav-buttons {
    position: absolute;
    transform: translateY(-50%);
    top: 50%;
    left: 5px;

    display: flex;
    flex-direction: row;
}

#menu-button {
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;

    outline: 1px solid rgb(80, 80, 80);
    border: 0;
    border-radius: 5px;
    background-color: rgb(29, 29, 29);

    margin-right: 5px;
}

#menu-button img {

    position: absolute;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;

    width: 70%;
    height: 70%;

}

#game-mode-dropdown {

    position: relative;
    width: 150px;
    height: 40px;

    outline: 1px solid rgb(80, 80, 80);
    border-radius: 5px;
    background-color: rgb(29, 29, 29);
    color: white;
    font-size: 1rem;
    /* font-weight: bold; */
    padding-left: 10px;
    border: 0;
    margin-right: 5px;

}

#game-mode-dropdown:disabled {
    opacity: 1;
}

#game-mode-dropdown option {
    color: white;
    font-size: 1rem;
    font-weight: 500;
}

#scoreboard {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;

    position: absolute;
    transform: translateY(-50%);
    top: calc(50% - 2px);
    right: 5px;
    font-size: 1rem;
}

#current-score, #high-score {
    color: white;
    margin-left: 30px;
}

#leaderboard-button {
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;

    outline: 1px solid rgb(80, 80, 80);
    border: 0;
    border-radius: 5px;
    background-color: rgb(29, 29, 29);

    margin-right: 5px;
}

#leaderboard-button img {

    position: absolute;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;

    width: 70%;
    height: 70%;

    filter: invert(1);

}






/* SCROLLER */

#scroller {
    position: absolute;
    width: 100dvw;
    height: 100dvh;
}

#scroller.scrolling {
    height: 150dvh;
    animation-name: scrollAnimation;
    animation-duration: 0.75s;
}

@keyframes scrollAnimation {
    from {transform: translateY(0);}
    to {transform: translateY(-50dvh);}
}

.panel {
    position: relative;
    width: 100dvw;
    height: 50dvh;
    overflow: hidden;
}


@media (orientation: landscape) {

    #scroller {
        width: 100dvw;
        height: 100dvh;
    }

    #scroller.scrolling {
        width: 150dvw;
    }
    
    .panel {
        display: inline-block;
        width: 50dvw;
        height: 100dvh;
    }
    
    @keyframes scrollAnimation {
        from {transform: translateX(0);}
        to {transform: translateX(-50dvw);}
    }

    #nav-bar {
        height: 70px;
    }

    #scoreboard {
        flex-direction: row;
        top: 50%;
        right: 30px;
        font-size: 1.2rem;
    }

    #game-mode-dropdown {
        height: 50px;
        width: 200px;
        font-size: 1.2rem;
        margin-right: 10px;
    }

    #game-mode-dropdown option {
        font-size: 1.2rem;
    }

    #nav-buttons {
        left: 10px;
    }

    #menu-button {
        width: 50px;
        height: 50px;
        margin-right: 10px;
    }

    #leaderboard-button {
        width: 50px;
        height: 50px;
    }

}


.darken {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

.flag {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translateX(-50%);
    left: 50%;
}

.text-container {

    display: flex;
    flex-direction: column;
    align-items: center;

    position: absolute;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;

    font-weight: bold;
    color: white;

    white-space: nowrap;
    
}

.name {
    font-size: 3rem;
}

.middle-text {
    font-size: 1.2rem;
}

.data {

    color: rgb(255, 255, 103);
    font-size: 3rem;

    transition: opacity 0.2s;
}




#buttons-container {

    position: absolute;
    top: 70%;

    transition: opacity 0.2s;
    
}

#higher-button, #lower-button {

    display: block;

    width: 12rem;
    height: 3.5rem;

    font-size: 2rem;

    border-radius: 1rem;
    border: 0.15rem solid black;

}

#higher-button:focus, #lower-button:focus {
    outline: none;
}

#higher-button {
    margin-bottom: 10px;
}


.hidden {
    opacity: 0;
}

.verdict {

    position: absolute;
    transform: translate(-50%, -50%) scale(0);
    top: 50%;
    left: 50%;

    height: 4rem;
    aspect-ratio: 1;

}

.verdict.show {

    animation-name: showVerdict;
    animation-duration: 1.5s;

}


@keyframes showVerdict {
    0% {transform: translate(-50%, -50%) scale(0);}
    20% {transform: translate(-50%, -50%) scale(1);}
    80% {transform: translate(-50%, -50%) scale(1);}
    100% {transform: translate(-50%, -50%) scale(0);}
}


