* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 800px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

h1 {
    color: #764ba2;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.value {
    font-size: 1.8em;
    font-weight: bold;
    color: #667eea;
}

.btn-reset {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1em;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: bold;
}

.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    perspective: 1000px;
    max-width: 600px;
    margin: 0 auto;
}

.card {
    aspect-ratio: 1;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card.flipped {
    transform: rotateY(180deg);
}

.card.matched {
    opacity: 0.7;
    cursor: default;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    font-size: 3em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card-front {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    font-weight: bold;
}

.card-front::before {
    content: "?";
}

.card-back {
    background: white;
    transform: rotateY(180deg);
}

.victory-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.victory-message.show {
    display: flex;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.victory-content {
    background: white;
    padding: 50px;
    border-radius: 25px;
    text-align: center;
    animation: scaleIn 0.5s;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes scaleIn {
    from {
        transform: scale(0.5);
    }
    to {
        transform: scale(1);
    }
}

.victory-content h2 {
    color: #764ba2;
    font-size: 2.5em;
    margin-bottom: 20px;
}

.victory-content p {
    font-size: 1.3em;
    color: #666;
    margin: 10px 0;
}

.btn-play-again {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s;
    font-weight: bold;
}

.btn-play-again:hover {
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 600px) {
    h1 {
        font-size: 1.8em;
    }
    
    .game-board {
        gap: 10px;
    }
    
    .card-face {
        font-size: 2em;
    }
    
    .stats {
        gap: 20px;
    }
}
