/* Reset simple */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: -apple-system, "Segoe UI", Roboto, sans-serif; background: #f4f4f5; color: #1f2937; }

/* Layout mobile first : panneau en haut, aperçu en dessous */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.panel {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem;
    overflow-y: auto;
}

.panel h1 {
    font-size: 1.1rem;
    margin: 0 0 0.75rem 0;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.panel h2 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin: 1rem 0 0.4rem 0;
    font-weight: 600;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.7rem;
}

.field-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.field label {
    font-size: 0.8rem;
    color: #374151;
    font-weight: 500;
}

.field-value {
    font-size: 0.75rem;
    color: #111827;
    font-variant-numeric: tabular-nums;
    background: #f3f4f6;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
}

/* Sliders : rendu discret et cohérent */
.field input[type="range"] {
    width: 100%;
    accent-color: #111827;
    cursor: pointer;
    padding: 0;
    background: transparent;
    border: none;
}

.field input, .field select, #seed, #background, #colorMode, #palette, #generator, #preset {
    padding: 0.4rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.85rem;
    background: #ffffff;
    color: #111827;
    font-family: inherit;
}

.field input[type="checkbox"] {
    width: auto;
    align-self: flex-start;
}

.row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.row > * { flex: 1; }

button {
    padding: 0.55rem 0.75rem;
    border: 1px solid #111827;
    background: #111827;
    color: #ffffff;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
}

button:hover { background: #374151; }

button.secondary {
    background: #ffffff;
    color: #111827;
}

button.secondary:hover { background: #f3f4f6; }

.preview-wrap {
    flex: 1;
    background: #e5e7eb;
    padding: 1rem;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

#preview {
    max-width: 100%;
    max-height: 100%;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

#preview svg {
    display: block;
    max-width: 100%;
    height: auto;
}

#status {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
    min-height: 1em;
}

/* Desktop : 2 colonnes */
@media (min-width: 1000px) {
    .app {
        flex-direction: row;
        height: 100vh;
    }
    .panel {
        width: 320px;
        min-width: 320px;
        border-right: 1px solid #e5e7eb;
        border-bottom: none;
        height: 100vh;
    }
    .preview-wrap {
        padding: 2rem;
    }
}
