/* Story pages (stories/<slug>/index.html, built by tools/build_stories.py).
   The same identity as the home page (index.html <style>; LOREMASTER_BRAND_GUIDELINES.md):
   Deep Void #0D0D0D, LoreMaster Gold #D4AF37, Parchment #F5F1E6, serif headings,
   sans-serif only for buttons, labels and navigation. Tokens, buttons, top bar,
   story cards and footer are copied from the home page so both read as one site.
   Contrast on #0D0D0D (WCAG, computed): gold 9.2:1, parchment 17.2:1,
   muted parchment #B8B3A7 9.3:1; void on gold 9.2:1.
   Layout: one box (header, body and footer share .container); the story column
   holds about 70 characters a line; from 768px an "On this page" pane sits beside
   it, and from 1024px that pane takes all the width the column leaves. */
@font-face {
    font-family: "Cormorant Garamond";
    src: url("/assets/fonts/cormorant-garamond.woff2") format("woff2");
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --void: #0D0D0D;
    --void-raised: #151413;
    --gold: #D4AF37;
    --gold-line: rgba(212, 175, 55, 0.35);
    --parchment: #F5F1E6;
    --parchment-muted: #B8B3A7;
    --display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --container: 1200px;
    --gutter: 20px;
    --section: 96px;
}

@media (min-width: 768px) { :root { --gutter: 24px; --section: 120px; } }
@media (min-width: 1024px) { :root { --gutter: 32px; --section: 144px; } }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--void);
    color: var(--parchment);
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a { color: inherit; }

a:focus-visible {
    outline: 2px solid var(--parchment);
    outline-offset: 3px;
    border-radius: 2px;
}

.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.eyebrow {
    margin: 0 0 16px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 14px 28px;
    border: 1px solid var(--gold);
    border-radius: 2px;
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    color: var(--gold);
    background: transparent;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.btn:hover { background: var(--gold); color: var(--void); }
.btn--primary { background: var(--gold); color: var(--void); }
.btn--primary:hover { background: var(--parchment); border-color: var(--parchment); }

/* ── Top bar (in the flow here: there is no full-screen hero under it) ── */
.topbar { border-bottom: 1px solid var(--gold-line); }

.topbar__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 80px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--parchment);
    cursor: pointer;
}

.brand img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--gold-line);
}

.brand span {
    font-family: var(--display);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* ── The story ───────────────────────────────────────────────────────── */
.story-page { padding-top: 48px; }

.story-page__grid {
    display: grid;
    gap: 48px;
}

@media (min-width: 768px) {
    .story-page__grid {
        grid-template-columns: minmax(0, 1fr) 240px;
        gap: 40px;
        align-items: start;
    }
}

@media (min-width: 1024px) {
    .story-page__grid {
        /* The story column is sized to the reading measure (~70 characters);
           the side pane takes all the width left, so the page runs from the
           logo to the box's right edge with no blank band between them. */
        grid-template-columns: minmax(0, 580px) minmax(260px, 1fr);
        gap: 56px;
        align-items: start;
    }
}

@media (min-width: 1024px) { .story-page__article { max-width: 580px; } }

.story-page h1 {
    margin: 0 0 24px;
    font-family: var(--display);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 600;
    line-height: 1.08;
    color: var(--parchment);
    text-wrap: balance;
}

.story-page__answer {
    margin: 0 0 16px;
    font-size: 21px;
    line-height: 1.55;
    color: var(--parchment);
}

.story-page__meta {
    margin: 0 0 32px;
    font-family: var(--sans);
    font-size: 14px;
    letter-spacing: 0.02em;
    color: var(--parchment-muted);
}

.story-page__video {
    display: block;
    margin: 0 0 16px;
    text-decoration: none;
    cursor: pointer;
}

.story-page__video .story__frame { display: block; }

.story-page__play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 72px;
    height: 72px;
    margin: -36px 0 0 -36px;
    border-radius: 50%;
    background: rgba(13, 13, 13, 0.78);
    border: 1px solid var(--gold);
    transition: background-color 160ms ease;
}

.story-page__play::after {
    content: "";
    position: absolute;
    left: 29px;
    top: 23px;
    border-style: solid;
    border-width: 13px 0 13px 21px;
    border-color: transparent transparent transparent var(--gold);
}

.story-page__video:hover .story-page__play { background: var(--gold); }
.story-page__video:hover .story-page__play::after { border-left-color: var(--void); }
.story-page__video:hover .story__frame { border-color: var(--gold); }

.story-page__video-label {
    display: block;
    margin-top: 16px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
}

.story-page__article section {
    padding-top: 40px;
    scroll-margin-top: 24px;
}

.story-page__article h2 {
    margin: 0 0 16px;
    font-family: var(--display);
    font-size: clamp(28px, 3.2vw, 36px);
    font-weight: 600;
    line-height: 1.15;
    color: var(--gold);
    text-wrap: balance;
}

.story-page__article section p { margin: 0 0 16px; }

.story-page__sources {
    margin-top: 40px;
    border-top: 1px solid var(--gold-line);
}

.story-page__sources p { color: var(--parchment-muted); }

/* ── Side pane: on this page + newsletter ───────────────────────────── */
.story-page__aside {
    display: grid;
    gap: 40px;
}

@media (min-width: 768px) {
    .story-page__aside { position: sticky; top: 32px; }
}

.toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
    border-left: 1px solid var(--gold-line);
}

.toc li a {
    display: block;
    padding: 8px 0 8px 16px;
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.4;
    text-decoration: none;
    color: var(--parchment-muted);
    cursor: pointer;
}

.toc li a:hover { color: var(--gold); }

.newsletter {
    padding: 24px;
    border: 1px solid var(--gold-line);
    background: var(--void-raised);
}

.newsletter p:not(.eyebrow) { margin: 0 0 24px; font-size: 17px; line-height: 1.5; }
.newsletter .btn { width: 100%; }

/* ── More stories: the home page's story cards ──────────────────────── */
.more {
    margin-top: 96px;
    padding-top: 48px;
    border-top: 1px solid var(--gold-line);
}

.more h2 {
    margin: 0 0 32px;
    font-family: var(--display);
    font-size: clamp(32px, 4vw, 44px);
    font-weight: 600;
    line-height: 1.1;
}

.story-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 640px) { .story-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .story-grid { grid-template-columns: repeat(3, 1fr); } }

.story {
    display: block;
    height: 100%;
    text-decoration: none;
    color: var(--parchment);
    cursor: pointer;
}

.story__frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--void-raised);
    border: 1px solid var(--gold-line);
    transition: border-color 200ms ease;
}

.story__frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms ease;
}

.story__time {
    position: absolute;
    left: 10px;
    top: 10px;
    padding: 3px 8px;
    border-radius: 2px;
    background: rgba(13, 13, 13, 0.88);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--parchment);
}

.story__game {
    margin: 18px 0 6px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
}

.story__title {
    margin: 0;
    font-family: var(--display);
    font-size: 25px;
    font-weight: 600;
    line-height: 1.15;
    text-wrap: balance;
}

.story:hover .story__frame { border-color: var(--gold); }
.story:hover .story__title { color: var(--gold); }

@media (prefers-reduced-motion: no-preference) {
    .story:hover .story__frame img { transform: scale(1.04); }
}

/* ── Franchise branch (tools/build_franchises.py) ───────────────────── */
/* Breadcrumbs: the page's place in the tree, in text (BreadcrumbList repeats it).
   Muted parchment on void, 9.3:1. */
.crumbs { margin: 0 0 32px; }

.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 0;
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--parchment-muted);
}

.crumbs li + li::before {
    content: "\203A";
    margin: 0 10px;
    color: var(--gold);
}

.crumbs a {
    text-decoration: none;
    color: var(--parchment-muted);
    cursor: pointer;
}

.crumbs a:hover { color: var(--gold); }
.crumbs [aria-current="page"] { color: var(--parchment); }

/* Cover: the franchise or game art, one band under the breadcrumbs. */
.cover {
    margin: 0 0 48px;
    aspect-ratio: 21 / 9;
    overflow: hidden;
    border: 1px solid var(--gold-line);
    background: var(--void-raised);
}

.cover img { width: 100%; height: 100%; object-fit: cover; }

.hub-page__head { max-width: 760px; }
.hub-page .more:first-of-type { margin-top: 64px; }
.more--first { margin-top: 48px; }

/* The Complete Story text: images, sub-headings, lists and quotes inside the column. */
.figure {
    margin: 32px 0;
    border: 1px solid var(--gold-line);
    background: var(--void-raised);
}

.figure img { width: 100%; height: auto; }

.story-page__intro p { margin: 0 0 16px; }

.story-page__article h3 {
    margin: 32px 0 12px;
    font-family: var(--display);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--parchment);
    text-wrap: balance;
}

.story-page__article ul {
    margin: 0 0 16px;
    padding-left: 22px;
}

.story-page__article li { margin: 0 0 8px; }

.story-page__article blockquote {
    margin: 24px 0;
    padding: 4px 0 4px 20px;
    border-left: 2px solid var(--gold);
    font-style: italic;
    color: var(--parchment);
}

.story-page__article section a,
.story-page__intro a {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Top bar chip: LIBRARY, right beside the logo ─────────────────────── */
.topbar__row { justify-content: flex-start; gap: clamp(16px, 2vw, 24px); }

.topnav { display: flex; align-items: center; gap: 8px; }

.topnav__link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--gold-line);
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--parchment);
    background: rgba(13, 13, 13, 0.55);
    cursor: pointer;
    transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}

.topnav__link:hover, .topnav__link[aria-current="page"] { border-color: var(--gold); color: var(--gold); background: rgba(212, 175, 55, 0.1); }

.topnav__link:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ── Capsules: tall cover art, the way a game library shows a collection ── */
.capsules {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 32px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 768px) { .capsules { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }

.capsule {
    display: block;
    text-decoration: none;
    color: var(--parchment);
    cursor: pointer;
    outline: none;
}

.capsule__art {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 6px;
    background: var(--void-raised);
    box-shadow: 0 0 0 1px var(--gold-line);
    transition: box-shadow 200ms ease, transform 200ms ease;
}

.capsule__art img { width: 100%; height: 100%; object-fit: cover; }

/* Foil sheen that sweeps across the cover on hover, like a card being picked. */
.capsule__art::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 35%, rgba(245, 200, 80, 0.28) 50%, transparent 65%);
    background-size: 250% 100%;
    background-position: 120% 0;
    opacity: 0;
    transition: opacity 200ms ease;
}

.capsule:hover .capsule__art,
.capsule:focus-visible .capsule__art {
    box-shadow: 0 0 0 2px var(--gold), 0 14px 36px rgba(212, 175, 55, 0.28);
}

.capsule:hover .capsule__art::after,
.capsule:focus-visible .capsule__art::after { opacity: 1; }

.capsule__name {
    display: block;
    margin: 14px 0 8px;
    font-family: var(--display);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.15;
    text-wrap: balance;
}

.capsule:hover .capsule__name, .capsule:focus-visible .capsule__name { color: var(--gold); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Gold on a faint gold wash over void: 8.6:1. */
.tag {
    padding: 3px 9px;
    border: 1px solid var(--gold-line);
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.1);
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--gold);
}

@media (prefers-reduced-motion: no-preference) {
    .capsule:hover .capsule__art, .capsule:focus-visible .capsule__art { transform: translateY(-6px); }
    .capsule:hover .capsule__art::after, .capsule:focus-visible .capsule__art::after {
        background-position: -20% 0;
        transition: opacity 200ms ease, background-position 700ms ease;
    }
}

/* ── The Library (tools/build_franchises.py): side list, spotlight, shelves ── */
.library { padding-top: 32px; }

.library__grid { display: grid; gap: 32px; }

@media (min-width: 1024px) {
    .library__grid { grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; }
    .lib-nav { position: sticky; top: 24px; }
}

.lib-nav__title {
    margin: 0 0 12px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
}

.lib-nav ul { margin: 0; padding: 0; list-style: none; }

.lib-nav__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-left: 3px solid transparent;
    border-radius: 0 4px 4px 0;
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.3;
    text-decoration: none;
    color: var(--parchment);
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
}

.lib-nav__item img { flex: none; width: 32px; height: 32px; border-radius: 3px; object-fit: cover; }

.lib-nav__all {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 3px;
    background:
        linear-gradient(var(--gold), var(--gold)) 8px 8px / 7px 7px no-repeat,
        linear-gradient(var(--gold), var(--gold)) 17px 8px / 7px 7px no-repeat,
        linear-gradient(var(--gold), var(--gold)) 8px 17px / 7px 7px no-repeat,
        linear-gradient(var(--gold), var(--gold)) 17px 17px / 7px 7px no-repeat,
        var(--void-raised);
    box-shadow: inset 0 0 0 1px var(--gold-line);
}

.lib-nav__item--game { padding-left: 24px; font-size: 14px; color: var(--parchment-muted); }

.lib-nav__item:hover { background: rgba(212, 175, 55, 0.08); color: var(--parchment); }

.lib-nav__item[aria-current="page"] {
    border-left-color: var(--gold);
    background: rgba(212, 175, 55, 0.14);
    color: var(--gold);
}

.lib-nav__item:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* Below desktop the side list becomes one row of chips that scrolls sideways. */
@media (max-width: 1023px) {
    .lib-nav > ul { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
    .lib-nav li, .lib-nav__games { display: contents; }
    .lib-nav__item, .lib-nav__item--game {
        flex: none;
        padding: 6px 14px 6px 6px;
        border: 1px solid var(--gold-line);
        border-radius: 999px;
        white-space: nowrap;
    }
    .lib-nav__item img, .lib-nav__all { width: 28px; height: 28px; border-radius: 50%; }
    .lib-nav__item[aria-current="page"] { border-color: var(--gold); }
}


.library__main .crumbs { margin-bottom: 24px; }

.library__head { max-width: 760px; margin-bottom: 32px; }

.library__head h1 {
    margin: 0 0 16px;
    font-family: var(--display);
    font-size: clamp(36px, 5vw, 52px);
    font-weight: 600;
    line-height: 1.05;
    text-wrap: balance;
}

/* Spotlight: the store-page banner. Art fills it; a dark wash holds the text at 9:1 or better. */
.spotlight {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 460px;
    overflow: hidden;
    border: 1px solid var(--gold-line);
    border-radius: 8px;
    isolation: isolate;
}

.spotlight__art { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }

.spotlight::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(0deg, rgba(13, 13, 13, 0.96) 0%, rgba(13, 13, 13, 0.55) 55%, rgba(13, 13, 13, 0.2) 100%),
        linear-gradient(90deg, rgba(13, 13, 13, 0.9) 0%, rgba(13, 13, 13, 0.75) 55%, rgba(13, 13, 13, 0.1) 100%);
}

.spotlight__body { max-width: 640px; padding: 28px 24px; }

@media (min-width: 768px) { .spotlight__body { padding: 40px; } }

.spotlight h1, .spotlight h2 {
    margin: 8px 0 16px;
    font-family: var(--display);
    font-size: clamp(34px, 4.5vw, 52px);
    font-weight: 600;
    line-height: 1.05;
    text-wrap: balance;
}

.spotlight__answer { margin: 0 0 24px; }

.spotlight__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn--play { gap: 10px; box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.5); }

.btn--play::before {
    content: "";
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 10px solid currentColor;
}

@media (prefers-reduced-motion: no-preference) {
    .btn--play { animation: play-pulse 2.4s ease-out 1s 2; }
    @keyframes play-pulse {
        0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.5); }
        100% { box-shadow: 0 0 0 16px rgba(212, 175, 55, 0); }
    }
}

.facts { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 24px 0 0; font-family: var(--sans); }

.facts dt {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--parchment-muted);
}

.facts dd { margin: 0; font-size: 15px; color: var(--parchment); }

.facts a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.shelf { margin-top: 56px; }

.shelf h2 {
    margin: 0 0 24px;
    font-family: var(--display);
    font-size: clamp(28px, 3.2vw, 36px);
    font-weight: 600;
    line-height: 1.1;
}

.library__main .story-page__sources { margin-top: 56px; max-width: 640px; }

/* ── Footer: the same as the home page ──────────────────────────────── */
.site-footer {
    margin-top: 96px;
    padding: 32px 0 40px;
    border-top: 1px solid var(--gold-line);
    font-family: var(--sans);
    font-size: 14px;
    color: var(--parchment-muted);
}

.site-footer__row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

@media (min-width: 768px) {
    .site-footer__row { flex-direction: row; justify-content: space-between; }
}

.seal-badge {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    text-decoration: none;
    cursor: pointer;
}

.seal-badge img { height: 26px; width: auto; }

.legal { margin: 0; }

.legal a {
    color: var(--parchment-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.legal a:hover { color: var(--parchment); }

.legal .sep { margin: 0 8px; }

/* ── The journey library (LIB-010) ───────────────────────────────────── */
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* One search for the whole library, results grouped by kind. */
.libsearch { position: relative; margin: 0 0 32px; max-width: 640px; }

.libsearch__input {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--gold-line);
    border-radius: 4px;
    background: var(--void-raised);
    font-family: var(--sans);
    font-size: 16px;
    color: var(--parchment);
}

.libsearch__input::placeholder { color: var(--parchment-muted); }
.libsearch__input:focus { outline: none; border-color: var(--gold); }

.libsearch__results {
    position: absolute;
    z-index: 20;
    left: 0; right: 0; top: calc(100% + 6px);
    max-height: 70vh;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--gold-line);
    border-radius: 4px;
    background: var(--void-raised);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}

.libsearch__kind {
    margin: 12px 8px 6px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
}

.libsearch__kind:first-child { margin-top: 4px; }

.libsearch__hit {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--parchment);
    cursor: pointer;
}

.libsearch__hit:hover, .libsearch__hit:focus-visible { background: rgba(212, 175, 55, 0.12); outline: none; }
.libsearch__hit img { width: 48px; height: 32px; object-fit: cover; border-radius: 2px; flex: none; }
.libsearch__hit > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.libsearch__title { font-family: var(--sans); font-size: 15px; line-height: 1.35; }
.libsearch__game { font-family: var(--sans); font-size: 13px; color: var(--parchment-muted); }
.libsearch__none { margin: 8px; font-family: var(--sans); font-size: 15px; color: var(--parchment-muted); }

/* The four stages of a game, like a quest line. */
.path { margin: 56px 0 0; }

.path h2, .dd-bar h2 {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(28px, 3.4vw, 38px);
    font-weight: 600;
    line-height: 1.1;
}

.path__lead { margin: 10px 0 24px; max-width: 62ch; font-family: var(--sans); font-size: 16px; line-height: 1.5; color: var(--parchment-muted); }

.path__list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: none;
}

@media (min-width: 640px) { .path__list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .path__list { grid-template-columns: repeat(4, 1fr); } }

.path__card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 0 18px;
    border: 1px solid var(--gold-line);
    border-radius: 4px;
    background: var(--void-raised);
    text-decoration: none;
    color: var(--parchment);
    transition: border-color 200ms ease;
}

a.path__card { cursor: pointer; }
a.path__card:hover, a.path__card:focus-visible { border-color: var(--gold); outline: none; }

.path__art { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--gold-line); }
.path__art img { width: 100%; height: 100%; object-fit: cover; }

.path__art--locked {
    background:
        repeating-linear-gradient(135deg, rgba(212, 175, 55, 0.06) 0 12px, transparent 12px 24px),
        var(--void);
}

.path__num, .path__name, .path__what, .path__meta, .path__cta { padding: 0 18px; font-family: var(--sans); }
.path__num { margin-top: 16px; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.path__name { margin-top: 6px; font-family: var(--display); font-size: 24px; font-weight: 600; line-height: 1.15; }
.path__what { margin-top: 6px; font-size: 15px; line-height: 1.45; color: var(--parchment-muted); }
.path__meta { margin-top: 10px; font-size: 13px; color: var(--parchment-muted); }
.path__cta { margin-top: auto; padding-top: 16px; font-size: 14px; font-weight: 600; color: var(--gold); }
.path__cta--locked { color: var(--parchment-muted); }
.path__card--locked { opacity: 0.85; }

/* Read stages get a mark, like an unlocked achievement. */
.path__card.is-read::after {
    content: "Read";
    position: absolute;
    top: 10px; right: 10px;
    padding: 3px 8px;
    border-radius: 2px;
    background: var(--gold);
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--void);
}

/* "Follow the story" in a reading page's side column. */
.path-next { margin-top: 32px; }
.path-next ul { margin: 0; padding: 0; list-style: none; }
.path-next li + li { margin-top: 8px; }
.path-next a { font-family: var(--sans); font-size: 15px; color: var(--parchment); text-decoration: none; cursor: pointer; }
.path-next a:hover { color: var(--gold); }
.path-next .path__num { padding: 0; margin-right: 6px; }

/* Shelf header row: heading left, tools right, one row. */
.dd-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 24px;
}

.dd-bar__tools { display: flex; align-items: center; gap: 10px; }
.dd-bar__filter { width: min(280px, 60vw); min-height: 40px; }

/* Newest/oldest is one flip icon. */
.dd-bar__sort {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border: 1px solid var(--gold-line);
    border-radius: 4px;
    background: var(--void-raised);
    cursor: pointer;
}

.dd-bar__sort:hover, .dd-bar__sort:focus-visible { border-color: var(--gold); outline: none; }

.dd-bar__sort span {
    width: 0; height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 9px solid var(--gold);
    transition: transform 200ms ease;
}

.dd-bar__sort[data-order="oldest"] span { transform: rotate(180deg); }

.dd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 28px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dd { display: flex; flex-direction: column; text-decoration: none; color: var(--parchment); cursor: pointer; }

.dd__art {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--gold-line);
    border-radius: 4px;
    background: var(--void-raised);
    transition: border-color 200ms ease;
}

.dd__art img { width: 100%; height: 100%; object-fit: cover; }
.dd:hover .dd__art, .dd:focus-visible .dd__art { border-color: var(--gold); }
.dd:focus-visible { outline: none; }
.dd__name { margin-top: 12px; font-family: var(--sans); font-size: 16px; line-height: 1.35; }
.dd:hover .dd__name { color: var(--gold); }
.dd__meta { margin-top: 6px; font-family: var(--sans); font-size: 13px; color: var(--parchment-muted); }

/* Stage filters on the library page. */
.stage-filters { display: flex; flex-wrap: wrap; gap: 8px; }

.stage-filters button {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--gold-line);
    border-radius: 999px;
    background: transparent;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--parchment);
    cursor: pointer;
}

.stage-filters button:hover { border-color: var(--gold); }
.stage-filters button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--void); }

.library__main .shelf + .shelf, .library__main .path + .shelf { margin-top: 56px; }

/* ── Extra Chapters: the games beside the fan's additions ─────────────── */
.extra-canon { list-style: none; padding-left: 0; }
.extra-canon li {
    margin: 0 0 16px;
    padding: 16px 20px;
    border: 1px solid var(--gold-line);
    background: var(--void-raised);
}
.extra-canon li p { margin: 0 0 8px; }
.extra-canon li p:last-child { margin: 0; color: var(--parchment-muted); }
