/* SPDX-FileCopyrightText: Copyright (C) 2026 plenarius */
/* SPDX-License-Identifier: MIT */

/* The line over the view without the engine, and the keyboard's focus ring. */

/* Without the engine: one line over the view saying what still works, with a link to how to start it. */
#noEngine,
#missingTex,
#missingModels {
    position: absolute;
    left: 50%;
    bottom: 44px;
    transform: translateX(-50%);
    width: min(760px, calc(100vw - 32px));
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    padding: 10px 40px 10px 14px;
    background: rgba(38, 44, 52, 0.97);
    border: 1px solid var(--warn);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    font-size: 14px;
    z-index: 20;
}
#noEngine[hidden],
#missingTex[hidden],
#missingModels[hidden] {
    display: none;
}
#noEngine b {
    color: var(--warn);
}
/* Placeables whose models the engine lacks (missingmodels.js): above the textures' notice when both show. */
#missingTex:not([hidden]) ~ #missingModels {
    bottom: 150px;
}
/* Textures the library hasn't got (missing.js): the export is refused until they are added or swapped. */
#missingTex {
    border-color: var(--missing);
}
#missingTex b {
    color: var(--missing);
}
#noEngine span,
#missingTex span,
#missingModels span {
    color: var(--muted);
}
#noEngine a {
    color: var(--accent);
}
#noEngineClose,
#missingTexClose,
#missingModelsClose {
    position: absolute;
    right: 8px;
    top: 4px;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--muted);
}

/* A panel that needs the game, on a page without it (the web demo): its notice instead of its lists and settings. */
.needs-game {
    margin: 8px 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--warn);
    border-radius: 8px;
    background: rgba(38, 44, 52, 0.6);
    font-size: 13px;
}
.needs-game p {
    margin: 0 0 8px;
}
/* (By id, so it outweighs the panels' own rules for their lists.) */
:is(#placePanel, #scatterPanel, #thingsPanel).no-game > :not(h3, .panel-close, .needs-game),
:is(#scriptDialog, #importDialog).no-game > :not(h2, .needs-game, .dialog-buttons, form),
:is(#scriptDialog, #importDialog).no-game > form > :not(h2, .needs-game, .dialog-buttons),
:is(#scriptDialog, #importDialog).no-game .dialog-buttons > :not([data-close], [value="cancel"]) {
    display: none;
}

/* The engine starting in the browser (try/page.js): a card over the page until it is ready. */
.web-start {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(20, 24, 30, 0.92);
    z-index: 100;
}
.web-start > div {
    width: min(420px, calc(100vw - 32px));
    padding: 20px 24px;
    background: rgba(38, 44, 52, 0.98);
    border: 1px solid var(--accent);
    border-radius: 10px;
    text-align: center;
}
.web-start h2 {
    margin: 0 0 10px;
    font-weight: 400;
}
