/* Spider Solitaire (/spider-solitaire): only what is the game's own - the canvas with the table. Tiles, buttons, fields
   and the accent come from the app kit (css/app-kit, docs/app-kit.md), the button row from css/app-kit/games.css (every
   game). Loaded only on this page (StylePaths). The felt keeps its own colours in both themes
   (filter-engines/spider-solitaire.js). */

/* The table: 4:3, no taller than the screen allows; taller than wide on a phone, so the columns have room. */
/* The board alone has a size; the canvas lies over it and takes no part in it. The game sizes the canvas to the
   board's size times the pixel ratio, so as the board's content it could make both a little taller every frame
   (as Cave Flutter's did). min-height: 0 keeps the board at the shape aspect-ratio gives it. */
.spider-solitaire-board {
    position: relative;
    min-height: 0;
    width: min(100%, calc((100vh - 230px) * 4 / 3));
    min-width: min(100%, 300px);
    aspect-ratio: 4 / 3;
}

.spider-solitaire-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: #1f6f43;
    touch-action: none;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.spider-solitaire-canvas:focus-visible {
    box-shadow: 0 0 0 3px var(--ak-accent);
}

/* Phones: the shared .game-fit layout (css/app-kit/games.css) fits the tiles and the table on the screen;
   --game-room is what the stage holds besides the table (no touch pad: the cards are tapped and dragged). */
.spider-solitaire-stage {
    --game-aspect: calc(4 / 3);
    --game-max: 1040px;
    --game-room: 103px;
    --game-room-touch: 103px;
    --game-room-short: 56px;
}

@media (max-width: 640px) {
    .spider-solitaire-stage {
        --game-aspect: calc(4 / 5);
    }

    .spider-solitaire-board {
        width: 100%;
        aspect-ratio: 4 / 5;
    }
}
