/* ======= GLOBAL STYLES ======= */

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: 'Rubik', sans-serif;
}

body {
    width: 100%;
    /* height: 100vh; */
    background: url('./images/main-bg.jpg');
    background-attachment: fixed;
    background-size: cover;
}

section {
    position: relative;
    width: 100%;
    /* height: 100vh; */
    /* margin: auto; */
}

.wrapper {
    width: 80%;
    /* min-width: 450px; */
    margin: auto;
    background-color: white;
    border: 1px solid black;
    border-radius: 10px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.btn {
    padding: 0.8rem 1.4rem;
    background-color: transparent;
    color: white;
    font-weight: 700;
    border: 1px solid grey;
    border-radius: 5px;
    cursor: pointer;
    transition: box-shadow 0.3s ease-in-out;
}

.btn:hover {
    -webkit-box-shadow: 0px 2px 5px 1px rgba(0,0,0,0.55);
    -moz-box-shadow: 0px 2px 5px 1px rgba(0,0,0,0.55);
    box-shadow: 0px 2px 5px 1px rgba(0,0,0,0.55);
}

li {
    list-style-type: none;
}

/* ======= SPLASH PAGE STYLES ======= */

.splash-page {
    height: 70vh;
    margin-top: 15vh;
}

.splash-page .main-title {
    width: 100%;
}

.splash-page .main-title img {
    height: 25vh;
    max-width: 250px;
    margin-top: 1em;
    margin-bottom: 1em;
}

.splash-page .main-title h1 {
    font-size: 1.5rem;
}

.splash-page label {
    width: 100%;
    margin: 2em 0 1em 0;
}

.splash-page #input-name {
    width: 60%;
    height: 2em;
    font-size: 1.25em;
    text-align: center;
    border: 1px solid grey;
    border-radius: 5px;
}

.play-btn,
.start-btn {
    margin-top: 1em;
    background-color: rgb(130, 189, 21);
}

/* ======= INSTRUCTIONS SCREEN STYLES ======= */

.instructions-page {
    height: 70vh;
    /* position: absolute;
    top: 15vh; */
    margin: 15vh auto 0;
    padding: 2.5em;
    z-index: 10;
}

.instructions-page .instructions {
    overflow: auto;
    margin-top: 1em;
}

.instructions p {
    margin: 1em 0;
}

.instructions p:nth-of-type(3) {
    margin: 1.25em;
    font-size: 1.25em;
}

.instructions ul {
    width: 100%;
    margin: auto;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    flex-flow: row wrap;
}

.instructions .digit {
    width: 25%;
    max-width: 50px;
    height: 50px;
    background-color: lightgrey;
    border-radius: 5px;
    font-size: 1.5em;
    line-height: 2em;
}

.instructions .clear {
    background-color: transparent;
    font-size: 1em;
    line-height: 2.75em;
}

.instructions .red {
    background-color: rgb(160, 53, 53);
}

.instructions .yellow {
    background-color: rgb(238, 213, 89);
}

.instructions .green {
    background-color: rgb(133, 182, 76);
}

.instructions .ins-answer {
    background-color: rgb(127, 80, 171);
    color: white;
    margin: auto;
}

/* ======= GAME PAGE STYLES ======= */

.game-page {
    /* position: absolute;
    top: 15vh;
    left: 20%; */
    height: 70vh;
    padding: 2.5em;
    margin: 15vh auto 0;
    z-index: 10;
}

/* == PLAYER HEADER == */

.game-page .player-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: start;
    font-weight: 700;
}

.game-page .player-header .player-id-container {
    text-align: start;
}

.game-page .timer-container {
    height: 15vh;
}

#timer-box {
    margin: auto;
    font-size: 3em;
    line-height: 2.5em;
}

.game-page #game-boxes {
    width: 90%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-page #game-boxes .digit {
    width: 25%;
    max-width: 75px;
    height: 75px;
    background-color: lightgrey;
    border-radius: 5px;
    font-size: 1.5em;
    line-height: 3em;
}



.answers-container {
    margin-top: 2em;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-flow: row wrap;
}

.answers-container .answer-result {
    width: 100%;
    height: 5vh;
    text-align: center;
}

.answers-container #user-answer {
    width: 40%;
    height: 2.5em;
    font-size: 1.25em;
    text-align: center;
    border: 1px solid grey;
    border-radius: 5px 0 0 5px;
}

.answers-container #check-answer-btn {
    width: 20%;
    height: 3.75em;
    padding: 0;
    background-color: rgb(127, 80, 171);
    border-radius: 0 5px 5px 0;
}

.answers-container #check-answer-btn img {
    width: 16px;
    margin: auto;
    filter: invert(100%);
}

.answers-container .nav-container {
    width: 100%;
    margin-top: 2em;
    display: flex;
    justify-content: space-evenly;
}

.nav-container .quit-btn {
    background-color: rgb(160, 53, 53);
}

.nav-container .next-question-btn {
    background-color: rgb(130, 189, 21);
}

/* ======= QUIT BOX STYLES ======= */

.quit-box {
    position: absolute;
    top: 8%;
    left: 15%;
    width: 70%;
    height: 60vh;
    /* margin: 15vh auto 0; */
    padding: 2.5em;
    z-index: 12;

}

.quit-box .nav-container {
    margin-top: 1.5em;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    flex-direction: column;
}

.quit-box .nav-container .btn {
    width: 100%;
    margin-bottom: 0.5em;
}

.resume-btn {
    background-color: rgb(130, 189, 21);
}

.restart-btn {
    background-color: rgb(215, 160, 41);
}

/* ======= RESULTS STYLES ======= */

.results-page {
    /* position: absolute;
    top: 15vh;
    left: 20%; */
    height: 70vh;
    padding: 2.5em;
    margin: 15vh auto 0;
    z-index: 10;
}

.results-page .game-over-text h2 {
    margin-top: 5em;
    padding: 1em;
}

.results-page .game-over-text,
.results-page .your-score-cont {
    margin: 2em auto;
}

.results-page .nav-container {
    margin-bottom: 6.5em;
}

.final-score {
    margin-top: 0.5em;
    font-size: 3em;
}

footer {
    color: lightslategrey;
    font-size: 0.80em;
    margin: 2em auto 5em auto;
}

/* ======= HIDDEN WRAPPER STYLES ======= */

.hidden {
    display: none;
}

.overlay {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    height: 100vh;
    padding: 2.5em;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 11;
}


/* ======= COLOR MASK ======= */

/* === DEMO BOXES === */

.instructions .demo .red {
    animation: changeRed 10s;
    animation-iteration-count: infinite;
}

.instructions .demo .yellow {
    animation: changeYellow 10s;
    animation-iteration-count: infinite;
}

.instructions .demo .green {
    animation: changeGreen 10s;
    animation-iteration-count: infinite;
}

/* === GAME BOXES === */

.game-page #game-boxes .red {
    animation: changeRed 10s forwards;
}

.game-page #game-boxes .yellow {
    animation: changeYellow 10s forwards;
}

.game-page #game-boxes .green {
    animation: changeGreen 10s forwards;
}

/* === KEYFRAMES === */

@keyframes changeRed {
    0% {
        background-color: lightgrey;
    }
    60% {
        color: black;
    }
    100% {
        background-color: rgb(160, 53, 53);
        color: rgb(160, 53, 53);
    }
}

@keyframes changeYellow {
    0% {
        background-color: lightgrey;
    }
    60% {
        color: black;
    }
    100% {
        background-color: rgb(238, 213, 89);
        color: rgb(238, 213, 89);
    }
}

@keyframes changeGreen {
    0% {
        background-color: lightgrey;
    }
    60% {
        color: black;
    }
    100% {
        background-color: rgb(133, 182, 76);
        color: rgb(133, 182, 76);
    }
}

/* ===== BREAKPOINT - TABLET ===== */

@media screen and (min-width: 641px) {

    body {
        font-size: 16px;
    }

    .splash-page,
    .instructions-page,
    .game-page,
    .results-page {
        width: 60%;
        height: 70vh;
        margin-top: 15vh;
        max-width: 400px;
    }

    .quit-box {
        width: 50%;
        height: 50vh;
        left: 25%;
    } 
}

/* ===== BREAKPOINT - DESKTOP ===== */

@media screen and (min-width: 960px) {

    body {
        font-size: 12px;
    }

    .quit-box {
        width: 25%;
        height: 60vh;
        top: 8%;
        left: 37.5%
    } 

    .splash-page .main-title h1 {
        font-size: 1em;
    }
    
    .splash-page #input-name {
        font-size: 0.75em;
    }
}