/* Newton's cradle (/newtons-cradle): what is its own - the canvas stage and what is drawn over it. The buttons and the accent
   come from the app kit (css/app-kit, docs/app-kit.md); the sliders and checkboxes are the shared app controls.
   Loaded only on this app's page (StylePaths). The stage is the canvas's own box, not the kit's padded
   .ak-stage column; the phone layout is the shared one for canvas apps in landing/seo-pages.css. */

.filter-landing-stage.cradle-landing-stage {
    position: relative;
    display: block;
    width: 100%;
    min-height: 280px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    box-shadow: none;
    cursor: default;
    touch-action: none;
    background-color: #1a1e27;
    background-image: none;
}

.cradle-landing-stage.is-over-ball {
    cursor: grab;
}

.cradle-landing-stage.is-dragging {
    cursor: grabbing;
}

.cradle-landing-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.cradle-hud {
    position: absolute;
    z-index: 2;
    left: 12px;
    top: 12px;
    width: max-content;
    max-width: min(300px, calc(100% - 24px));
    box-sizing: border-box;
    margin: 0;
    padding: 9px 13px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(8, 12, 24, 0.72);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #e2e8f0;
    font-size: 0.78rem;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.cradle-hud:empty,
.cradle-hud[hidden],
.cradle-hud [hidden] {
    display: none;
}

.cradle-hud-row {
    margin: 0;
}

.cradle-hud-label,
.cradle-hud-sep {
    opacity: 0.66;
}

.cradle-hud-value {
    color: #f8fafc;
    font-weight: 600;
}

.cradle-hud-kept {
    opacity: 0.66;
}

.cradle-hud-status {
    margin-inline-start: 6px;
    color: #fbbf24;
    font-weight: 600;
}

/* Height and motion, as a share of the energy at release. */
.cradle-hud-bar {
    display: flex;
    height: 6px;
    margin: 6px 0 5px;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
}

.cradle-hud-bar-height,
.cradle-hud-bar-motion {
    display: block;
    height: 100%;
    transition: width 0.1s linear;
}

.cradle-hud-bar-height,
.cradle-hud-swatch--height {
    background: #fbbf24;
}

.cradle-hud-bar-motion,
.cradle-hud-swatch--motion {
    background: #5eead4;
}

.cradle-hud-swatch {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-inline-end: 6px;
    border-radius: 2px;
    vertical-align: 0;
}

.cradle-hud-paused {
    display: inline-block;
    width: 8px;
    height: 10px;
    margin-inline-end: 7px;
    box-sizing: border-box;
    border-left: 3px solid #fbbf24;
    border-right: 3px solid #fbbf24;
    vertical-align: -1px;
}

.cradle-landing-stage--compact .cradle-hud {
    left: 8px;
    top: 8px;
    max-width: calc(100% - 16px);
    padding: 6px 9px 7px;
    border-radius: 10px;
    font-size: 0.68rem;
}

.cradle-landing-stage--compact .cradle-hud-speeds {
    display: none;
}

.cradle-landing-stage--compact .cradle-hud-bar {
    height: 4px;
    margin: 0 0 4px;
}

@media (prefers-reduced-motion: reduce) {
    .cradle-hud-bar-height,
    .cradle-hud-bar-motion {
        transition: none;
    }
}

body.filter-app-mode .cradle-landing-app .cradle-landing-canvas {
    max-width: none;
}

body.filter-app-mode .cradle-landing-stage {
    box-shadow: none;
}

.cradle-landing-stage.cradle-stage--transparent {
    background: var(--component-checkerboard);
}
