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

        body {
            min-height: 100vh;
            background: linear-gradient(135deg, #1e1b4b 0%, #581c87 50%, #831843 100%);
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px;
        }

        /* Header */
        .header {
            text-align: center;
            margin-bottom: 30px;
        }

        .header h1 {
            font-size: 3rem;
            background: linear-gradient(90deg, #fef08a, #f9a8d4, #a5f3fc);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 10px;
            text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
        }

        .header p {
            color: rgba(255, 255, 255, 0.7);
            font-size: 1.1rem;
        }

        /* Stats Bar */
        .stats-bar {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 15px;
            margin-bottom: 30px;
        }

        .stat-card {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border-radius: 15px;
            padding: 15px 25px;
            display: flex;
            align-items: center;
            gap: 10px;
            border: 1px solid rgba(255, 255, 255, 0.2);
            min-width: 120px;
        }

        .stat-card .icon {
            font-size: 1.5rem;
        }

        .stat-card .stat-info {
            text-align: left;
        }

        .stat-card .stat-label {
            color: rgba(255, 255, 255, 0.6);
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .stat-card .stat-value {
            color: white;
            font-size: 1.5rem;
            font-weight: bold;
        }

        /* New Game Button */
        .new-game-btn {
            background: linear-gradient(135deg, #ec4899, #8b5cf6);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: white;
            padding: 15px 30px;
            border-radius: 15px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.3s ease;
        }

        .new-game-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
        }

        /* Game Board */
        .game-board {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
            max-width: 500px;
            width: 100%;
            padding: 20px;
        }

        /* Card */
        .card {
            aspect-ratio: 1;
            perspective: 1000px;
            cursor: pointer;
        }

        .card-inner {
            position: relative;
            width: 100%;
            height: 100%;
            transition: transform 0.5s ease;
            transform-style: preserve-3d;
        }

        .card.flipped .card-inner,
        .card.matched .card-inner {
            transform: rotateY(180deg);
        }

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

        .card-back {
            background: linear-gradient(135deg, #8b5cf6, #a855f7, #d946ef);
            border: 4px solid rgba(255, 255, 255, 0.2);
        }

        .card-back:hover {
            transform: scale(1.02);
            box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
        }

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

        .card-front {
            background: linear-gradient(135deg, #fffbeb, #fef3c7);
            border: 4px solid #fcd34d;
            transform: rotateY(180deg);
            font-size: 3rem;
        }

        .card.matched .card-front {
            background: linear-gradient(135deg, #34d399, #14b8a6);
            border-color: #6ee7b7;
            animation: bounce 0.5s ease;
        }

        .card.matched .card-front::before {
            content: '✨';
            position: absolute;
            top: -5px;
            right: -5px;
            font-size: 1rem;
        }

        @keyframes bounce {
            0%, 100% { transform: rotateY(180deg) scale(1); }
            50% { transform: rotateY(180deg) scale(1.1); }
        }

        /* Instructions */
        .instructions {
            background: rgba(255, 255, 255, 0.05);
            backdrop-filter: blur(10px);
            border-radius: 15px;
            padding: 20px 30px;
            margin-top: 30px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            text-align: center;
            max-width: 500px;
            width: 100%;
        }

        .instructions h3 {
            color: white;
            margin-bottom: 10px;
        }

        .instructions ul {
            list-style: none;
            color: rgba(255, 255, 255, 0.6);
        }

        .instructions li {
            padding: 5px 0;
        }

        /* Win Modal */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(5px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            padding: 20px;
        }

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

        .modal {
            background: linear-gradient(135deg, #7c3aed, #6d28d9);
            border-radius: 25px;
            padding: 40px;
            max-width: 400px;
            width: 100%;
            text-align: center;
            border: 1px solid rgba(255, 255, 255, 0.2);
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
            animation: modalIn 0.3s ease;
        }

        @keyframes modalIn {
            from {
                transform: scale(0.8);
                opacity: 0;
            }
            to {
                transform: scale(1);
                opacity: 1;
            }
        }

        .modal .emoji {
            font-size: 4rem;
            margin-bottom: 20px;
        }

        .modal h2 {
            color: white;
            font-size: 2rem;
            margin-bottom: 10px;
        }

        .modal p {
            color: rgba(255, 255, 255, 0.8);
            margin-bottom: 30px;
        }

        .modal-stats {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin-bottom: 20px;
        }

        .modal-stat {
            background: rgba(255, 255, 255, 0.1);
            border-radius: 15px;
            padding: 15px;
        }

        .modal-stat .label {
            color: rgba(255, 255, 255, 0.6);
            font-size: 0.85rem;
        }

        .modal-stat .value {
            color: white;
            font-size: 2rem;
            font-weight: bold;
        }

        .new-best {
            background: rgba(250, 204, 21, 0.2);
            border: 1px solid rgba(250, 204, 21, 0.4);
            border-radius: 10px;
            padding: 10px;
            margin-bottom: 20px;
            color: #fcd34d;
            font-weight: 600;
            display: none;
        }

        .new-best.show {
            display: block;
        }

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

        .modal-btn {
            flex: 1;
            padding: 15px;
            border-radius: 15px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            border: none;
            transition: all 0.3s ease;
        }

        .modal-btn.close {
            background: rgba(255, 255, 255, 0.2);
            color: white;
        }

        .modal-btn.close:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .modal-btn.play-again {
            background: white;
            color: #6d28d9;
        }

        .modal-btn.play-again:hover {
            transform: scale(1.05);
        }

        /* Confetti */
        .confetti {
            position: fixed;
            width: 10px;
            height: 10px;
            top: -10px;
            pointer-events: none;
            z-index: 1001;
        }

        @keyframes fall {
            0% {
                transform: translateY(0) rotate(0deg);
                opacity: 1;
            }
            100% {
                transform: translateY(100vh) rotate(720deg);
                opacity: 0;
            }
        }

        /* Responsive */
        @media (max-width: 500px) {
            .header h1 {
                font-size: 2rem;
            }

            .game-board {
                gap: 8px;
                padding: 10px;
            }

            .card-front {
                font-size: 2rem;
            }

            .stat-card {
                padding: 10px 15px;
                min-width: 100px;
            }

            .stats-bar {
                gap: 10px;
            }
        }