/* Lost in the Universe (/lost-in-the-universe): only what is the game's own - the canvas of space. 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). Space stays dark in both themes (filter-engines/lost-in-the-universe.js). */

/* The universe: 4 x 3, as wide as the panel and no taller than the screen allows (outside the app layout). */
.lost-in-the-universe-board {
    width: min(100%, 1400px, calc((100vh - 230px) * 4 / 3));
    min-width: min(100%, 260px);
    aspect-ratio: 4 / 3;
    margin-inline: auto;
}

/* In the app layout on a computer the universe fills the whole stage under the tiles, edge to edge, at whatever shape
   the stage has: the script lays the scene (16 x 9) out in the canvas' box and the sky fills the rest, and the text
   on the canvas grows with it. */
@media (min-width: 961px) {
    body.filter-app-mode .ak-app > .filter-landing-stage.lost-in-the-universe-stage {
        padding-inline: 0;
        padding-bottom: 0;
    }

    body.filter-app-mode .ak-app > .filter-landing-stage.lost-in-the-universe-stage > .ak-stats {
        margin-inline: 16px;
    }

    body.filter-app-mode .lost-in-the-universe-stage > .game-board-panel {
        flex: 1 1 0;
        min-height: 0;
    }

    body.filter-app-mode .lost-in-the-universe-board {
        flex: 1 1 0;
        width: 100%;
        min-width: 0;
        min-height: 320px;
        aspect-ratio: auto;
    }
}

.lost-in-the-universe-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #05050e;
    touch-action: manipulation;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* No focus ring around the game: the canvas takes the focus on every click (for the keys), and the game marks the
   object selected with the arrow keys on the canvas itself. */
.lost-in-the-universe-canvas:focus,
.lost-in-the-universe-canvas:focus-visible {
    outline: none;
    box-shadow: none;
}

/* The stage is space too: the same colour as the edges of every scene (SPACE in the engine), so the canvas melts into
   it, with the tiles as faint glass on it. The root pins the kit's dark theme for the stage (data-ak-theme="dark"); the
   control panel keeps following the site's theme. */
.lost-in-the-universe-landing-app[data-theme] > .filter-landing-stage.lost-in-the-universe-stage {
    --ak-bg: #05050e;
    --ak-panel: rgba(255, 255, 255, 0.045);
    --ak-border: rgba(170, 180, 255, 0.14);
    --ak-text: #eef1ff;
    --ak-muted: #9aa4c8;
    background: #05050e;
}

/* Phones: the shared .game-fit layout (css/app-kit/games.css) fits the board and the tiles on the screen;
   --game-room(-touch) is what the stage holds besides the board. There is no touch pad: a tap picks an object. */
.lost-in-the-universe-stage {
    --game-aspect: calc(4 / 3);
    --game-max: 1400px;
    --game-room: 77px;
    --game-room-touch: 77px;
    --game-room-short: 55px;
}

/* Narrow screens: a square board, so the clue (long in some languages, with a tip for Cadets) leaves the scene room.
   The script lays the scene out in whatever box the canvas has. */
@media (max-width: 600px) {
    .lost-in-the-universe-board {
        aspect-ratio: 1 / 1;
        width: min(100%, calc(100vh - 230px));
    }

    .lost-in-the-universe-stage {
        --game-aspect: 1;
    }
}
