/* Ballistic trajectory (/ballistic-trajectory): 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. */

.ballistic-group {
    display: contents;
}

.filter-landing-stage.ballistic-landing-stage {
    position: relative;
    display: block;
    width: 100%;
    min-height: 280px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    box-shadow: none;
    cursor: default;
    touch-action: manipulation;
    background-color: #0f1d33;
    background-image: none;
}

.ballistic-landing-stage.ballistic-stage--aim {
    cursor: crosshair;
    touch-action: none;
}

.ballistic-landing-stage.is-aiming {
    cursor: grabbing;
}

.ballistic-landing-stage:focus {
    outline: none;
}

.ballistic-landing-stage:focus-visible {
    outline: 2px solid rgba(147, 197, 253, 0.7);
    outline-offset: -2px;
}

.ballistic-landing-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

/* Top left: the ball flies off to the right. The paths are fitted around the panel. */
.ballistic-hud {
    position: absolute;
    z-index: 2;
    left: 12px;
    top: 12px;
    width: max-content;
    min-width: 190px;
    max-width: min(330px, calc(100% - 24px));
    box-sizing: border-box;
    margin: 0;
    padding: 9px 13px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(8, 12, 24, 0.74);
    -webkit-backdrop-filter: blur(8px) saturate(1.2);
    backdrop-filter: blur(8px) saturate(1.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    color: #e2e8f0;
    font-size: 0.78rem;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.ballistic-hud[hidden],
.ballistic-hud:empty {
    display: none;
}

.ballistic-hud-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 0;
}

.ballistic-hud-label {
    flex: 1 1 auto;
    opacity: 0.7;
}

.ballistic-hud-value {
    flex: none;
    margin-inline-start: 10px;
    color: #f8fafc;
    font-weight: 600;
    text-align: end;
}

.ballistic-hud-swatch {
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    transform: translateY(-1px);
}

.ballistic-hud-row[data-tone="u"] .ballistic-hud-label {
    color: #67e8f9;
    opacity: 1;
}

.ballistic-hud-row[data-tone="v"] .ballistic-hud-label {
    color: #fda4af;
    opacity: 1;
}

.ballistic-hud-rule {
    display: block;
    height: 0;
    margin: 5px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.ballistic-hud-muted {
    font-size: 0.92em;
    opacity: 0.78;
}

.ballistic-hud-dim {
    opacity: 0.55;
}

.ballistic-hud-row.is-winner .ballistic-hud-label,
.ballistic-hud-row.is-winner .ballistic-hud-value {
    color: #fbbf24;
    opacity: 1;
    font-weight: 700;
}

.ballistic-hud-lead {
    display: block;
    color: #fde68a;
    font-weight: 600;
}

.ballistic-hud-formula {
    display: block;
    margin-top: 4px;
    font-size: 0.9em;
    opacity: 0.88;
    white-space: normal;
}

.ballistic-hud-status {
    display: block;
    margin-top: 5px;
    font-size: 0.9em;
    opacity: 0.75;
    white-space: normal;
}

.ballistic-hud-status[data-tone="good"] {
    color: #86efac;
    opacity: 1;
    font-weight: 600;
}

.ballistic-landing-stage--compact .ballistic-hud {
    left: 8px;
    top: 8px;
    min-width: 0;
    max-width: min(230px, calc(100% - 16px));
    padding: 6px 9px 7px;
    border-radius: 10px;
    font-size: 0.64rem;
    line-height: 1.4;
}

/* On a small stage the formulas and hints would cover too much of the picture. */
.ballistic-landing-stage--compact .ballistic-hud-formula,
.ballistic-landing-stage--compact .ballistic-hud-status,
.ballistic-landing-stage--compact .ballistic-hud-minor {
    display: none;
}

.ballistic-group[hidden],
.ballistic-landing-controls [data-ballistic-for][hidden],
.ballistic-landing-controls button[hidden] {
    display: none !important;
}

.ballistic-landing-controls .app-check-row:has(input:disabled) {
    opacity: 0.45;
}

body.filter-app-mode .ballistic-landing-app .ballistic-landing-canvas {
    max-width: none;
}

body.filter-app-mode .ballistic-landing-stage {
    box-shadow: none;
}

.ballistic-landing-stage.ballistic-stage--transparent {
    background: var(--component-checkerboard);
}
