/* Set the default font for the entire page */
body {
    font-family: 'Nunito', sans-serif;
    text-align: center;
    /* Add background image */
    background-color: rgba(255, 166, 158, 0.5);
    background-image: url('../images/animals-pattern.png');
    background-size: 110%;
    background-repeat: repeat;
    background-position: 0;
    animation: moveBackground 10s linear infinite;
}


/* Add animation to the background image */
@keyframes moveBackground {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 100px 100px;
    }
}


/* Style the header */
header {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgb(244, 143, 134, 1);
    width: 100%;
    height: 70px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
    font-size: 40px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

header a {
    text-decoration: none;
    color: rgba(30, 30, 30, 1);
}

/* Define common font styles for h1, h2, and h3 tags */
h1,
h2,
h3 {
    font-family: 'PT Sans';
    font-weight: 300;
}

/* Style the fgame container */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    margin-top: 30px;
    margin-bottom: 60px;
    padding: 20px;
    max-width: 100%;
    perspective: 1000px;
}

.game-container h2 {
    margin-top: 60px;
    background-color: rgba(255, 166, 158, 1);
    color: rgba(30, 30, 30, 1);
    border: none;
    border-radius: 5px;
    padding: 5px;
    border: 1px solid rgba(30, 30, 30, 1);
}


/* Style the game tiles container */
.tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 100%;
    padding: 20px;
    justify-content: center;
    background-color: rgba(255, 166, 158, 0.9);
    border: 1px solid rgba(149, 75, 68, 0.8); 
    border-radius: 5px;
    perspective: 1000px;
}

/* Style individual tiles */
.tile {
    transition: transform 0.3s ease;
    width: 100%;
    max-width: 100px;
    max-height: 100px;
    display: flex;
    justify-content: center;
    background-color: rgba(255, 166, 158, 1);
    box-shadow: 0px 2px 3px rgba(255, 166, 158, 0.5);
    border: 1px solid rgba(149, 75, 68, 0.8); 
    box-sizing: border-box;
    margin: 0 auto;
    border-radius: 5px;
    cursor: pointer;
}

/* Apply a flip animation on tile click */
.tile:active {
    transform: rotateY(180deg);
}

/* Apply a flip animation to flipped tiles */
.tile.flipped {
    transform: rotateY(180deg);
}

/* Style the inner content of each tile */
.tile-inner {
    width: 80px;
    height: 80px;
}

/* Style images within tiles */
.tile img {
    width: 80px;
    height: 80px;
    background-color: rgba(221, 255, 247, 0.5);
    border-radius: 5px;
    object-fit: contain;
}

/* Hide images with the 'hidden' class */
.tile .hidden {
    display: none;
}

/* Style the reset button*/
#reset-btn {
    background-color: rgba(255, 255, 255, 0.9);
    color: rgba(30, 30, 30, 1);
    border: 1px solid rgb(149, 75, 68);
    margin: 0 8px;
    padding: 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Increase button size on hover */
#reset-btn:hover {
    background-color: rgba(255, 150, 130, 0.7);
    color: rgba(255, 255, 255, 1);
}

#start-button:hover {
    background-color: rgba(255, 255, 255, 1);
    color: rgba(30, 30, 30, 1);
}

#play-again:hover {
    background-color: rgba(255, 255, 255, 1);
    color: rgba(30, 30, 30, 1);
}

#play-again1:hover {
    background-color: rgba(255, 255, 255, 1);
    color: rgba(30, 30, 30, 1);
}

/* Style the buttons within the modal */
#start-button,
#play-again, #play-again1 {
    border: none;
    padding: 10px 20px;
    color: rgba(221, 255, 247, 1);
    background-color: rgb(149, 75, 68);
    border: 1px solid rgb(149, 75, 68, 0.8);
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}


/* Style the game overlay */
.overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2;
    border: none;
}

/* Style the game modal within the overlay */
.modal {
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    color: #000;
}


.modal {
    background-color: rgba(255, 166, 158, 1);
    color: rgba(30, 30, 30, 1);
    border: 1px solid rgba(30, 30, 30, 1);
    border-radius: 5px;
}


/* Hide the overlay by default */
.overlay {
    display: none;
}

/* Cat animation if player lost */
#happy-cat {
    width: 100px;
    height: 100px;
}

/* Style the score board */
.score-board {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 166, 158, 1);
    color: rgba(30, 30, 30, 1);
    max-width: 100%;
    margin-top: 20px;
    padding: 5px 10px;
    border: 1px solid rgba(30, 30, 30, 1);
    border-radius: 5px;
}

/* Style the scores and lives elements */
#score,
#lives {
    font-size: 16px;
    color: rgba(30, 30, 30, 1);
    margin: 0 8px;
    padding: 5px;
}

/* Footer and social media icons*/
footer {
    position: fixed;
    width: 100%;
    height: 60px;
    background-color: rgba(255, 166, 158, 1);
    bottom: 0;
    left: 0;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

#social-media {
    text-align: center;
    padding: 0 0px;
    display: flex;
    justify-content: space-evenly;
    list-style-type: none;
}

#social-media i {
    color: rgba(30, 30, 30, 1);
    font-size: 180%;
    padding: 5%;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#social-media i:hover {
    color: rgba(255, 255, 255, 0.9);
}

@media screen and (min-width: 768px) {
    .tiles {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media screen and (min-width: 992px){
    body {
        background-size: 70%;
    }
    
    header {
        height: 80px;
        font-size: 40px;
    }

    .game-container {
        padding: 30px;
        font-size: 20px;
    }
}