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

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(45deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    font-family: 'Poppins', sans-serif;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.main-container {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    text-align: center;
    max-width: 600px;
    width: 90%;
}

.header h1 {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: rgba(255, 255, 255, 0.4);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    display: flex;
    flex-direction: column;
    color: #fff;
    font-size: 0.9rem;
}

.stat-box span:last-child {
    font-weight: 700;
    font-size: 1.2rem;
    color: #555;
}

.game-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    perspective: 1000px;
    margin-bottom: 2rem;
}

.card {
    height: 100px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    cursor: pointer;
}

.card:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

.card.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.card-front {
    background: linear-gradient(135deg, #fff 0%, #f0f2f5 100%);
    transform: rotateY(180deg);
    font-size: 3rem;
}

.card-back {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 200% 200%;
}

.card-back::after {
    content: '?';
    font-size: 2rem;
    color: rgba(255,255,255,0.5);
    font-weight: 700;
}

#restart-btn {
    background: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    color: #764ba2;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    font-family: 'Poppins', sans-serif;
}

#restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

@media (max-width: 480px) {
    .game-container {
        gap: 10px;
    }
    .card {
        height: 80px;
    }
    .card-front {
        font-size: 2.2rem;
    }
}