* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 800px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

h1 {
    font-weight: 800;
    background: -webkit-linear-gradient(#00f2fe, #4facfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stats {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.2rem;
}

button {
    background: #4facfe;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

button:hover {
    background: #00f2fe;
    transform: scale(1.05);
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    perspective: 1000px;
}

.card {
    width: 100%;
    aspect-ratio: 1;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.card.flipped,
.card.matched {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.card-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card-back {
    background: #fff;
    transform: rotateY(180deg);
}

.leaderboard {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 12px;
}

.leaderboard ul {
    list-style: none;
    margin-top: 10px;
}

.leaderboard li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #2c5364;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-content input {
    padding: 10px;
    border-radius: 5px;
    border: none;
    font-size: 1rem;
    outline: none;
}

@media (max-width: 500px) {
    .game-board {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .card-face {
        font-size: 2rem;
    }

    h1 {
        font-size: 1.5rem;
    }
}