
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body{
    font-family: 'Righteous', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: 100vh;
    background-color: #c7cdd3;
}

img {
    width: 80%;
    height: 80%;
}

.card{
    width: 90px;
    height: 90px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform .5s;
}

.card_back, .card_front{
    width: 100%;
    height: 100%;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.45);
    backface-visibility: hidden;
}

.flip{
    transform: rotateY(180deg);
}

.card_front{
    background-color: #101c2c;
    transform: rotateY(180deg);
}

.card_back{
    color: #101c2c;
    background-color: #05c3ff;
    font-size: 30px;
}

#gameOver{
    position: absolute;
    width: 100%;
    height: 100%;
    background-color:rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 40px;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    top: 0;
}

#restart{
    padding: 20px;
    font-size: 20px;
    background-color: yellow;
    border: none;
    border-radius: 10px;
    margin-top: 10px;
    font-family: 'Righteous', sans-serif;
}

#gameBoard {
    max-width: 700px;
    display: grid;
    grid-template: 1fr 1fr 1fr 1fr 1fr / 1fr 1fr 1fr 1fr;
    gap: 20px;
}

#scoreBoard{
    display: inline-block;
    position: fixed;
    top: 0;
    right: 0;
    max-width: 250px;
    margin-top: 50px;
    margin-right: 30px;
    margin-bottom: 30px;
    padding: 30px;
    width: 250px;
    height: auto;
    background-color:rgba(255, 255, 255, 0.35);
}

h3{
    margin-bottom: 5px;
}

ol{
    margin-left: 20px;
}

li{
    margin-top: 10px;
    color: rgba(0, 0, 0, 0.8);

}

@media screen and (max-width: 1024px){
    body{
        height: 100vh;
    }
    
    img {
        width: 90%;
        height: 90%;
    }
    
    .card{
        width: 140px;
        height: 140px;
    }
    
    .card_back, .card_front{
        width: 100%;
        height: 100%;
    }

    .card_back{

        font-size: 40px;
    }

    #gameBoard {
        max-width: 700px;
}

    #scoreBoard{
        position: relative;
        top: 0;
        right: 0;
        left: 0;
        max-width: 500px;
        width: 500px;
        height: auto;
        margin-right: 15px;
    }

    ol{
    width: 500px;
    }

    li{
    float: left;
    width: 250px;

    }

}

@media screen and (max-width: 770px){
    body{
        height: 100vh;
    }
    
    img {
        width: 70%;
        height: 70%;
    }
    
    .card{
        width: 100px;
        height: 100px;
    }
    
    .card_back, .card_front{
        width: 100%;
        height: 100%;
    }

    .card_back{

        font-size: 30px;
    }

    #gameBoard {
        max-width: 700px;
}

    #scoreBoard{
        position: relative;
        top: 0;
        right: 0;
        left: 0;
        max-width: 400px;
        width: 400px;
        height: auto;
        margin-right: 20px;
    }

    ol{
    width: 400px;
    }

    li{
    float: left;
    width: 200px;

    }

}

@media screen and (max-width: 550px){
    body{
        height: 100vh;
    }
    
    img {
        width: 70%;
        height: 70%;
    }
    
    .card{
        width: 75px;
        height: 75px;
    }
    
    .card_back, .card_front{
        width: 100%;
        height: 100%;
    }

    .card_back{

        font-size: 15px;
    }

    #gameBoard {
        max-width: 700px;
        margin-top: 60px;
}

#scoreBoard{
    position: relative;
    top: 0;
    right: 0;
    width: 350px;
    max-width: 350px;
    height: auto;
    margin-right: 15px;
}

ol{
width: 350px;
}

li{
float: left;
width: 175px;

}

#gameOver {
    font-size: 42px;
}

}

@media screen and (max-width: 400px){
    body{
        height: 100vh;
    }
    
    img {
        width: 70%;
        height: 70%;
    }
    
    .card{
        width: 60px;
        height: 60px;
    }
    
    .card_back, .card_front{
        width: 100%;
        height: 100%;
    }

    .card_back{

        font-size: 15px;
    }

    #gameBoard {
        max-width: 700px;
}

    #scoreBoard{
        position: relative;
        top: 0;
        right: 0px;
        width: 280px;
        max-width: 280px;
        margin-right: 15px;
        height: auto;

    }

    ol{
    width: 280px;
    }

    li{
    float: left;
    width: 140px;
    font-size: 14px;
    }

    #gameOver {
        font-size: 34px;
    }

}

@media screen and (max-width: 350px){
    body{
        height: 100vh;
    }
    
    img {
        width: 70%;
        height: 70%;
    }
    
    .card{
        width: 50px;
        height: 50px;
    }
    
    .card_back, .card_front{
        width: 100%;
        height: 100%;
    }

    .card_back{

        font-size: 15px;
    }

    #gameBoard {
        max-width: 700px;
}

    #scoreBoard{
        position: relative;
        top: 0;
        right: 0;
        width: 240px;
        max-width: 240px;
        margin-right: 15px;
        height: auto;
    }

    ol{
    width: 240px;
    }

    li{
    float: left;
    width: 90px;
    font-size: 14px;
    }

    #gameOver {
        font-size: 24px;
    }
}


@media screen and (max-width: 280px){
    body{
        height: 100vh;
    }
    
    img {
        width: 70%;
        height: 70%;
    }
    
    .card{
        width: 50px;
        height: 50px;
    }
    
    .card_back, .card_front{
        width: 100%;
        height: 100%;
        border-radius: 10px;
        box-shadow: 7px 7px 7px rgba(0, 0, 0, 0.45);
    }

    .card_back{

        font-size: 15px;
    }

    #gameBoard {
        max-width: 700px;
        gap: 13px;
}

    #scoreBoard{
        position: relative;
        top: 0;
        right: 0;
        width: 220px;
        max-width: 220px;
        margin-right: 17px;
        height: auto;
    }

    ol{
        font-size: 14px;
        width: 220px;
    }

    li{
    float: left;
    width: 90px;
    font-size: 14px;
    }

    #gameOver{
        position: absolute;
        width: 100%;
        height: 100%;
        background-color:rgba(0, 0, 0, 0.9);
        color: white;
        font-size: 25px;
        display: none;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        top: 0;
    }
}

