/* Pinball (/pinball): only what is the game's own - the canvas with the cabinet (the table and its backglass head).
   Buttons, fields and the accent come from the app kit (css/app-kit, docs/app-kit.md). Loaded only on this page
   (StylePaths). The table keeps its own colours in both themes (filter-engines/pinball.js); it stands on the
   stage's own colour, like the table of 8 Ball Pool, with no frame or box around it. */

/* A focus stage (ak-stage--focus): the canvas fills the stage edge to edge and the script fits the cabinet into it. */
.ak-app > .filter-landing-stage.pinball-stage {
    background: var(--component-stage-bg);
}

.pinball-canvas {
    display: block;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.pinball-canvas:focus-visible {
    box-shadow: inset 0 0 0 3px var(--ak-accent);
}

/* The panel with the canvas takes the whole stage at every width (a tablet's layout would size it to its content). */
body.filter-app-mode .ak-app.pinball-landing-app > .filter-landing-stage.pinball-stage > .ak-panel.pinball-panel {
    flex: 1 1 0;
    min-height: 0;
}

/* Phones and tablets: the shared layout caps a stage at a square, which would leave a tall table small. The stage takes
   the screen's height under the site header, less the toolbar under it (5.25rem), so the table is as big as it can be.
   !important: the shared cap uses a long :not() chain. */
@media (max-width: 960px) {
    body.filter-app-mode .ak-app.pinball-landing-app > .filter-landing-stage.pinball-stage {
        height: calc(100svh - var(--seo-chrome-height, 4.875rem) - 5.25rem) !important;
        min-height: 15rem !important;
        max-height: none !important;
        aspect-ratio: auto !important;
        overflow: hidden !important;
    }
}
