body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    /* min-height: 100vh; */
}

@media (min-width: 640px) {
    body {
        padding: 2rem;
    }
}

@media (min-width: 768px) {
    body {
        padding: 3rem;
    }
}

.container {
    background-color: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    width: 100%;
    max-width: 48rem;
    text-align: center;
}

@media (min-width: 640px) {
    .container {
        padding: 2rem;
    }
}

.title {
    font-size: 2.25rem;
    line-height: 2.5rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .title {
        font-size: 2.5rem;
    }
}

@media (min-width: 768px) {
    .title {
        font-size: 3rem;
    }
}

.subtitle {
    color: #64748b;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

@media (min-width: 640px) {
    .subtitle {
        margin-bottom: 2rem;
        font-size: 1rem;
        line-height: 1.5rem;
    }
}

.space-y-6 > * + * {
    margin-top: 1.5rem;
}

.controls-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .controls-container {
        flex-direction: row;
    }
}

.btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition-property: background-color, transform;
    transition-duration: 200ms;
}

.btn.primary {
    background-color: #4f46e5;
    color: #fff;
}

.btn.primary:hover {
    background-color: #4338ca;
}

.btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

.select-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    width: 100%;
    max-width: 200px; /* Constrain select width */
}

@media (min-width: 640px) {
    .select-container {
        max-width: none;
    }
}


.select-container label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.select-container select {
    width: 100%;
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    background-color: #fff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
    appearance: none; /* Hide default dropdown arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M7 7l3-3 3 3m0 6l-3 3-3-3' stroke='%234b5563' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.5em;
}

.loading-indicator {
    display: none;
    color: #4f46e5;
    font-weight: 600;
    margin-top: 1rem;
    align-items: center;
    justify-content: center;
}

.loading-indicator.visible {
    display: flex;
}

.loading-icon {
    animation: spin 1s linear infinite;
    display: inline-block;
    height: 1.25rem;
    width: 1.25rem;
    margin-right: 0.75rem;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.image-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
    justify-items: center;
}

@media (min-width: 768px) {
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-title {
    font-size: 1.125rem;
    line-height: 1.75rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
}

.canvas-box {
    border: 2px solid #cbd5e1;
    border-radius: 0.5rem;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    /* Fixed pixel size to show the 32x32 image scaled up cleanly */
    width: 256px;
    height: 256px;
    background-color: #000;
    image-rendering: pixelated;
}

.result-box {
    background-color: #eef2ff;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    display: none;
}

.result-box.visible {
    display: block;
}

.error-box {
    background-color: #fef2f2;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    display: none;
}

.error-box.visible {
    display: block;
}

.result-text {
    font-weight: 700;
    color: #334155;
}

.result-value {
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 800;
    color: #4f46e5;
}

.error-text {
    font-weight: 600;
    color: #dc2626;
}

.error-message {
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #ef4444;
}
