/* Fractal generator landing (/fractal-generator) */

.fractal-landing-app {
    align-items: start;
}

    .fractal-landing-app .fractal-landing-frame {
        max-width: none;
        width: 100%;
        height: auto;
        min-width: 0;
    }

.fractal-landing-stage {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: stretch;
    gap: 8px;
    background: #07090f;
    box-shadow: none;
    place-items: stretch;
    min-height: 0;
    height: auto;
}

.fractal-landing-history {
    display: flex;
    flex-direction: column;
    width: 80px;
    min-width: 80px;
    height: 0;
    min-height: 100%;
    padding: 4px;
    gap: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.fractal-landing-history-item {
    appearance: none;
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 64px;
    height: 64px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

    .fractal-landing-history-item img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        pointer-events: none;
    }

    .fractal-landing-history-item:hover,
    .fractal-landing-history-item:focus-visible {
        border-color: var(--landing-accent, #2563eb);
        outline: none;
    }

    .fractal-landing-history-item.is-current {
        border-color: #fff;
        box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.65);
    }

    .fractal-landing-history-item.is-future {
        opacity: 0.55;
    }

@media (max-width: 600px) {
    .fractal-landing-history {
        width: 56px;
        min-width: 56px;
        gap: 4px;
        padding: 2px 0;
    }

    .fractal-landing-history-item {
        width: 48px;
        height: 48px;
    }
}

.fractal-landing-viewport {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    cursor: crosshair;
    background: #07090f;
}

.fractal-landing-app .fractal-landing-canvas,
.fractal-landing-app .fractal-landing-overlay {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: fill;
}

.fractal-landing-overlay {
    position: absolute;
    inset: 0;
    touch-action: none;
}

.fractal-landing-more {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8em;
}

.fractal-landing-more a {
    color: var(--landing-accent, #2563eb);
    font-size: 1.0rem;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.dark .fractal-landing-more a {
    color: #93c5fd;
}

.fractal-landing-coords {
    margin: 14px 0 0;
    color: var(--main-200);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    line-height: 1.4;
    word-break: break-word;
}

.dark .fractal-landing-coords {
    color: rgba(255, 255, 255, 0.72);
}

.fractal-landing-app .fractal-landing-types {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

    .fractal-landing-app .fractal-landing-types .landing-cta {
        width: auto;
        flex: 1 1 calc(33.33% - 8px);
        min-width: 6.4rem;
    }

.fractal-landing-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 8px;
    row-gap: 8px;
}

    .fractal-landing-field[hidden] {
        display: none;
    }

    .fractal-landing-field > .filter-landing-controls-label {
        grid-column: 1;
    }

    .fractal-landing-field > .fractal-landing-select {
        grid-column: 2;
    }

    .fractal-landing-field > .fractal-landing-gradient-row {
        grid-column: 1 / -1;
    }

.fractal-landing-select {
    width: 100%;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid rgba(20, 24, 32, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--main-200);
    font: inherit;
    font-size: 0.9rem;
}

    .fractal-landing-select option {
        color: #111;
        background: #fff;
    }

.fractal-landing-gradient-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

    .fractal-landing-gradient-row .fractal-landing-gradient {
        flex: 1 1 auto;
    }

.fractal-landing-dice {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(20, 24, 32, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--main-200);
    cursor: pointer;
}

    .fractal-landing-dice svg {
        width: 22px;
        height: 22px;
    }

.dark .fractal-landing-dice {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
}

.fractal-landing-gradient {
    width: 100%;
    height: 40px;
    margin: 0;
    border-radius: 8px;
    box-sizing: border-box;
}

.dark .fractal-landing-gradient {
    border-color: rgba(255, 255, 255, 0.14);
}

.dark .fractal-landing-select {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
}

.fractal-landing-app.is-busy .fractal-landing-overlay {
    cursor: wait;
}

body.filter-app-mode .fractal-landing-viewport {
    place-items: stretch;
    aspect-ratio: auto;
}

body.filter-app-mode .fractal-landing-history {
    align-self: stretch;
    height: 0;
    min-height: 100%;
}

body.filter-app-mode .fractal-landing-app .fractal-landing-canvas,
body.filter-app-mode .fractal-landing-app .fractal-landing-overlay {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
}

@media (max-width: 960px) {
    body.filter-app-mode .fractal-landing-coords,
    body.filter-app-mode .fractal-landing-more {
        display: none;
    }
}

@media (max-width: 600px) {
    body.filter-app-mode .fractal-landing-app {
        grid-template-rows: auto minmax(0, 1fr);
    }

        body.filter-app-mode .fractal-landing-app > .filter-landing-stage,
        body.filter-app-mode .fractal-landing-app .fractal-landing-frame {
            height: auto;
        }

        body.filter-app-mode .fractal-landing-app .fractal-landing-viewport {
            flex: 0 0 auto;
            width: 100%;
            height: min(38vh, 280px);
            max-height: min(38vh, 280px);
            aspect-ratio: auto;
        }

        body.filter-app-mode .fractal-landing-app > .filter-landing-controls {
            max-height: none;
            overflow: auto;
            padding-bottom: max(8px, env(safe-area-inset-bottom));
        }

        body.filter-app-mode .fractal-landing-app .fractal-landing-more {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            gap: 0.45em 1.15em;
            margin-top: 2px;
            flex-shrink: 0;
        }

        body.filter-app-mode .fractal-landing-app .fractal-landing-types .landing-cta {
            min-height: 32px;
            padding: 6px 10px;
            font-size: 0.8rem;
            min-width: 0;
            flex: 1 1 calc(33.33% - 8px);
        }

    body.filter-app-mode .fractal-landing-select {
        padding: 7px 10px;
        font-size: 0.9rem;
    }
}
