:root {
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --primary: #06b6d4;
    --primary-light: #22d3ee;
    --primary-dark: #0891b2;
    --accent: #f43f5e;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: #1e293b;
    --gradient-primary: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-darker);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navbar */
.navbar {
    padding: 1.5rem 0;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 1px;
    font-family: 'Outfit', sans-serif;
}

.logo .dot {
    color: var(--primary);
}

.back-btn {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.back-btn:hover {
    color: var(--primary);
}

/* Game Main */
.game-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    background: radial-gradient(circle at top right, rgba(6, 182, 212, 0.1), transparent),
        radial-gradient(circle at bottom left, rgba(244, 63, 94, 0.1), transparent);
}

.game-container {
    width: 100%;
    max-width: 800px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.game-header {
    margin-bottom: 2rem;
}

.game-title {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.game-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Stats */
.game-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
}

/* Memory Grid */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
    perspective: 1000px;
}

.memory-card {
    aspect-ratio: 1/1;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.memory-card:active {
    transform: scale(0.95);
    transition: transform 0.2s;
}

.memory-card.flip {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    border: 2px solid var(--glass-border);
}

.card-front {
    background: var(--card-bg);
    transform: rotateY(180deg);
}

.card-back {
    background: var(--gradient-primary);
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

.card-back::after {
    content: '?';
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: white;
    font-size: 2rem;
    opacity: 0.5;
}

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

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Controls & Buttons */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.game-button {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    background: var(--gradient-primary);
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 15px -3px rgba(6, 182, 212, 0.3);
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(6, 182, 212, 0.4);
}

.game-button:active {
    transform: translateY(0);
}

/* Overlay */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 2rem;
}

.game-overlay.active {
    display: flex;
}

.overlay-content {
    text-align: center;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.overlay-content h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-family: 'Outfit', sans-serif;
}

.overlay-content p {
    color: var(--text-secondary);
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

/* Footer */
.footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--glass-border);
}

/* Responsive */
@media (max-width: 640px) {
    .memory-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .game-container {
        padding: 1.5rem;
    }

    .game-title {
        font-size: 2rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}