        body {
            font-family: 'Arial', sans-serif;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            background-color: #f0f0f0;
            margin: 0;
            padding: 20px;
            box-sizing: border-box;
        }

        .controls {
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 15px;
            background-color: #fff;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }

        .controls label, .controls select, .controls button {
            font-size: 16px;
        }

        .controls button {
            padding: 8px 15px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        .controls button:hover {
            background-color: #45a049;
        }

        .stats {
            display: flex;
            gap: 20px;
            margin-bottom: 20px;
            font-size: 18px;
            background-color: #fff;
            padding: 10px 20px;
            border-radius: 8px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }

        .game-board {
            display: grid;
            gap: 10px;
            perspective: 1000px; /* For 3D flip effect */
        }

        .card {
            width: 80px;
            height: 100px;
            background-color: #ddd;
            border: 2px solid #333;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 30px;
            cursor: pointer;
            position: relative;
            transform-style: preserve-3d;
            transition: transform 0.6s;
            user-select: none; /* Prevent text selection */
        }

        .card.flipped, .card.matched {
            transform: rotateY(180deg);
        }
        
        .card.matched {
            background-color: #aaffaa; /* Light green for matched cards */
            border-color: #008000;
        }

        .card-face {
            position: absolute;
            width: 100%;
            height: 100%;
            backface-visibility: hidden; /* Hide the back of the element when flipped */
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px; /* Match card's border-radius */
        }

        .card-front {
            background-color: #4a90e2; /* Blue for card front */
            color: white;
        }
        .card-front::before {
            content: '?'; /* Question mark for hidden state */
            font-size: 40px;
        }


        .card-back {
            background-color: #f9f9f9; /* Light grey for card back */
            color: #333;
            transform: rotateY(180deg); /* Initially hidden */
        }

        .game-over-modal {
            display: none; /* Hidden by default */
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.7);
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }

        .game-over-content {
            background-color: white;
            padding: 30px;
            border-radius: 10px;
            text-align: center;
            box-shadow: 0 5px 15px rgba(0,0,0,0.3);
        }

        .game-over-content h2 {
            margin-top: 0;
            color: #333;
        }
        .game-over-content p {
            font-size: 18px;
            margin: 10px 0;
        }
        .game-over-content button {
            padding: 10px 20px;
            font-size: 16px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            margin-top: 15px;
        }