/* styles start here */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:Verdana, Geneva, Tahoma, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #f0f0f0;
}

header {
    /* display: flex; */
    /* justify-content: space-between; */
    text-align: center;
    align-items: center;
    width: 100%;
    padding: 20px;
    background-color: #333;
    color:white;
}

header h1 {
    font-size: 1.5rem;
}

#restart {
    padding: 10px 20px;
    font-size: 1rem;
    background-color:crimson;
    color: white;
    border: none;
    cursor: pointer;
    margin-top: 20px;
    border-radius: 25px;
}

#restart:hover {
    background-color:green;
}

main {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    width: 100%;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 100px);
    grid-gap: 10px;
    justify-content: center;
    align-content: center;
}

.card {
    width: 100px;
    height: 150px;
    background-color: #fff;
    border: 2px solid #333;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

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

.card .front,
.card .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
}

.card .front {
    background-color:#333;
    color: white;
    font-size: 2rem;
    transform: rotateY(180deg);
}

.card .back {
    background-color:crimson;
    color: white;
    font-size: 2rem;
}

@media screen and (max-width: 600px) {
    .game-board {
        grid-template-columns: repeat(2, 80px);
        grid-gap: 5px;
    }

    .card {
        width: 80px;
        height: 120px;
    }
}