/* ══════════════════════════════════════════════════════════════════════════
   CAMPAIGN COGITATOR — terminal theme
   This :root block is the single source of truth for colour. Change it HERE
   ONLY — nothing else in this file hard-codes a hex value.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
    --bg:          #05070a;   /* near-black, faint blue-green cast */
    --bg-panel:    #0a0f0c;   /* panel / table background          */
    --bg-hover:    #10170f;   /* row hover                         */
    --green:       #33ff66;   /* primary phosphor                  */
    --green-dim:   #1f9444;   /* secondary text, labels — 4.9:1 on a panel, legible at label sizes */
    --green-faint: #0f4020;   /* BORDERS AND RULES ONLY — too dark for text */
    --amber:       #ffb000;   /* rank 1, highlights, warnings      */
    --red:         #ff2e2e;   /* losses, alerts                    */
    --bone:        #d8d2c0;   /* parchment tone, long-form text    */

    --mono: 'JetBrains Mono', 'IBM Plex Mono', 'Fira Code', ui-monospace,
            SFMono-Regular, Menlo, Consolas, monospace;

    --glow: 0 0 6px currentColor;

    /* Everything below is MIXED from the colours above — no new hexes. A
       theme that changes the colours gets these for free, and one that wants
       none of it (the Old World) sets each to nothing. */

    /* Frames: a step brighter than the faint rules, so modules read as built objects. */
    --line:   color-mix(in srgb, var(--green-dim) 45%, var(--green-faint));
    /* Hover and selection fills. */
    --wash:   color-mix(in srgb, var(--green) 6%, transparent);
    /* Phosphor bloom for the few things that should burn: a tight core and a soft halo. */
    --bloom:  0 0 1px currentColor, 0 0 14px color-mix(in srgb, currentColor 38%, transparent);
    /* A module lifting off the glass. */
    --lift:   0 22px 44px -28px rgb(0 0 0 / 0.95), 0 0 0 1px rgb(0 0 0 / 0.5);
    /* Light caught along a module's top edge. */
    --sheen:  linear-gradient(to bottom, color-mix(in srgb, var(--green) 4%, transparent), transparent 9rem);

    /* Faces other themes swap out. The terminal uses its monospace for all. */
    --display: var(--mono);   /* the site title                        */
    --caps:    var(--mono);   /* labels, panel titles, map names       */

    /* The flat realm map (js/realm.js) — only the Old World uses it so far. */
    --sea:     #0d2b26;
    --sea-ink: #1a8039;
    --forest:  #1a8039;
}

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

html { color-scheme: dark; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--green);
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    scrollbar-color: var(--line) var(--bg);
}

/* Selecting text inverts it, as a terminal does. */
::selection { background: var(--green); color: var(--bg); text-shadow: none; }

/* One focus ring for every control: keyboard users always know where they are. */
:where(a, button, input, summary, [tabindex]):focus-visible { outline: 1px solid var(--amber); outline-offset: 3px; }

/* Faint green wash, horizon glow and a fine grain, so the black is glass
   rather than flat paint. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 120% 60% at 50% 0%, color-mix(in srgb, var(--green) 7%, transparent), transparent 70%),
        radial-gradient(ellipse 100% 50% at 50% 100%, color-mix(in srgb, var(--green) 3%, transparent), transparent 70%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 1 0 0 0 0 .4 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── The crest (index.html defines it; <use href="#crest"> draws it) ─────── */

.crest {
    display: block;
    overflow: visible;
    color: var(--green);
    /* Stroke weight per size: set --crest-stroke where it's used. */
    --crest-stroke: 1.6;
}
.crest__cog, .crest__ring, .crest__skull, .crest__optic, .crest__teeth, .crest__trace, .crest__brow {
    fill: none;
    stroke: currentColor;
    stroke-width: var(--crest-stroke);
    stroke-linejoin: round;
    stroke-linecap: round;
}
.crest__cog   { fill: color-mix(in srgb, currentColor 7%, transparent); }
.crest__ring  { stroke-opacity: 0.5; }
.crest__skull { fill: color-mix(in srgb, currentColor 11%, transparent); }
.crest__trace { stroke-opacity: 0.7; stroke-width: calc(var(--crest-stroke) * 0.8); }
.crest__socket, .crest__nose, .crest__node { fill: currentColor; }
/* The bionic eye: the one warm light on the machine. */
.crest__optic { stroke: var(--amber); }
.crest__lens  { fill: var(--amber); }

/* ── CRT overlays ────────────────────────────────────────────────────────── */

/* Fine and light: scanlines you notice on a second look, not ones that dim
   the text. Static — a moving pattern repaints the whole screen every frame;
   the refresh band below moves on the compositor instead. */
.crt-scanlines {
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: none;
    overflow: hidden;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0 2px,
        rgb(0 0 0 / 0.17) 2px 3px
    );
}

/* The refresh band: a soft bar of light rolling down the glass every few seconds. */
.crt-scanlines::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 22vh;
    background: linear-gradient(to bottom,
        transparent,
        color-mix(in srgb, var(--green) 1.6%, transparent) 70%,
        color-mix(in srgb, var(--green) 3.4%, transparent) 97%,
        transparent);
    transform: translateY(-25vh);
    animation: crt-roll 9s linear infinite;
    will-change: transform;
}

.crt-vignette {
    position: fixed;
    inset: 0;
    z-index: 8999;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 55%, rgb(0 0 0 / 0.6) 100%);
}

@keyframes crt-roll  { from { transform: translateY(-25vh); } 62%, to { transform: translateY(105vh); } }
@keyframes blink     { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes led-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── Feed columns ────────────────────────────────────────────────────────── */

/* Two feeds crawling down the screen edges: sector dispatches on the left,
   litanies on the right. Deliberately dim — they are texture, not content,
   and must never compete with the leaderboard. */
.feed {
    position: fixed;
    top: 0;
    width: 208px;
    height: 100vh;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    background: var(--bg-panel);

    /* Legible, but clearly behind the content in the hierarchy. */
    opacity: 0.7;
}

/* Border on the inner edge only, so each reads as a screen bezel; the shade
   along it sinks the column a little behind the glass. */
.feed--left  { left: 0;  border-right: 1px solid var(--green-faint); box-shadow: inset -18px 0 24px -20px rgb(0 0 0 / 0.9); }
.feed--right { right: 0; border-left: 1px solid var(--green-faint);  box-shadow: inset 18px 0 24px -20px rgb(0 0 0 / 0.9); }

.feed__label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.1rem 0.7rem;
    border-bottom: 1px solid var(--green-faint);
    color: var(--green);
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
}

/* A carrier light: the feed is live. */
.feed__label::before {
    content: "";
    flex: none;
    width: 5px;
    height: 5px;
    background: var(--amber);
    box-shadow: 0 0 6px var(--amber);
    animation: led-pulse 2.4s steps(2, jump-none) infinite;
}

.feed__viewport {
    position: absolute;
    top: 2.6rem;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;

    /* Fade both ends so lines emerge and dissolve rather than being clipped. */
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}

.feed__track {
    /* Travels exactly half its height — one full copy of the shuffled list —
       so the restart lands on an identical frame and the seam is invisible. */
    animation: feed-scroll 200s linear infinite;
}

/* Different pace per side, so the two columns never march in lockstep. */
.feed--left .feed__track { animation-duration: 260s; }

@keyframes feed-scroll {
    from { transform: translateY(0); }
    to   { transform: translateY(-50%); }
}

.feed__line {
    margin: 0 0 1.5rem;
    padding: 0 1.1rem;
    color: var(--green-dim);
    font-size: 0.6rem;
    line-height: 1.7;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

/* NOTE: never pad .feed__track — it scrolls exactly -50% of its own height to
   land on an identical frame. Anything added inside it shifts that boundary
   and the loop develops a visible jump. Pad .feed__line instead. */

/* Content is 900px, each feed 208px. Drop the left feed first, then both,
   rather than letting either crowd the leaderboard. */
@media (max-width: 1359px) {
    .feed--left { display: none; }
}

@media (max-width: 1139px) {
    .feed { display: none; }
}

/* ── Layout shell ────────────────────────────────────────────────────────── */

.term {
    position: relative;
    z-index: 1;
    /* Narrow enough that the leaderboard's names and numbers stay visually
       related, and long prose keeps a comfortable measure. */
    max-width: 900px;
    margin: 0 auto;
    padding-block: 2rem 3rem;
    padding-inline: 16px;
}

.term__head { border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
/* With the tabs in, they sit on the rule themselves. */
.term__head:has(.nav) { padding-bottom: 0; }

/* The crest beside the name, like a seal beside a signature. */
.term__brand {
    display: flex;
    align-items: center;
    gap: 1.15rem;
}
.term__brand .crest {
    flex: none;
    width: 66px;
    height: 66px;
    --crest-stroke: 1.55;
    filter: drop-shadow(0 0 1px currentColor) drop-shadow(0 0 9px color-mix(in srgb, currentColor 40%, transparent));
    animation: crest-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.term__id { min-width: 0; }

/* The crest powers up: faint, a stutter, then lit. Once per load (the header survives navigation). */
@keyframes crest-in {
    0%   { opacity: 0; transform: scale(0.94) rotate(-18deg); }
    40%  { opacity: 0.9; }
    52%  { opacity: 0.3; }
    64%  { opacity: 1; transform: none; }
    100% { opacity: 1; transform: none; }
}

.term__stamp {
    color: var(--green-dim);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.term__title {
    margin: 0.3rem 0 0;
    font-size: clamp(1.35rem, 5vw, 2.3rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.1em;
    text-transform: uppercase;

    /* Lit phosphor: the letters carry the raster (every third line dimmer)
       and burn softly into the glass around them. */
    color: var(--green);
    background: repeating-linear-gradient(to bottom,
        var(--green) 0 2px,
        color-mix(in srgb, var(--green) 58%, transparent) 2px 3px);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 1px color-mix(in srgb, var(--green) 70%, transparent)) drop-shadow(0 0 10px color-mix(in srgb, var(--green) 45%, transparent));

    /* Typewriter. width:max-content makes 100% mean "the width of the text",
       so the animation reveals character by character. steps() is what makes
       it tick rather than slide. */
    width: max-content;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    animation: type 0.55s steps(18, end) both;
}

/* Blazor focuses the heading after each navigation (App.razor), for screen
   readers. It isn't a control, so it shouldn't wear a focus ring. */
.term__title:focus { outline: none; }

@keyframes type {
    from { width: 0; }
    to   { width: 100%; }
}

/* The header and body print in sequence, like a terminal filling a screen.
   Kept under ~0.8s end to end — this runs on every visit, and people checking
   the standings should not have to sit through a title sequence. */
@keyframes reveal {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

/* The header lives in MainLayout, which survives navigation — so these run
   once, on first load only. */
.term__sub   { animation: reveal 0.25s ease-out 0.22s both; }
.nav         { animation: reveal 0.25s ease-out 0.38s both; }

/* The body is replaced on every tab change, so these re-run each time. Keep
   them short — a delay that's charming once is tiresome on the twentieth
   navigation. Whole sequence lands inside 0.6s. */
.term__body .prompt { animation: reveal 0.22s ease-out both; }
.term__body .prompt:nth-of-type(1) { animation-delay: 0.04s; }
.term__body .prompt:nth-of-type(2) { animation-delay: 0.11s; }
.term__body .prompt:nth-of-type(3) { animation-delay: 0.18s; }

/* Uniform delay rather than a per-panel stagger: the match log renders one
   panel per game night, so a stagger would leave late panels crawling in. */
.term__body .panel { animation: panel-in 0.42s ease-out 0.24s both; }

/* Settles with a CRT flicker, as though the screen is redrawing. */
@keyframes panel-in {
    0%   { opacity: 0; transform: translateY(6px); }
    35%  { opacity: 0.9; }
    45%  { opacity: 0.35; }
    60%  { opacity: 1; }
    100% { opacity: 1; transform: none; }
}

.term__sub {
    margin: 0.35rem 0 0;
    color: var(--bone);
    opacity: 0.72;
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

/* Status strip: AUTH / STATUS / date-stamp. Sits in the footer, as a row of
   readout cells split by hairlines, led by a carrier light. */
.term__strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0;
    margin-top: 1.1rem;
    padding-top: 0.95rem;
    border-top: 1px solid var(--green-faint);
    font-size: 0.64rem;
    letter-spacing: 0.16em;
    color: var(--green-dim);
    text-transform: uppercase;
}
.term__strip::before {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    margin-right: 1rem;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: led-pulse 3.2s ease-in-out infinite;
}
.term__strip > span { padding-right: 1.1rem; margin-right: 1.1rem; border-right: 1px solid var(--green-faint); }
.term__strip > span:last-child { border-right: 0; margin-right: 0; }

.term__strip b { color: var(--green); font-weight: 500; }

.term__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 0.75rem;
    margin-top: 1.1rem;
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.term__actions:empty { display: none; }

.term__seal {
    padding: 0;
    border: 0;
    background: none;
    color: var(--green-dim);
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    text-decoration: none;
    cursor: pointer;
}
.term__seal:hover, .term__seal:focus-visible { color: var(--amber); text-shadow: var(--glow); outline: none; }

/* In the footer's own row they are real controls, so they look like keys. */
.term__actions .term__seal {
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--line);
    background: var(--sheen), var(--bg);
    color: var(--green);
    transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.term__actions .term__seal:hover, .term__actions .term__seal:focus-visible {
    color: var(--amber);
    border-color: var(--amber);
    box-shadow: 0 0 12px -2px color-mix(in srgb, var(--amber) 45%, transparent);
}

/* ── Access code (sealed campaign archive) ───────────────────────────────── */

.gate { max-width: 36rem; }
.gate__label {
    display: block;
    margin-bottom: 0.6rem;
    color: var(--green-dim);
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}
.gate__row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
/* The field carries a prompt, so typing reads as entering a command. */
.gate__field { position: relative; display: flex; flex: 1 1 15rem; min-width: 0; }
.gate__field::before {
    content: ">";
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-54%);
    color: var(--green-dim);
    font-weight: 700;
    pointer-events: none;
}
.gate__input {
    flex: 1;
    min-width: 0;
    padding: 0.72rem 0.8rem 0.72rem 2.1rem;
    border: 1px solid var(--line);
    background: var(--sheen), var(--bg);
    color: var(--green);
    font: inherit;
    font-size: 1.05rem;
    letter-spacing: 0.3em;
    caret-color: var(--green);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.gate__input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 1px var(--green), 0 0 20px -6px color-mix(in srgb, var(--green) 60%, transparent);
}
.gate__submit {
    padding: 0.72rem 1.25rem;
    border: 1px solid var(--green-dim);
    background: color-mix(in srgb, var(--green) 9%, var(--bg));
    color: var(--green);
    font: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.gate__submit:hover, .gate__submit:focus-visible {
    color: var(--bg);
    background: var(--amber);
    border-color: var(--amber);
    box-shadow: 0 0 18px -4px var(--amber);
    outline: none;
}
.gate__submit:disabled, .gate__input:disabled { opacity: 0.6; cursor: progress; }

/* A wrong code: the field shakes its head and flares red. */
.gate--denied .gate__field { animation: denied 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
.gate--denied .gate__input { border-color: var(--red); box-shadow: 0 0 0 1px var(--red), 0 0 20px -6px var(--red); }
.gate--denied .gate__field::before { color: var(--red); }
@keyframes denied {
    10%, 90%      { translate: -1px 0; }
    20%, 80%      { translate: 3px 0; }
    30%, 50%, 70% { translate: -6px 0; }
    40%, 60%      { translate: 6px 0; }
}

.gate__denied { margin: 0.9rem 0 0; color: var(--red); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; text-shadow: var(--glow); }
.gate__hint { margin: 1.1rem 0 0; color: var(--bone); opacity: 0.62; font-size: 0.74rem; line-height: 1.65; }

/* ── Navigation ──────────────────────────────────────────────────────────── */

/* Tabs, numbered, sitting on the header's rule. The one you're on is lit
   amber and seated on the rule by a bar of light. */
.nav {
    display: flex;
    flex-wrap: wrap;
    margin-top: 1.35rem;
    margin-bottom: -1px;
    counter-reset: nav;
}

.nav a {
    position: relative;
    display: inline-flex;
    align-items: baseline;
    gap: 0.7em;
    padding: 0.7rem 1.15rem 0.75rem;
    color: var(--green-dim);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: color 0.15s, background-color 0.15s;
}
.nav a:first-child { padding-left: 0.2rem; }

/* 01, 02, ... — counted by the stylesheet, so no theme has to say them. */
.nav a::before {
    counter-increment: nav;
    content: counter(nav, decimal-leading-zero);
    font-size: 0.86em;
    letter-spacing: 0.06em;
    opacity: 0.6;
}

/* The bar of light under the current tab. */
.nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
    transform: scaleX(0);
    transition: transform 0.2s ease-out;
}
.nav a:first-child::after { left: 0.2rem; }

.nav a:hover { color: var(--green); }
.nav a:hover::after { transform: scaleX(1); opacity: 0.35; box-shadow: none; }

/* Blazor's NavLink adds .active to the matching route. */
.nav a.active {
    color: var(--amber);
    text-shadow: var(--glow);
    background: linear-gradient(to top, color-mix(in srgb, var(--amber) 11%, transparent), transparent 85%);
}
.nav a.active::after { transform: none; opacity: 1; }
.nav a.active::before { opacity: 0.8; }

/* A phone gets a keypad: two tabs a row, each a key, all of them in reach. */
@media (max-width: 560px) {
    .nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1px;
        margin: 1.1rem 0 1rem;
        border: 1px solid var(--line);
        background: var(--line);
    }
    .term__head:has(.nav) { padding-bottom: 0; border-bottom: 0; }
    .nav a, .nav a:first-child {
        padding: 0.8rem 0.75rem;
        background: var(--bg);
        font-size: 0.62rem;
        letter-spacing: 0.14em;
    }
    .nav a.active { background: color-mix(in srgb, var(--amber) 11%, var(--bg)); }
    .nav a::after, .nav a:first-child::after { left: 0; right: auto; top: 0; bottom: 0; width: 2px; height: auto; transform: scaleY(0); }
    .nav a.active::after { transform: none; }
    /* An odd tab out spans the row rather than leaving a hole. */
    .nav a:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.term__body { margin-top: 2.5rem; }

.term__foot {
    margin-top: 4rem;
    color: var(--green-dim);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
}

.term__foot p { margin: 0.35rem 0; }

/* The sign-off: the crest set into the closing rule. */
.term__sign {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.4rem;
    color: var(--green-dim);
}
.term__sign::before, .term__sign::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.term__sign .crest { width: 30px; height: 30px; --crest-stroke: 2.2; opacity: 0.85; }

.term__foot-head { font-weight: 500; letter-spacing: 0.2em; }

.thought {
    color: var(--bone);
    opacity: 0.85;
    font-style: italic;
    letter-spacing: 0.03em;
    text-transform: none;
    font-size: 0.86rem;
}

.term__colophon { opacity: 0.85; line-height: 1.6; }

/* ── Prompt lines ────────────────────────────────────────────────────────── */

.prompt {
    --track: 0.12em;
    margin: 0 0 0.4rem;
    color: var(--green-dim);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: var(--track);
    /* Values interpolated from the data files (season name, dates) arrive in
       whatever case they were typed. Uppercase here keeps the header uniform. */
    text-transform: uppercase;
    /* The ">> " marker hangs in the margin, so a line that wraps continues
       under the text, not under the marker. Three monospace cells wide. */
    padding-left: calc(3 * (0.6em + var(--track)));
    text-indent: calc(-3 * (0.6em + var(--track)));
    text-wrap: pretty;
}

.prompt b { color: var(--green); font-weight: 700; }

.cursor {
    display: inline-block;
    margin-left: 0.15em;
    color: var(--green);
    animation: blink 1.1s steps(1) infinite;
}

/* ── Panel (bordered box with an inset title, like a fieldset) ───────────── */

/* A module of the cogitator: a framed pane lit faintly from above, lifted
   off the glass, with machined corners and a title plate riveted to its top
   edge. */
.panel {
    position: relative;
    margin-top: 2.5rem;
    border: 1px solid var(--line);
    background: var(--sheen), var(--bg-panel);
    box-shadow: var(--lift), inset 0 1px 0 color-mix(in srgb, var(--green) 7%, transparent);
    padding: 1.95rem 1.25rem 1.3rem;
}

.panel__title {
    position: absolute;
    top: 0;
    left: 1rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    max-width: calc(100% - 2rem);
    padding: 0.32rem 0.8rem 0.32rem 0.65rem;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--green);
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The plate's status light. */
.panel__title::before {
    content: "";
    flex: none;
    width: 5px;
    height: 5px;
    background: currentColor;
    box-shadow: 0 0 7px currentColor;
}

/* All four corners bracketed, in one layer. They brighten when you're over
   the module, as though it had come to attention. */
.panel::before {
    --corner: var(--green);
    content: "";
    position: absolute;
    inset: -1px;
    pointer-events: none;
    background:
        linear-gradient(var(--corner), var(--corner)) top left     / 12px 1px,
        linear-gradient(var(--corner), var(--corner)) top left     / 1px 12px,
        linear-gradient(var(--corner), var(--corner)) top right    / 12px 1px,
        linear-gradient(var(--corner), var(--corner)) top right    / 1px 12px,
        linear-gradient(var(--corner), var(--corner)) bottom left  / 12px 1px,
        linear-gradient(var(--corner), var(--corner)) bottom left  / 1px 12px,
        linear-gradient(var(--corner), var(--corner)) bottom right / 12px 1px,
        linear-gradient(var(--corner), var(--corner)) bottom right / 1px 12px;
    background-repeat: no-repeat;
    opacity: 0.7;
    transition: opacity 0.25s;
}
.panel:hover::before { opacity: 1; }

.notice {
    margin: 0 0 1rem;
    color: var(--amber);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* ── Fault / empty states ────────────────────────────────────────────────── */

.alert { color: var(--red); }

.panel--alert { border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.panel--alert::before { --corner: var(--red); }
.panel__title--alert { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.notice--alert { color: var(--red); }

.fault {
    margin: 0 0 1rem;
    padding: 0.75rem 0.9rem;
    background: color-mix(in srgb, var(--red) 8%, var(--bg));
    border-left: 2px solid var(--red);
    color: var(--red);
    font-size: 0.78rem;
    word-break: break-word;
}

.hint {
    margin: 0;
    color: var(--bone);
    opacity: 0.7;
    font-size: 0.78rem;
}

.faults {
    margin: 0;
    padding: 0;
    list-style: none;
}

.faults li {
    padding: 0.5rem 0.9rem;
    margin-bottom: 0.4rem;
    background: color-mix(in srgb, var(--red) 8%, var(--bg));
    border-left: 2px solid var(--red);
    color: var(--red);
    font-size: 0.76rem;
    word-break: break-word;
}

code {
    color: var(--amber);
    font-family: var(--mono);
    font-size: 0.92em;
}

.empty {
    margin: 1.5rem 0;
    color: var(--green-dim);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
}

/* ── Standings table ─────────────────────────────────────────────────────── */

.table-scroll { overflow-x: auto; }

.standings {
    width: 100%;
    min-width: 360px;
    border-collapse: separate;
    border-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.standings thead th {
    padding: 0 0.6rem 0.65rem;
    border-bottom: 1px solid var(--line);
    color: var(--green-dim);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}
.standings thead th:first-child { padding-left: 1rem; }

.standings td {
    padding: 0.85rem 0.6rem;
    border-bottom: 1px solid color-mix(in srgb, var(--green-faint) 75%, transparent);
    vertical-align: middle;
}
/* Only the short cells hold together. The name cell may wrap — on a phone,
   a faction line that can't is what pushed the results off the screen. */
.standings td.rank, .standings td.num, .standings td.col-status { white-space: nowrap; }

/* Must out-specify `.standings thead th`, which left-aligns by default */
.standings thead th.num { text-align: center; }

/* Anything carrying a native tooltip signals it on hover. */
.standings thead th[title] { cursor: help; }

/* The army's colour runs down each row's leading edge: the colour its ground
   wears on the map. An undeclared commander's edge is broken signal, as its
   ground is on the map. */
.standings tbody td:first-child {
    padding-left: 1rem;
    box-shadow: inset 3px 0 0 var(--army, transparent);
}
.standings tbody tr.is-undeclared td:first-child {
    box-shadow: none;
    background: repeating-linear-gradient(to bottom, color-mix(in srgb, var(--red) 65%, transparent) 0 3px, transparent 3px 7px) left / 3px 100% no-repeat;
}

.standings tbody tr { transition: background-color 0.15s; }
.standings tbody tr:hover { background: var(--wash); }
.standings tbody tr:last-child td { border-bottom: none; }

.num { text-align: center; }
.standings td.num { width: 2.8rem; font-size: 0.95rem; font-weight: 500; }

.rank { color: var(--green-dim); width: 1%; font-size: 1.05rem; font-weight: 300; letter-spacing: 0.04em; }

.commander { color: var(--green); font-size: 0.92rem; font-weight: 700; letter-spacing: 0.1em; }
/* The name opens the commander's file: a chevron says so on hover. */
a.commander::after { content: " ›"; opacity: 0; transition: opacity 0.15s; }
a.commander:hover::after, a.commander:focus-visible::after { opacity: 1; }

.faction {
    display: block;
    margin-top: 0.15rem;
    color: var(--bone);
    opacity: 0.55;
    font-size: 0.64rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.w { color: var(--green); }
.d { color: var(--bone); opacity: 0.75; }
.l { color: var(--red); opacity: 0.9; }

/* A zero carries no news. Without this, nil losses render in alarm-red, which
   reads as a problem when it is the best cell in the table. Out-specifies the
   .w/.d/.l colours above. */
.standings td.is-zero {
    color: color-mix(in srgb, var(--bone) 24%, transparent);
    opacity: 1;
}

/* The leader: burning amber, and the row lit from its leading edge. */
.standings tbody tr.is-first { background: linear-gradient(90deg, color-mix(in srgb, var(--amber) 10%, transparent), transparent 62%); }
.is-first .commander,
.is-first .rank { color: var(--amber); text-shadow: var(--glow); }
.is-first .rank { font-weight: 700; }

/* A status chip: a lamp and a word. */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.22rem 0.55rem 0.22rem 0.45rem;
    border: 1px solid color-mix(in srgb, currentColor 50%, transparent);
    background: color-mix(in srgb, currentColor 8%, transparent);
    font-size: 0.58rem;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: nowrap;

    /* Signals there's an explanation behind it. The tooltip itself is a native
       title attribute — a styled one would be clipped by .table-scroll, which
       establishes a scroll container and therefore cuts off anything absolutely
       positioned outside it. */
    cursor: help;
}
.tag::before {
    content: "";
    flex: none;
    width: 5px;
    height: 5px;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
}

/* Status reflects the last engagement, not league position. Escalating runs
   get the stronger wording and the stronger colour — and a lamp that won't settle. */
.tag--ascendant { color: var(--amber); text-shadow: var(--glow); }   /* 3+ wins  */
.tag--victory   { color: var(--green); }                             /* last: won */
.tag--stalemate { color: var(--bone); opacity: 0.7; }                /* last: drew */
.tag--defeat    { color: var(--red); opacity: 0.75; }                /* last: lost */
.tag--penance   { color: var(--red); }                               /* 3+ losses */
.tag--none      { color: var(--green-dim); }                         /* no games  */
.tag--none::before { background: none; box-shadow: inset 0 0 0 1px currentColor; }
.tag--ascendant::before, .tag--penance::before { animation: led-pulse 1.4s ease-in-out infinite; }

/* ── Match log ───────────────────────────────────────────────────────────── */

.engagement {
    padding: 1.2rem 0 1.35rem;
    border-bottom: 1px solid color-mix(in srgb, var(--green-faint) 75%, transparent);
}

.engagement:first-of-type { padding-top: 0.2rem; }
.engagement:last-child { border-bottom: none; padding-bottom: 0.2rem; }

.engagement__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.9rem;
    color: var(--green-dim);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* The engagement's number in inverse video: a record's reference, stamped. */
.engagement__id {
    padding: 0.1rem 0.45rem;
    background: var(--green);
    color: var(--bg);
    font-weight: 700;
    letter-spacing: 0.14em;
}

/* The scoreboard: each side a plate edged in its army's colour. */
.engagement__combatants {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.6rem 0.9rem;
    margin-top: 0.8rem;
}

.combatant {
    flex: 1 1 11rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.6rem 0.95rem 0.6rem 1.05rem;
    border: 1px solid var(--green-faint);
    background: linear-gradient(var(--army, var(--line)), var(--army, var(--line))) left / 3px 100% no-repeat, var(--bg);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
/* Two sides face each other: the second reads from the right. */
.engagement__combatants > .combatant:nth-child(3):last-child {
    align-items: flex-end;
    text-align: right;
    padding: 0.6rem 1.05rem 0.6rem 0.95rem;
    background-position: right, 0 0;
}

.combatant__name { font-size: 0.9rem; }
.combatant__army {
    color: var(--bone);
    opacity: 0.6;
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.12em;
}

.combatant.is-victor { border-color: color-mix(in srgb, var(--amber) 45%, transparent); box-shadow: 0 0 22px -12px var(--amber); }
.combatant.is-victor .combatant__name { color: var(--amber); text-shadow: var(--glow); }
.combatant.is-victor .combatant__name::before { content: "▲ "; font-size: 0.8em; }
.combatant.is-defeated .combatant__name { color: var(--red); opacity: 0.75; }
.combatant.is-defeated { opacity: 0.85; }
.combatant.is-drawn .combatant__name { color: var(--bone); opacity: 0.85; }

.engagement__vs {
    align-self: center;
    color: var(--green-dim);
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

/* A phone stacks the sides, the "vs" centred between them. */
@media (max-width: 560px) {
    .engagement__combatants { flex-direction: column; gap: 0.35rem; }
    .combatant { flex: none; }
}

.engagement__verdict {
    margin: 0.85rem 0 0;
    color: var(--green-dim);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.engagement__verdict b { color: var(--amber); font-weight: 700; }
.engagement__verdict.is-draw { color: var(--bone); opacity: 0.65; }

/* Which territory the result moved — ties the log to the Theatre of War. */
.engagement__territory {
    margin: 0.3rem 0 0;
    color: var(--green-dim);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.engagement__territory b { color: var(--bone); font-weight: 500; }
.engagement__maplink {
    margin-left: 0.5rem;
    color: var(--green-dim);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
}
.engagement__maplink:hover, .engagement__maplink:focus-visible { color: var(--amber); text-shadow: var(--glow); }

.engagement__playlabel {
    margin: 1.05rem 0 0.35rem;
    color: var(--green-dim);
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

/* The players' own words — quoted and set on an amber rule, so it reads as testimony. */
.engagement__notes {
    margin: 0.5rem 0 0;
    max-width: 66ch;
    padding: 0.15rem 0 0.15rem 0.95rem;
    border-left: 2px solid color-mix(in srgb, var(--amber) 55%, transparent);
    color: var(--bone);
    opacity: 0.72;
    font-size: 0.8rem;
    font-style: italic;
    line-height: 1.65;
    letter-spacing: 0.01em;
}

/* The same battle as campaign record: upright, not quoted, slightly warmer,
   so it reads as the archive speaking rather than a player. */
.engagement__chronicle {
    margin: 0.5rem 0 0;
    max-width: 68ch;
    padding-left: 0.95rem;
    border-left: 1px solid var(--line);
    color: var(--bone);
    opacity: 0.84;
    font-size: 0.84rem;
    line-height: 1.8;
    letter-spacing: 0.005em;
    text-wrap: pretty;
}

/* ── Commander dossiers ──────────────────────────────────────────────────── */

/* The rank again, stamped large and faint in the army's colour. */
.dossier__stamp {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    color: var(--army, var(--green-dim));
    opacity: 0.17;
    font-size: clamp(3rem, 9vw, 5rem);
    font-weight: 800;
    line-height: 0.9;
    letter-spacing: -0.02em;
    pointer-events: none;
    user-select: none;
}

/* The name block carries the army's colour down its edge, as the standings
   rows do. Undeclared: broken signal. */
.dossier__head {
    position: relative;
    margin-bottom: 1.6rem;
    padding: 0.1rem 4rem 0.1rem 1.05rem;
    background: linear-gradient(var(--army, var(--line)), var(--army, var(--line))) left / 3px 100% no-repeat;
}
.dossier--undeclared .dossier__head {
    background: repeating-linear-gradient(to bottom, color-mix(in srgb, var(--red) 65%, transparent) 0 3px, transparent 3px 7px) left / 3px 100% no-repeat;
}

.dossier__name {
    margin: 0;
    font-size: clamp(1.3rem, 4.2vw, 1.75rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.14em;
    color: var(--green);
    text-shadow: var(--bloom);
}

.dossier__faction {
    margin: 0.4rem 0 0;
    color: var(--bone);
    opacity: 0.62;
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* Specs and the archive note side by side, on a screen wide enough for both. */
.dossier__body { display: grid; gap: 1.5rem 2rem; }
@media (min-width: 761px) {
    .dossier__body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); }
    .dossier__file { padding-left: 2rem; border-left: 1px solid var(--green-faint); }
}

/* Label column sized to the longest label, so values line up in a stat block. */
.dossier__specs {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-content: start;
    gap: 0.62rem 1.3rem;
    margin: 0;
}

.dossier__specs dt {
    padding-top: 0.16rem;
    color: var(--green-dim);
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.dossier__specs dd {
    margin: 0;
    color: var(--green);
    font-size: 0.8rem;
    line-height: 1.5;
    letter-spacing: 0.03em;
}

/* ★ ground is amber on the map, so its bonuses are amber here. */
.dossier__specs dd.dossier__bonuses { color: var(--amber); }

/* NOTE: the form string is no longer rendered anywhere — CommanderStatus
   derives the status tag from it instead. StandingsCalculator still computes
   it, and that is what feeds the status. Don't delete it from the model. */

.dossier__lorelabel {
    margin: 0 0 0.5rem;
    color: var(--green-dim);
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.dossier__lore {
    margin: 0;
    max-width: 68ch;
    color: var(--bone);
    opacity: 0.86;
    font-size: 0.84rem;
    line-height: 1.75;
    letter-spacing: 0.005em;
    text-wrap: pretty;
}

.dossier__lore--missing {
    color: var(--amber);
    opacity: 0.75;
    font-style: italic;
}

/* The record as a readout: four tiles on hairlines. */
.dossier__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin-top: 1.7rem;
}
.dossier__record {
    display: grid;
    grid-template-columns: repeat(4, minmax(4.4rem, 1fr));
    gap: 1px;
    margin: 0;
    border: 1px solid var(--green-faint);
    background: var(--green-faint);
}
.dossier__stat { padding: 0.5rem 0.85rem 0.45rem; background: var(--bg); }
.dossier__stat dt {
    color: var(--green-dim);
    font-size: 0.54rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}
.dossier__stat dd { margin: 0.1rem 0 0; color: var(--bone); font-size: 1.3rem; font-weight: 700; line-height: 1.15; }
.dossier__stat--won dd   { color: var(--green); text-shadow: var(--glow); }
.dossier__stat--drawn dd { color: var(--bone); }
.dossier__stat--lost dd  { color: var(--red); }
.dossier__stat.is-zero dd { color: color-mix(in srgb, var(--bone) 24%, transparent); text-shadow: none; }

@media (max-width: 520px) {
    /* Stack labels above values rather than squeezing two columns. */
    .dossier__specs { grid-template-columns: 1fr; gap: 0.15rem; }
    .dossier__specs dd { margin-bottom: 0.65rem; }
    .dossier__record { grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
    .dossier__stat { padding-inline: 0.6rem; }
    .dossier__head { padding-right: 3rem; }
}

.dossier__maplink { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--line); transition: color 0.15s, border-color 0.15s; }
.dossier__maplink:hover, .dossier__maplink:focus-visible { color: var(--amber); border-bottom-color: var(--amber); border-bottom-style: solid; }

/* Names link through to the commander's full file. */
.dossier__namelink, a.commander, a.claim-list__army { color: inherit; text-decoration: none; }
.dossier__namelink:hover, .dossier__namelink:focus-visible,
a.commander:hover, a.commander:focus-visible,
a.claim-list__army:hover, a.claim-list__army:focus-visible { color: var(--amber); text-shadow: var(--glow); outline: none; }

/* "Open full file" is the card's one action, so it's a key. */
.dossier__open { margin: 0; font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; }
.dossier__open a {
    display: inline-block;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--line);
    background: var(--sheen), var(--bg);
    color: var(--green);
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.dossier__open a:hover, .dossier__open a:focus-visible {
    color: var(--amber);
    border-color: var(--amber);
    box-shadow: 0 0 14px -4px var(--amber);
    outline: none;
}
/* A link that is an action, drawn as a key (the 404 page's way back). */
.key {
    display: inline-block;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--line);
    background: var(--sheen), var(--bg);
    color: var(--green);
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.key:hover, .key:focus-visible { color: var(--amber); border-color: var(--amber); box-shadow: 0 0 14px -4px var(--amber); outline: none; }
.missing__back { margin: 1.5rem 0 0; }

.profile__crumb, .profile__back a { color: var(--green-dim); text-decoration: none; transition: color 0.15s; }
.profile__crumb:hover, .profile__crumb:focus-visible,
.profile__back a:hover, .profile__back a:focus-visible { color: var(--amber); text-shadow: var(--glow); }
.profile__back { margin: 1rem 0 0; font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; }

/* ── Commander profile ───────────────────────────────────────────────────── */

.profile__rule { margin: 0 0 1.1rem; max-width: 68ch; color: var(--bone); opacity: 0.72; font-size: 0.74rem; line-height: 1.65; }

/* Each bonus a gilt-edged card: ★ ground is amber everywhere it appears. */
.bonus-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.75rem;
}
.bonus-list li {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.8rem 0.95rem 0.75rem;
    border: 1px solid color-mix(in srgb, var(--amber) 28%, transparent);
    background: linear-gradient(to bottom, color-mix(in srgb, var(--amber) 6%, transparent), transparent 75%), var(--bg);
}
.bonus-list__name { color: var(--amber); text-shadow: var(--glow); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.bonus-list__effect { color: var(--bone); font-size: 0.8rem; line-height: 1.6; }
.bonus-list__where {
    margin-top: auto;
    padding-top: 0.3rem;
    color: var(--green-dim);
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.15s;
}
.bonus-list__where::before { content: "⌖ "; }
.bonus-list__where:hover, .bonus-list__where:focus-visible { color: var(--amber); }

a.register__item { box-sizing: border-box; text-decoration: none; }

.profile__result {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    margin: 0.75rem 0 0.2rem;
    color: var(--green-dim);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
/* The result as a chip with a lamp, like the status tags. */
.profile__verdict {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.22rem 0.6rem 0.22rem 0.5rem;
    border: 1px solid color-mix(in srgb, currentColor 50%, transparent);
    background: color-mix(in srgb, currentColor 9%, transparent);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}
.profile__verdict::before { content: ""; width: 5px; height: 5px; background: currentColor; box-shadow: 0 0 6px currentColor; }
.profile__verdict.is-victor   { color: var(--amber); text-shadow: var(--glow); }
.profile__verdict.is-defeated { color: var(--red); }
.profile__verdict.is-drawn    { color: var(--bone); }

/* ── Sector brief (campaign lore) ────────────────────────────────────────── */

/* The file's classification line, ruled above and below like a header strip. */
.brief__designation {
    margin: 0 0 2rem;
    padding: 0.6rem 0;
    border-block: 1px solid var(--green-faint);
    color: var(--green-dim);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* The epigraph as the brief's pull quote: large, amber, on its own rule. */
.brief__epigraph {
    margin: 0 0 2.4rem;
    padding: 0.2rem 0 0.2rem 1.25rem;
    border-left: 2px solid var(--amber);
    max-width: 58ch;
    color: var(--amber);
    font-size: clamp(1rem, 2.4vw, 1.2rem);
    font-style: italic;
    line-height: 1.6;
    text-shadow: var(--glow);
    text-wrap: balance;
}

/* Section headings run a rule out to the margin, and end in their number. */
.brief { counter-reset: brief-section; }
.brief__heading {
    counter-increment: brief-section;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2.4rem 0 1rem;
    color: var(--green);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}
.brief__heading::after {
    content: "§" counter(brief-section, decimal-leading-zero);
    order: 2;
    color: var(--green-dim);
    font-weight: 400;
    letter-spacing: 0.1em;
}
.brief__heading::before {
    content: "";
    order: 1;
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--line), var(--green-faint));
}

/* Long prose in monospace needs a tight measure or it becomes unreadable. */
.brief__body {
    margin: 0 0 1rem;
    max-width: 66ch;
    color: var(--bone);
    opacity: 0.84;
    font-size: 0.84rem;
    line-height: 1.8;
    letter-spacing: 0.005em;
    text-wrap: pretty;
}
/* Each section opens on a lead paragraph, a step larger. */
.brief__heading + .brief__body { opacity: 0.95; font-size: 0.9rem; }

/* War-parties as cards, two to a row where there's room, each edged in its army's colour. */
.claimants {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
    gap: 0.9rem;
}

.claimant {
    padding: 1.05rem 1.15rem 0.6rem;
    border: 1px solid var(--green-faint);
    background: linear-gradient(var(--army, var(--line)), var(--army, var(--line))) top / 100% 3px no-repeat, var(--bg);
}

.claimant__name {
    margin: 0;
    color: var(--green);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-shadow: var(--glow);
}

.claimant__meta {
    margin: 0.3rem 0 0.9rem;
    color: var(--bone);
    opacity: 0.55;
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.claimant__objective {
    margin: 0 0 0.9rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent);
    background: color-mix(in srgb, var(--amber) 6%, transparent);
    color: var(--amber);
    font-size: 0.64rem;
    font-weight: 500;
    line-height: 1.55;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.claimant .brief__body { font-size: 0.8rem; line-height: 1.75; }

/* The undeclared players — deliberately colder than the named war-parties:
   no colour, and an edge of broken signal. */
.claimant--unknown {
    background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--red) 60%, transparent) 0 6px, transparent 6px 10px) top / 100% 3px no-repeat, var(--bg);
}
.claimant--unknown .claimant__name {
    margin-bottom: 0.6rem;
    color: var(--green-dim);
    text-shadow: none;
}

/* The brief signs off: centred, amber, between rules. */
.brief__closing {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin: 3rem 0 0;
    color: var(--amber);
    opacity: 0.85;
    font-size: 0.82rem;
    font-style: italic;
    line-height: 1.7;
    text-align: center;
    text-wrap: balance;
}
.brief__closing::before, .brief__closing::after { content: ""; flex: 1; min-width: 2rem; height: 1px; background: color-mix(in srgb, var(--amber) 35%, transparent); }

/* ── Theatre of War (the globe) ──────────────────────────────────────────── */

/* wwwroot/js/globe.js builds this SVG and re-projects it every frame. Faction
   tints come from players.json ("colour") and arrive as each tile's `color`,
   so every part of a tile below just uses currentColor. */

/* The map and its readouts side by side, both columns ending on one line;
   the story of the game on the timeline runs full width underneath. */
.theatre {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    grid-template-areas: "map side" "story story";
    gap: 0 1.25rem;
    align-items: stretch;
}
.theatre__map   { grid-area: map; display: flex; flex-direction: column; }
.theatre__side  { grid-area: side; display: flex; flex-direction: column; }
.theatre__story { grid-area: story; }
/* The last readout stretches, so both columns end on one line. */
.theatre__side > .panel:last-child { flex: 1 0 auto; }

/* The globe and the replay controls hold still at the top of the panel,
   whatever height the readout column gives it; any extra is left empty at the
   bottom. Never centre them: picking a territory (hovering one does) grows the
   readout, and a globe that moved with it would slide a different territory
   under the mouse, which would pick that one in turn. */
.globe-host {
    aspect-ratio: 620 / 500;   /* globe.js's viewBox */
    flex: none;
}

/* ── Globe / chart switch: a two-way toggle set into the map panel's top edge ── */
.mapview {
    position: absolute;
    top: 0;
    right: 1rem;
    transform: translateY(-50%);
    display: flex;
    border: 1px solid var(--line);
    background: var(--bg);
    z-index: 1;
}
.mapview__btn {
    padding: 0.32rem 0.75rem;
    border: 0;
    background: none;
    color: var(--green-dim);
    font: inherit;
    font-size: 0.62rem;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s;
}
.mapview__btn + .mapview__btn { border-left: 1px solid var(--line); }
.mapview__btn:hover, .mapview__btn:focus-visible { color: var(--amber); outline: none; }
.mapview__btn.is-on {
    background: color-mix(in srgb, var(--green) 14%, var(--bg));
    color: var(--green);
    text-shadow: var(--glow);
    cursor: default;
}

/* ── The planet as a chart (flatmap.js): every territory at once ── */
.flatmap-host { aspect-ratio: 624 / 316; }
.flatmap {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-select: none;
    animation: chart-in 0.45s ease-out;
}
.globe { animation: chart-in 0.45s ease-out; }
@keyframes chart-in {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: none; }
}
.flatmap .cell { cursor: pointer; }
/* Every territory in view at once: names smaller and tighter than on the globe (flatmap.js spaces the lines to match). */
.flatmap .cell__label { font-size: 7.4px; letter-spacing: 0.03em; stroke-width: 2px; }
.flatmap .cell__bonus { font-size: 8.4px; }
.flatmap__body { fill: var(--bg); stroke: none; }
.flatmap__grid path { fill: none; stroke: var(--green-faint); stroke-width: 0.6; stroke-dasharray: 2 4; }
.flatmap__grid .flatmap__equator, .flatmap__grid .flatmap__meridian { stroke: var(--green-dim); stroke-opacity: 0.5; stroke-dasharray: 5 4; }
.flatmap__rim { fill: none; stroke: var(--green-dim); stroke-width: 1.2; pointer-events: none; filter: drop-shadow(0 0 4px var(--green-dim)); }
.flatmap__labels { pointer-events: none; }
.flatmap .stalemate__title {
    fill: var(--amber); stroke: var(--bg); stroke-width: 5px;
    font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: 0.3em;
    text-shadow: 0 0 10px var(--amber);
}
.flatmap .stalemate__sides { stroke: var(--bg); stroke-width: 4px; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; }
.flatmap .stalemate__sep { fill: var(--green-dim); }
.flatmap .stalemate__plate { fill: var(--bg); fill-opacity: 0.82; stroke: var(--amber); stroke-opacity: 0.6; stroke-width: 1; }
.globe {
    display: block;
    width: 100%;
    height: auto;
    cursor: grab;
    /* Horizontal drags turn the world; vertical ones still scroll the page on a phone. */
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}
.globe.is-dragging { cursor: grabbing; }

.globe__body { fill: var(--bg); }
.globe__rim { fill: none; stroke: var(--green-dim); stroke-opacity: 0.6; stroke-width: 1; pointer-events: none; }
.globe__halo { fill: url(#globeHalo); pointer-events: none; }
.globe__shade { pointer-events: none; }
.halo-stop-in   { stop-color: var(--green); stop-opacity: 0.1; }
.halo-stop-out  { stop-color: var(--green); stop-opacity: 0; }
.limb-stop-clear { stop-color: var(--bg); stop-opacity: 0; }
.limb-stop-dark  { stop-color: var(--bg); stop-opacity: 0.85; }
.light-stop-in  { stop-color: var(--bone); stop-opacity: 0.07; }
.light-stop-out { stop-color: var(--bone); stop-opacity: 0; }

.orbit { fill: none; stroke: var(--bone); stroke-opacity: 0.18; stroke-width: 0.8; stroke-dasharray: 2 5; pointer-events: none; }

/* The auspex (globe.js scope): a ring of degree ticks round the planet, the
   feed's name, and the live coordinates under the crosshair. Instrument
   ink — thin, dim, never competing with the territories. */
.hud { pointer-events: none; }
.hud__ring { fill: none; stroke: var(--green-faint); stroke-width: 1; }
.hud__tick { fill: none; stroke: var(--green-dim); stroke-width: 1; stroke-opacity: 0.45; }
.hud__tick--major { stroke-opacity: 0.9; }
/* The viewport's corners: what the feed is, and where the crosshair is. */
.globe-host { position: relative; }
.hud__corner {
    position: absolute;
    top: 0;
    color: var(--green-dim);
    font-size: 0.56rem;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
}
.hud__corner--feed { left: 0; }
.hud__corner--feed::before { content: "● "; color: var(--red); animation: led-pulse 1.8s steps(2, jump-none) infinite; }
.hud__corner--live { right: 0; color: var(--green); font-variant-numeric: tabular-nums; }
.hud__cross { fill: none; stroke: var(--bone); stroke-opacity: 0.35; stroke-width: 1; pointer-events: none; }

/* Target lock round the picked territory: amber brackets, turning slowly. */
.lock { pointer-events: none; }
.lock__corner { fill: none; stroke: var(--amber); stroke-width: 1.6; stroke-linecap: square; filter: drop-shadow(0 0 3px var(--amber)); }
.lock__spin { transform-origin: 0 0; animation: lock-turn 7s linear infinite, lock-in 0.35s ease-out; }
@keyframes lock-turn { to { rotate: 90deg; } }
@keyframes lock-in { from { scale: 1.8; opacity: 0; } }

.cell { cursor: crosshair; }
/* The timeline: colour eases over when a tile changes hands. */
.cell, .cell__labelwrap { transition: color 0.7s ease; }
.cell--taken { animation: taken-flash 1.4s ease-out; }
@keyframes taken-flash {
    0%   { filter: brightness(2.6) drop-shadow(0 0 10px currentColor); }
    100% { filter: none; }
}
/* The winner's name, rising off the tile it just took. */
.cell__banner-text {
    fill: currentColor;
    stroke: var(--bg);
    stroke-width: 3px;
    paint-order: stroke;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-anchor: middle;
    text-shadow: 0 0 6px currentColor;
}
.cell__banner, .land__banner { animation: banner-rise 2.8s ease-out forwards; }

/* A draw: the verdict over the middle of the map, both sides' ground flickering. */
.stalemate { transform-box: fill-box; transform-origin: center; animation: stalemate-in 2.8s ease-out forwards; pointer-events: none; }
@keyframes stalemate-in {
    0%   { opacity: 0; scale: 0.85; }
    12%  { opacity: 1; scale: 1; }
    78%  { opacity: 1; scale: 1; }
    100% { opacity: 0; scale: 1.04; }
}
.stalemate__title, .stalemate__sides { text-anchor: middle; paint-order: stroke; stroke-linejoin: round; }
.globe .stalemate__title {
    fill: var(--amber); stroke: var(--bg); stroke-width: 5px;
    font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: 0.3em;
    text-shadow: 0 0 10px var(--amber);
}
.globe .stalemate__sides { stroke: var(--bg); stroke-width: 4px; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; }
.globe .stalemate__sep { fill: var(--green-dim); }
.globe .stalemate__plate { fill: var(--bg); fill-opacity: 0.82; stroke: var(--amber); stroke-opacity: 0.6; stroke-width: 1; }
.realm .stalemate__title { fill: var(--red); stroke: var(--bg-panel); stroke-width: 7px; font-family: var(--caps); font-size: 40px; }
.realm .stalemate__sides { stroke: var(--bg-panel); stroke-width: 6px; font-family: var(--caps); font-size: 19px; }
.realm .stalemate__sep { fill: var(--green-dim); }
.realm .stalemate__plate { fill: var(--bg-panel); fill-opacity: 0.94; stroke: var(--red); stroke-width: 1.5; filter: drop-shadow(0 2px 3px rgba(60, 35, 10, 0.35)); }
.cell--stalemate { animation: stalemate-flicker 1.5s ease-in-out; }
@keyframes stalemate-flicker {
    0%, 100% { filter: none; }
    25% { filter: brightness(1.9); }
    50% { filter: none; }
    72% { filter: brightness(1.5); }
}
.land--stalemate .land__fill { animation: land-stalemate 1.5s ease-in-out; }
@keyframes land-stalemate {
    0%, 50%, 100% { fill-opacity: 0.14; }
    25% { fill-opacity: 0.5; }
    72% { fill-opacity: 0.38; }
}
.cell__banner-text, .land__banner-text { transform-box: fill-box; }
@keyframes banner-rise {
    0%   { opacity: 0; translate: 0 8px; }
    12%  { opacity: 1; translate: 0 0; }
    75%  { opacity: 1; translate: 0 -4px; }
    100% { opacity: 0; translate: 0 -14px; }
}
.cell__fill { fill: currentColor; fill-opacity: 0.2; transition: fill-opacity 0.15s; }
.cell__rim { fill: none; stroke: currentColor; stroke-opacity: 0.6; stroke-width: 1; }
.cell__keep { fill: none; stroke: currentColor; stroke-opacity: 0.8; stroke-width: 1; stroke-dasharray: 3 2; pointer-events: none; }

.cell:hover .cell__fill, .cell.is-active .cell__fill { fill-opacity: 0.42; }
.cell:hover .cell__rim,  .cell.is-active .cell__rim  { stroke-opacity: 1; stroke-width: 1.4; }

/* The latest engagement: its border flickers amber until the next one. */
.cell--recent .cell__rim { stroke: var(--amber); stroke-opacity: 0.9; animation: recent-flicker 2.4s steps(1) infinite; }
@keyframes recent-flicker { 0%, 100% { stroke-opacity: 0.9; } 40% { stroke-opacity: 0.35; } 44% { stroke-opacity: 1; } }

/* No glow filter here — labels move every frame, and a filter per label per
   frame is what makes a phone stutter. A dark halo keeps them legible instead. */
.cell__label {
    fill: currentColor;
    stroke: var(--bg);
    stroke-width: 2.4px;
    stroke-opacity: 0.8;
    paint-order: stroke;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.06em;
    text-anchor: middle;
    text-transform: uppercase;
}
.globe__labels { pointer-events: none; }
/* Bonus star: amber whatever army holds it, so bonus ground reads across the whole globe. */
.cell__bonus { fill: var(--amber); font-size: 11px; }

/* Uncharted: dark red with flickering static. Hostile, not merely empty. */
.cell--uncharted { color: var(--red); }
.cell--uncharted .cell__fill { fill: color-mix(in srgb, var(--red) 8%, var(--bg)); fill-opacity: 0.92; }
.cell--uncharted .cell__rim { stroke-opacity: 0.35; }
.cell--uncharted .cell__keep { stroke-opacity: 0.4; }
.cell__static { fill: url(#hatch); pointer-events: none; }
.cell:not(.cell--uncharted) .cell__static { display: none; }
.cell__static, .cell__label--lost { animation: static-flicker 3.2s steps(1) infinite; }
.hatch-line { stroke: var(--red); stroke-width: 1; stroke-opacity: 0.35; }

@keyframes static-flicker {
    0%, 100% { opacity: 0.55; }
    7%  { opacity: 0.15; }
    9%  { opacity: 0.7; }
    52% { opacity: 0.35; }
    55% { opacity: 0.6; }
}

/* The Counting Moon: bone on a black void, sealed. The only body in no army's
   colour, so it reads as neutral at a glance. It pulses: it is the signal. */
.moon { cursor: crosshair; color: var(--bone); }
.moon__body { fill: var(--bg); stroke: var(--bone); stroke-width: 1.2; }
.moon:hover .moon__body, .moon.is-active .moon__body { fill: var(--bg-hover); stroke-width: 1.8; }
.moon__seal { fill: none; stroke: var(--bone); stroke-opacity: 0.4; stroke-width: 0.8; stroke-dasharray: 1 2.5; }
.moon__core { fill: var(--bone); filter: drop-shadow(0 0 3px currentColor); }
.moon__pulse {
    fill: none; stroke: var(--bone); stroke-opacity: 0.5;
    pointer-events: none;
    transform-origin: 0 0;
    animation: moon-pulse 3.4s ease-out infinite;
}
@keyframes moon-pulse {
    from { transform: scale(0.45); opacity: 0.8; }
    to   { transform: scale(1.5);  opacity: 0; }
}

/* Phone-only summary under the globe; the side panels are below the fold there. */
.globe-card { display: none; }
@media (max-width: 760px) {
    .globe-card {
        display: block;
        margin-top: 0.9rem;
        padding: 0.8rem 0.9rem;
        border: 1px solid var(--line);
        background: var(--bg);
        font-size: 0.78rem;
    }
}
.globe-card p { margin: 0; }
.globe-card__name { font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; text-shadow: var(--glow); }
.globe-card .readout__holder { margin-top: 0.35rem; }
.globe-card__meta { margin-top: 0.3rem !important; color: var(--green-dim); font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; }
.globe-card__desc { margin-top: 0.55rem !important; color: var(--bone); line-height: 1.6; }

/* ── Timeline: the campaign replayed under the map ─────────────────────── */
.timeline {
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--green-faint);
}
.timeline__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.2rem 1rem;
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.timeline__title { color: var(--green-dim); }
.timeline__pos { color: var(--green); text-shadow: var(--glow); font-variant-numeric: tabular-nums; }
.timeline--past .timeline__pos { color: var(--amber); }

.timeline__controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.7rem;
}
.timeline__step, .timeline__now {
    flex: none;
    min-width: 2.2rem;
    height: 2rem;
    padding: 0 0.6rem;
    border: 1px solid var(--line);
    background: var(--sheen), var(--bg);
    color: var(--green);
    font: inherit;
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.timeline__step:hover:not(:disabled), .timeline__now:hover:not(:disabled),
.timeline__step:focus-visible, .timeline__now:focus-visible {
    color: var(--amber);
    border-color: var(--amber);
    box-shadow: 0 0 12px -4px var(--amber);
    outline: none;
}
.timeline__step:active:not(:disabled), .timeline__now:active:not(:disabled) { translate: 0 1px; }
.timeline__step:disabled, .timeline__now:disabled { opacity: 0.3; cursor: default; }

/* The track: a tick for every game, and the stretch of the campaign already
   replayed lit in phosphor. Inset by half the thumb, so each tick sits under
   the thumb's centre at that step. */
.timeline__track {
    --thumb: 8px;
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}
.timeline__track::before {
    content: "";
    position: absolute;
    left: calc(var(--thumb) / 2);
    right: calc(var(--thumb) / 2);
    top: 50%;
    height: 11px;
    transform: translateY(-50%);
    background:
        linear-gradient(var(--green-faint), var(--green-faint)) center / 100% 2px no-repeat,
        linear-gradient(90deg, var(--green-dim) 0 1px, transparent 1px) 0 0 / calc((100% - 1px) / var(--steps)) 100% repeat-x;
    pointer-events: none;
}
.timeline__track::after {
    content: "";
    position: absolute;
    left: calc(var(--thumb) / 2);
    top: 50%;
    width: calc((100% - var(--thumb)) * var(--at) / var(--steps));
    height: 2px;
    transform: translateY(-50%);
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    pointer-events: none;
    transition: width 0.3s ease;
}
.timeline--past .timeline__track::after { background: var(--amber); box-shadow: 0 0 8px var(--amber); }

.timeline__range {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
    height: 28px;
    margin: 0;
    background: none;
    accent-color: var(--green);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.timeline__range::-webkit-slider-runnable-track { height: 2px; background: transparent; }
.timeline__range::-moz-range-track { height: 2px; background: transparent; }
.timeline__range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 8px; height: 20px; margin-top: -9px;
    border: 0; background: var(--green); box-shadow: 0 0 10px var(--green);
}
.timeline__range::-moz-range-thumb {
    width: 8px; height: 20px; border: 0; border-radius: 0;
    background: var(--green); box-shadow: 0 0 10px var(--green);
}
.timeline--past .timeline__range::-webkit-slider-thumb { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.timeline--past .timeline__range::-moz-range-thumb { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.timeline__range:focus-visible { outline: 1px solid var(--amber); outline-offset: 2px; }

.timeline__past {
    margin: 0.65rem 0 0;
    color: var(--amber);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    animation: led-pulse 2.6s ease-in-out infinite;
}
.timeline__log {
    display: inline-block;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--line);
    background: var(--sheen), var(--bg);
    color: var(--green);
    font-size: 0.64rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.timeline__log:hover, .timeline__log:focus-visible {
    color: var(--amber);
    border-color: var(--amber);
    box-shadow: 0 0 12px -4px var(--amber);
    outline: none;
}
.globe-card__bonus { margin-top: 0.5rem !important; color: var(--amber); line-height: 1.55; }

/* Replaying the past: the map and its story go amber, like archive footage,
   so nobody mistakes an old page for the war as it stands. */
.theatre:has(.timeline--past) :is(.theatre__map, .theatre__story) {
    border-color: color-mix(in srgb, var(--amber) 45%, transparent);
}
.theatre:has(.timeline--past) :is(.theatre__map, .theatre__story)::before { --corner: var(--amber); }
.theatre:has(.timeline--past) :is(.theatre__map, .theatre__story) > .panel__title {
    color: var(--amber);
    border-color: color-mix(in srgb, var(--amber) 45%, transparent);
}

/* ── The story: what the game on the timeline was ── */
.story__lead {
    margin: 0;
    max-width: 70ch;
    color: var(--green);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.6;
    text-wrap: pretty;
}
.story__body {
    margin: 0.9rem 0 0;
    padding-left: 0.95rem;
    border-left: 1px solid var(--line);
    color: var(--bone);
    opacity: 0.86;
    font-size: 0.84rem;
    line-height: 1.8;
    text-wrap: pretty;
}
/* Two columns when the panel runs the full width, as a dispatch would be set. */
@media (min-width: 900px) {
    .story__body { columns: 2; column-gap: 2.5rem; column-rule: 1px solid var(--green-faint); }
}
.story__foot { margin: 1.1rem 0 0; }

/* ── Territory register (the globe as a list) ── */
/* The toggle is a key, with its state on its face: + to open, − to close. */
.register summary {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    width: fit-content;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--line);
    background: var(--sheen), var(--bg);
    cursor: pointer;
    list-style: none;
    color: var(--green);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.register summary::-webkit-details-marker { display: none; }
.register summary::after { content: "+"; color: var(--green-dim); font-weight: 700; }
.register details[open] summary::after { content: "−"; }
.register summary:hover, .register summary:focus-visible {
    color: var(--amber);
    border-color: var(--amber);
    box-shadow: 0 0 12px -4px var(--amber);
}
.register__army {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    margin: 1.6rem 0 0.65rem;
    color: var(--bone);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
/* The army's colour as a swatch, not as the words: the words stay legible. */
.register__army::before {
    content: "";
    flex: none;
    width: 10px;
    height: 10px;
    border: 1px solid var(--army, var(--line));
    background: color-mix(in srgb, var(--army, transparent) 35%, transparent);
}
.register__army span { color: var(--green-dim); font-weight: 400; font-size: 0.6rem; letter-spacing: 0.16em; }
.register__army--lost { color: var(--red); }
.register__army--lost::before { border-color: var(--red); background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--red) 60%, transparent) 0 1px, transparent 1px 3px); }
.register__lost { margin: 0; color: var(--bone); opacity: 0.7; font-size: 0.75rem; line-height: 1.6; }
.register__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 0.45rem;
}
/* Each territory a small plate, edged in its holder's colour. */
.register__item {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0.5rem 0.7rem 0.5rem 0.85rem;
    border: 1px solid var(--green-faint);
    background: linear-gradient(var(--army, var(--line)), var(--army, var(--line))) left / 2px 100% no-repeat, var(--bg);
    color: var(--bone);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.register__item:hover, .register__item:focus-visible { border-color: var(--line); background-color: var(--bg-hover); outline: none; }
.register__item.is-active { border-color: var(--amber); background-color: var(--bg-hover); box-shadow: 0 0 14px -6px var(--amber); outline: none; }
.register__item.is-active .register__name { color: var(--green); }
/* Ground a commander has lost no longer wears their colour. */
.register__list--lost { --army: color-mix(in srgb, var(--red) 55%, transparent); }
.register__list--lost .register__name { opacity: 0.7; }
.register__name { display: block; font-size: 0.76rem; line-height: 1.45; }
.register__meta { display: block; margin-top: 0.2rem; color: var(--green-dim); font-size: 0.56rem; letter-spacing: 0.14em; text-transform: uppercase; }

/* ── The readout: whatever is picked on the map ── */
.readout { font-size: 0.78rem; }
.readout__name {
    margin: 0 0 0.3rem;
    color: var(--green);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    text-shadow: var(--glow);
    text-wrap: balance;
}
/* Nothing picked: the planet itself, named large. */
.readout__name--planet { font-size: 1.45rem; font-weight: 800; letter-spacing: 0.16em; text-shadow: var(--bloom); }
.readout__name--lost { color: var(--red); }
.readout__name--moon { color: var(--bone); }
/* Who holds it: the army's colour as a chip, its name in the terminal's ink. */
.readout__holder {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.25rem;
    color: var(--bone);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.readout__holder::before {
    content: "";
    flex: none;
    width: 10px;
    height: 10px;
    background: var(--army);
    box-shadow: 0 0 8px color-mix(in srgb, var(--army) 60%, transparent);
}
.readout__meta {
    margin: 0 0 0.85rem;
    color: var(--green-dim);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
}
.readout__desc { margin: 0 0 0.85rem; color: var(--bone); line-height: 1.65; opacity: 0.9; }
/* Standing facts about the ground, as chips. */
.readout__tag {
    display: flex;
    width: fit-content;
    margin: 0 0 0.6rem;
    padding: 0.28rem 0.55rem;
    border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
    background: color-mix(in srgb, currentColor 8%, transparent);
    color: var(--amber);
    font-size: 0.6rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.readout__tag--alert { color: var(--red); }
.readout__label {
    margin: 0.9rem 0 0.35rem;
    color: var(--green-dim);
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.readout__history { list-style: none; margin: 0; padding: 0; color: var(--bone); font-size: 0.7rem; line-height: 1.5; }
.readout__history li { padding: 0.35rem 0; border-bottom: 1px solid var(--green-faint); }
.readout__history li:last-child { border-bottom: 0; }
.readout__history b { color: var(--green); font-weight: 700; margin-right: 0.4rem; }

/* ── Claimants: the control bar and its legend ── */

/* Every army's share of the planet in one bar, lost ground as broken signal.
   A 2px gap of glass between shares; numbers only where they fit. The list
   under it names every share in full. */
.control {
    display: flex;
    gap: 2px;
    height: 16px;
    margin: 0.2rem 0 1rem;
}
.control__seg {
    flex: 1 1 0;
    min-width: 3px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--army);
    color: var(--ink, var(--bg));
    font-size: 0.56rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    cursor: default;
    transition: filter 0.15s;
}
.control__seg:hover { filter: brightness(1.25); }
.control__seg:first-child { border-radius: 2px 0 0 2px; }
.control__seg:last-child { border-radius: 0 2px 2px 0; }
.control__seg--lost {
    background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--red) 55%, transparent) 0 2px, color-mix(in srgb, var(--red) 12%, transparent) 2px 5px);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 55%, transparent);
    color: var(--red);
}

.claim-list { list-style: none; margin: 0; padding: 0; font-size: 0.72rem; }
.claim-list li {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    gap: 0.7rem;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--green-faint);
}
.claim-list li:last-child { border-bottom: 0; }
.claim-list__swatch {
    width: 10px; height: 10px;
    background: var(--army, currentColor);
    box-shadow: 0 0 7px color-mix(in srgb, var(--army, currentColor) 55%, transparent);
}
.claim-list__army { color: var(--bone); line-height: 1.35; }
.claim-list__commander {
    display: block;
    margin-top: 0.1rem;
    color: var(--green-dim);
    font-size: 0.56rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.claim-list__count { color: var(--green); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.06em; }
.claim-list__lost { color: var(--red); }
.claim-list__moon { color: var(--bone); }
.claim-list__moon .claim-list__swatch { background: var(--bg); border: 1px solid var(--bone); border-radius: 50%; box-shadow: none; }
.claim-list__moon .claim-list__count { color: var(--green-dim); font-weight: 500; font-size: 0.6rem; letter-spacing: 0.16em; }
.claim-list__lost .claim-list__swatch {
    background: repeating-linear-gradient(45deg, var(--red) 0 1px, transparent 1px 3px);
    box-shadow: inset 0 0 0 1px var(--red);
}
.claim-list__lost .claim-list__army, .claim-list__lost .claim-list__count { color: var(--red); }

/* One column on a phone: the map, then its story, then the readouts. */
@media (max-width: 760px) {
    .theatre { grid-template-columns: minmax(0, 1fr); grid-template-areas: "map" "story" "side"; }
    .theatre__map { padding-inline: 0.5rem; }
    .theatre__map .timeline, .theatre__map .globe-card { margin-inline: 0.4rem; }
}

/* ── Rules of engagement: numbered cards ── */
.rules {
    list-style: none;
    counter-reset: rule;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    color: var(--bone);
    font-size: 0.78rem;
    line-height: 1.65;
}
.rules li {
    counter-increment: rule;
    position: relative;
    padding: 0.8rem 1rem 0.85rem 3.3rem;
    border: 1px solid var(--green-faint);
    background: var(--bg);
}
.rules li::before {
    content: counter(rule, decimal-leading-zero);
    position: absolute;
    left: 0.95rem;
    top: 0.72rem;
    color: var(--green-dim);
    font-size: 1.05rem;
    font-weight: 300;
    line-height: 1.3;
}
.rules b { display: block; margin-bottom: 0.15rem; color: var(--green); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.72rem; }

/* ── Legend ──────────────────────────────────────────────────────────────── */

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.4rem;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--green-faint);
    color: var(--green-dim);
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.legend > span { display: inline-flex; align-items: baseline; gap: 0.6rem; }
.legend > span::before { content: "//"; opacity: 0.55; }

/* ── Boot screen (shown while the WASM runtime downloads) ────────────────── */

/* Full-screen cover. Sits above the page but below the CRT overlays, so the
   scanlines and vignette play over the boot sequence too. */
.boot-overlay {
    position: fixed;
    inset: 0;
    z-index: 8800;
    background: var(--bg);
    overflow-y: auto;
    transition: opacity 0.55s ease;

    /* A tap anywhere skips it — signal that it's interactive. */
    cursor: pointer;
}

.boot-overlay.is-done {
    opacity: 0;
    pointer-events: none;
}

.boot {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    padding: 5rem 16px;
    color: var(--green);
}

.boot__mark {
    margin: 0 0 2rem;
    color: var(--green-dim);
    font-size: 0.7rem;
    line-height: 1.3;
    letter-spacing: 0.1em;
}

/* Self-test lines: label on the left, verdict on the right, dotted leader
   between them. They print in sequence rather than appearing at once. */
.boot__line {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin: 0 0 0.45rem;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--green-dim);

    /* Each line arrives ~110ms after the last; see nth-child below. */
    animation: reveal 0.2s ease-out both;
}

/* The dotted leader — a flexible rule that fills whatever space is left. */
.boot__line span {
    flex: 0 1 auto;
}

.boot__line::after {
    content: "";
    flex: 1 1 auto;
    height: 0;
    margin-bottom: 0.25em;
    border-bottom: 1px dotted var(--green-faint);
    order: 1;
}

.boot__line b {
    order: 2;
    color: var(--green);
    font-weight: 400;
    white-space: nowrap;
}

.boot__line b.is-warn { color: var(--amber); }

/* Each check takes a visible moment: the label prints, then the verdict lands
   ~0.35s later, so it reads as the cogitator actually testing something rather
   than a list fading in. Full sequence runs about 3.5 seconds.

   NOTE: the boot screen is replaced the instant the WASM runtime finishes
   downloading, so on a warm cache this gets cut short. That's correct — a cold
   boot should take longer than a warm one. */
.boot__line:nth-child(2) { animation-delay: 0.30s; }
.boot__line:nth-child(3) { animation-delay: 0.92s; }
.boot__line:nth-child(4) { animation-delay: 1.54s; }
.boot__line:nth-child(5) { animation-delay: 2.16s; }
.boot__line:nth-child(6) { animation-delay: 2.78s; }
.boot__line:nth-child(7) { animation-delay: 3.40s; }
.boot__line:nth-child(8) { animation-delay: 4.02s; }

/* The verdict resolves ~0.4s after its label, so each check visibly takes a
   moment rather than arriving complete. */
.boot__line b { animation: reveal 0.18s ease-out both; }

.boot__line:nth-child(2) b { animation-delay: 0.70s; }
.boot__line:nth-child(3) b { animation-delay: 1.32s; }
.boot__line:nth-child(4) b { animation-delay: 1.94s; }
.boot__line:nth-child(5) b { animation-delay: 2.56s; }
.boot__line:nth-child(6) b { animation-delay: 3.18s; }
.boot__line:nth-child(7) b { animation-delay: 3.80s; }
.boot__line:nth-child(8) b { animation-delay: 4.42s; }

/* The mark and the closing lines bracket the sequence. */
.boot__mark { animation: reveal 0.3s ease-out both; }
.boot__bar  { animation: reveal 0.3s ease-out 4.6s both; }
.boot__rite { animation: reveal 0.3s ease-out 4.8s both; }
.boot__warn { animation: reveal 0.3s ease-out 5.0s both; }

.boot__warn {
    margin-top: 0.75rem;
    /* Dimmed in the colour, not with opacity: the reveal animation ends on
       opacity 1 and would otherwise light it at full strength. */
    color: color-mix(in srgb, var(--red) 60%, transparent);
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* The held state. Every check has resolved; this is what the screen sits on
   while the runtime finishes downloading, however long that takes. It pulses
   indefinitely rather than running to an end, so there's no dead frame. */
.boot__enter {
    margin-top: 1.5rem;
    color: var(--amber);
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-shadow: var(--glow);
    /* Appears once every check has resolved, then pulses until the overlay is
       dismissed — the sequence never runs out before the app arrives. */
    animation:
        reveal 0.3s ease-out 5.2s both,
        boot-pulse 1.6s ease-in-out 5.5s infinite;
}

@keyframes boot-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}

/* Appears early — the people who want it are the ones who aren't watching the
   rest. Deliberately quiet so it doesn't undercut the sequence. */
.boot__skip {
    margin-top: 2rem;
    color: var(--green-dim);
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    animation: reveal 0.4s ease-out 1.5s both;
}

.boot__bar {
    margin-top: 1.5rem;
    height: 3px;
    background: var(--green-faint);
    overflow: hidden;
}

.boot__bar span {
    display: block;
    width: 35%;
    height: 100%;
    background: var(--green);
    box-shadow: var(--glow);
    animation: boot-sweep 1.4s ease-in-out infinite;
}

@keyframes boot-sweep {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(385%); }
}

/* ── The Cogitator's rite (index.html .boot.only-cogitator) ── */

/* Power-on: a bright point snaps out into a scan-line, which blooms open and
   fades as the rite begins to print — a tube warming up. */
.boot-overlay::before {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    top: calc(40% - 40px);
    height: 80px;
    z-index: 2;
    /* A hot line through the middle, falling off softly either side, so the
       bloom opens as light rather than as a slab. */
    background: linear-gradient(to bottom,
        transparent,
        color-mix(in srgb, var(--green) 18%, transparent) 38%,
        color-mix(in srgb, var(--green) 75%, white) 49% 51%,
        color-mix(in srgb, var(--green) 18%, transparent) 62%,
        transparent);
    pointer-events: none;
    opacity: 0;
    animation: tube-on 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.05s both;
}
@keyframes tube-on {
    0%   { opacity: 1; transform: scale(0.02, 0.05); }
    30%  { opacity: 1; transform: scale(1, 0.05); }
    65%  { opacity: 0.4; transform: scale(1, 2.2); }
    100% { opacity: 0; transform: scale(1, 4.5); }
}

/* The crest and the unit's name, in place of a nameplate. */
.boot__brand {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    margin: 0 0 2.2rem;
    animation: reveal 0.3s ease-out 0.25s both;
}
.boot__brand .crest {
    flex: none;
    width: 58px;
    height: 58px;
    --crest-stroke: 1.6;
    filter: drop-shadow(0 0 1px currentColor) drop-shadow(0 0 9px color-mix(in srgb, currentColor 45%, transparent));
    animation: crest-in 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both;
}
.boot__id { display: flex; flex-direction: column; gap: 0.35rem; margin: 0; }
.boot__org { color: var(--green); font-size: 0.86rem; font-weight: 700; letter-spacing: 0.42em; text-transform: uppercase; text-shadow: var(--glow); }
.boot__unit { color: var(--green-dim); font-size: 0.62rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; }

/* Each verdict lands with a flicker, as though the check had to settle. */
.only-cogitator .boot__line b { animation-name: verdict-in; animation-duration: 0.32s; }
@keyframes verdict-in {
    0%   { opacity: 0; }
    30%  { opacity: 1; }
    45%  { opacity: 0.25; }
    65%  { opacity: 1; }
    100% { opacity: 1; }
}

/* The bar fills cell by cell while the checks run, then holds, breathing,
   until the archive is ready. */
.only-cogitator .boot__bar {
    height: 8px;
    animation: reveal 0.3s ease-out 0.3s both;
    background: repeating-linear-gradient(90deg, var(--green-faint) 0 calc(100% / 24 - 2px), transparent calc(100% / 24 - 2px) calc(100% / 24));
}
.only-cogitator .boot__bar span {
    width: 100%;
    background: repeating-linear-gradient(90deg, var(--green) 0 calc(100% / 24 - 2px), transparent calc(100% / 24 - 2px) calc(100% / 24));
    box-shadow: none;
    filter: drop-shadow(0 0 4px var(--green));
    clip-path: inset(0 100% 0 0);
    animation:
        boot-fill 4.2s steps(24, end) 0.3s forwards,
        boot-pulse 1.6s ease-in-out 4.6s infinite;
}
@keyframes boot-fill { to { clip-path: inset(0 0 0 0); } }

.boot__rite {
    margin-top: 2rem;
    color: var(--green-dim);
    font-size: 0.64rem;
    letter-spacing: 0.2em;
}

/* ── Blazor error bar ────────────────────────────────────────────────────── */

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9500;
    padding: 0.8rem 1.2rem;
    background: color-mix(in srgb, var(--red) 8%, var(--bg));
    border-top: 1px solid var(--red);
    color: var(--red);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
}

#blazor-error-ui a, #blazor-error-ui .dismiss {
    color: var(--red);
    cursor: pointer;
    margin-left: 1rem;
    text-decoration: none;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

/* The status column is the first thing to go when space runs short — the
   record itself matters more than the commentary on it. */
@media (max-width: 700px) {
    .col-status { display: none; }
}

@media (max-width: 520px) {
    /* Remaining columns fit a phone unaided; let the table use full width. */
    .standings { min-width: 0; }
    .term { padding-block: 1.5rem 2.5rem; }

    /* Every result stays on screen: tighter cells, a faction line that wraps. */
    .standings thead th, .standings td { padding-inline: 0.3rem; }
    .standings thead th:first-child, .standings tbody td:first-child { padding-left: 0.75rem; }
    .standings td { padding-block: 0.75rem; }
    .standings td.num { width: 1.9rem; font-size: 0.86rem; }
    .rank { font-size: 0.88rem; }
    .commander { font-size: 0.82rem; letter-spacing: 0.08em; }
    .faction { font-size: 0.56rem; letter-spacing: 0.06em; line-height: 1.5; }

    .prompt { --track: 0.07em; font-size: 0.66rem; }
    .panel { padding-inline: 0.9rem; }

    /* The strip wraps here, so no separators left dangling at line ends. */
    .term__strip > span { border-right: 0; padding-right: 0; margin-right: 1.4rem; }
    /* Under the field, the submit key takes the full width. */
    .gate__submit { flex: 1 1 100%; }
    .term__brand { gap: 0.85rem; }
    .term__brand .crest { width: 54px; height: 54px; }
    .term__stamp { font-size: 0.56rem; letter-spacing: 0.2em; }
    .term__sub { font-size: 0.64rem; letter-spacing: 0.14em; }
}

/* ── Motion / contrast preferences ───────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .crt-scanlines { animation: none; }
    .crt-scanlines::after { display: none; }
    .cursor        { animation: none; }
    .boot__bar span { animation: none; width: 100%; }
    .only-cogitator .boot__bar span { clip-path: none; }
    .boot__brand, .crest { animation: none !important; }
    .boot-overlay::before { display: none; }

    /* Lamps hold steady; the lock doesn't turn; a refused code doesn't shake. */
    .feed__label::before, .term__strip::before, .tag::before, .hud__corner--feed::before,
    .timeline__past, .lock__spin, .gate--denied .gate__field { animation: none; }

    /* Perpetual scrolling in peripheral vision is the exact thing this
       preference exists to stop. Removed outright, not just paused. */
    .feed { display: none; }

    /* Everything arrives at once, fully formed. No typing, no fade-in. */
    .term__title {
        animation: none;
        width: auto;
        white-space: normal;
        overflow: visible;
    }

    .term__sub,
    .term__strip,
    .nav,
    .boot__mark,
    .boot__line,
    .boot__line b,
    .boot__bar,
    .boot__rite,
    .boot__warn,
    .boot__enter,
    .boot__skip,
    .term__body .prompt,
    .term__body .panel { animation: none; }

    /* The globe holds still unless dragged (globe.js checks this too). */
    .moon__pulse { display: none; }
    .cell__static, .cell__label--lost, .cell--recent .cell__rim { animation: none; }

    * { transition: none !important; }
}

@media (prefers-contrast: more) {
    .crt-scanlines, .crt-vignette { display: none; }
    body::before { background: none; }
    .faction, .d { opacity: 1; }
}

/* ── The realm (a flat map: js/realm.js) ─────────────────────────────────── */

/* The Theatre of War for campaigns on a realm-N.json map. Drawn once, never
   re-projected, so filters and blend modes are affordable here in a way
   they aren't on the spinning globe. Army tints arrive as each land's
   `color`; everything else is a token, so the realm follows the theme. */

.realm-host { overflow-x: auto; }
.realm {
    display: block;
    width: 100%;
    /* Below this a land's name stops being legible, so a phone scrolls the
       map sideways instead of shrinking it further. */
    min-width: 640px;
    height: auto;
    user-select: none;
    -webkit-user-select: none;
}

.realm__sheet  { fill: var(--bg-panel); }
.realm__stain  { opacity: 0.55; pointer-events: none; }
.realm__sea    { fill: var(--sea); fill-opacity: 0.55; }
.realm__shore  { fill: none; stroke: var(--green); stroke-width: 2.2; stroke-opacity: 0.95; stroke-linecap: round; stroke-linejoin: round; }
.realm__ripple { fill: none; stroke: var(--sea-ink); stroke-width: 1; stroke-opacity: 0.55; stroke-linecap: round; }
.realm__hatch  { stroke: var(--green-dim); stroke-width: 1; stroke-opacity: 0.4; }

.realm__lines, .realm__inland, .realm__labels, .realm__region,
.realm__cartouche, .realm__compass, .realm__glyph, .realm__neatline, .realm__ship { pointer-events: none; }

.land { cursor: pointer; outline: none; }
.land, .land__labelwrap { transition: color 0.8s ease; }
.land--taken .land__fill { animation: land-taken 1.4s ease-out; }
@keyframes land-taken {
    0%   { fill-opacity: 0.6; }
    100% { fill-opacity: 0.14; }
}
.land__banner-text {
    fill: currentColor;
    stroke: var(--bg-panel);
    stroke-width: 5px;
    stroke-linejoin: round;
    paint-order: stroke;
    font-family: var(--caps);
    font-size: 19px;
    text-anchor: middle;
}
.land__fill { fill: currentColor; fill-opacity: 0.14; mix-blend-mode: multiply; transition: fill-opacity 0.15s; }
.land__band { fill: none; stroke: currentColor; stroke-width: 12; stroke-opacity: 0.42; mix-blend-mode: multiply; }
.land__rim  { fill: none; stroke: none; }
.land__hatch { fill: url(#realm-hatch); pointer-events: none; }
.land:not(.land--uncharted) .land__hatch { display: none; }

.land:hover .land__fill, .land.is-active .land__fill { fill-opacity: 0.32; }
.land:hover .land__rim, .land.is-active .land__rim { stroke: var(--amber); stroke-width: 3; }

/* The latest battle: its border marches, in the colour of highlights. */
.land--recent .land__rim { stroke: var(--red); stroke-width: 2.4; stroke-dasharray: 7 5; animation: realm-march 1.6s linear infinite; }
@keyframes realm-march { to { stroke-dashoffset: -24; } }

/* Unmapped: the army hasn't shown its banner, so its lands are hatched
   parchment in plain ink — no colour until it declares. */
.land--uncharted { color: var(--green-dim); }
.land--uncharted .land__band { stroke-opacity: 0.12; }
.land--uncharted .land__fill { fill-opacity: 0.05; }

.realm__border { fill: none; stroke: var(--green); stroke-opacity: 0.6; stroke-width: 1.1; stroke-dasharray: 7 3 1.5 3; stroke-linejoin: round; }
.realm__edge   { fill: none; stroke: var(--green); stroke-width: 1.3; stroke-opacity: 0.75; stroke-linejoin: round; }
.realm__edge--coast { stroke-width: 2.2; stroke-opacity: 0.95; }
.realm__river-bank { fill: none; stroke: var(--bg-panel); stroke-width: 6.5; stroke-linecap: round; stroke-linejoin: round; }
.realm__river { fill: none; stroke: var(--sea-ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

.realm__peak  { fill: var(--bg-panel); stroke: var(--green); stroke-width: 1.1; stroke-linejoin: round; }
.realm__peak-shade { fill: url(#realm-shade); stroke: none; }
.realm__shade-line { stroke: var(--green); stroke-width: 0.75; stroke-opacity: 0.6; }
.realm__shade { fill: none; stroke: var(--green); stroke-width: 0.7; stroke-opacity: 0.6; }
.realm__tuft  { fill: none; stroke: var(--green-dim); stroke-width: 0.9; stroke-linecap: round; }
.realm__trunk { stroke: var(--green); stroke-width: 1; }
.realm__crown { fill: var(--forest); fill-opacity: 0.5; stroke: var(--green); stroke-width: 0.9; stroke-linejoin: round; }
.realm__hill  { fill: none; stroke: var(--green); stroke-width: 1.1; stroke-linecap: round; }

.land__label {
    fill: var(--green);
    stroke: var(--bg-panel);
    stroke-width: 4px;
    stroke-opacity: 0.85;
    stroke-linejoin: round;
    paint-order: stroke;
    font-family: var(--caps);
    font-size: 15.5px;
    text-anchor: middle;
}
.land__labelwrap--lost .land__label { fill: var(--green-dim); font-style: italic; }
.land__keep { fill: currentColor; fill-opacity: 0.85; stroke: var(--green); stroke-width: 1; stroke-linejoin: round; }
.land__boon {
    fill: var(--amber);
    stroke: var(--bg-panel);
    stroke-width: 3px;
    paint-order: stroke;
    font-size: 17px;
    text-anchor: middle;
}

.realm__region {
    fill: var(--green-dim);
    /* A halo of paper, so the name reads over the mountains it's written across. */
    stroke: var(--bg-panel);
    stroke-width: 5px;
    stroke-linejoin: round;
    paint-order: stroke;
    font-family: var(--caps);
    font-size: 17px;
    letter-spacing: 0.32em;
    text-anchor: middle;
    dominant-baseline: middle;
}
.realm__region--coast { fill: var(--sea-ink); font-style: italic; font-size: 19px; }

.realm__cartouche-frame { fill: var(--bg-panel); stroke: var(--green); stroke-width: 1.4; stroke-linejoin: round; }
.realm__cartouche-inner { fill: none; stroke: var(--green); stroke-width: 0.6; }
.realm__ribbon-tail { fill: var(--bg-hover); stroke: var(--green); stroke-width: 1.2; stroke-linejoin: round; }
.realm__ribbon-fold { fill: var(--green-dim); fill-opacity: 0.6; stroke: var(--green); stroke-width: 1; stroke-linejoin: round; }
.realm__title { fill: var(--red); font-family: var(--display); font-size: 26px; text-anchor: middle; }

.realm__compass-ring  { fill: none; stroke: var(--green); stroke-width: 0.9; stroke-opacity: 0.8; }
.realm__compass-ring--fine { stroke-width: 0.5; }
.realm__compass-tick  { stroke: var(--green); stroke-width: 0.6; stroke-opacity: 0.8; }
.realm__compass-point { fill: var(--bg-panel); stroke: var(--green); stroke-width: 0.6; stroke-linejoin: round; }
.realm__compass-dark  { fill: var(--green); stroke: var(--green); stroke-width: 0.6; stroke-linejoin: round; }
.realm__compass-north { fill: var(--red); stroke: var(--green); stroke-width: 0.6; stroke-linejoin: round; }
.realm__compass-north-lit { fill: color-mix(in srgb, var(--red) 45%, var(--bg-panel)); stroke: var(--green); stroke-width: 0.6; stroke-linejoin: round; }
.realm__compass-hub   { fill: var(--bg-panel); stroke: var(--green); stroke-width: 0.8; }
.realm__compass-n     { fill: var(--red); font-family: var(--caps); font-size: 15px; text-anchor: middle; }

/* The neatline: an engraved border round the sheet. */
.realm__margin { fill: var(--bg-panel); }
.realm__frame { fill: none; stroke: var(--green); stroke-width: 0.8; }
.realm__frame--outer { stroke-width: 1.8; }
.realm__frame--inner { stroke-width: 0.6; }
.realm__frame-band { fill: var(--green); fill-opacity: 0.85; }

.realm__ship-hull { fill: var(--green-dim); stroke: var(--green); stroke-width: 0.9; stroke-linejoin: round; }
.realm__ship-mast { fill: none; stroke: var(--green); stroke-width: 1; }
.realm__ship-sail { fill: var(--bg-panel); stroke: var(--green); stroke-width: 0.8; stroke-linejoin: round; }
.realm__ship-flag { fill: var(--red); }

/* A flat map wants the whole width; the readout and the claimants sit
   side by side underneath it instead of in a column beside it — right under
   the map, since the readout answers clicks on it — and the story after them. */
@media (min-width: 761px) {
    .theatre--flat { grid-template-columns: minmax(0, 1fr); grid-template-areas: "map" "side" "story"; }
}
.theatre--flat .theatre__side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 1.25rem; }
@media (prefers-reduced-motion: reduce) {
    .cell, .cell__labelwrap, .land, .land__labelwrap { transition: none; }
    .flatmap, .globe,
    .cell--taken, .land--taken .land__fill, .cell__banner, .land__banner,
    .stalemate, .cell--stalemate, .land--stalemate .land__fill { animation: none; }
    .land--recent .land__rim { animation: none; }
}

/* Parts of index.html that exist once per theme: the boot screen, the error
   bar. Each theme shows its own. */
.only-oldworld { display: none; }


/* Heraldry: each army's arms, in its colour. Only the Old World hangs them up. */
.herald { display: none; }


/* ══════════════════════════════════════════════════════════════════════════
   THE OLD WORLD — a ledger open on a desk
   A campaign with "theme": "oldworld" in its campaign.json. Everything above
   still applies; this block re-colours it through the same tokens, swaps the
   type, and takes away what only a terminal would do (glow, scanlines,
   blinking cursors, shouting).

   The page is a folio of parchment lying on a dark leather desk by
   candlelight, with a silk ribbon to keep the place. Rumours and sayings are
   paper scrolls on the desk either side. Each army carries its arms, a shield
   in its colour.

   Colour lives in the tokens here and nowhere else, exactly as in the
   Cogitator's :root. The ornaments (flourishes, panel corners, shields, the
   crown) are SVG *masks* painted with a token, so they follow it too.
   ══════════════════════════════════════════════════════════════════════════ */

:root[data-theme="oldworld"] {
    --bg:          #ece0c1;   /* parchment                                  */
    --bg-panel:    #f4ebd3;   /* vellum: panels and the map sheet           */
    --bg-hover:    #e6d5ae;   /* row hover                                  */
    --green:       #2a1c10;   /* iron-gall ink — the primary "text" colour  */
    --green-dim:   #6a4f33;   /* faded ink: labels, secondary text          */
    --green-faint: #c9b287;   /* RULES AND BORDERS ONLY — too pale for text */
    --amber:       #8a5a08;   /* gilt: rank one, highlights                 */
    --red:         #962a17;   /* rubric vermilion: losses, alerts, titles   */
    --bone:        #3a2917;   /* long-form prose                            */

    --sea:         #a9bcb4;
    --sea-ink:     #3f6461;
    --forest:      #6f7c3d;

    /* The desk the ledger lies on, and the candle that lights it. */
    --desk:        #1f150e;
    --desk-edge:   #0a0604;
    --candle:      #6b4521;
    /* Gold leaf, for the leader and the illuminated details. */
    --gilt-hi:     #e7c873;
    --gilt:        #b98a2e;
    --gilt-lo:     #74500f;
    /* Sealing wax and the silk of the ribbon. */
    --wax-hi:      #d25a3c;
    --wax:         #9c2a17;
    --wax-lo:      #551208;
    /* The scroll rollers. */
    --wood-hi:     #94673d;
    --wood:        #5a3a1f;
    --wood-lo:     #24160b;

    --mono:    'EB Garamond', Garamond, 'Palatino Linotype', Georgia, serif;
    --caps:    'IM Fell English SC', 'EB Garamond', Georgia, serif;
    --display: 'UnifrakturMaguntia', 'IM Fell English SC', Georgia, serif;

    /* A valid shadow that draws nothing, so rules that list var(--glow)
       alongside another shadow stay valid. */
    --glow: 0 0 0 transparent;

    /* None of the terminal's light: no bloom, no module lifting off glass,
       no sheen along a top edge. Frames are ruled in the same pale ink. */
    --line:  var(--green-faint);
    --wash:  color-mix(in srgb, var(--green-faint) 28%, transparent);
    --bloom: 0 0 0 transparent;
    --lift:  0 1px 0 color-mix(in srgb, var(--gilt-lo) 8%, transparent);
    --sheen: none;

    /* The parchment's grain, laid over every sheet of it. */
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .22 0 0 0 0 .1 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
    --sheet:
        var(--grain),
        radial-gradient(ellipse 80% 50% at 22% 0%, color-mix(in srgb, white 45%, transparent), transparent 70%),
        radial-gradient(ellipse 70% 60% at 100% 100%, color-mix(in srgb, var(--gilt-lo) 14%, transparent), transparent 70%),
        var(--bg);

    /* Ornaments, painted through as masks. */
    --flourish: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 26'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.3' stroke-linecap='round'%3E%3Cpath d='M113 13C105 13 102 6 96 6.5C91.5 7 91.5 12.5 95.5 12.5C98 12.5 98.5 9.5 96.5 9'/%3E%3Cpath d='M147 13C155 13 158 6 164 6.5C168.5 7 168.5 12.5 164.5 12.5C162 12.5 161.5 9.5 163.5 9'/%3E%3Cpath d='M113 13C105 13 102 20 96 19.5C91.5 19 91.5 13.5 95.5 13.5C98 13.5 98.5 16.5 96.5 17'/%3E%3Cpath d='M147 13C155 13 158 20 164 19.5C168.5 19 168.5 13.5 164.5 13.5C162 13.5 161.5 16.5 163.5 17'/%3E%3Cpath d='M130 2.5L139.5 13L130 23.5L120.5 13Z'/%3E%3C/g%3E%3Cpath d='M130 8L134.5 13L130 18L125.5 13Z'/%3E%3Cpath d='M2 13L86 11.8L86 14.2Z M258 13L174 11.8L174 14.2Z'/%3E%3Ccircle cx='88' cy='13' r='1.8'/%3E%3Ccircle cx='172' cy='13' r='1.8'/%3E%3C/svg%3E");
    --corners: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cg transform='rotate%280 15 15%29'%3E%3Cg fill='none' stroke='%23000' stroke-linecap='round'%3E%3Cpath d='M3 29V3H29' stroke-width='1.3'/%3E%3Cpath d='M7 22V7H22' stroke-width='.7'/%3E%3Cpath d='M7 13C11 13 13 11 13 7' stroke-width='.9'/%3E%3C/g%3E%3Cpath d='M3 0L6 3L3 6L0 3Z'/%3E%3Ccircle cx='29' cy='3' r='1.2'/%3E%3Ccircle cx='3' cy='29' r='1.2'/%3E%3C/g%3E%3C/svg%3E") top left / 30px 30px no-repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cg transform='rotate%2890 15 15%29'%3E%3Cg fill='none' stroke='%23000' stroke-linecap='round'%3E%3Cpath d='M3 29V3H29' stroke-width='1.3'/%3E%3Cpath d='M7 22V7H22' stroke-width='.7'/%3E%3Cpath d='M7 13C11 13 13 11 13 7' stroke-width='.9'/%3E%3C/g%3E%3Cpath d='M3 0L6 3L3 6L0 3Z'/%3E%3Ccircle cx='29' cy='3' r='1.2'/%3E%3Ccircle cx='3' cy='29' r='1.2'/%3E%3C/g%3E%3C/svg%3E") top right / 30px 30px no-repeat,
               url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cg transform='rotate%28270 15 15%29'%3E%3Cg fill='none' stroke='%23000' stroke-linecap='round'%3E%3Cpath d='M3 29V3H29' stroke-width='1.3'/%3E%3Cpath d='M7 22V7H22' stroke-width='.7'/%3E%3Cpath d='M7 13C11 13 13 11 13 7' stroke-width='.9'/%3E%3C/g%3E%3Cpath d='M3 0L6 3L3 6L0 3Z'/%3E%3Ccircle cx='29' cy='3' r='1.2'/%3E%3Ccircle cx='3' cy='29' r='1.2'/%3E%3C/g%3E%3C/svg%3E") bottom left / 30px 30px no-repeat, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cg transform='rotate%28180 15 15%29'%3E%3Cg fill='none' stroke='%23000' stroke-linecap='round'%3E%3Cpath d='M3 29V3H29' stroke-width='1.3'/%3E%3Cpath d='M7 22V7H22' stroke-width='.7'/%3E%3Cpath d='M7 13C11 13 13 11 13 7' stroke-width='.9'/%3E%3C/g%3E%3Cpath d='M3 0L6 3L3 6L0 3Z'/%3E%3Ccircle cx='29' cy='3' r='1.2'/%3E%3Ccircle cx='3' cy='29' r='1.2'/%3E%3C/g%3E%3C/svg%3E") bottom right / 30px 30px no-repeat;
    --shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 48' preserveAspectRatio='none'%3E%3Cpath d='M1 1H39V19C39 33 30 42 20 47C10 42 1 33 1 19Z'/%3E%3C/svg%3E");
    --crown: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 14'%3E%3Cpath d='M2.5 13L1.5 4.5L7 8.5L12 2L17 8.5L22.5 4.5L21.5 13Z'/%3E%3Ccircle cx='1.5' cy='3.2' r='1.4'/%3E%3Ccircle cx='12' cy='1.4' r='1.4'/%3E%3Ccircle cx='22.5' cy='3.2' r='1.4'/%3E%3C/svg%3E");

    color-scheme: light;
    /* Everything is sized in rem for a 14px monospace; a serif needs more. */
    font-size: 18px;

    /* No terminal in a ledger: nothing glows, nothing shouts, nothing is
       letter-spaced like a readout. :where() keeps this at the specificity
       of the root selector, so any rule below can say otherwise. */
    & :where(body *) { text-shadow: none; text-transform: none; letter-spacing: normal; }

    & body {
        font-size: 17px;
        line-height: 1.55;
        color: var(--green);
        background-color: var(--desk);
        /* Candlelight pooling on dark leather, falling away to the edges. */
        background-image:
            radial-gradient(ellipse 70% 55% at 30% 18%, color-mix(in srgb, var(--candle) 55%, transparent), transparent 70%),
            radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, var(--desk-edge) 100%);
        background-attachment: fixed;
        font-variant-numeric: oldstyle-nums proportional-nums;
        scrollbar-color: var(--wood) var(--desk);
    }

    /* The leather's grain instead of the phosphor wash. */
    & body::before {
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='l'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23l)'/%3E%3C/svg%3E");
        opacity: 0.8;
    }

    & .crt-scanlines { display: none; }
    & .crt-vignette { display: none; }
    & .cursor { display: none; }
    & .only-oldworld { display: revert; }
    & .only-cogitator { display: none; }

    & ::selection { background: color-mix(in srgb, var(--gilt) 40%, transparent); color: var(--green); }

    /* ── The folio ─────────────────────────────────────────────────────── */

    & .term {
        /* Room for the scrolls (the feeds) either side; see the media
           queries at the end of this block. */
        margin-block: clamp(10px, 3vw, 44px) clamp(24px, 5vw, 64px);
        padding: clamp(1.5rem, 4vw, 2.6rem) clamp(18px, 5vw, 56px) 2.25rem;
        background: var(--sheet);
        border-radius: 2px;
        /* The page, then the pages under it, then its shadow on the desk. */
        box-shadow:
            inset 0 0 0 1px color-mix(in srgb, var(--gilt-lo) 18%, transparent),
            inset 0 0 70px color-mix(in srgb, var(--gilt-lo) 20%, transparent),
            0 1px 0 var(--bg-hover),
            0 3px 0 -1px var(--green-faint),
            0 5px 0 -2px var(--bg-hover),
            0 7px 0 -3px var(--green-faint),
            0 22px 50px -10px color-mix(in srgb, black 80%, transparent),
            0 10px 18px color-mix(in srgb, black 40%, transparent);
    }

    /* A silk ribbon, keeping the place in the ledger. */
    & .term::before {
        content: "";
        position: absolute;
        top: -10px;
        right: clamp(22px, 7vw, 64px);
        width: clamp(18px, 3vw, 24px);
        height: clamp(84px, 13vw, 118px);
        background:
            linear-gradient(90deg, color-mix(in srgb, black 25%, transparent), transparent 30%, color-mix(in srgb, white 18%, transparent) 50%, transparent 70%, color-mix(in srgb, black 30%, transparent)),
            linear-gradient(var(--wax-lo), var(--wax) 18%, var(--wax));
        clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 12px), 0 100%);
        filter: drop-shadow(0 2px 2px color-mix(in srgb, black 35%, transparent));
        pointer-events: none;
        z-index: 2;
    }

    /* ── Header: the title page ───────────────────────────────────────── */

    /* No crest on parchment: the ledger's title stands alone, centred. */
    & .term__brand { display: block; }
    & .crest, & .term__sign { display: none; }

    & .term__head {
        position: relative;
        text-align: center;
        border-bottom: 0;
        padding-bottom: 2.4rem;
    }
    /* An engraved flourish to close the title page. */
    & .term__head::after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: 0;
        width: min(300px, 70%);
        height: 26px;
        translate: -50% 0;
        background: var(--green-dim);
        mask: var(--flourish) center / contain no-repeat;
        -webkit-mask: var(--flourish) center / contain no-repeat;
        opacity: 0.75;
    }
    & .term__stamp {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.9rem;
        font-family: var(--caps);
        font-size: 0.82rem;
        color: var(--green-dim);
    }
    & .term__stamp::before, & .term__stamp::after {
        content: "";
        flex: 0 1 4.5rem;
        height: 1px;
        background: linear-gradient(to var(--to, right), transparent, var(--green-faint));
    }
    & .term__stamp::after { --to: left; }
    & .term__title {
        margin: 0.55rem 0 0.15rem;
        font-family: var(--display);
        font-weight: 400;
        font-size: clamp(2.2rem, 8.5vw, 3.7rem);
        line-height: 1.08;
        color: var(--green);
        /* Ink, not lit phosphor. */
        background: none;
        -webkit-text-fill-color: currentColor;
        filter: none;
        animation: reveal 0.5s ease-out both;
        width: auto;
        white-space: normal;
        overflow: visible;
    }
    /* The initial in vermilion, as a rubricator would letter it. */
    & .term__title::first-letter { color: var(--red); }
    /* Blazor focuses the heading after each navigation (App.razor); on
       parchment the browser's focus ring reads as a box drawn round the title. */
    & .term__title:focus { outline: none; }
    & .term__sub { margin-top: 0.35rem; font-style: italic; font-size: 1.05rem; color: var(--bone); opacity: 0.85; }

    & .nav { justify-content: center; align-items: center; gap: 0.35rem 0; margin: 1.15rem 0 0; }
    & .nav a {
        position: relative;
        display: inline-block;
        padding: 0.15rem 0.95rem 0.3rem;
        background: none;
        font-family: var(--caps);
        font-size: 1.04rem;
        color: var(--green-dim);
        transition: color 0.15s;
    }
    /* No numbers on the tabs; a small lozenge between them instead. */
    & .nav a::before { content: none; }
    & .nav a + a::before {
        content: "";
        opacity: 1;
        position: absolute;
        left: -2.5px;
        top: 50%;
        width: 5px;
        height: 5px;
        background: var(--green-faint);
        transform: translateY(-50%) rotate(45deg);
    }
    /* The page you're on is underlined in red, swelling in the middle like a pen stroke. */
    & .nav a::after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: 0;
        right: auto;
        top: auto;
        width: 0;
        height: 2px;
        border-radius: 50%;
        background: var(--red);
        box-shadow: none;
        transform: none;
        translate: -50% 0;
        transition: width 0.25s ease;
    }
    & .nav a:hover { color: var(--green); }
    & .nav a:hover::after { width: 30%; opacity: 0.5; transform: none; }
    & .nav a.active { color: var(--red); background: none; }
    & .nav a.active::after { width: 70%; opacity: 1; }
    /* A phone keeps the words, wrapped and centred, rather than the Cogitator's keypad. */
    @media (max-width: 560px) {
        & .nav { display: flex; border: 0; background: none; }
        & .nav a, & .nav a:first-child, & .nav a.active { padding: 0.15rem 0.75rem 0.3rem; background: none; font-size: 1rem; }
        & .nav a::after, & .nav a:first-child::after { top: auto; bottom: 0; left: 50%; width: 0; height: 2px; transform: none; }
        & .nav a.active::after { width: 70%; }
    }

    & .term__body { margin-top: 2.1rem; }

    /* ── Prompts: the scribe's rubrics, centred under the title ── */
    & .prompt { padding-left: 0; text-indent: 0; text-align: center; margin-bottom: 0.15rem; font-size: 0.95rem; font-style: italic; color: var(--green-dim); }
    & .prompt b { color: var(--green); font-weight: 600; font-style: normal; }
    & .term__body .panel { animation: reveal 0.4s ease-out 0.12s both; }

    /* ── Panels: a ruled frame with engraved corners, title between rules ── */
    & .panel {
        margin-top: 1.9rem;
        padding: 1.35rem clamp(1rem, 3vw, 1.75rem) 1.4rem;
        background: color-mix(in srgb, var(--bg-panel) 72%, transparent);
        border: 1px solid var(--green-faint);
        box-shadow:
            inset 0 0 0 4px color-mix(in srgb, var(--bg-panel) 72%, transparent),
            inset 0 0 0 5px color-mix(in srgb, var(--green-faint) 55%, transparent),
            0 1px 2px color-mix(in srgb, var(--gilt-lo) 14%, transparent);
    }
    /* The four corners, in one layer: four masks, one ink. */
    & .panel::before {
        top: -1px; right: -1px; bottom: -1px; left: -1px;
        width: auto; height: auto;
        border: 0;
        background: var(--green-dim);
        mask: var(--corners);
        -webkit-mask: var(--corners);
        opacity: 0.8;
    }
    & .panel::after { display: none; }
    & .panel__title {
        position: static;
        transform: none;
        display: flex;
        align-items: center;
        gap: 0.9rem;
        max-width: none;
        margin: 0 0 1.1rem;
        padding: 0;
        border: 0;
        background: none;
        white-space: normal;
        overflow: visible;
        font-family: var(--caps);
        font-weight: 400;
        font-size: 1.28rem;
        line-height: 1.2;
        text-align: center;
        color: var(--red);
    }
    & .panel__title::before, & .panel__title::after {
        content: "";
        flex: 1 1 0;
        min-width: 1.5rem;
        width: auto;
        height: 1px;
        box-shadow: none;
        background: linear-gradient(to var(--to, left), var(--green-faint), transparent);
    }
    & .panel__title::after { --to: right; }
    & .notice { font-family: var(--caps); font-size: 0.95rem; }
    & .panel--alert { border-color: color-mix(in srgb, var(--red) 50%, transparent); }
    & .panel--alert::before { background: var(--red); }
    & .fault, & .faults li, & #blazor-error-ui { background: color-mix(in srgb, var(--red) 7%, transparent); }
    & .fault, & .faults li { font-size: 0.9rem; }
    & .empty { font-style: italic; font-size: 1rem; text-align: center; }
    & .hint, & .gate__hint { font-size: 0.85rem; }
    & code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8em; color: var(--red); }

    /* ── Heraldry ── */
    & .herald {
        display: block;
        width: 22px;
        height: 26px;
        /* The ink edge of the shield... */
        background: var(--green);
        mask: var(--shield) center / contain no-repeat;
        -webkit-mask: var(--shield) center / contain no-repeat;
        position: relative;
    }
    /* ...and the field inside it, in the army's colour, catching the light. */
    & .herald::after {
        content: "";
        position: absolute;
        inset: 1.5px;
        background:
            radial-gradient(ellipse 80% 60% at 32% 18%, color-mix(in srgb, white 38%, transparent), transparent 60%),
            linear-gradient(to bottom, transparent 55%, color-mix(in srgb, black 22%, transparent)),
            var(--army, var(--green-faint));
        mask: var(--shield) center / contain no-repeat;
        -webkit-mask: var(--shield) center / contain no-repeat;
    }
    /* No colour declared: a blank shield, hatched, until they show their arms. */
    & .herald--unknown::after {
        background:
            repeating-linear-gradient(45deg, var(--green-faint) 0 1px, transparent 1px 4px),
            var(--bg-panel);
    }
    & .herald--large { position: absolute; top: 0; right: 0; width: 50px; height: 60px; }
    & .herald--large::after { inset: 2px; }
    /* A gilt edge for the big ones. */
    & .herald--large:not(.herald--unknown) { background: linear-gradient(160deg, var(--gilt-hi), var(--gilt) 45%, var(--gilt-lo)); }

    /* ── Access: break the seal ── */
    & .gate { margin: 0 auto; text-align: center; }
    & .gate::before {
        content: "M";
        display: grid;
        place-items: center;
        width: 76px;
        height: 76px;
        margin: 0.2rem auto 1.2rem;
        border-radius: 47% 53% 50% 48% / 52% 46% 54% 48%;
        background: radial-gradient(circle at 36% 30%, var(--wax-hi), var(--wax) 50%, var(--wax-lo) 100%);
        box-shadow:
            0 3px 6px color-mix(in srgb, black 40%, transparent),
            inset 0 0 0 7px color-mix(in srgb, black 10%, transparent),
            inset 0 0 0 8px color-mix(in srgb, white 12%, transparent),
            inset 0 -3px 6px color-mix(in srgb, black 30%, transparent);
        color: color-mix(in srgb, var(--wax-lo) 85%, transparent);
        font-family: var(--display);
        font-size: 2.1rem;
        line-height: 1;
        text-shadow: 0 1px 0 color-mix(in srgb, var(--wax-hi) 55%, transparent);
        rotate: -6deg;
    }
    & .gate__label { font-family: var(--caps); font-size: 1rem; color: var(--green-dim); }
    & .gate__row { justify-content: center; }
    & .gate__field::before { display: none; }
    & .gate__input {
        padding: 0.6rem 0.8rem;
        background: var(--bg);
        border: 0;
        border-bottom: 1px solid var(--green-dim);
        font-size: 1.15rem;
        letter-spacing: 0.12em;
        text-align: center;
        transition: border-color 0.15s;
    }
    & .gate__input:focus { border-color: var(--red); box-shadow: 0 1px 0 var(--red); }
    & .gate__submit {
        padding: 0.55rem 1.3rem;
        font-family: var(--caps);
        font-size: 1.02rem;
        color: var(--bg-panel);
        background: linear-gradient(var(--wax-hi), var(--wax) 40%, var(--wax-lo));
        border: 1px solid var(--wax-lo);
        border-radius: 3px;
        box-shadow: 0 2px 4px color-mix(in srgb, black 25%, transparent), inset 0 1px 0 color-mix(in srgb, white 25%, transparent);
    }
    & .gate__submit:hover, & .gate__submit:focus-visible { color: var(--bg-panel); background: linear-gradient(var(--wax-hi), var(--wax) 40%, var(--wax-lo)); border-color: var(--wax-lo); box-shadow: 0 2px 4px color-mix(in srgb, black 25%, transparent); filter: brightness(1.1); }
    & .gate__denied { font-style: italic; font-size: 0.95rem; }

    /* ── Roll of warlords ── */
    & .standings thead th { font-family: var(--caps); font-size: 0.9rem; color: var(--green-dim); border-bottom-color: var(--green-faint); }
    & .standings td { padding-block: 0.75rem; border-bottom: 1px dotted var(--green-faint); }
    & .standings td.num { font-variant-numeric: lining-nums tabular-nums; font-size: 1.05rem; }
    & .standings td.is-zero { color: color-mix(in srgb, var(--bone) 30%, transparent); }
    & .standings td.who { position: relative; padding-left: 2.85rem; }
    /* The shield carries the army's colour, so the row needs no coloured edge. */
    & .standings tbody td:first-child { box-shadow: none; }
    & .standings tbody tr.is-undeclared td:first-child { background: none; }
    & .standings .herald { position: absolute; left: 0.6rem; top: 50%; translate: 0 -50%; width: 25px; height: 30px; }
    & .rank { font-family: var(--caps); font-size: 1.05rem; font-weight: 400; color: var(--green-dim); text-align: center; min-width: 2.4rem; }
    & .commander { font-weight: 600; font-size: 1.12rem; }
    & .faction { font-style: italic; font-size: 0.86rem; opacity: 0.8; }
    & .d { opacity: 0.85; }

    /* The leader: gold leaf on the name and the numeral, and a crown above it. */
    & .standings tbody tr.is-first { background: linear-gradient(90deg, color-mix(in srgb, var(--gilt-hi) 24%, transparent), transparent 70%); }
    & .is-first .rank { position: relative; padding-top: 1rem; }
    & .is-first .rank::before {
        content: "";
        position: absolute;
        left: 50%;
        top: 0.5rem;
        width: 20px;
        height: 12px;
        translate: -50% 0;
        background: linear-gradient(var(--gilt-hi), var(--gilt) 55%, var(--gilt-lo));
        mask: var(--crown) center / contain no-repeat;
        -webkit-mask: var(--crown) center / contain no-repeat;
    }
    & .is-first .rank { color: var(--amber); font-weight: 400; }
    & .is-first .commander {
        color: var(--gilt-lo);
        background: linear-gradient(170deg, var(--gilt) 10%, var(--gilt-lo) 55%, var(--gilt) 90%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    /* Fortune, written small in its colour rather than boxed like a form. */
    & .tag {
        margin-left: 0;
        padding: 0.1rem 0.6rem 0.15rem;
        border: 0;
        border-radius: 999px;
        background: color-mix(in srgb, currentColor 10%, transparent);
        box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent);
        font-family: var(--caps);
        font-size: 0.82rem;
        line-height: 1.4;
        opacity: 1;
    }
    & .tag::before { content: none; }
    & .tag--ascendant { color: var(--amber); background: color-mix(in srgb, var(--gilt-hi) 30%, transparent); }
    & .tag--victory   { color: var(--green); }
    & .tag--stalemate { color: var(--green-dim); }
    & .tag--defeat    { color: var(--red); }
    & .tag--penance   { color: var(--red); background: color-mix(in srgb, var(--red) 16%, transparent); }
    & .tag--none      { color: var(--green-dim); background: none; box-shadow: none; font-style: italic; font-family: var(--mono); }
    & .legend { justify-content: center; gap: 0.3rem 1.6rem; margin-top: 1.25rem; border-top: 1px dotted var(--green-faint); font-style: italic; font-size: 0.82rem; }
    & .legend > span::before { content: none; }

    /* ── Chronicle of battles ── */
    & .engagement { padding: 1.3rem 0 1.1rem; border-bottom: 0; }
    /* A dinkus between battles, as between a book's sections. */
    & .engagement + .engagement { border-top: 0; }
    & .engagement + .engagement::before {
        content: "⁂";
        display: block;
        margin: -0.6rem 0 0.9rem;
        text-align: center;
        font-size: 1.1rem;
        color: var(--green-faint);
    }
    & .engagement__head { font-family: var(--caps); font-size: 0.85rem; gap: 0.2rem 0.8rem; }
    & .engagement__id { padding: 0; background: none; color: var(--red); font-weight: 400; }
    & .engagement__combatants { margin-top: 0.6rem; gap: 0.5rem 0.9rem; }
    & .combatant {
        border-color: var(--green-faint);
        background: linear-gradient(var(--army, var(--line)), var(--army, var(--line))) left / 3px 100% no-repeat, color-mix(in srgb, var(--bg-panel) 80%, transparent);
        box-shadow: none;
        opacity: 1;
    }
    & .combatant__name { font-family: var(--caps); font-weight: 400; font-size: 1.35rem; line-height: 1.2; }
    & .combatant__army { color: var(--green-dim); opacity: 1; font-style: italic; font-size: 0.9rem; }
    & .combatant.is-victor { border-color: color-mix(in srgb, var(--gilt) 55%, transparent); box-shadow: none; }
    & .combatant.is-victor .combatant__name { color: var(--amber); }
    & .combatant.is-victor .combatant__name::before { content: none; }
    & .combatant.is-defeated .combatant__name { color: var(--green-dim); opacity: 1; }
    & .combatant.is-drawn .combatant__name { color: var(--bone); opacity: 1; }
    & .engagement__vs { font-style: italic; font-size: 0.95rem; }
    & .engagement__verdict, & .engagement__territory { font-size: 0.98rem; }
    & .engagement__verdict b { color: var(--amber); font-weight: 600; }
    & .engagement__territory b { font-weight: 600; color: var(--green); }
    & .engagement__maplink { color: var(--red); font-style: italic; }
    & .engagement__maplink:hover, & .engagement__maplink:focus-visible { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
    & .engagement__playlabel { margin-top: 0.9rem; font-family: var(--caps); font-size: 0.88rem; color: var(--green-dim); }
    /* The players' own words, hung off a big rubricated quote mark. */
    & .engagement__notes {
        position: relative;
        padding: 0 0 0 1.6rem;
        border-left: 0;
        font-size: 1.06rem;
        opacity: 0.85;
    }
    & .engagement__notes::first-letter { color: transparent; }
    & .engagement__notes::before {
        content: "\201C";
        position: absolute;
        left: 0;
        top: -0.35rem;
        font-family: var(--caps);
        font-size: 2.4rem;
        line-height: 1;
        font-style: normal;
        color: var(--red);
        opacity: 0.8;
    }

    /* Book prose: justified, hyphenated, opening on a drop capital. */
    & .engagement__chronicle, & .dossier__lore, & .brief__body {
        text-align: justify;
        hyphens: auto;
        -webkit-hyphens: auto;
    }
    & .engagement__chronicle {
        max-width: none;
        padding-left: 0;
        border-left: 0;
        font-size: 1.04rem;
        line-height: 1.65;
        opacity: 1;
    }
    & .engagement__chronicle::first-letter,
    & .dossier__lore:not(.dossier__lore--missing)::first-letter,
    & .brief__heading + .brief__body::first-letter {
        float: left;
        margin: 0.07em 0.08em 0 0;
        padding: 0;
        font-family: var(--display);
        font-size: 3.15em;
        line-height: 0.82;
        color: var(--red);
    }

    /* ── Generals ── */
    /* The rank stamp is the terminal's; the ledger hangs the army's arms instead. */
    & .dossier__stamp { display: none; }
    & .dossier__head { min-height: 60px; margin-bottom: 1.3rem; padding: 0 4.2rem 0 0; background: none; }
    & .dossier--undeclared .dossier__head { background: none; }
    & .dossier__name { font-family: var(--caps); font-weight: 400; font-size: clamp(1.6rem, 5vw, 2.15rem); line-height: 1.15; }
    & .dossier__namelink:hover, & .dossier__namelink:focus-visible { color: var(--red); }
    & .dossier__faction { margin-top: 0.3rem; font-style: italic; font-size: 1rem; opacity: 0.85; }
    & .dossier__specs { gap: 0.45rem 1.5rem; }
    & .dossier__specs dt { padding-top: 0.12rem; font-family: var(--caps); font-size: 0.88rem; color: var(--green-dim); }
    & .dossier__specs dd { font-size: 1rem; }
    & .dossier__specs .tag { margin-top: -0.1rem; }
    & .dossier__file { border-left-color: var(--green-faint); }
    & .dossier__specs dd.dossier__bonuses { color: var(--amber); }
    /* The record as four ruled cells, in the ledger's figures. */
    & .dossier__foot { margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--green-faint); }
    & .dossier__record { border-color: var(--green-faint); background: var(--green-faint); }
    & .dossier__stat { background: var(--bg-panel); text-align: center; }
    & .dossier__stat dt { font-family: var(--caps); font-size: 0.8rem; color: var(--green-dim); }
    & .dossier__stat dd { font-size: 1.55rem; font-weight: 500; font-variant-numeric: lining-nums; color: var(--green); }
    & .dossier__stat--won dd { color: var(--green); }
    & .dossier__stat--drawn dd { color: var(--green-dim); }
    & .dossier__stat--lost dd { color: var(--red); }
    & .dossier__stat.is-zero dd { color: color-mix(in srgb, var(--bone) 28%, transparent); }
    & .dossier__lorelabel { margin-top: 0.2rem; font-family: var(--caps); font-size: 0.9rem; color: var(--green-dim); }
    & .dossier__lore { max-width: none; font-size: 1.05rem; line-height: 1.65; opacity: 1; }
    & .dossier__lore--missing { color: var(--amber); font-style: italic; text-align: left; }
    & .dossier__maplink { border-bottom-style: dotted; }
    & .dossier__maplink:hover, & .dossier__maplink:focus-visible { color: var(--red); border-bottom-color: var(--red); }
    & .dossier__open, & .profile__back { font-family: var(--caps); font-size: 0.95rem; }
    & .dossier__open { text-align: right; }
    & .dossier__open a, & .key { padding: 0; border: 0; background: none; box-shadow: none; }
    & .key { font-family: var(--caps); font-size: 0.95rem; color: var(--red); }
    & .key:hover, & .key:focus-visible { color: var(--red); border: 0; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }
    & .dossier__open a::after { content: " \2192"; font-family: var(--mono); }
    & .dossier__open a, & .profile__crumb, & .profile__back a { color: var(--red); }
    & .dossier__open a:hover, & .profile__crumb:hover, & .profile__back a:hover,
    & .dossier__open a:focus-visible, & .profile__crumb:focus-visible, & .profile__back a:focus-visible { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
    & .profile__back { text-align: center; }
    & .profile__rule { font-size: 0.92rem; font-style: italic; }
    & .profile__result { font-size: 1rem; }
    & .profile__verdict { padding: 0; border: 0; background: none; font-family: var(--caps); font-size: 1.15rem; font-weight: 400; }
    & .profile__verdict::before { content: none; }
    & .profile__verdict.is-victor { color: var(--amber); }
    & .profile__verdict.is-defeated { color: var(--red); }
    & .bonus-list li { border-color: color-mix(in srgb, var(--gilt) 40%, transparent); background: linear-gradient(to bottom, color-mix(in srgb, var(--gilt-hi) 14%, transparent), transparent 75%), var(--bg-panel); }
    & .bonus-list__where::before { content: none; }
    & .bonus-list__name { font-family: var(--caps); font-size: 1.05rem; color: var(--amber); }
    & .bonus-list__effect { font-size: 1rem; }
    & .bonus-list__where { font-style: italic; font-size: 0.88rem; }
    & .bonus-list__where:hover { color: var(--red); }

    /* ── Lay of the land ── */
    & .brief__designation { text-align: center; font-family: var(--caps); font-size: 0.92rem; }
    & .brief__epigraph {
        position: relative;
        margin: 0.4rem auto 2.2rem;
        padding: 0 1.5rem;
        border-left: 0;
        max-width: 34em;
        text-align: center;
        font-size: 1.25rem;
        line-height: 1.5;
        color: var(--red);
        opacity: 1;
    }
    & .brief__heading { display: block; margin-top: 2.2rem; font-family: var(--caps); font-weight: 400; font-size: 1.22rem; color: var(--red); }
    & .brief__heading::before, & .brief__heading::after { content: none; }
    & .brief__body { max-width: none; font-size: 1.06rem; line-height: 1.68; opacity: 1; }
    & .brief__closing {
        position: relative;
        display: block;
        opacity: 1;
        max-width: 34em;
        margin: 2.4rem auto 0;
        padding-top: 2.4rem;
        text-align: center;
        font-size: 1.08rem;
        color: var(--red);
    }
    & .brief__closing::before {
        content: "";
        position: absolute;
        left: 50%;
        top: 0;
        width: 220px;
        height: 22px;
        translate: -50% 0;
        background: var(--green-dim);
        mask: var(--flourish) center / contain no-repeat;
        -webkit-mask: var(--flourish) center / contain no-repeat;
        opacity: 0.6;
    }
    & .claimant {
        position: relative;
        padding: 1.15rem 1.15rem 0.8rem 3.9rem;
        border: 1px solid var(--green-faint);
        background: color-mix(in srgb, var(--bg-panel) 70%, transparent);
    }
    & .claimant .herald { position: absolute; left: 1rem; top: 1.2rem; width: 36px; height: 43px; }
    & .claimant--unknown { padding-left: 1.15rem; background: color-mix(in srgb, var(--bg-panel) 70%, transparent); }
    & .claimant__name { font-family: var(--caps); font-weight: 400; font-size: 1.35rem; }
    & .claimant__meta { font-style: italic; font-size: 0.92rem; opacity: 0.8; }
    & .claimant__objective { padding: 0; border: 0; background: none; font-size: 0.98rem; font-style: italic; color: var(--amber); }
    & .claimant .brief__body { font-size: 1rem; }

    /* ── Map of the realm ── */
    & .realm-host { border: 1px solid var(--green-faint); box-shadow: 0 1px 3px color-mix(in srgb, var(--gilt-lo) 25%, transparent); }
    & .mapview { background: var(--bg-panel); top: 1.55rem; right: 1.5rem; transform: none; }
    & .mapview__btn { font-family: var(--caps); font-size: 0.9rem; }
    & .mapview__btn.is-on { color: var(--red); }
    & .readout { font-size: 0.98rem; }
    & .readout__name { font-family: var(--caps); font-weight: 400; font-size: 1.4rem; line-height: 1.2; }
    & .readout__name--planet { font-size: 1.6rem; }
    & .readout__name--lost { color: var(--green-dim); font-style: italic; }
    & .readout__holder { font-family: var(--caps); font-size: 1rem; color: var(--green); }
    & .readout__holder::before {
        width: 14px;
        height: 17px;
        box-shadow: none;
        background: radial-gradient(ellipse 80% 60% at 32% 18%, color-mix(in srgb, white 38%, transparent), transparent 60%), var(--army);
        mask: var(--shield) center / contain no-repeat;
        -webkit-mask: var(--shield) center / contain no-repeat;
    }
    & .readout__meta { font-style: italic; font-size: 0.92rem; }
    & .readout__label { font-family: var(--caps); font-size: 0.9rem; }
    & .readout__tag { padding: 0; border: 0; background: none; font-family: var(--caps); font-size: 0.95rem; }
    & .readout__history, & .claim-list { font-size: 0.95rem; }
    & .readout__history li, & .claim-list li { border-bottom-style: dotted; }
    & .readout__history b { font-family: var(--caps); color: var(--red); }

    /* The claimants' swatches become their shields. */
    & .claim-list li { grid-template-columns: 18px 1fr auto; padding: 0.45rem 0; }
    & .claim-list__swatch {
        width: 18px;
        height: 21px;
        border: 0;
        background:
            radial-gradient(ellipse 80% 60% at 32% 18%, color-mix(in srgb, white 38%, transparent), transparent 60%),
            var(--army, currentColor);
        box-shadow: none;
        mask: var(--shield) center / contain no-repeat;
        -webkit-mask: var(--shield) center / contain no-repeat;
    }
    & .claim-list__army { font-weight: 600; font-size: 1.02rem; color: var(--green); }
    & .claim-list__commander { font-family: var(--caps); font-size: 0.8rem; font-weight: 400; }
    & .control__seg { font-family: var(--caps); font-weight: 400; font-size: 0.75rem; }
    & .control__seg--lost { background: repeating-linear-gradient(45deg, var(--green-faint) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--green-faint); color: var(--green-dim); }
    & .claim-list__army:hover, & .claim-list__army:focus-visible { color: var(--red); }
    & .claim-list__count { color: var(--green-dim); font-weight: 400; font-style: italic; font-variant-numeric: lining-nums; }
    & .claim-list__lost, & .claim-list__lost .claim-list__army, & .claim-list__lost .claim-list__count { color: var(--green-dim); }
    & .claim-list__lost .claim-list__swatch { background: repeating-linear-gradient(45deg, var(--green-dim) 0 1px, transparent 1px 4px); }
    & .claim-list__moon .claim-list__swatch { border-radius: 50%; mask: none; -webkit-mask: none; box-shadow: inset 0 0 0 1px currentColor; background: var(--bg); }

    /* ── Timeline: turning the ledger's pages ── */
    & .timeline { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--green-faint); }
    & .timeline__head { font-family: var(--caps); font-size: 0.98rem; align-items: baseline; }
    & .timeline__title { color: var(--red); }
    & .timeline__pos { font-family: var(--mono); font-style: italic; color: var(--green-dim); }
    & .timeline--past .timeline__pos { color: var(--red); }
    & .timeline__controls { gap: 0.7rem; margin-top: 0.7rem; }
    /* Round buttons, like the bosses on a book's binding. */
    & .timeline__step {
        display: grid;
        place-items: center;
        min-width: 0;
        width: 34px;
        height: 34px;
        padding: 0;
        border: 1px solid var(--green-faint);
        border-radius: 50%;
        background: radial-gradient(circle at 35% 30%, var(--bg-panel), var(--bg-hover));
        box-shadow: 0 1px 2px color-mix(in srgb, var(--gilt-lo) 30%, transparent);
        color: var(--green-dim);
        font-size: 0.7rem;
        line-height: 1;
    }
    & .timeline__now {
        height: auto;
        padding: 0.3rem 0.9rem;
        border: 1px solid var(--green-faint);
        border-radius: 999px;
        background: none;
        font-family: var(--caps);
        font-size: 0.92rem;
        color: var(--green-dim);
    }
    & .timeline__step:hover:not(:disabled), & .timeline__now:hover:not(:disabled),
    & .timeline__step:focus-visible, & .timeline__now:focus-visible { color: var(--red); border-color: var(--red); }
    & .timeline__step:disabled, & .timeline__now:disabled { opacity: 0.4; }
    /* The rail and a tick per battle come from the track behind the slider;
       the pages already turned are inked in red. */
    & .timeline__track { --thumb: 20px; }
    & .timeline__track::before {
        background:
            linear-gradient(var(--green-faint), var(--green-faint)) center / 100% 2px no-repeat,
            linear-gradient(90deg, var(--green-dim) 0 1px, transparent 1px) 0 0 / calc((100% - 1px) / var(--steps)) 100% repeat-x;
    }
    & .timeline__track::after { background: var(--red); box-shadow: none; }
    & .timeline--past .timeline__track::after { background: var(--amber); box-shadow: none; }
    /* A little wax seal for a thumb. */
    & .timeline__range::-webkit-slider-thumb {
        width: 20px; height: 20px; margin-top: -9px;
        border-radius: 47% 53% 50% 48% / 52% 46% 54% 48%;
        background: radial-gradient(circle at 36% 30%, var(--wax-hi), var(--wax) 55%, var(--wax-lo));
        box-shadow: 0 1px 3px color-mix(in srgb, black 40%, transparent), inset 0 0 0 3px color-mix(in srgb, black 12%, transparent);
    }
    & .timeline__range::-moz-range-thumb {
        width: 20px; height: 20px; border: 0;
        border-radius: 47% 53% 50% 48% / 52% 46% 54% 48%;
        background: radial-gradient(circle at 36% 30%, var(--wax-hi), var(--wax) 55%, var(--wax-lo));
        box-shadow: 0 1px 3px color-mix(in srgb, black 40%, transparent), inset 0 0 0 3px color-mix(in srgb, black 12%, transparent);
    }
    & .timeline--past .timeline__range::-webkit-slider-thumb { background: radial-gradient(circle at 36% 30%, var(--wax-hi), var(--wax) 55%, var(--wax-lo)); }
    & .timeline--past .timeline__range::-moz-range-thumb { background: radial-gradient(circle at 36% 30%, var(--wax-hi), var(--wax) 55%, var(--wax-lo)); }
    & .timeline__past { font-family: var(--caps); font-size: 0.88rem; color: var(--red); animation: none; }
    & .timeline__log { padding: 0; border: 0; background: none; box-shadow: none; font-family: var(--caps); font-size: 0.95rem; color: var(--red); }
    /* The story of the page on the timeline: a rubric, then the chronicle in italic. */
    & .story__lead { max-width: none; font-family: var(--caps); font-size: 1.15rem; font-weight: 400; line-height: 1.4; color: var(--green); }
    & .story__body {
        padding-left: 0;
        border-left: 0;
        font-style: italic;
        font-size: 1.02rem;
        line-height: 1.65;
        opacity: 1;
        text-align: justify;
        hyphens: auto;
        -webkit-hyphens: auto;
        column-rule-color: var(--green-faint);
    }
    & .timeline__log::after { content: " \2192"; font-family: var(--mono); }
    & .timeline__log:hover, & .timeline__log:focus-visible { color: var(--red); border: 0; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }

    & .globe-card { border-top-style: dotted; }
    & .globe-card__name { font-family: var(--caps); font-size: 1.15rem; }
    & .globe-card__meta { font-style: italic; font-size: 0.85rem; }
    & .register summary { margin: 0 auto; padding: 0; border: 0; background: none; box-shadow: none; color: var(--green-dim); font-family: var(--caps); font-size: 1rem; }
    & .register summary:hover, & .register summary:focus-visible { color: var(--red); border: 0; box-shadow: none; }
    & .register__army { font-family: var(--caps); font-weight: 400; font-size: 1.12rem; color: var(--green); }
    & .register__army::before {
        width: 14px;
        height: 17px;
        border: 0;
        background: radial-gradient(ellipse 80% 60% at 32% 18%, color-mix(in srgb, white 38%, transparent), transparent 60%), var(--army, var(--green-faint));
        mask: var(--shield) center / contain no-repeat;
        -webkit-mask: var(--shield) center / contain no-repeat;
        align-self: center;
    }
    & .register__army--lost::before { background: repeating-linear-gradient(45deg, var(--green-dim) 0 1px, transparent 1px 4px); }
    & .register__army span { font-family: var(--mono); font-style: italic; font-size: 0.85rem; }
    & .register__army--lost { color: var(--green-dim); }
    & .register__item { background-color: color-mix(in srgb, var(--bg-panel) 70%, transparent); }
    & .register__item.is-active { border-color: var(--red); box-shadow: none; }
    & .register__item.is-active .register__name { color: var(--red); }
    & .register__name { font-size: 0.98rem; }
    & .register__meta { font-style: italic; font-size: 0.82rem; }

    /* The articles of war, numbered as articles are. */
    & .rules { max-width: none; font-size: 1rem; line-height: 1.55; }
    & .rules li { border-color: var(--green-faint); background: color-mix(in srgb, var(--bg-panel) 70%, transparent); }
    & .rules li::before { content: counter(rule, upper-roman); font-family: var(--caps); font-size: 1.2rem; font-weight: 400; color: var(--red); }
    & .rules b { font-family: var(--caps); font-size: 1.05rem; font-weight: 400; color: var(--green); }

    /* ── Footer: the colophon, under the seal ── */
    & .term__foot {
        position: relative;
        margin-top: 3.8rem;
        padding-top: 2.6rem;
        text-align: center;
        border-top: 1px solid var(--green-faint);
        color: var(--green-dim);
        font-size: 0.82rem;
    }
    /* Red wax, pressed over the rule. */
    & .term__foot::before {
        content: "M";
        position: absolute;
        top: 0;
        left: 50%;
        display: grid;
        place-items: center;
        width: 48px;
        height: 48px;
        translate: -50% -50%;
        rotate: 8deg;
        border-radius: 47% 53% 50% 48% / 52% 46% 54% 48%;
        background: radial-gradient(circle at 36% 30%, var(--wax-hi), var(--wax) 50%, var(--wax-lo) 100%);
        box-shadow:
            0 0 0 6px var(--bg),
            0 3px 5px 6px color-mix(in srgb, var(--gilt-lo) 10%, transparent),
            inset 0 0 0 4px color-mix(in srgb, black 10%, transparent),
            inset 0 -2px 4px color-mix(in srgb, black 30%, transparent);
        color: color-mix(in srgb, var(--wax-lo) 85%, transparent);
        font: 1.35rem/1 var(--display);
        text-shadow: 0 1px 0 color-mix(in srgb, var(--wax-hi) 55%, transparent);
    }
    & .term__foot-head { font-family: var(--caps); font-size: 0.92rem; font-weight: 400; color: var(--red); }
    & .thought { margin: 0.2rem auto 0.9rem !important; max-width: 32em; font-size: 1.15rem; line-height: 1.45; color: var(--bone); opacity: 0.9; }
    & .term__strip { justify-content: center; gap: 0.3rem 0; margin-top: 1.3rem; border-top: 1px dotted var(--green-faint); font-family: var(--caps); font-size: 0.82rem; }
    & .term__strip::before { display: none; }
    & .term__strip > span { margin-right: 0; padding: 0 0.85rem; border-right: 0; }
    & .term__strip > span + span { border-left: 1px solid var(--green-faint); }
    & .term__strip b { color: var(--green); }
    & .term__actions { justify-content: center; font-family: var(--caps); font-size: 0.85rem; }
    & .term__seal, & .term__actions .term__seal { padding: 0; border: 0; background: none; box-shadow: none; font-family: var(--caps); color: var(--red); }
    & .term__seal:hover, & .term__seal:focus-visible, & .term__actions .term__seal:hover, & .term__actions .term__seal:focus-visible { color: var(--red); border: 0; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }

    /* ── Side columns: paper scrolls on the desk ── */
    & .feed {
        top: 34px;
        height: calc(100vh - 68px);
        width: 172px;
        overflow: visible;
        opacity: 1;
        border: 0;
        background:
            var(--grain),
            linear-gradient(90deg, color-mix(in srgb, var(--gilt-lo) 22%, transparent), transparent 12%, transparent 88%, color-mix(in srgb, var(--gilt-lo) 22%, transparent)),
            var(--bg);
        box-shadow: 0 12px 30px color-mix(in srgb, black 60%, transparent);
    }
    & .feed--left  { left: 18px; border: 0; }
    & .feed--right { right: 18px; border: 0; }
    /* The rollers, top and bottom. */
    & .feed::before, & .feed::after {
        content: "";
        position: absolute;
        left: -9px;
        right: -9px;
        height: 14px;
        border-radius: 7px;
        background:
            radial-gradient(circle at 50% 35%, var(--wood-hi), var(--wood) 55%, var(--wood-lo)) left / 14px 14px no-repeat,
            radial-gradient(circle at 50% 35%, var(--wood-hi), var(--wood) 55%, var(--wood-lo)) right / 14px 14px no-repeat,
            linear-gradient(var(--wood-hi), var(--wood) 45%, var(--wood-lo)) center / calc(100% - 20px) 10px no-repeat;
        filter: drop-shadow(0 3px 3px color-mix(in srgb, black 50%, transparent));
        z-index: 1;
    }
    & .feed::before { top: -7px; }
    & .feed::after { bottom: -7px; }
    & .feed__label::before { display: none; }
    & .feed__label {
        display: block;
        padding: 1.15rem 0.9rem 0.7rem;
        border-bottom: 0;
        text-align: center;
        white-space: normal;
        font-family: var(--caps);
        font-size: 0.86rem;
        line-height: 1.25;
        color: var(--red);
    }
    & .feed__label::after {
        content: "";
        display: block;
        width: 70%;
        height: 14px;
        margin: 0.35rem auto 0;
        background: var(--green-dim);
        mask: var(--flourish) center / contain no-repeat;
        -webkit-mask: var(--flourish) center / contain no-repeat;
        opacity: 0.6;
    }
    & .feed__viewport { top: 4.6rem; bottom: 0.6rem; }
    & .feed__line { padding: 0 1rem; margin-bottom: 0; color: var(--green-dim); font-style: italic; font-size: 0.8rem; line-height: 1.5; text-align: center; }
    /* A small mark between the rumours. Inside the line, so the loop's -50% stays exact. */
    & .feed__line::after { content: "·"; display: block; padding: 0.55rem 0 0.7rem; font-style: normal; color: var(--green-faint); }

    /* ── Boot screen: the scrivener prepares the page ── */
    & .boot-overlay { background: var(--desk); }
    & .boot-overlay::before {
        content: "";
        position: fixed;
        inset: 0;
        height: auto;
        z-index: 0;
        opacity: 1;
        transform: none;
        animation: none;
        background:
            radial-gradient(ellipse 70% 55% at 30% 18%, color-mix(in srgb, var(--candle) 55%, transparent), transparent 70%),
            radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, var(--desk-edge) 100%);
        pointer-events: none;
    }
    & .boot {
        max-width: 560px;
        margin: clamp(16px, 8vh, 90px) auto;
        padding: 3rem clamp(20px, 6vw, 3rem) 2.4rem;
        text-align: left;
        background: var(--sheet);
        box-shadow:
            inset 0 0 70px color-mix(in srgb, var(--gilt-lo) 20%, transparent),
            0 22px 50px -10px color-mix(in srgb, black 80%, transparent);
        animation: reveal 0.5s ease-out both;
    }
    & .boot-overlay .boot { margin-inline: max(12px, calc((100% - 560px) / 2)); }
    & .boot__mark { margin-bottom: 0.4rem; font-family: var(--display); font-size: clamp(2rem, 8vw, 2.9rem); line-height: 1.1; color: var(--green); text-align: center; white-space: normal; }
    & .boot__mark::first-letter { color: var(--red); }
    & .boot__mark small { display: block; margin-top: 0.5rem; font-family: var(--mono); font-style: italic; font-size: 1rem; color: var(--green-dim); }
    & .boot__mark::after {
        content: "";
        display: block;
        width: 220px;
        height: 22px;
        margin: 1.1rem auto 1.6rem;
        background: var(--green-dim);
        mask: var(--flourish) center / contain no-repeat;
        -webkit-mask: var(--flourish) center / contain no-repeat;
        opacity: 0.7;
    }
    & .boot__line { font-size: 1rem; font-style: italic; color: var(--green-dim); }
    & .boot__line b { font-style: normal; font-family: var(--caps); color: var(--green); }
    & .boot__line::after { border-bottom-color: var(--green-faint); }
    & .boot__line b.is-warn { color: var(--red); }
    & .boot__bar { height: 1px; margin-top: 1.4rem; background: var(--green-faint); }
    & .boot__bar span { background: var(--red); }
    & .boot__rite { font-family: var(--caps); font-size: 1rem; text-align: center; color: var(--red); }
    & .boot__warn { font-style: italic; font-size: 0.82rem; text-align: center; opacity: 0.8; }
    & .boot__enter { margin-top: 1rem; font-family: var(--caps); font-size: 1.05rem; text-align: center; color: var(--red); }
    & .boot__skip { margin-top: 1.4rem; font-style: italic; font-size: 0.8rem; text-align: center; color: var(--green-dim); }
    /* The seal comes down once every check is done. */
    & .boot__seal {
        display: grid;
        place-items: center;
        width: 64px;
        height: 64px;
        margin: 1.4rem auto 0;
        border-radius: 47% 53% 50% 48% / 52% 46% 54% 48%;
        background: radial-gradient(circle at 36% 30%, var(--wax-hi), var(--wax) 50%, var(--wax-lo) 100%);
        box-shadow:
            0 3px 6px color-mix(in srgb, black 40%, transparent),
            inset 0 0 0 6px color-mix(in srgb, black 10%, transparent),
            inset 0 -3px 6px color-mix(in srgb, black 30%, transparent);
        color: color-mix(in srgb, var(--wax-lo) 85%, transparent);
        font: 1.8rem/1 var(--display);
        text-shadow: 0 1px 0 color-mix(in srgb, var(--wax-hi) 55%, transparent);
        animation: seal-press 0.45s cubic-bezier(0.3, 1.5, 0.6, 1) 4.6s both;
    }
}

@keyframes seal-press {
    from { opacity: 0; transform: scale(1.8) rotate(-20deg); }
    to   { opacity: 1; transform: scale(1) rotate(-6deg); }
}

/* The folio keeps clear of the scrolls. Content and scrolls are sized as in
   the Cogitator's feed breakpoints above; with only the right scroll showing
   the page moves left rather than sliding under it. */
@media (min-width: 1140px) and (max-width: 1359px) {
    :root[data-theme="oldworld"] .term {
        margin-left: max(16px, calc((100vw - 900px - 208px) / 2));
        margin-right: calc(208px + max(16px, calc((100vw - 900px - 208px) / 2)));
    }
}

@media (max-width: 520px) {
    :root[data-theme="oldworld"] {
        & .term { margin-inline: 6px; }
        & .standings td.who { padding-left: 2.4rem; white-space: normal; }
        & .standings td { padding-inline: 0.35rem; }
        & .legend { flex-direction: column; align-items: center; gap: 0.15rem; }
        & .legend span + span::before { display: none; }
        & .nav a + a::before { display: none; }
        & .faction { font-size: 0.8rem; }
        & .term__strip { gap: 0.2rem 1.2rem; }
        & .term__strip > span { margin-right: 0; padding: 0; }
        & .term__strip > span + span { border-left: 0; }
        & .standings .herald { left: 0.3rem; width: 21px; height: 25px; }
        & .herald--large { width: 40px; height: 48px; }
        & .claimant { padding-left: 3.2rem; }
        & .claimant .herald { left: 0.8rem; width: 30px; height: 36px; }
        & .dossier__head { padding-right: 3.2rem; min-height: 48px; }
        & .nav a { padding-inline: 0.75rem; font-size: 1rem; }
        & .engagement__chronicle, & .dossier__lore, & .brief__body { text-align: left; }
    }
}

@media (prefers-reduced-motion: reduce) {
    :root[data-theme="oldworld"] {
        & .boot, & .boot__seal, & .term__title { animation: none; }
        & .nav a::after { transition: none; }
    }
}

@media (prefers-contrast: more) {
    :root[data-theme="oldworld"] .feed { display: none; }
}
