/* Sandpile Fractal (/sandpile-fractal): the square canvas with its zoom buttons in a corner, the status line with the
   progress bar, the legend of heights, and the grains / example pair. Tiles, panels, fields, the chart and the theme
   come from the app kit (css/app-kit, docs/app-kit.md). Loaded only on this app's page (StylePaths). */

.sp-landing-app .sp-main {
    display: flex;
    flex-direction: column;
    gap: var(--ak-space-2);
}

.sp-landing-app .sp-canvas-wrap {
    position: relative;
    width: 100%;
    max-width: min(100%, 72vh);
    margin-inline: auto;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--ak-radius-sm);
}

/* The canvas takes every pointer: drag moves (or pours grains), wheel and pinch zoom. */
.sp-landing-app .sp-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
}

.sp-landing-app .sp-canvas:active { cursor: grabbing; }
.sp-landing-app[data-sp-mode="drops"] .sp-canvas { cursor: crosshair; }

.sp-landing-app .sp-zoom {
    position: absolute;
    inset-block-start: var(--ak-space-2);
    inset-inline-end: var(--ak-space-2);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.sp-landing-app .sp-status-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(6rem, 14rem);
    align-items: center;
    gap: var(--ak-space-3, 1rem);
}

.sp-landing-app .sp-status {
    margin: 0;
    color: var(--ak-muted);
    font-size: var(--ak-fs-sm);
    font-variant-numeric: tabular-nums;
}

.sp-landing-app .sp-progress[hidden] { display: none; }

.sp-landing-app .sp-legend {
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.sp-landing-app .sp-legend b { color: var(--ak-text); font-weight: 700; }

.sp-landing-app .sp-swatch {
    width: 1rem;
    height: 1rem;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ak-text) 25%, transparent);
}

.sp-landing-app .sp-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--ak-space-2);
}

.sp-landing-app .sp-pair > .ak-row { min-width: 0; }
.sp-landing-app .sp-pair[hidden] { display: none; }
