* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #333;
}

.game-container {
    width: 100%;
    max-width: 600px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    font-size: 18px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 10px;
    margin: 0 auto;
}

.card {
    height: 120px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
}

.card.flipped {
    transform: rotateY(180deg);
}

.card.matched .card-front {
    background-color: #27ae60;
    color: white;
}

.card-front, .card-back {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
}

.card-front {
    background-color: #3498db;
    transform: rotateY(180deg);
    color: white;
}

.card-back {
    background-color: #e74c3c;
    background-image: linear-gradient(135deg, #e74c3c 25%, #c0392b 25%, #c0392b 50%, #e74c3c 50%, #e74c3c 75%, #c0392b 75%, #c0392b 100%);
    background-size: 40px 40px;
}

.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    display: none;
}

.result-message {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.result-message h2 {
    color: #27ae60;
    margin-bottom: 15px;
}

.result-message p {
    margin-bottom: 20px;
    font-size: 18px;
}

@media (max-width: 500px) {
    .game-board {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .card {
        height: 100px;
    }
    
    .stats {
        flex-direction: column;
        gap: 5px;
    }
} 