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

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #0a3c2f;
}

.container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 30px;
    background-color: #0d614b;
    padding: 40px 60px;
}

h2 {
    font-size: 3em;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.1em;

}

.reset {
    padding: 15px 20px;
    color: #267c65;
    background: #fff;
    border: none;
    font-size: 1.5em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    font-weight: 600;
}

.reset:focus {
    color: #fff;
    background: #267c65;
}

.game {
    width: 430px;
    height: 430px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    transform-style: preserve-3d;
    perspective: 500px;
}

.item {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3em;
    background: #fff;
    transform: rotateY(180deg);
    transition: 0.25s;

}

.item.boxOpen {
    transform: rotateY(0deg);
}

.item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #209d7b;
    cursor: pointer;
    /* opacity: 0.85; */
    transition: 0.25s;
    transform: rotateY(0deg);
    backface-visibility: hidden;

}

.boxOpen:after,

.boxMatch:after {
    transform: rotateY(180deg);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px 30px;
        gap: 20px;
    }

    h2 {
        font-size: 2em;
    }

    .reset {
        padding: 10px 15px;
        font-size: 1em;
    }

    .game {
        width: 300px;
        height: 300px;
        gap: 6px;
    }

    .item {
        width: 65px;
        height: 65px;
        font-size: 2em;
    }
}

@media (max-width: 500px) {
    .container {
        padding: 20px 30px;
        gap: 20px;
    }

    h2 {
        font-size: 2em;
    }

    .reset {
        padding: 10px 15px;
        font-size: 1em;
    }

    .game {
        width: 300px;
        height: 300px;
        gap: 6px;
    }

    .item {
        width: 65px;
        height: 65px;
        font-size: 2em;
    }
}