body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #fef3f3;
    margin: 0;
}
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 400px;
    margin-bottom: 20px;
}
.header span, .header button {
    font-size: 1.2rem;
    font-weight: bold;
}
.header button {
    padding: 5px 10px;
    background-color: #ff6f61;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.header button:hover {
    background-color: #ff4f41;
}
.game-container {
    display: grid;
    gap: 10px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.card {
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffe5e5;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease, background-color 0.3s ease;
}
.card.flipped {
    background: white;
    cursor: default;
}
.card.matched {
    background: #b8f5a9;
    transform: scale(1.2);
    animation: pulse 0.6s infinite alternate;
}
@keyframes pulse {
    0% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.card .front, .card .back {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    backface-visibility: hidden;
    transition: transform 0.3s ease;
}
.card .front {
    transform: rotateY(180deg);
    background: white;
}
.card .back {
    background: #ff9aa2;
}
.card.flipped .front {
    transform: rotateY(0);
}
.card.flipped .back {
    transform: rotateY(180deg);
}
.heart {
    font-size: 2rem;
    color: #ff6f61;
}
