body {
            font-family: 'Inter', sans-serif;
            background-color: #f0f4f8;
            display: flex;
            justify-content: center;
            align-items: flex-start;
            min-height: 100vh;
            padding: 10px; /* MODIFIED: Reduced padding */
            box-sizing: border-box;
        }
        #app-container {
            background-color: #ffffff;
            padding: 20px; /* MODIFIED: Reduced padding */
            border-radius: 15px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
            max-width: 1050px; /* MODIFIED: Changed from width */
            width: 100%;       /* MODIFIED: Added for fluidity */
        }
        .form-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
            width: 100%;
        }
        select {
            padding: 10px;
            border: 1px solid #cbd5e1;
            border-radius: 8px;
            background-color: #f8fafc;
            font-size: 1rem;
        }
        .action-button {
            background-color: #4f46e5;
            color: white;
            padding: 15px 30px;
            border-radius: 0;
            font-weight: 600;
            font-size: 1.1rem;
            transition: background-color 0.3s ease, transform 0.1s ease;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
            flex-grow: 1;
            min-width: 120px;
        }
        .action-button:hover {
            background-color: #4338ca;
            transform: translateY(-1px);
        }
        .action-button:active {
            transform: translateY(1px);
            box-shadow: none;
        }
        .action-button:disabled {
            background-color: #9ca3af;
            cursor: not-allowed;
            box-shadow: none;
        }
        #puzzleCanvas {
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            background-color: #f8fafc;
            max-width: 100%; /* ADDED: Ensures canvas doesn't overflow */
            height: auto;    /* ADDED: Maintains aspect ratio */
        }
        #statusMessage {
            font-weight: 600;
            color: #475569;
            min-height: 24px;
            text-align: center;
        }
        .spinner {
            border: 4px solid rgba(0, 0, 0, 0.1);
            border-left-color: #4f46e5;
            border-radius: 50%;
            width: 24px;
            height: 24px;
            animation: spin 1s linear infinite;
            display: inline-block;
            vertical-align: middle;
            margin-right: 8px;
        }
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* ADDED: Media query for mobile responsiveness */
        @media (max-width: 767px) { /* Targets screens smaller than 'md' */
            body {
                padding: 5px; /* Further reduce body padding */
            }
            #app-container {
                padding: 15px; /* Reduce container padding */
            }
            h1 {
                font-size: 1.5rem; /* text-2xl */
                line-height: 2rem;
            }
            .action-button {
                padding: 12px 15px; /* Make buttons slightly smaller */
                font-size: 0.95rem;
            }
            select {
                padding: 8px; /* Make dropdowns slightly smaller */
                font-size: 0.95rem;
            }
        }