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

/* Every dialog's defaults, the New area dialog's choices and the message shown without WebGL. */

dialog {
    background: var(--panel);
    color: var(--text);
    border: 1px solid #000;
    border-radius: 14px;
    padding: 22px 26px;
    width: 460px;
}
dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
}
dialog h2 {
    margin-top: 0;
}
dialog label {
    display: block;
    margin: 12px 0 6px;
}
dialog small {
    color: var(--muted);
    margin-left: 6px;
}
dialog input[type="text"],
dialog input:not([type]) {
    width: 100%;
    padding: 8px 10px;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid #000;
    border-radius: 8px;
}
.size-choices {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.size-choices button {
    padding: 10px 0;
    background: var(--panel-2);
    border: 2px solid transparent;
    border-radius: 10px;
}
.size-choices button.active {
    border-color: var(--accent);
}
.size-choices small {
    display: block;
    margin: 0;
}
.start-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
}
.start-choices label {
    margin: 0;
}
.start-choices small {
    display: block;
    margin-left: 22px;
}
/* The buttons at the foot of a dialog. :where() keeps the specificity <menu> had here before. */
dialog div:where(.dialog-buttons) {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0;
    margin: 22px 0 0;
}
dialog div:where(.dialog-buttons) button {
    padding: 9px 18px;
    background: var(--panel-2);
    border: 1px solid #000;
    border-radius: 8px;
}
dialog div:where(.dialog-buttons) button.primary {
    background: var(--accent);
    color: #1d1a12;
    font-weight: 600;
}

#nowebgl {
    position: fixed;
    inset: 0;
    z-index: 10;
    padding: 60px;
    background: var(--bg);
}
#nowebgl pre {
    background: var(--panel);
    padding: 12px;
    border-radius: 8px;
    white-space: pre-wrap;
}

/* Import heightmap: the picked image, small, with its pixels kept sharp. */
.heightmap-preview {
    display: block;
    max-width: 160px;
    max-height: 160px;
    margin: 0.5rem 0;
    border: 1px solid var(--panel-2);
    image-rendering: pixelated;
}

/* Get more textures: a row a pack (swatches, what it is, its buttons), and the install's progress. */
#packsDialog {
    width: min(680px, 94vw);
}
.packs-list {
    max-height: 58vh;
    overflow-y: auto;
}
.pack-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pack-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 14px;
    padding: 10px 12px;
    background: var(--panel-2);
    border: 1px solid #000;
    border-radius: 8px;
}
.pack-row.installed {
    border-color: #2f4a35;
}
.pack-swatches {
    display: grid;
    grid-template-columns: repeat(3, 48px);
    gap: 4px;
}
.pack-swatches img {
    display: block;
    border-radius: 4px;
    background: #1d2228;
}
.pack-text {
    flex: 1 1 240px;
    min-width: 0;
}
.pack-text h3 {
    margin: 0 0 2px;
    font-size: 15px;
}
.pack-text p {
    margin: 2px 0;
    font-size: 13px;
}
.pack-text .note,
#packsDialog .note {
    color: var(--muted);
}
#packsDialog .note.err {
    color: var(--bad);
}
#packsDialog .note.ok {
    color: #5cc46a;
}
.pack-credits {
    font-style: italic;
}
.pack-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
}
.pack-buttons button {
    padding: 7px 14px;
    background: var(--panel);
    border: 1px solid #000;
    border-radius: 8px;
    white-space: nowrap;
}
.pack-buttons button.primary {
    background: var(--accent);
    color: #1d1a12;
    font-weight: 600;
}
#packsBar {
    display: block;
    width: 100%;
    height: 8px;
    margin: 12px 0 4px;
    accent-color: var(--accent);
}
#packsBar[hidden] {
    display: none;
}

/* Textures missing from the library (missing.js): a row each, its checker, its id and share, and what to swap it for. */
#missingDialog {
    width: min(620px, calc(100vw - 32px));
}
#missingDialog .note {
    color: var(--muted);
}
#missingAdd {
    margin: 4px 0 12px;
}
.missing-row {
    display: grid;
    grid-template-columns: 28px minmax(110px, 1fr) minmax(0, 1.4fr) auto;
    gap: 4px 10px;
    align-items: center;
    padding: 6px 0;
    border-top: 1px solid var(--panel-2);
}
.missing-row select {
    min-width: 0;
    font: inherit;
    color: var(--text);
    background: var(--panel-2);
    border: 1px solid #000;
    border-radius: 6px;
    padding: 4px;
}
#missingAdd button.primary {
    background: var(--accent);
    color: #1d1a12;
    font-weight: 600;
}
.missing-why {
    grid-column: 3 / 5;
    font-size: 12px;
}
.missing-swatch {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: repeating-conic-gradient(#ff00ff 0 25%, #140014 0 50%) 0 0 / 14px 14px;
}
