@import url('https://fonts.googleapis.com/css2?family=Boogaloo&family=Open+Sans&display=swap');

/* Global styling */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: url(../images/background.jpg) no-repeat center;
    background-size: cover;
    font-family: 'Boogaloo', sans-serif;
    text-align: center;
    height: 100vh;
    width: 100vw;
}

h2 {
    color: #e89ac7;
    font-weight: 800;
    font-size: 50px;
    margin-bottom: 50px;
}

/* Home Page */

.title {
    font-size: 70px;
    text-transform: uppercase;
    color: #44281d;
    padding: 50px;
}

.intro-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px;
    margin-top: 100px;
}

.btn {
    height: auto;
    width: 300px;
    font-family: 'Boogaloo', sans-serif;
    font-size: 30px;
    text-transform: uppercase;
    color: #f0e14a;
    background-color: #44281d;
    border: none;
    border-radius: 10px;
    padding: 10px;
    margin: 30px;
}

.btn:hover {
    background-color: #97ce4c;
    color: #e89ac7;
    transition: 0.5s;
}

/* Instructions section */

#instructions {
    flex-direction: column;
    align-items: center;
    display: none;
}

.popup-msg {
    background-color: rgb(68, 40, 29, .8);
    border-radius: 10px;
    width: 50%;
    padding: 50px;
}

.popup-msg li {
    color: #e89ac7;
    font-family: 'Open Sans', sans-serif;
    font-size: 20px;
    margin: 25px;
    list-style-type: none;
}

.popup-msg p {
    color: #e89ac7;
    font-size: 30px;
    font-weight: 800;
}

/* Game Board */

#game-board {
    display: none;
    flex-direction: column;
    align-items: center;
}

#game {
    width: 800px;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(4, 130px);
    gap: 5px;
    justify-content: center;
}

.card {
    height: 130px;
    width: 130px;
    border-radius: 10px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: 0.5s ease-in-out;
}

.card-image {
    width: 130px;
    height: 130px;
    border-radius: 10px;
    background-color: #e89ac7;
}

.card.flip {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    border-radius: 10px;
    height: 100%;
    width: 100%;
    transition: 0.5s ease-in-out;
}

.card .card-back {
    background: url(../images/backcard.jpg) center center;
    background-size: cover;
    backface-visibility: hidden;
}

/* Score board */

#stats {
    width: 620px;
    display: flex;
    justify-content: space-around;
}

#stats p {
    color: #e89ac7;
    font-size: 30px;
}

/* End of game message */

#game-end {
    display: none;
    flex-direction: column;
    align-items: center;
}

#game-end p {
    font-weight: 400;
    padding: 20px 0 20px 0;
}

/* Responsive Design */

/* Screen sizes from 950px wide and down */

@media screen and (max-width: 950px) {
    
    .title {
        padding: 20px;
    }

    /* Responsive Game Board */

    #game {
        grid-template-columns: repeat(4, 100px);
    }

    .card {
        height: 100px;
        width: 100px;
    }

    .card-image {
        width: 100px;
        height: 100px;
    } 
}

/* Screen sizes from 575px wide and down */

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

    .title {
        font-size: 50px;
    }

    /* Responsive Instructions */

    .popup-msg {
        border-radius: 10px;
        width: 90%;
        padding: 30px;
    }

    .btn {
        width: 250px;
        font-size: 25px;
    }

	  /* Responsive Game Board */

	#game {
        width: 100%;
        grid-template-columns: repeat(4, minmax(100px, 1fr));
        gap: 2px;
        justify-items: center;
    
    }
        
    .card {
        height: 80px;
        width: 80px;
    }

    .card-image {
        width: 100%;
        height: 100%;
    }  
}