
        :root {
            --text-color: #ffffff;
            --border-color: #e5e7eb;
            --cell-unrevealed: #d1d5db;
            --cell-revealed: #f9fafb;
            --cell-hover: #e5e7eb;
            --mine-color: #ef4444;
            --flag-color: #2563eb;
            --win-color: #22c55e;
            --lose-color: #ef4444;
            --btn-bg: #4f46e5;
            --btn-hover: #4338ca;
        }
        [data-theme="dark"] {
            --bg-color: #111827;
            --text-color: #ffffff;
            --border-color: #374151;
            --cell-unrevealed: #4b5563;
            --cell-revealed: #1f2937;
            --cell-hover: #6b7280;
            --mine-color: #f87171;
            --flag-color: #60a5fa;
            --win-color: #4ade80;
            --lose-color: #f87171;
            --btn-bg: #4f46e5;
            --btn-hover: #6366f1;
        }

        body {
          background: linear-gradient(
            45deg,
            #fbc2eb 0%,    
            #fdd384 25%,   
            #fff5b1 50%,   
            #c1e1ff 75%, 
            #d0e8ff 100%   
          );
            color: var(--text-color);
            font-family: "Poppins", sans-serif;
            transition: background-color 0.3s, color 0.3s;
        }

        .board-grid {
            display: grid;
            border: 2px solid var(--border-color);
            border-radius: 0.5rem;
            transition: border-color 0.3s;
            overflow: hidden;
        }

        .cell {
            width: 100%;
            padding-top: 100%;
            position: relative;
            background-color: var(--cell-unrevealed);
            border: 1px solid var(--border-color);
            cursor: pointer;
            user-select: none;
            transition: background-color 0.1s, border-color 0.3s, transform 0.1s;
        }

        .cell:hover:not(.revealed):not(.flagged) {
            background-color: var(--cell-hover);
        }

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

        .cell-content {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: clamp(0.75rem, 2vw, 1.5rem);
            transform: scale(0);
            transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        
        .cell.revealed .cell-content {
            transform: scale(1);
        }

        .cell.mine .cell-content {
            color: var(--mine-color);
            font-size: clamp(1rem, 3vw, 2rem);
        }

        .cell.flagged .cell-content {
            color: var(--flag-color);
            font-size: clamp(1rem, 3vw, 2rem);
            transform: scale(1);
        }
        
        .cell.mine.exploded {
            animation: mine-explode 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
        }

        @keyframes mine-explode {
            0% { transform: scale(1); }
            50% { transform: scale(1.5); }
            100% { transform: scale(1); background-color: var(--mine-color); }
        }

        .cell[data-adjacent="1"] { color: #1e40af; }
        .cell[data-adjacent="2"] { color: #166534; }
        .cell[data-adjacent="3"] { color: #b91c1c; }
        .cell[data-adjacent="4"] { color: #1e3a8a; }
        .cell[data-adjacent="5"] { color: #881337; }
        .cell[data-adjacent="6"] { color: #0c4a6e; }
        .cell[data-adjacent="7"] { color: #3f3f46; }
        .cell[data-adjacent="8"] { color: #000000; }

        [data-theme="dark"] .cell[data-adjacent="1"] { color: #60a5fa; }
        [data-theme="dark"] .cell[data-adjacent="2"] { color: #4ade80; }
        [data-theme="dark"] .cell[data-adjacent="3"] { color: #f87171; }
        [data-theme="dark"] .cell[data-adjacent="4"] { color: #3b82f6; }
        [data-theme="dark"] .cell[data-adjacent="5"] { color: #f43f5e; }
        [data-theme="dark"] .cell[data-adjacent="6"] { color: #0ea5e9; }
        [data-theme="dark"] .cell[data-adjacent="7"] { color: #a1a1aa; }
        [data-theme="dark"] .cell[data-adjacent="8"] { color: #ffffff; }

        .modal-overlay {
            background-color: rgba(0, 0, 0, 0.5);
        }
