@import url('https://fonts.googleapis.com/css2?family=Alfa+Slab+One&family=Send+Flowers&display=swap');

body {
    font-family: Arial, Helvetica, sans-serif;
    text-align: center;
}

h1 {
    font-family: 'Alfa Slab One', cursive;
    color: rgba(255, 251, 0, 0.88);
    font-size: 40px;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.801);
    letter-spacing: 6px;
}

h3 {
    text-align: center;
    text-decoration: underline;
    margin-bottom: 20px;
}

button {
    min-width: 50px;
    min-height: 25px;
    padding: 0;
    margin: 0;
    display: inline;
    background: #535353;
    color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    -webkit-transition-duration: 0.3s;
    -webkit-text-stroke: 0;
}
button:hover {
    background-color: rgba(107, 107, 107, 0.3);
    color: yellow;
    border: 4px solid black;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    -webkit-transform: scale(1.1);
}

        /* Best Results lists ordered elements */
ol {
    display: block;
    list-style-type: decimal;
    margin-block-start: 0;
    margin-block-end: 1em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
    padding-inline-start: 5px;
}

li {
    font-size:17px;
    border-bottom: 1px solid black;
    padding: 0;
    margin: 0 10px 0 10px;
}

        /* Header and title */
#header {
    background-color: rgb(124, 124, 124);
    height: fit-content;
    width: 100%;
    padding: 10px 0 5px 0;
    margin: 0 auto;
}  
#header label {
    padding: 0 10px;
    margin: 0 auto;
}

        /* Navigation section */
#nav_bar {
    height: fit-content;
    margin: 0 10px;
    text-align: right;
}
.nav_button {
    width: 5%;
    padding: 0;
    margin: 0;
    display: inline;
    background-color: #4CAF50;
}

        /* Main game section */
#game_container {
    border: 2px solid blue;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr;
    height: fit-content;
    line-height: 20px;
    margin: 15px 5% 15px 5%;
    padding: 10px;
}

#game_window {
    width: fit-content;
    text-align: center;
    padding: 20px;
}

#board {
    width: 480px;
    height: 600px;
    border: 2px solid blue;

    display: flex;
    flex-wrap: wrap;
}

#board img {
    width: 116px;
    height: 116px;
    border: 2px solid blue;
}

        /* Start New Game/Quit Game Button */
#btn_new_game {
    background-color: #4CAF50;
    border: 2px solid black;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
}

#btn_new_game:hover{
    background-color: #4CAF50;
    border: 4px solid black;
    color: yellow;
}


#rules, #results{
    height: fit-content;
    min-width: 150px;
    padding: 10px 10%;
    margin-top: 20px;
    background-color: #adaa7713;
    flex-wrap: nowrap;
}

#message_box {
    color: rgb(204, 0, 0);
}

#results {
    text-align: justify;
    margin-bottom: 100px;
}

        /* Footer */
#footer{
    background-color: lightgrey;
    text-align: center;
    width: 100%;
    height: fit-content;
    padding: 10px;
    margin-top: 100px;

    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 3;
}

        /* Popup Boxes section */
.popup .overlay {
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
    display: none;
}

.popup .content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: #fff;
    width: 450px;
    height: fit-content;
    z-index: 2;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.popup .close-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 25px;
    font-weight: 600;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
}

.popup.active .overlay {
    display: block;
}

.popup.popup.active .content {
    transition: all 300ms ease-in-out;
    transform: translate(-50%, -50%) scale(1);
}


@media screen and (max-width: 1200px){
    #game_container {
        margin: 20px 0 0 0; 
    }

    /* For smaller size screens not only width is important but also height of the screen.  
       The board should also fit verticaly to the size of the screen*/
    #board {
        width: 436px;
        height: 545px;
        border: 2px solid blue;
    
        display: flex;
        flex-wrap: wrap;
    }
    
    #board img {
        width: 105px;
        height: 105px;
        border: 2px solid blue;
    }
}

@media screen and (max-width: 992px){
    #game_container {
        border: 1px solid blue;
        display: block;
        grid-template-columns: none;
        grid-template-rows: none;
        height: fit-content;
        line-height: 20px;
        margin: 20px 5px 20px 5px; 
        padding: 10px;
    }

    #game_window {
        width: fit-content;
        text-align: center;
        padding: 20px 10%;
        margin: auto;
    }

    #board {
        width: 436px;
        height: 545px;
        border: 2px solid blue;
    }

    #results {
        margin: auto;
        text-align: justify
    }

    .popup .content {
        top: 70%;
    }
}

@media screen and (max-width: 768px){
    * {
        margin: 0;
        padding: 0;
        border: none;
    }

    h1, h2, h3 {
        padding: 20px 0;
    }

    button {
        border: 2px solid black;
    }

    #game_container {
        border: 1px solid blue;
        display: block;
        grid-template-columns: none;
        grid-template-rows: none;
        height: fit-content;
        line-height: 20px;
        margin: 20px 0 40px 0; 
        padding: 10px 0;
    }

    #game_window {
        width: fit-content;
        text-align: center;
        padding: 20px 0 20px 0;
        margin: auto;
    }

    #btn_new_game {
        padding: 15px 32px;
        margin: 15px 0;
    }

    .popup .content {
        top: 70%;
    }
}

@media screen and (max-width: 576px){

    #board {
        width: auto;
        max-width: 344px;
        height: 430px;
        border: 2px solid blue;
    
        margin: 5px 0;
        display: flex;
        flex-wrap: wrap;
    }
    
    #board img {
        margin: 0 auto;
        max-width: 82px;
        height: 82px;
        border: 2px solid blue;
    }

    .popup .content {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0);
        background: #fff;
        width: 90%;
        max-width: 400px;
        height: fit-content;
        z-index: 2;
        text-align: center;
        padding: 20px;
        box-sizing: border-box;
        overflow: auto;
    }

    .popup .content {
        top: 70%;
    }
}

@media screen and (max-width: 370px){

    #board {
        width: auto;
        max-width: 292px;
        height: 365px;
        border: 2px solid blue;
    
        margin: 5px 0;
        display: flex;
        flex-wrap: wrap;
    }
    
    #board img {
        width: 69px;
        height: 69px;
    }

    .popup .content {
        top: 70%;
    }
}


