/* Newton's cannon (/newtons-cannon): 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.cannon-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: #070d1c;
    background-image: none;
}

.filter-landing-stage.cannon-landing-stage {
    cursor: crosshair;
    touch-action: none;
}

.cannon-landing-stage.is-aiming {
    cursor: grabbing;
}

.cannon-landing-stage:focus {
    outline: none;
}

.cannon-landing-stage:focus-visible {
    outline: 2px solid rgba(147, 197, 253, 0.7);
    outline-offset: -2px;
}

.cannon-landing-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

/* Top left; the planet and the paths are fitted around the panel. */
.cannon-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;
}

.cannon-hud[hidden],
.cannon-hud:empty {
    display: none;
}

.cannon-hud-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 0;
}

.cannon-hud-label {
    flex: 1 1 auto;
    opacity: 0.7;
}

.cannon-hud-value {
    flex: none;
    margin-inline-start: 10px;
    color: #f8fafc;
    font-weight: 600;
    text-align: end;
}

.cannon-hud-swatch {
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    transform: translateY(-1px);
}

.cannon-hud-rule {
    display: block;
    height: 0;
    margin: 5px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.cannon-hud-lead {
    display: block;
    color: #fde68a;
    font-weight: 600;
}

.cannon-hud-formula {
    display: block;
    margin-top: 4px;
    font-size: 0.9em;
    opacity: 0.88;
    white-space: normal;
}

.cannon-hud-status {
    display: block;
    margin-top: 5px;
    font-size: 0.9em;
    opacity: 0.75;
    white-space: normal;
}

.cannon-landing-stage--compact .cannon-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. */
.cannon-landing-stage--compact .cannon-hud-formula,
.cannon-landing-stage--compact .cannon-hud-status,
.cannon-landing-stage--compact .cannon-hud-minor {
    display: none;
}

.cannon-landing-controls button[hidden] {
    display: none !important;
}

.cannon-landing-controls .app-check-row:has(input:disabled) {
    opacity: 0.45;
}

body.filter-app-mode .cannon-landing-app .cannon-landing-canvas {
    max-width: none;
}

body.filter-app-mode .cannon-landing-stage {
    box-shadow: none;
}

/* In Newton's sketch the panel is ink on paper. */
.cannon-stage--sketch .cannon-hud {
    border-color: rgba(58, 44, 28, 0.35);
    background: rgba(246, 238, 216, 0.88);
    box-shadow: 0 6px 18px rgba(58, 44, 28, 0.18);
    color: #3a2c1c;
    font-family: Georgia, "Times New Roman", serif;
}

.cannon-stage--sketch .cannon-hud-value,
.cannon-stage--sketch .cannon-hud-lead {
    color: #2a1f13;
}

.cannon-stage--sketch .cannon-hud-rule {
    border-top-color: rgba(58, 44, 28, 0.25);
}

.cannon-landing-stage.cannon-stage--transparent {
    background: var(--component-checkerboard);
}
