/* Enigma Machine (/enigma-machine): the machine and its wiring diagram fill a focus stage, with the four tiles in the floating
   panel beside them (docs/app-kit.md). Tiles, panels and buttons come from the app kit (css/app-kit, docs/app-kit.md). Loaded
   only on this app's page (StylePaths). */

/* A click on a key types it, on a rotor window turns it, on the sockets plugs a cable; the script sets the cursor. */
.em-landing-app .em-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.em-landing-app .em-canvas:focus-visible {
    outline: 2px solid var(--ak-accent, #2563eb);
    outline-offset: -2px;
}

/* Phones: the machine above its diagram needs a taller picture than the kit's square, so the stage may grow to the screen's
   height less the page's bar and the controls' first rows (as the birthday paradox's does). */
@media (max-width: 960px) {
    .em-landing-app.ak-app > .ak-stage.ak-stage--focus > .ak-panel.em-main {
        height: min(150dvw, max(100dvw, calc(100dvh - var(--seo-chrome-height, 4rem) - 11rem)));
    }

    body .filter-landing-app.em-landing-app > .filter-landing-stage.ak-stage--focus {
        max-height: max(100dvw, calc(100dvh - var(--seo-chrome-height, 4rem) - 11rem)) !important;
    }
}

/* The message, the settings and the result: letters in a fixed width, long texts wrap inside the box (never wider than the panel). */
.em-landing-app .em-text,
.em-landing-app .em-output,
.em-landing-app .em-letters {
    font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    max-width: 100%;
    box-sizing: border-box;
}

.em-landing-app .em-text,
.em-landing-app .em-output {
    resize: vertical;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.em-landing-app .em-letters {
    text-transform: uppercase;
}

.em-landing-app .em-output {
    color: #c2410c;
}

:root[data-theme="dark"] .em-landing-app .em-output,
.em-landing-app[data-theme="dark"] .em-output {
    color: #fbbf24;
}
