/* The addon's own skin, rebuilt for a browser. Colours come from
   Core/Constants.lua, the square corners and the thin gold rules come from the
   window frame. The spacing and the type are where the web version earns its
   keep against a 10 pt game font. */

@font-face {
    font-family: "Cinzel";
    src: url("/fonts/cinzel-400.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Cinzel";
    src: url("/fonts/cinzel-600.woff2") format("woff2");
    font-weight: 600;
    font-display: swap;
}

:root {
    --gold: #ffe64d;
    --frame: #d9b326;
    --bronze: #8c7326;
    --muted: #bfbfbf;
    --dim: #999999;
    --panel-top: #1a140d;
    --panel-bottom: #080605;
    --canvas: #060504;
    --bad: #e06666;

    --head: "Cinzel", "Palatino Linotype", Georgia, serif;
    --body: ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--muted);
    font-family: var(--body);
    font-size: 17px;
    line-height: 1.6;
}

main {
    max-width: 62rem;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.topbar {
    border-bottom: 1px solid var(--bronze);
    background: linear-gradient(90deg, rgba(217, 179, 38, 0.18), rgba(217, 179, 38, 0));
}

.brand {
    display: block;
    max-width: 62rem;
    margin: 0 auto;
    padding: 0.9rem 1rem;
    font-family: var(--head);
    font-size: 1.1rem;
    letter-spacing: 0.06em;
    color: var(--gold);
    text-decoration: none;
}

.panel {
    border: 1px solid var(--bronze);
    background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
    padding: 1.5rem;
}

h1,
h2 {
    font-family: var(--head);
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.04em;
    margin: 0 0 1rem;
}

h1 {
    font-size: 1.7rem;
}

h2 {
    font-size: 1.3rem;
}

p {
    margin: 0 0 1rem;
    max-width: 46rem;
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--frame);
}

.quiet {
    color: var(--dim);
    font-size: 0.92rem;
}

.error,
.problem {
    color: var(--bad);
    border-left: 2px solid var(--bad);
    padding-left: 0.75rem;
}

textarea {
    width: 100%;
    height: 8.5rem;
    margin: 0.5rem 0 1rem;
    padding: 0.75rem;
    border: 1px solid var(--bronze);
    background: var(--canvas);
    color: var(--muted);
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
}

textarea:focus,
button:focus-visible,
a:focus-visible {
    outline: 1px solid var(--gold);
    outline-offset: 2px;
}

.inside {
    margin: 0 0 1rem;
    padding-left: 1.1rem;
}

.inside li {
    margin-bottom: 0.35rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

button,
.button {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--bronze);
    background: transparent;
    color: var(--muted);
    font-family: var(--head);
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    border-color: var(--frame);
    color: var(--gold);
}

button.primary,
.button.primary {
    border-color: var(--frame);
    color: var(--gold);
    background: rgba(217, 179, 38, 0.12);
}

button.primary:hover,
.button.primary:hover {
    background: rgba(217, 179, 38, 0.22);
}

button:disabled {
    opacity: 0.5;
    cursor: default;
}

.link a {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 1.05rem;
    color: var(--gold);
    word-break: break-all;
}

.viewer .summary {
    color: var(--dim);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.plan-frame {
    position: relative;
    border: 1px solid var(--bronze);
    background: var(--canvas);
    padding: 0.75rem;
}

.tip {
    position: fixed;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    max-width: 18rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--bronze);
    background: var(--panel-bottom);
    font-size: 0.9rem;
    line-height: 1.35;
    pointer-events: none;
}

.tip-name {
    font-family: var(--head);
}

.tip-size {
    color: var(--dim);
    font-size: 0.82rem;
}

.plan {
    display: block;
    width: 100%;
    height: auto;
    max-height: 70vh;
}

.plan text {
    font-family: var(--body);
    paint-order: stroke;
    pointer-events: none;
}

.plan .room:hover rect,
.plan .room:hover circle {
    filter: brightness(1.35);
}

.empty {
    color: var(--dim);
    text-align: center;
    padding: 2rem 0;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
}

.floors,
.switches {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.bar-label {
    font-family: var(--head);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--dim);
    margin-right: 0.35rem;
}

button.floor {
    min-width: 2.2rem;
    padding: 0.3rem 0.5rem;
    text-align: center;
}

button.toggle {
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
}

button.toggle::before {
    content: "○ ";
    color: var(--dim);
}

button.floor[aria-pressed="true"],
button.toggle[aria-pressed="true"] {
    border-color: var(--frame);
    color: var(--gold);
    background: rgba(217, 179, 38, 0.15);
}

button.toggle[aria-pressed="true"]::before {
    content: "● ";
    color: var(--gold);
}

.note {
    margin-top: 1rem;
    color: var(--dim);
    font-size: 0.92rem;
}

footer {
    border-top: 1px solid var(--bronze);
    padding: 1.25rem 1rem;
}

footer p {
    max-width: 62rem;
    margin: 0 auto;
    color: var(--dim);
    font-size: 0.85rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

@media (max-width: 40rem) {
    body {
        font-size: 16px;
    }

    main {
        padding: 1rem 0.75rem 3rem;
        gap: 1rem;
    }

    .panel {
        padding: 1.1rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    .actions button,
    .actions .button {
        flex: 1 1 auto;
        text-align: center;
    }
}
