    @import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Orbitron:wght@500;700;900&display=swap');

    :root {
        --bg-primary: #0a0e27;
        --bg-secondary: #1a1f3a;
        --accent-primary: #00ff88;
        --accent-secondary: #ff006e;
        --accent-warning: #ffbe0b;
        --text-primary: #e0e0ff;
        --text-secondary: #8892b0;
        --cell-unrevealed: #2d3561;
        --cell-revealed: #1a1f3a;
        --cell-mine: #ff006e;
        --cell-flag: #00ff88;
        --border-color: #404870;
    }

    [data-theme="light"] {
        --bg-primary: #f5f5f0;
        --bg-secondary: #ffffff;
        --accent-primary: #00b359;
        --accent-secondary: #d90429;
        --accent-warning: #ff9500;
        --text-primary: #1a1a1a;
        --text-secondary: #666666;
        --cell-unrevealed: #acacac;
        --cell-revealed: #ffffff;
        --cell-mine: #d90429;
        --cell-flag: #00b359;
        --border-color: #cccccc;
    }

    [data-theme="neon"] {
        --bg-primary: #000000;
        --bg-secondary: #0d0d0d;
        --accent-primary: #00ffff;
        --accent-secondary: #ff00ff;
        --accent-warning: #ffff00;
        --text-primary: #ffffff;
        --text-secondary: #00ffff;
        --cell-unrevealed: #1a1a1a;
        --cell-revealed: #0d0d0d;
        --cell-mine: #ff00ff;
        --cell-flag: #00ffff;
        --border-color: #00ffff;
    }

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

    body {
        font-family: 'Space Mono', monospace;
        background: var(--bg-primary);
        color: var(--text-primary);
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 20px;
        transition: background 0.3s ease, color 0.3s ease;
    }

    .dark .game-container {
        background-image: url('background.jpg');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: 50% 50%;
    }

    header {
        text-align: center;
        animation: fadeInDown 0.6s ease;
    }

    h1 {
        font-family: 'Orbitron', sans-serif;
        font-size: clamp(2rem, 5vw, 3.5rem);
        font-weight: 900;
        background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        margin-bottom: 10px;
        letter-spacing: 2px;
    }

    .controls {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
        margin-bottom: 30px;
        animation: fadeIn 0.6s ease 0.2s both;
    }

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

    /* .container {
      display: flex;
      flex-direction: column;
      flex-wrap: nowrap;
      justify-content: flex-start;
      align-items: center;
    } */

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

    select,
    button {
        font-family: 'Space Mono', monospace;
        padding: 10px 20px;
        border: 2px solid var(--border-color);
        background: var(--bg-secondary);
        color: var(--text-primary);
        cursor: pointer;
        font-size: 0.9rem;
        transition: all 0.3s ease;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    select:hover,
    button:hover {
        border-color: var(--accent-primary);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
    }

    button.primary {
        background: var(--accent-primary);
        color: var(--bg-primary);
        border-color: var(--accent-primary);
        font-weight: 700;
    }

    button.primary:hover {
        box-shadow: 0 4px 20px rgba(0, 255, 136, 0.5);
    }

    button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

    button:disabled:hover {
        border-color: var(--border-color);
        box-shadow: none;
        transform: none;
    }

    .stats {
        display: flex;
        gap: 20px;
        justify-content: center;
        flex-wrap: wrap;
        /* margin-bottom: 20px; */
        font-family: 'Orbitron', sans-serif;
        font-size: 1.2rem;
        animation: fadeIn 0.6s ease 0.4s both;
    }

    .stat {
        display: flex;
        align-items: center;
        gap: 10px;
    }

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

    .stat-value {
        color: var(--accent-primary);
        font-weight: 700;
    }

    .game-container {
        display: flex;
        justify-content: center;
        align-items: center;
        animation: fadeInUp 0.8s ease 0.6s both;
    }

    #game-board {
        width: 100%;
        max-width: min(90vw, 90vh);
        height: auto;
        filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
    }

    .cell {
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .cell:hover {
        opacity: 0.8;
    }

    .cell.revealed {
        cursor: default;
    }

    .cell.revealed:hover {
        opacity: 1;
    }

    .cell.revealed.has-number:hover {
        cursor: pointer;
        opacity: 0.9;
    }

    .cell:hover polygon {
        stroke-width: 2.5;
    }

    .cell polygon {
        stroke: var(--border-color);
        stroke-width: 1.5;
    }

    .cell.unrevealed polygon {
        fill: var(--cell-unrevealed);
    }

    .cell.revealed polygon {
        fill: var(--cell-revealed);
    }

    .cell.flagged polygon {
        fill: var(--accent-secondary);
    }

    .cell.mine polygon {
        fill: var(--cell-mine);
    }

    .cell.second-chance-bomb polygon {
        fill: var(--accent-warning);
    }

    .cell text {
        fill: var(--text-primary);
        font-family: 'Orbitron', sans-serif;
        font-weight: 700;
    }

    .cell.neighbor-hover polygon {
        stroke: var(--accent-primary);
        stroke-width: 3;
        filter: drop-shadow(0 0 6px var(--accent-primary));
    }

    .message {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0);
        background: var(--bg-secondary);
        border: 3px solid var(--accent-primary);
        padding: 40px 60px;
        text-align: center;
        z-index: 1000;
        animation: popIn 0.5s ease forwards;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    }

    .message h2 {
        font-family: 'Orbitron', sans-serif;
        font-size: 2.5rem;
        margin-bottom: 20px;
        color: var(--accent-primary);
    }

    .message.lose h2 {
        color: var(--accent-secondary);
    }

    .message button {
        margin-top: 20px;
        font-size: 1rem;
        padding: 12px 30px;
    }

    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        z-index: 999;
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

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

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes popIn {
        0% {
            transform: translate(-50%, -50%) scale(0);
            opacity: 0;
        }

        50% {
            transform: translate(-50%, -50%) scale(1.1);
        }

        100% {
            transform: translate(-50%, -50%) scale(1);
            opacity: 1;
        }
    }

    @keyframes pulse {

        0%,
        100% {
            opacity: 1;
        }

        50% {
            opacity: 0.3;
        }
    }

    .theme-switcher {
        position: fixed;
        top: 20px;
        right: 20px;
        display: flex;
        gap: 10px;
        z-index: 100;
    }

    .theme-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 2px solid var(--border-color);
        cursor: pointer;
        transition: all 0.3s ease;
        padding: 0;
    }

    .theme-btn:hover {
        transform: scale(1.1);
        border-color: var(--accent-primary);
    }

    .theme-btn.active {
        border-color: var(--accent-primary);
        box-shadow: 0 0 15px var(--accent-primary);
    }

    .theme-btn.dark {
        background: linear-gradient(135deg, #0a0e27, #1a1f3a);
    }

    .theme-btn.light {
        background: linear-gradient(135deg, #f5f5f0, #ffffff);
    }

    .theme-btn.neon {
        background: linear-gradient(135deg, #000000, #00ffff);
    }

    .info-note {
        text-align: center;
        color: var(--text-secondary);
        font-size: 0.8rem;
        margin-top: 20px;
        font-style: italic;
    }

    @media (max-width: 768px) {
        .controls {
            flex-direction: column;
            align-items: stretch;
        }

        .stats {
            gap: 10px;
            font-size: 1rem;
        }

        .message {
            padding: 30px 40px;
        }

        .message h2 {
            font-size: 2rem;
        }
    }

    @keyframes spin {
        0% {
            transform: rotate(0deg);
        }

        100% {
            transform: rotate(360deg);
        }
    }

    .loading-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        display: none;
        justify-content: center;
        align-items: center;
        z-index: 10000;
        backdrop-filter: blur(5px);
    }

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

    .loading-content {
        background: var(--bg-primary);
        padding: 40px;
        border-radius: 20px;
        text-align: center;
        border: 2px solid var(--accent-primary);
        box-shadow: 0 10px 50px rgba(0, 255, 136, 0.3);
        min-width: 300px;
    }

    .loading-spinner {
        width: 60px;
        height: 60px;
        border: 4px solid var(--bg-secondary);
        border-top: 4px solid var(--accent-primary);
        border-radius: 50%;
        margin: 0 auto 20px;
        animation: spin 1s linear infinite;
    }

    .loading-text {
        font-size: 1.2rem;
        color: var(--text-primary);
        margin-bottom: 10px;
        font-weight: 600;
    }

    .loading-subtext {
        font-size: 0.9rem;
        color: var(--text-secondary);
    }