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

        :root {
            --bg-primary: #1a1a1a;
            --bg-secondary: #2d2d2d;
            --accent: #6b5b95;
            --accent-hover: #7b6ba5;
            --text: #e0e0e0;
            --text-dim: #a0a0a0;
            --cell-hidden: #3a3a3a;
            --cell-revealed: #4a4a4a;
            --cell-mine: #8b2635;
            --cell-flag: #2d5a27;
            --shadow: rgba(0, 0, 0, 0.3);
        }

        .theme-lofi {
            --bg-primary: #1a1a1a;
            --bg-secondary: #2d2d2d;
            --accent: #6b5b95;
            --accent-hover: #7b6ba5;
            --text: #e0e0e0;
            --text-dim: #a0a0a0;
            --cell-hidden: #1d1c1c;
            --cell-revealed: #4a4a4a;
            --cell-mine: #8b2635;
            --cell-flag: #2d5a27;
        }

        .theme-bw {
            --bg-primary: #0a0a0a;
            --bg-secondary: #1a1a1a;
            --accent: #666666;
            --accent-hover: #777777;
            --text: #ffffff;
            --text-dim: #cccccc;
            --cell-hidden: #131212;
            --cell-revealed: #3a3a3a;
            --cell-mine: #555555;
            --cell-flag: #444444;
        }

        .theme-cyber {
            --bg-primary: #0a0a0f;
            --bg-secondary: #1a1a2e;
            --accent: #00d4ff;
            --accent-hover: #33ddff;
            --text: #00ffff;
            --text-dim: #66cccc;
            --cell-hidden: #16213e;
            --cell-revealed: #0f3460;
            --cell-mine: #0066cc;
            --cell-flag: #004499;
        }

        body {
            font-family: 'Courier New', monospace;
            background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
            color: var(--text);
            min-height: 100vh;
            padding: 20px;
            transition: all 0.3s ease;
        }

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

        header {
            text-align: center;
            margin-bottom: 30px;
        }

        h1 {
            font-size: 2.5rem;
            margin-bottom: 10px;
            text-shadow: 0 0 20px var(--accent);
            letter-spacing: 2px;
        }

        .controls {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-bottom: 30px;
            flex-wrap: wrap;
        }

        .control-group {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }

        label {
            color: var(--text-dim);
            font-size: 0.9rem;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        select, button {
            background: var(--bg-secondary);
            color: var(--text);
            border: 2px solid var(--accent);
            padding: 10px 15px;
            border-radius: 5px;
            font-family: inherit;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        select:hover, select:focus,
        button:hover, button:focus {
            border-color: var(--accent-hover);
            box-shadow: 0 0 15px var(--accent);
            outline: none;
        }

        .stats {
            display: flex;
            justify-content: center;
            gap: 30px;
            margin-bottom: 30px;
            font-size: 1.1rem;
        }

        .stat {
            text-align: center;
        }

        .stat-value {
            display: block;
            font-size: 1.5rem;
            color: var(--accent);
            font-weight: bold;
        }

        .game-board {
            display: grid;
            gap: 2px;
            justify-content: center;
            margin: 0 auto;
            max-width: 600px;
            background: var(--bg-primary);
            padding: 10px;
            border-radius: 10px;
            border: 2px solid var(--accent);
        }

        .grid-9 { grid-template-columns: repeat(9, 1fr); }
        .grid-16 { grid-template-columns: repeat(16, 1fr); }
        .grid-24 { grid-template-columns: repeat(24, 1fr); }

        .cell {
            aspect-ratio: 1;
            background: var(--cell-hidden);
            border: 1px solid var(--accent);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            font-weight: bold;
            transition: all 0.2s ease;
            min-height: 25px;
            user-select: none;
        }

        .cell:hover:not(.revealed):not(.flagged) {
            background: var(--accent);
            transform: scale(1.05);
        }

        .cell.revealed {
            background: var(--cell-revealed);
            cursor: default;
        }

        .cell.flagged {
            background: var(--cell-flag);
            color: var(--accent);
        }

        .cell.mine {
            background: var(--cell-mine);
            color: var(--text);
        }

        .cell.mine-exploded {
            background: #ff4444;
            color: white;
            animation: explode 0.5s ease-out;
        }

        @keyframes explode {
            0% { transform: scale(1); }
            50% { transform: scale(1.3); }
            100% { transform: scale(1); }
        }

        .number-1 { color: #0099ff; }
        .number-2 { color: #00ff00; }
        .number-3 { color: #ff6600; }
        .number-4 { color: #6600ff; }
        .number-5 { color: #ff0066; }
        .number-6 { color: #00ffff; }
        .number-7 { color: #ffff00; }
        .number-8 { color: #ff0000; }

        .game-status {
            text-align: center;
            margin-top: 30px;
            padding: 20px;
            background: var(--bg-secondary);
            border: 2px solid var(--accent);
            border-radius: 10px;
            display: none;
        }

        .game-status.show {
            display: block;
            animation: slideIn 0.5s ease-out;
        }

        @keyframes slideIn {
            from { opacity: 0; transform: translateY(-20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .celebration {
            font-size: 2rem;
            margin-bottom: 15px;
        }

        .difficulty-buttons {
            display: flex;
            gap: 10px;
            justify-content: center;
            margin-bottom: 20px;
        }

        .difficulty-btn {
            padding: 8px 16px;
            font-size: 0.9rem;
        }

        .difficulty-btn.active {
            background: var(--accent);
            color: var(--bg-primary);
        }

        .instructions {
            text-align: center;
            color: var(--text-dim);
            font-size: 0.9rem;
            margin-bottom: 20px;
        }

        @media (max-width: 768px) {
            .controls {
                flex-direction: column;
                align-items: center;
            }
            
            .stats {
                flex-direction: column;
                gap: 15px;
            }
            
            h1 {
                font-size: 2rem;
            }
            
            .cell {
                font-size: 0.7rem;
                min-height: 20px;
            }
            
            .difficulty-buttons {
                flex-direction: column;
                align-items: center;
            }
        }