/* Hogs of Duty — "fort wall" theme: weathered brickwork, riveted steel plate, amber stencil accents.
   The wallpaper is generated by tools/make-wallpaper.mjs into game/img (the game's loading screens
   use the same files). Titles are Black Ops One; everything smaller is Fredoka. */

@font-face { font-family: "Black Ops One"; src: url("game/fonts/BlackOpsOne-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("game/fonts/Fredoka-Variable.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }

:root {
    --bg: #17110e;
    --bg-raised: #1f1b19;
    --panel: rgba(27, 26, 26, 0.93);
    --panel-solid: #1e1c1b;
    --olive: #3a3833;
    --olive-bright: #57524a;
    --line: #3c3936;
    --line-bright: #5a554e;
    --text: #e6e0cb;
    --muted: #a9a48e;
    --amber: #e2a72e;
    --amber-dim: #a87b22;
    --amber-glow: rgba(226, 167, 46, 0.18);
    --red: #c0492f;
    --green: #86a24e;
    --pink: #e9a39c;
    --font-display: "Black Ops One", "Impact", "Arial Narrow", sans-serif;
    --font-body: "Fredoka", "Segoe UI", "Trebuchet MS", sans-serif;
    --font-mono: ui-monospace, "Cascadia Mono", "Consolas", monospace;
    --cut: 14px;
    /* Layers, top first: a shade so text reads, the stencil marks and loopholes, the brickwork. */
    --wall:
        linear-gradient(180deg, rgba(12, 9, 8, 0.4), rgba(12, 9, 8, 0.6)),
        url("game/img/fort-marks.svg"),
        url("game/img/fort-wall.svg");
    --plate: linear-gradient(180deg, rgba(40, 39, 38, 0.95), rgba(25, 24, 24, 0.95));
    --rivet: radial-gradient(circle at 35% 35%, #8d877c 0 1.2px, #4a4640 1.6px 3.2px, rgba(0, 0, 0, 0.55) 3.4px 4.4px, transparent 4.8px);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    background-color: var(--bg);
    background-image: var(--wall);
    background-size: auto, 2080px 1408px, 1040px 704px;
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.0325rem;
    font-weight: 400;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 400; }
a { color: var(--amber); text-decoration: none; }
a:hover { color: #f3c25a; }
p { margin: 0 0 0.75rem; }

:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

h1:focus { outline: none; }

.stencil, .eyebrow, .page__title, .section-title, .panel__title, .chip, .btn, .tabs__title, .keycap {
    font-family: var(--font-display);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--amber);
    font-size: 0.8rem;
    letter-spacing: 0.22em;
    text-shadow: 0 1px 2px #000, 0 0 10px rgba(0, 0, 0, 0.9);
}

.muted { color: var(--muted); }
.amber { color: var(--amber); }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.strong { font-weight: 700; }
.text-danger { color: var(--red); }
.sep { color: var(--amber-dim); margin: 0 0.35rem; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Shell ---------- */

.shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);   /* the nav scrolls instead of widening the page */
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0.7rem clamp(1rem, 3vw, 2.5rem);
    background: linear-gradient(180deg, #121310, #0e0f0c);
    border-bottom: 1px solid #000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* The top of the wall: battlements against the dark of the bar. */
.topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 22px;
    background: url("game/img/fort-crenel.svg") repeat-x left top;
    pointer-events: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text);
    flex-shrink: 0;
}

.brand:hover { color: var(--text); }

.brand__mark {
    width: 34px;
    height: 34px;
    background: url("favicon.svg") center / contain no-repeat;
}

.brand__text { display: flex; flex-direction: column; line-height: 1; }

.brand__title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand__sub {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 0.2rem;
}

.topnav {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.topnav a {
    padding: 0.45rem 0.8rem;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.topnav a:hover { color: var(--text); }
.topnav a.active { color: var(--amber); border-bottom-color: var(--amber); }

.main {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: calc(clamp(1.25rem, 3vw, 2.5rem) + 22px) clamp(1rem, 3vw, 2.5rem) 4.5rem;
}

/* PNN ticker */
.ticker {
    position: relative;
    display: flex;
    align-items: stretch;
    border-top: 1px solid #000;
    background: #0e0d0b;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Sandbags stacked along the foot of the wall. */
.ticker::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 56px;
    background: url("game/img/fort-sandbags.svg") repeat-x left bottom;
    pointer-events: none;
}

.ticker__label {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.9rem;
    background: var(--red);
    color: #fff;
    font-family: var(--font-display);
    letter-spacing: 0.12em;
    flex-shrink: 0;
}

.ticker__track { overflow: hidden; flex: 1; display: flex; align-items: center; }

.ticker__items {
    display: flex;
    gap: 3rem;
    padding-left: 2rem;
    white-space: nowrap;
    animation: ticker 70s linear infinite;
}

.ticker__item { color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.ticker__item::before { content: "■ "; color: var(--amber-dim); font-size: 0.6em; vertical-align: middle; }

@keyframes ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ---------- Building blocks ---------- */

.page__header { margin-bottom: 1.75rem; max-width: 72ch; }

.page__title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    line-height: 1;
    color: var(--text);
    text-shadow: 0 2px 0 #000, 0 4px 18px rgba(0, 0, 0, 0.9);
}

.page__lede { margin-top: 0.6rem; color: #cfc9b3; font-size: 1.1rem; text-shadow: 0 1px 2px #000, 0 0 12px rgba(0, 0, 0, 0.8); }

.panel {
    position: relative;
    background:
        var(--rivet) 8px 8px / 10px 10px no-repeat,
        var(--rivet) calc(100% - 8px) calc(100% - 8px) / 10px 10px no-repeat,
        var(--plate);
    border: 1px solid var(--line-bright);
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
    padding: 1.25rem 1.4rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.panel--flush { padding: 0; }
.panel--warning { border-color: var(--amber-dim); color: var(--amber); }

.panel__title, .section-title {
    color: var(--amber);
    font-size: 0.95rem;
    letter-spacing: 0.14em;
}

.section-title { margin: 1.25rem 0 0.6rem; }

.chip {
    display: inline-block;
    padding: 0.18rem 0.5rem;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    border: 1px solid currentColor;
    vertical-align: middle;
}

.chip--amber { color: var(--amber); background: var(--amber-glow); }
.chip--green { color: var(--green); background: rgba(134, 162, 78, 0.14); }
.chip--locked { color: var(--muted); background: rgba(255, 255, 255, 0.04); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.6rem 1.1rem;
    border: 1px solid var(--line-bright);
    background: var(--olive);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn:hover { background: var(--olive-bright); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--amber); border-color: var(--amber); color: #1b1607; }
.btn--primary:hover { background: #f0b941; color: #1b1607; }
.btn--ghost { background: transparent; border-color: var(--line-bright); color: var(--muted); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.btn--danger { background: transparent; border-color: var(--red); color: #e7826b; }
.btn--danger:hover { background: rgba(192, 73, 47, 0.18); color: #ffb3a1; }
.btn--small { padding: 0.3rem 0.65rem; font-size: 0.72rem; }

.btn--deploy {
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.95rem 1.2rem;
    background: var(--amber);
    border-color: var(--amber);
    color: #1b1607;
    font-size: 1.5rem;
    letter-spacing: 0.16em;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4) inset;
}

.btn--deploy:hover { background: #f0b941; color: #1b1607; }
.btn__sub { font-family: var(--font-body); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.08em; opacity: 0.75; }

.link-button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--amber);
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--line-bright);
    color: var(--text);
    font: inherit;
    font-weight: 600;
}

.input:focus { border-color: var(--amber); outline: none; box-shadow: 0 0 0 3px var(--amber-glow); }
select.input { cursor: pointer; }
select.input option { background: var(--panel-solid); }

.hint { color: var(--muted); font-size: 0.95rem; margin-top: 0.6rem; }
.hint--warning { color: var(--amber); }
.loading-line { color: var(--muted); font-family: var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; }
.empty { padding: 2rem 1.4rem; margin: 0; color: var(--muted); text-align: center; }

.quote { font-size: 1.15rem; font-style: italic; }
.quote__by { color: var(--amber); font-weight: 700; }

.progress {
    position: relative;
    height: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--line-bright);
    overflow: hidden;
}

.progress--slim { height: 6px; margin-bottom: 1.5rem; }

.progress__fill {
    height: 100%;
    background: repeating-linear-gradient(-45deg, var(--amber) 0 10px, #c98f1d 10px 20px);
    box-shadow: 0 0 12px rgba(226, 167, 46, 0.5);
    transition: width 0.25s ease-out;
}

.progress__fill--busy { animation: busy 0.8s linear infinite; background-size: 28px 28px; opacity: 0.6; }

@keyframes busy {
    from { background-position: 0 0; }
    to { background-position: 28px 0; }
}

/* ---------- Home ---------- */

.home {
    position: relative;
    min-height: calc(100vh - 160px);
    display: grid;
    grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
    gap: clamp(1.5rem, 3.5vw, 3.5rem);
    align-items: center;
}

.home__content { position: relative; max-width: 560px; }
.home__side { min-width: 0; }

/* Screenshot gallery (ScreenshotGallery.razor) */

.gallery { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }

.gallery__stage {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0b0c09;
    border: 1px solid var(--line-bright);
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.gallery__shot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 0.9s ease, transform 7s ease-out;
}

.gallery__shot--active { opacity: 1; transform: scale(1); }

.gallery__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 2.6rem 1.2rem 0.95rem;
    background: linear-gradient(transparent, rgba(8, 9, 6, 0.88) 60%);
    pointer-events: none;
}

.gallery__where {
    font-family: var(--font-display);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--amber);
}

.gallery__title {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2.2vw, 1.7rem);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 2px 0 #000;
}

.gallery__quip { color: var(--text); font-size: 1.02rem; font-weight: 600; font-style: italic; }

.gallery__nav, .gallery__pause {
    position: absolute;
    display: grid;
    place-items: center;
    background: rgba(13, 15, 11, 0.72);
    border: 1px solid var(--line-bright);
    color: var(--text);
    font: inherit;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, border-color 0.15s, color 0.15s;
}

.gallery__nav { top: 50%; width: 2.6rem; height: 3.4rem; margin-top: -2.4rem; font-size: 2rem; line-height: 1; }
.gallery__nav--prev { left: 0.7rem; }
.gallery__nav--next { right: 0.7rem; }
.gallery__pause { top: 0.7rem; right: 0.7rem; width: 2.2rem; height: 2.2rem; font-size: 0.75rem; letter-spacing: -0.1em; }

.gallery:hover .gallery__nav, .gallery:hover .gallery__pause,
.gallery__nav:focus-visible, .gallery__pause:focus-visible { opacity: 1; }

.gallery__nav:hover, .gallery__pause:hover { border-color: var(--amber); color: var(--amber); }

.gallery__count {
    position: absolute;
    top: 0.8rem;
    left: 0.9rem;
    padding: 0.1rem 0.45rem;
    background: rgba(13, 15, 11, 0.72);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.gallery__timer {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: var(--amber);
    transform-origin: left;
    transition: transform 0.25s linear;
}

.gallery__thumbs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.4rem; }

.gallery__thumb {
    position: relative;
    padding: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0b0c09;
    border: 1px solid var(--line);
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s, border-color 0.15s;
}

.gallery__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb:hover, .gallery__thumb:focus-visible { opacity: 0.9; border-color: var(--line-bright); }
.gallery__thumb--active { opacity: 1; border-color: var(--amber); }
.gallery__thumb--active::after { content: ""; position: absolute; inset: auto 0 0; height: 3px; background: var(--amber); }

.home__title {
    font-family: var(--font-display);
    font-size: clamp(3.4rem, 9vw, 6.5rem);
    line-height: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text);
    text-shadow: 0 3px 0 #000, 0 6px 22px rgba(0, 0, 0, 0.9), 0 0 40px rgba(226, 167, 46, 0.15);
}

.home__tagline {
    margin: 0.9rem 0 2rem;
    color: var(--amber);
    font-size: 1.3rem;
    font-weight: 500;
    font-style: italic;
    text-shadow: 0 2px 0 #000, 0 0 14px rgba(0, 0, 0, 0.9);
}

/* The trailer (TrailerCard.razor): a riveted "now showing" plate under the screenshots whose
   thumbnail opens the trailer in a dialog. The pink snout is the one that marks the way in training. */
.trailer { margin-top: 1.1rem; }

.trailer__card {
    display: grid;
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
    gap: 1.1rem;
    align-items: center;
    padding: 0.75rem;
    color: var(--text);
    background:
        var(--rivet) 6px 6px / 10px 10px no-repeat,
        var(--rivet) calc(100% - 6px) calc(100% - 6px) / 10px 10px no-repeat,
        var(--plate);
    border: 1px solid var(--line-bright);
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
    transition: border-color 0.15s;
}

.trailer__card:hover, .trailer__card:focus-visible { border-color: var(--amber); outline: none; }
.trailer__card:focus-visible .trailer__thumb { outline: 3px solid var(--amber); outline-offset: 2px; }

.trailer__thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0b0c09;
    border: 1px solid var(--line);
}

.trailer__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.trailer__card:hover .trailer__thumb img { transform: scale(1.04); }

.trailer__snout {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 3.6rem;
    aspect-ratio: 1.36;
    translate: -50% -50%;
    border-radius: 50%;
    background: radial-gradient(ellipse at 38% 30%, #ffd2dc 0%, #f39cb2 38%, #c45a77 100%);
    box-shadow: inset 0 -4px 8px rgba(110, 25, 45, 0.45), inset 0 2px 4px rgba(255, 255, 255, 0.35),
        0 0 0 3px rgba(243, 156, 178, 0.28), 0 6px 16px rgba(0, 0, 0, 0.7);
    transition: scale 0.18s ease;
}

.trailer__snout::before, .trailer__snout::after {
    content: "";
    position: absolute;
    top: 30%;
    width: 19%;
    height: 42%;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 35%, #5a1d27, #3b1219 70%);
    transition: transform 0.18s ease;
}

.trailer__snout::before { left: 25%; transform: rotate(14deg); }
.trailer__snout::after { right: 25%; transform: rotate(-14deg); }
.trailer__card:hover .trailer__snout { scale: 1.1; }
.trailer__card:hover .trailer__snout::before { transform: rotate(14deg) scale(1.22, 1.12); }
.trailer__card:hover .trailer__snout::after { transform: rotate(-14deg) scale(1.22, 1.12); }

.trailer__text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.trailer__eyebrow { font-family: var(--font-display); font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--amber); }
.trailer__title { font-family: var(--font-display); font-size: 1.45rem; font-weight: 400; letter-spacing: 0.05em; text-transform: uppercase; color: #fff; text-shadow: 0 2px 0 #000; }
.trailer__quip { font-size: 1.02rem; font-weight: 600; font-style: italic; }
.trailer__meta { margin-top: 0.2rem; color: var(--muted); font-size: 0.92rem; }

.trailer-dialog {
    width: min(1180px, calc(100vw - 2rem), calc((100vh - 9.5rem) * 16 / 9));
    max-width: none;
    max-height: none;
    margin: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    overflow: visible;
}

.trailer-dialog::backdrop { background: rgba(8, 9, 7, 0.86); }
.trailer-dialog[open] { animation: trailer-in 0.22s ease-out; }

@keyframes trailer-in {
    from { opacity: 0; transform: scale(0.97); }
}

.trailer-dialog__box {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.8rem 1rem 1rem;
    background:
        var(--rivet) 7px 7px / 10px 10px no-repeat,
        var(--rivet) calc(100% - 7px) 7px / 10px 10px no-repeat,
        var(--rivet) 7px calc(100% - 7px) / 10px 10px no-repeat,
        var(--rivet) calc(100% - 7px) calc(100% - 7px) / 10px 10px no-repeat,
        linear-gradient(160deg, #5b5e60 0%, #46494b 40%, #393c3e 65%, #4e5254 100%);
    border: 1px solid #0b0b0b;
    border-top: 4px solid var(--amber);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 30px 80px rgba(0, 0, 0, 0.75);
}

.trailer-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-inline: 0.6rem; }
.trailer-dialog__title { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: 0.06em; text-transform: uppercase; color: #fff; text-shadow: 0 2px 0 #000; }
.trailer-dialog__title span { margin-left: 0.6rem; font-size: 0.8rem; letter-spacing: 0.18em; color: var(--amber); }

.trailer-dialog__close {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    flex: none;
    background: rgba(13, 15, 11, 0.6);
    border: 1px solid var(--line-bright);
    color: var(--text);
    font: inherit;
    font-size: 1.1rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.trailer-dialog__close:hover, .trailer-dialog__close:focus-visible { border-color: var(--amber); color: var(--amber); outline: none; }

.trailer-dialog__screen { aspect-ratio: 16 / 9; background: #000; box-shadow: 0 0 0 2px #0b0b0b, 0 0 0 4px rgba(255, 255, 255, 0.06); }
.trailer-dialog__screen video { display: block; width: 100%; height: 100%; background: #000; }

.trailer-dialog__foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-inline: 0.6rem; }

.trailer-dialog__plate {
    padding: 0.2rem 0.8rem 0.1rem;
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--amber);
    background: #26282a;
    border: 1px solid #0b0b0b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.trailer-dialog__page { font-weight: 600; }
.trailer-dialog__page:hover, .trailer-dialog__page:focus-visible { text-decoration: underline; }

/* The intro memo: a typed order pinned to the wall under the screenshots. */
.memo {
    position: relative;
    margin-top: 1.1rem;
    padding: 1.15rem 1.4rem 1.05rem 1.5rem;
    background: linear-gradient(175deg, #efe6cb, #e2d6b4);
    color: #2a2418;
    border: 1px solid #b7a981;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55), inset 0 0 40px rgba(120, 96, 50, 0.18);
    transform: rotate(-0.6deg);
    font-size: 1.02rem;
    line-height: 1.5;
}

.memo::before, .memo::after {
    content: "";
    position: absolute;
    top: -9px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ff8d78, #b8321d 55%, #6d170b);
    box-shadow: 0 3px 4px rgba(0, 0, 0, 0.5);
}

.memo::before { left: 1.4rem; }
.memo::after { right: 1.4rem; }

.memo__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.55rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid rgba(42, 36, 24, 0.55);
}

.memo__title { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 0.06em; text-transform: uppercase; color: #2a2418; }
.memo__stamp { font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: #a3301c; border: 2px solid #a3301c; padding: 0.05rem 0.45rem; transform: rotate(3deg); white-space: nowrap; opacity: 0.85; }
.memo p { margin: 0 0 0.5rem; }
.memo p:last-child { margin-bottom: 0; }
.memo em { font-style: normal; font-weight: 600; }
.memo__aside { color: #7a4a1a; font-weight: 500; }

.main-menu { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 2rem; }

.main-menu__item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 0.7rem 1rem;
    background: linear-gradient(90deg, rgba(30, 29, 28, 0.96), rgba(30, 29, 28, 0.82));
    border: 1px solid var(--line-bright);
    border-left: 3px solid #7a746a;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.main-menu__item:hover:not(:disabled) {
    border-left-color: var(--amber);
    background: linear-gradient(90deg, rgba(62, 56, 48, 0.98), rgba(34, 32, 30, 0.9));
    color: var(--text);
    transform: translateX(4px);
}

.main-menu__item:disabled { cursor: progress; opacity: 0.7; }

.main-menu__label {
    font-family: var(--font-display);
    font-size: 1.35rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.main-menu__hint { color: var(--muted); font-size: 0.92rem; font-weight: 500; text-align: right; }

.main-menu__item--deploy {
    padding: 1rem 1.1rem;
    background: linear-gradient(90deg, rgba(226, 167, 46, 0.95), rgba(168, 123, 34, 0.85));
    border-color: var(--amber);
    border-left-color: #fff3cf;
    color: #1b1607;
}

.main-menu__item--deploy .main-menu__label { font-size: 2rem; }
.main-menu__item--deploy .main-menu__hint { color: #3a2c09; }

.main-menu__item--deploy:hover:not(:disabled) {
    background: linear-gradient(90deg, #f0b941, rgba(201, 143, 29, 0.95));
    color: #1b1607;
}

.callsign {
    padding: 0.9rem 1rem;
    background: rgba(14, 12, 11, 0.82);
    border: 1px dashed var(--line-bright);
}

.callsign__label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--amber);
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.callsign__row { display: flex; gap: 0.5rem; }
.callsign__row .input { flex: 1; min-width: 0; }
.callsign__hint { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.88rem; }
.callsign__current { margin: 0; display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.callsign__current .callsign__label { display: inline; margin: 0; }
.callsign__current strong { font-size: 1.2rem; }

/* ---------- Pig Map ---------- */

.pigmap__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.pigmap__map { overflow: hidden; }

.tmap { display: block; width: 100%; height: auto; font-family: var(--font-display); }
.tmap__sea { fill: #18211f; }
.tmap__gridline { fill: none; stroke: rgba(130, 160, 140, 0.09); stroke-width: 1; }
.tmap__land { fill: #2b3220; stroke: #59643c; stroke-width: 1.5; }
.tmap__land--desert { fill: #3e3522; stroke: #7b6a3e; }
.tmap__land--hostile { fill: #262a2f; stroke: #5e6670; }
.tmap__hatch { stroke: rgba(192, 73, 47, 0.28); stroke-width: 2; }
.tmap__state { fill: rgba(226, 167, 46, 0.05); stroke: rgba(226, 167, 46, 0.45); stroke-dasharray: 6 5; stroke-width: 1.5; }
.tmap__contour { fill: none; stroke: rgba(160, 135, 80, 0.35); stroke-width: 1; }
.tmap__region { fill: rgba(220, 216, 192, 0.32); font-size: 20px; letter-spacing: 6px; text-anchor: middle; }
.tmap__region--hostile { fill: rgba(220, 120, 100, 0.55); }
.tmap__note { fill: rgba(220, 216, 192, 0.45); font-family: var(--font-body); font-weight: 700; font-size: 12px; letter-spacing: 3px; text-anchor: middle; }
.tmap__note--hostile { fill: rgba(220, 120, 100, 0.6); }
.tmap__route { fill: none; stroke: var(--amber); stroke-width: 2; stroke-dasharray: 2 9; stroke-linecap: round; opacity: 0.7; animation: route 1.4s linear infinite; }
.tmap__compass circle { fill: rgba(0, 0, 0, 0.3); stroke: rgba(220, 216, 192, 0.35); }
.tmap__compass path { fill: rgba(220, 216, 192, 0.45); }
.tmap__compass text { fill: rgba(220, 216, 192, 0.6); font-size: 14px; text-anchor: middle; }

@keyframes route { to { stroke-dashoffset: -22; } }

.tmap__pin { cursor: pointer; outline: none; }
.tmap__pin text { text-anchor: middle; paint-order: stroke; stroke: rgba(0, 0, 0, 0.85); stroke-width: 4px; stroke-linejoin: round; }
.tmap__pin-op { fill: var(--amber); font-size: 12px; letter-spacing: 2px; }
.tmap__pin-label { fill: var(--text); font-size: 15px; letter-spacing: 2px; }
.tmap__pin-title { fill: var(--muted); font-family: var(--font-body); font-weight: 700; font-size: 11px; letter-spacing: 2px; }
.tmap__pin-ring { fill: rgba(0, 0, 0, 0.5); stroke: var(--amber); stroke-width: 2.5; }
.tmap__pin-dot { fill: var(--amber); }
.tmap__pin-pulse { fill: none; stroke: var(--amber); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.tmap__pin:hover .tmap__pin-ring, .tmap__pin:focus-visible .tmap__pin-ring { stroke-width: 4; }
.tmap__pin.is-selected .tmap__pin-pulse { animation: pulse 1.6s ease-out infinite; }
.tmap__pin.is-selected .tmap__pin-label { fill: var(--amber); }
.tmap__pin--secured .tmap__pin-ring { stroke: var(--green); }
.tmap__pin--secured .tmap__pin-dot { fill: var(--green); }
.tmap__pin--locked .tmap__pin-ring { stroke: #777; stroke-dasharray: 4 3; }
.tmap__pin--locked .tmap__pin-dot { fill: #777; }
.tmap__pin--locked .tmap__pin-op { fill: #888; }

@keyframes pulse {
    0% { opacity: 0.9; transform: scale(0.6); }
    100% { opacity: 0; transform: scale(1.8); }
}

.briefing__header { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0.25rem 1rem; margin-bottom: 1rem; }
.briefing__header .eyebrow { grid-column: 1 / -1; margin: 0; }
.briefing__title { font-family: var(--font-display); font-size: 2.2rem; line-height: 1; text-transform: uppercase; }
.briefing__text { color: #c9c5ad; border-left: 2px solid var(--amber-dim); padding-left: 0.9rem; margin: 1rem 0; }
.briefing__resume { margin-top: 1rem; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1rem; margin: 0; }
.facts div { min-width: 0; }
.facts dt { color: var(--muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.facts dd { margin: 0; font-weight: 600; }

.locked-panel {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--amber-dim);
    background:
        linear-gradient(rgba(18, 20, 16, 0.88), rgba(18, 20, 16, 0.88)),
        repeating-linear-gradient(-45deg, var(--amber) 0 14px, #111 14px 28px);
}

.locked-panel__title { font-family: var(--font-display); color: var(--amber); letter-spacing: 0.14em; text-transform: uppercase; }

/* Difficulty picker */
.difficulty { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

.difficulty__option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    padding: 0.7rem 0.8rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--line-bright);
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.difficulty__option:hover { border-color: var(--amber-dim); }
.difficulty__option.is-selected { border-color: var(--amber); background: var(--amber-glow); box-shadow: inset 3px 0 0 var(--amber); }
.difficulty__pips { display: flex; gap: 3px; }
.difficulty__pip { width: 14px; height: 5px; background: var(--line-bright); }
.difficulty__pip.is-on { background: var(--amber); }
.difficulty__name { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.06em; text-transform: uppercase; }
.difficulty__desc { color: var(--muted); font-size: 0.88rem; line-height: 1.25; }
.difficulty__rec { margin-top: 0.3rem; }

/* Toggles & settings */
.toggle { display: flex; align-items: flex-start; gap: 0.75rem; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.toggle__track {
    position: relative;
    flex-shrink: 0;
    width: 42px;
    height: 22px;
    margin-top: 2px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--line-bright);
    transition: background 0.15s, border-color 0.15s;
}

.toggle__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    background: var(--muted);
    transition: transform 0.15s, background 0.15s;
}

.toggle input:checked + .toggle__track { background: var(--amber-glow); border-color: var(--amber); }
.toggle input:checked + .toggle__track::after { transform: translateX(20px); background: var(--amber); }
.toggle input:focus-visible + .toggle__track { outline: 2px solid var(--amber); outline-offset: 2px; }
.toggle__text { display: flex; flex-direction: column; }
.toggle__label { font-weight: 700; }
.toggle__hint { color: var(--muted); font-size: 0.9rem; }

.barracks__status { position: sticky; top: 64px; z-index: 5; height: 0; display: flex; justify-content: flex-end; }

.saved {
    padding: 0.3rem 0.7rem;
    background: var(--panel-solid);
    border: 1px solid var(--green);
    color: var(--green);
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s;
}

.saved--on { opacity: 1; transform: none; }

.barracks__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.25rem; }
.barracks__keys { grid-column: 1 / -1; }
.barracks__footer { margin-top: 1.5rem; display: flex; justify-content: flex-end; }

fieldset.panel { margin: 0; min-width: 0; }
fieldset.panel legend { float: left; width: 100%; padding: 0; margin-bottom: 1rem; }
fieldset.panel legend + * { clear: both; }

.settings { display: flex; flex-direction: column; gap: 1rem; }
.setting { display: flex; flex-direction: column; gap: 0.35rem; }
.setting > label:not(.toggle) { font-weight: 700; }
.setting__control { display: flex; align-items: center; gap: 0.9rem; }
.setting__control output { min-width: 3.6rem; text-align: right; color: var(--amber); }
.setting__hint { margin: 0; color: var(--muted); font-size: 0.9rem; }
.toggle.setting { flex-direction: row; }

input[type="range"] {
    flex: 1;
    appearance: none;
    height: 22px;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--line-bright); }
input[type="range"]::-moz-range-track { height: 4px; background: var(--line-bright); }
input[type="range"]::-moz-range-progress { height: 4px; background: var(--amber-dim); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 14px; height: 20px; margin-top: -8px; background: var(--amber); border: 1px solid #000; }
input[type="range"]::-moz-range-thumb { width: 14px; height: 20px; background: var(--amber); border: 1px solid #000; border-radius: 0; }

/* Key bindings */
.keys { width: 100%; border-collapse: collapse; }
.keys th, .keys td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.keys thead th { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; }
.keys tbody th { font-weight: 600; }
.keys__action { display: block; color: var(--muted); font-size: 0.75rem; }
.keys__buttons { text-align: right; white-space: nowrap; }
.keys__buttons .btn + .btn { margin-left: 0.35rem; }
.keys__row--clash td { background: rgba(226, 167, 46, 0.05); }
.keys__clash { margin-left: 0.6rem; color: var(--amber); font-size: 0.85rem; }

.keycap {
    display: inline-block;
    min-width: 2.2rem;
    padding: 0.2rem 0.55rem;
    background: linear-gradient(#2c3122, #1d2117);
    border: 1px solid var(--line-bright);
    border-bottom-width: 3px;
    color: var(--text);
    font-size: 0.8rem;
    text-align: center;
}

.capture {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: rgba(8, 9, 7, 0.82);
    backdrop-filter: blur(3px);
    outline: none;
}

.capture__panel {
    max-width: 440px;
    padding: 2rem;
    text-align: center;
    background: var(--panel-solid);
    border: 1px solid var(--amber);
    box-shadow: 0 0 0 6px rgba(226, 167, 46, 0.08);
}

.capture__title { font-family: var(--font-display); font-size: 1.8rem; text-transform: uppercase; margin-bottom: 0.75rem; }

/* Dialog */
.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(8, 9, 7, 0.8);
}

.dialog {
    width: min(520px, 100%);
    padding: 1.6rem;
    background: var(--panel-solid);
    border: 1px solid var(--amber-dim);
    border-top: 4px solid var(--amber);
}

.dialog__title { font-family: var(--font-display); font-size: 1.6rem; text-transform: uppercase; margin-bottom: 1rem; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.25rem; flex-wrap: wrap; }

/* ---------- Trophy Trough ---------- */

.trophy-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 0.9rem;
}

.trophy {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--panel);
    border: 1px solid var(--line);
}

.trophy__medal {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    background: #2a2e22;
    position: relative;
}

.trophy__medal::after {
    content: "";
    position: absolute;
    inset: 13px;
    background: url("favicon.svg") center / contain no-repeat;
    filter: grayscale(1) brightness(0.5);
}

.trophy__title { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 0.2rem; }
.trophy__condition { margin: 0 0 0.35rem; color: #bdb9a2; font-size: 0.98rem; }
.trophy__state { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.trophy--unlocked { border-color: var(--amber-dim); background: linear-gradient(135deg, rgba(226, 167, 46, 0.12), var(--panel) 55%); }
.trophy--unlocked .trophy__medal { background: linear-gradient(135deg, #f3c25a, #a87b22); }
.trophy--unlocked .trophy__medal::after { filter: brightness(0.2); }
.trophy--unlocked .trophy__state { color: var(--amber); }
.trophy--locked { opacity: 0.6; }
.trophy--locked .trophy__title { color: var(--muted); }

/* ---------- Mud Board ---------- */

.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }

.tabs__tab {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.6rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--line);
    border-bottom: 3px solid var(--line);
    color: var(--muted);
    font: inherit;
    cursor: pointer;
}

.tabs__tab:hover { color: var(--text); }
.tabs__tab.is-active { color: var(--text); border-bottom-color: var(--amber); background: var(--amber-glow); }
.tabs__title { font-size: 1.05rem; }
.tabs__sub { font-size: 0.8rem; font-weight: 600; }

.filters { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 1rem; }

.filter {
    padding: 0.3rem 0.75rem;
    background: transparent;
    border: 1px solid var(--line-bright);
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}

.filter:hover { color: var(--text); }
.filter.is-active { border-color: var(--amber); color: var(--amber); }

.board { width: 100%; border-collapse: collapse; }
.board th, .board td { padding: 0.6rem 1rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.board thead th { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; background: rgba(0, 0, 0, 0.3); }
.board .num { text-align: right; }
.board tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.board__top--1 td:first-child { color: #f3c25a; }
.board__top--2 td:first-child { color: #c9c9c0; }
.board__top--3 td:first-child { color: #c98a52; }
.board__you { background: var(--amber-glow); box-shadow: inset 3px 0 0 var(--amber); }
.mudboard .panel--flush { overflow-x: auto; }

/* ---------- Roll Call ---------- */

.credits__viewport {
    height: min(68vh, 680px);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
}

.credits__roll {
    padding: 0 1.5rem;
    text-align: center;
    animation: roll 75s linear infinite;
}

.credits__viewport:hover .credits__roll { animation-play-state: paused; }

@keyframes roll {
    from { transform: translateY(min(68vh, 680px)); }
    to { transform: translateY(-100%); }
}

.credits__opening { color: var(--muted); letter-spacing: 0.25em; text-transform: uppercase; font-weight: 700; }
.credits__logo { font-family: var(--font-display); font-size: clamp(2.6rem, 7vw, 4.5rem); text-transform: uppercase; }
.credits__tagline { color: var(--amber); font-style: italic; margin-bottom: 3rem; }
.credits__section { margin: 0 auto 3rem; max-width: 760px; }
.credits__heading { font-family: var(--font-display); color: var(--amber); font-size: 1.1rem; letter-spacing: 0.25em; text-transform: uppercase; margin-bottom: 1rem; }
.credits__list { margin: 0; }
.credits__line { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; padding: 0.25rem 0; }
.credits__line dt { text-align: right; color: var(--muted); }
.credits__line dd { margin: 0; text-align: left; font-weight: 700; }
.credits__disclaimer { color: var(--muted); font-size: 0.9rem; }
.credits__end { margin: 3rem 0 4rem; font-family: var(--font-display); font-size: 1.6rem; letter-spacing: 0.2em; color: var(--red); }

/* ---------- Game page ---------- */

.game-shell { position: fixed; inset: 0; background: #000; overflow: hidden; }

.game-shell__preboot {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 1.1rem;
}

.game-host { position: absolute; inset: 0; z-index: 1; }

.game-host__stage {
    position: absolute;
    inset: 0;
    background: #000;
    touch-action: none;
}

.loader {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background-color: var(--bg);
    background-image: linear-gradient(180deg, rgba(12, 9, 8, 0.62), rgba(12, 9, 8, 0.8)), url("game/img/fort-marks.svg"), url("game/img/fort-wall.svg");
    background-size: auto, 2080px 1408px, 1040px 704px;
    transition: opacity 0.6s ease;
    overflow-y: auto;
}

.loader--fading { opacity: 0; pointer-events: none; }

.loader__panel { width: min(820px, 100%); }
.loader__title { font-family: var(--font-display); font-size: clamp(2.8rem, 8vw, 5rem); line-height: 0.95; text-transform: uppercase; text-shadow: 0 3px 0 #000; }
.loader__meta { margin: 0.6rem 0 0.4rem; color: var(--muted); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.loader__difficulty { margin-bottom: 1rem; }
.loader__difficulty .chip { margin-left: 0.5rem; }
.loader__briefing { color: #c9c5ad; border-left: 2px solid var(--amber-dim); padding-left: 1rem; margin-bottom: 1.75rem; max-width: 70ch; }
.loader__status { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.5rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; }

.loader__tip {
    margin-top: 1.5rem;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--line);
    min-height: 3.4rem;
}

.loader__tip-label {
    margin-right: 0.6rem;
    color: var(--amber);
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.loader__error { padding: 1.25rem; border: 1px solid var(--red); background: rgba(192, 73, 47, 0.12); }
.loader__error h2 { color: #e7826b; font-size: 1.6rem; margin-bottom: 0.5rem; }

.toasts {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    flex-direction: column;
    width: 320px;
    padding: 0.8rem 1rem;
    background: rgba(20, 22, 16, 0.94);
    border: 1px solid var(--amber-dim);
    border-left: 4px solid var(--amber);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: toast-in 0.35s ease-out;
}

.toast__eyebrow { color: var(--amber); font-family: var(--font-display); font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; }
.toast__title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 400; text-transform: uppercase; }
.toast__body { color: var(--muted); font-size: 0.9rem; }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: none; }
}

.escape-link {
    position: absolute;
    left: 0.75rem;
    bottom: 0.75rem;
    z-index: 30;
    padding: 0.3rem 0.65rem;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(220, 216, 192, 0.6);
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.55;
    transition: opacity 0.15s, color 0.15s;
}

.escape-link:hover, .escape-link:focus-visible { opacity: 1; color: var(--amber); }

/* ---------- Blazor error UI ---------- */

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    padding: 0.7rem 1.25rem;
    background: var(--red);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

#blazor-error-ui a { color: #fff; text-decoration: underline; margin-left: 0.75rem; }
#blazor-error-ui .dismiss { position: absolute; right: 1rem; top: 0.45rem; cursor: pointer; font-size: 1.3rem; }

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
    .pigmap__layout { grid-template-columns: 1fr; }
    .home { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .home__content { max-width: none; }
}

@media (max-width: 760px) {
    .topbar { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
    .topnav { width: 100%; }
    .gallery__thumbs { display: flex; overflow-x: auto; padding-bottom: 0.3rem; scrollbar-width: thin; }
    .gallery__thumb { flex: 0 0 5.5rem; }
    .gallery__nav, .gallery__pause { opacity: 1; }
    .gallery__nav { width: 1.9rem; height: 2.4rem; margin-top: -1.7rem; font-size: 1.4rem; }
    .gallery__caption { padding: 1.6rem 0.8rem 0.6rem; }
    .gallery__where { font-size: 0.66rem; }
    .gallery__title { font-size: 1.05rem; }
    .gallery__quip { display: none; }
    .trailer__card { grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr); gap: 0.8rem; }
    .trailer__snout { width: 2.6rem; }
    .trailer__title { font-size: 1.1rem; }
    .trailer__quip { font-size: 0.92rem; }
    .trailer-dialog { width: calc(100vw - 1rem); }
    .trailer-dialog__box { padding: 0.6rem 0.5rem 0.7rem; }
    .trailer-dialog__title span { display: none; }
    .main-menu__item { flex-direction: column; gap: 0.1rem; }
    .main-menu__hint { text-align: left; }
    .difficulty, .facts { grid-template-columns: 1fr; }
    .barracks__grid { grid-template-columns: 1fr; }
    .keys__action { display: none; }
    .credits__line { grid-template-columns: 1fr; gap: 0; }
    .credits__line dt, .credits__line dd { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .ticker__items, .credits__roll, .tmap__route, .tmap__pin-pulse, .progress__fill--busy { animation: none !important; }
    .memo { transform: none; }
    .gallery__shot, .gallery__timer { transition: none; transform: none; }
    .trailer__thumb img, .trailer__snout, .trailer__snout::before, .trailer__snout::after { transition: none; }
    .trailer-dialog[open] { animation: none; }
    .credits__viewport { overflow-y: auto; }
}
