    :root {
        --bg: #fafafa;
        --cell-bg: #ffffff;
        --cell-fixed-bg: #e9eef5;
        --cell-hover: #deecff;
        --error: #ffb3b3;
        --primary: #3b82f6;
        --border: #cbd5e1;
        --radius: 6px;
        --anim: 0.15s ease;
    }
	
	#grid {
        display: grid;
        gap: 3px;
        margin-top: 20px;
        width: min(90vw, 450px);
    }

    .cell {
        background: var(--cell-bg);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        aspect-ratio: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: clamp(1.2rem, 3vw, 2rem);
        font-weight: 600;
        cursor: pointer;
        transition: background var(--anim), transform var(--anim);
        user-select: none;
    }

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

    .fixed {
        background: var(--cell-fixed-bg);
        cursor: not-allowed;
    }

    .error {
        background: var(--error) !important;
    }

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

    button {
        background: var(--primary);
        color: white;
        border: none;
        padding: 10px 16px;
        border-radius: var(--radius);
        font-size: 1rem;
        cursor: pointer;
        transition: background 0.2s ease, transform 0.1s ease;
    }

    button:hover {
        background: #1d4ed8;
    }

    button:active {
        transform: scale(0.96);
    }

    button:disabled {
        background: #94a3b8;
        cursor: not-allowed;
        opacity: 0.6;
    }

    button:disabled:hover {
        background: #94a3b8;
        transform: none;
    }

    #rulesBtn {
        background: #6366f1;
        font-weight: 600;
        padding: 10px 14px;
    }

    #rulesBtn:hover {
        background: #4f46e5;
    }

    /* Modal */
    .modal {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        animation: fadeIn 0.3s ease;
    }

    .modal.show {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .modal-content {
        background: white;
        padding: 30px;
        border-radius: 12px;
        max-width: 500px;
        width: 90%;
        max-height: 80vh;
        overflow-y: auto;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
        animation: slideUp 0.3s ease;
    }

    .modal-content h3 {
        margin-top: 0;
        color: var(--primary);
        font-size: 1.5rem;
    }

    .modal-content ul {
        line-height: 1.8;
        padding-left: 20px;
    }

    .modal-content li {
        margin-bottom: 10px;
    }

    .close-modal {
        background: #64748b;
        margin-top: 20px;
        width: 100%;
    }

    .close-modal:hover {
        background: #475569;
    }

    /* Success Modal */
    .success-modal .modal-content {
        text-align: center;
        padding: 40px;
    }

    .success-modal h3 {
        font-size: 2rem;
        margin-bottom: 10px;
    }

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

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    @keyframes slideUp {
        from {
            transform: translateY(30px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

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