* {
    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;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    color: white;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.stats {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.stat {
    background: rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.game-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 10px;
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.card {
    width: 70px;
    height: 70px;
    background: linear-gradient(145deg, #f0f0f0, #cacaca);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.card.revealed {
    background: linear-gradient(145deg, #ffeaa7, #fdcb6e);
    transform: rotateY(0deg);
}

.card.matched {
    background: linear-gradient(145deg, #00b894, #00a085);
    animation: pulse 0.6s ease-in-out;
}

.card.flipping {
    animation: flip 0.6s ease-in-out;
}

@keyframes flip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0deg); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.controls {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

button {
    background: linear-gradient(145deg, #74b9ff, #0984e3);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

button:active {
    transform: translateY(0);
}

.win-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, #00b894, #00a085);
    color: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    font-size: 1.5em;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    display: none;
    z-index: 1000;
}

.win-message.show {
    display: block;
    animation: winAnimation 0.8s ease-out;
}

@keyframes winAnimation {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1);
    }
}

@media (max-width: 768px) {
    .game-board {
        gap: 5px;
        padding: 15px;
    }
    
    .card {
        width: 35px;
        height: 35px;
        font-size: 1.2em;
    }
    
    .stats {
        gap: 15px;
        font-size: 1em;
    }
    
    h1 {
        font-size: 2em;
    }
}

.text {
    margin-top: 3em;
}
