/* ===== Where Winds Meet — Codex of the Jianghu ===== */
:root {
  --ink: #0a0c0f;
  --ink-2: #11151a;
  --ink-3: #181e25;
  --line: rgba(233, 222, 196, .12);
  --line-2: rgba(233, 222, 196, .22);
  --paper: #ece4d0;
  --paper-dim: rgba(236, 228, 208, .68);
  --paper-faint: rgba(236, 228, 208, .42);
  --gold: #d4ad62;
  --gold-2: #f0d595;
  --cinnabar: #c63a2c;
  --jade: #5fa08d;
  --azure: #6a8fc4;
  --violet: #9a7cc4;
  --radius: 14px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .55);
  --display: "Cormorant Garamond", "Noto Serif SC", serif;
  --body: "Manrope", system-ui, sans-serif;
  --han: "Noto Serif SC", serif;
  --brush: "Ma Shan Zheng", "Noto Serif SC", serif;
  --maxw: 1240px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 16px/1.7 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before { /* paper grain */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1000; opacity: .06;
  background-image: 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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, video { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); }
::selection { background: var(--cinnabar); color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.1; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(2.6rem, 7vw, 6rem); }
h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); }
h3 { font-size: 1.6rem; }
p { margin: 0 0 1em; }
.han { font-family: var(--han); }
.brush { font-family: var(--brush); }
.muted { color: var(--paper-dim); }
.faint { color: var(--paper-faint); }
.gold { color: var(--gold); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

/* ===== Nav ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px; padding: 14px 28px;
  transition: background .4s, backdrop-filter .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.solid { background: rgba(10, 12, 15, .78); backdrop-filter: blur(14px) saturate(1.2); border-color: var(--line); }
.logo { display: flex; align-items: center; gap: 12px; color: var(--paper); font-family: var(--display); font-size: 1.25rem; font-weight: 600; white-space: nowrap; }
.logo .seal {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 6px;
  background: var(--cinnabar); color: #fbe9d0; font-family: var(--brush); font-size: 1.35rem;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.15), 0 4px 14px rgba(198,58,44,.4);
  transform: rotate(-4deg);
}
.nav-links { display: flex; gap: 4px; margin-left: auto; flex-wrap: nowrap; }
.nav-links a {
  color: var(--paper-dim); padding: 8px 12px; border-radius: 999px; font-size: .9rem; font-weight: 500;
  transition: color .2s, background .2s; white-space: nowrap;
}
.nav-links a:hover { color: var(--paper); background: rgba(255,255,255,.05); }
.nav-links a.active { color: var(--ink); background: var(--gold); }
.search-btn {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03);
  color: var(--paper-dim); padding: 7px 12px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .85rem;
}
.search-btn kbd { font-family: var(--body); font-size: .72rem; border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; }
.burger { display: none; background: none; border: 0; color: var(--paper); font-size: 1.6rem; cursor: pointer; margin-left: auto; }
@media (max-width: 1520px) {
  .burger { display: block; }
  .nav-links {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; background: rgba(10,12,15,.97);
    padding: 16px; gap: 2px; border-bottom: 1px solid var(--line); transform: translateY(-120%); transition: transform .35s;
    max-height: calc(100vh - 64px); overflow: auto;
  }
  .nav-links.open { transform: none; }
  .nav-links a { padding: 12px 16px; border-radius: 10px; }
  .search-btn kbd { display: none; }
}
@media (max-width: 600px) { .nav { padding: 12px 16px; gap: 12px; } .logo .txt { display: none; } }

/* ===== Hero ===== */
.hero { position: relative; height: 100vh; min-height: 640px; overflow: hidden; display: flex; align-items: flex-end; }
.hero video, .hero .hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 60%, transparent 0%, rgba(10,12,15,.4) 60%, rgba(10,12,15,.85) 100%),
    linear-gradient(180deg, rgba(10,12,15,.55) 0%, transparent 25%, transparent 55%, var(--ink) 100%);
}
#wind { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.hero-content { position: relative; z-index: 3; padding-bottom: 12vh; width: 100%; }
.hero-kicker { font-size: .8rem; letter-spacing: .35em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; display: flex; align-items: center; gap: 14px; }
.hero-kicker::before { content: ""; width: 48px; height: 1px; background: var(--gold); }
.hero h1 { text-shadow: 0 6px 40px rgba(0,0,0,.6); max-width: 900px; }
.hero h1 em { font-style: italic; color: var(--gold-2); font-weight: 500; }
.hero-sub { max-width: 560px; font-size: 1.1rem; color: var(--paper-dim); }
.hero-han {
  position: absolute; right: 4vw; top: 50%; transform: translateY(-50%); z-index: 3;
  writing-mode: vertical-rl; font-family: var(--brush); font-size: clamp(3rem, 7vw, 6.5rem); line-height: 1;
  color: rgba(236,228,208,.85); text-shadow: 0 0 40px rgba(0,0,0,.7); letter-spacing: .1em;
}
.hero-han small { display: block; font-size: .28em; letter-spacing: .5em; color: var(--gold); margin-top: 18px; font-family: var(--han); }
@media (max-width: 760px) { .hero-han { display: none; } }
.scroll-cue { position: absolute; z-index: 3; bottom: 28px; left: 50%; transform: translateX(-50%); color: var(--paper-faint); font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.scroll-cue::after { content: ""; width: 1px; height: 44px; background: linear-gradient(var(--gold), transparent); animation: cue 2s infinite; }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: .92rem;
  border: 1px solid var(--gold); color: var(--ink); background: var(--gold); cursor: pointer; font-family: inherit; transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(212,173,98,.3); color: var(--ink); background: var(--gold-2); }
.btn.ghost { background: transparent; color: var(--paper); border-color: var(--line-2); }
.btn.ghost:hover { background: rgba(255,255,255,.06); color: var(--paper); box-shadow: none; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* ===== Page layout ===== */
main { min-height: 100vh; }
.page-head { position: relative; padding: 160px 0 70px; overflow: hidden; }
.page-head .bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .35; mask-image: linear-gradient(180deg, #000 0%, transparent 100%); -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 100%); }
.page-head .wrap { position: relative; }
.page-head .big-han { position: absolute; right: 24px; top: -10px; font-family: var(--brush); font-size: clamp(6rem, 16vw, 14rem); color: rgba(236,228,208,.05); line-height: 1; pointer-events: none; }
.page-head p { max-width: 680px; font-size: 1.08rem; color: var(--paper-dim); }
.eyebrow { font-size: .75rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; display: block; }
section.block { padding: 80px 0; }
section.block + section.block { padding-top: 20px; }
.divider { height: 40px; margin: 40px auto; max-width: 420px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 40'%3E%3Cpath d='M0 20 Q105 8 190 20' stroke='%23d4ad62' stroke-opacity='.5' fill='none'/%3E%3Cpath d='M230 20 Q315 32 420 20' stroke='%23d4ad62' stroke-opacity='.5' fill='none'/%3E%3Crect x='200' y='10' width='20' height='20' transform='rotate(45 210 20)' fill='none' stroke='%23d4ad62'/%3E%3C/svg%3E") center/contain no-repeat; }

.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

.card {
  position: relative; background: linear-gradient(180deg, var(--ink-2), var(--ink-3)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; transition: border-color .3s, transform .3s, box-shadow .3s; overflow: hidden;
}
.card:hover { border-color: var(--line-2); }
.card.link { cursor: pointer; }
.card.link:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card h3 { margin-bottom: .3em; }
.card .han-title { font-family: var(--han); color: var(--gold); font-size: .95rem; letter-spacing: .1em; }

.tag { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .06em; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--paper-dim); margin: 0 6px 6px 0; }
.tag.gold { border-color: rgba(212,173,98,.5); color: var(--gold); }
.tag.red { border-color: rgba(198,58,44,.6); color: #ef7b6e; }
.tag.jade { border-color: rgba(95,160,141,.6); color: #8fd1bd; }

.reveal { opacity: 0; transform: translateY(30px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } html { scroll-behavior: auto; } }

/* ===== Home ===== */
.intro-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 60px; align-items: center; }
@media (max-width: 900px) { .intro-grid { grid-template-columns: 1fr; } }
.framed { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.framed::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(236,228,208,.25); border-radius: 8px; pointer-events: none; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 40px; }
.stats-row > div { background: var(--ink-2); padding: 24px; text-align: center; }
.stats-row b { display: block; font-family: var(--display); font-size: 2.4rem; color: var(--gold); line-height: 1; margin-bottom: 6px; }
.stats-row span { font-size: .8rem; color: var(--paper-dim); letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 700px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }

.portal { position: relative; min-height: 300px; border-radius: var(--radius); overflow: hidden; display: flex; align-items: flex-end; padding: 26px; color: var(--paper); border: 1px solid var(--line); }
.portal img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2,.7,.2,1), filter .6s; filter: saturate(.85) brightness(.75); }
.portal::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, transparent 30%, rgba(10,12,15,.92)); }
.portal:hover img { transform: scale(1.07); filter: saturate(1.05) brightness(.9); }
.portal > div { position: relative; z-index: 2; }
.portal h3 { font-size: 1.9rem; margin: 0; }
.portal .han { position: absolute; z-index: 2; top: 18px; right: 22px; font-family: var(--brush); font-size: 2.4rem; color: rgba(236,228,208,.75); }
.portal p { margin: 4px 0 0; color: var(--paper-dim); font-size: .92rem; }
.portal.tall { min-height: 420px; }

.quote { font-family: var(--display); font-size: clamp(1.6rem, 3.4vw, 2.6rem); font-style: italic; line-height: 1.35; text-align: center; max-width: 900px; margin: 0 auto; color: var(--paper); }
.quote cite { display: block; font-style: normal; font-family: var(--body); font-size: .85rem; color: var(--gold); letter-spacing: .2em; text-transform: uppercase; margin-top: 18px; }

/* ===== Timeline ===== */
.timeline { position: relative; margin: 40px 0; }
.timeline::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: linear-gradient(transparent, var(--gold) 5%, var(--gold) 95%, transparent); opacity: .5; }
.tl-item { position: relative; width: 50%; padding: 0 48px 48px 0; text-align: right; }
.tl-item:nth-child(even) { margin-left: 50%; padding: 0 0 48px 48px; text-align: left; }
.tl-item::before { content: ""; position: absolute; top: 8px; right: -7px; width: 13px; height: 13px; border-radius: 50%; background: var(--ink); border: 2px solid var(--gold); box-shadow: 0 0 0 5px rgba(212,173,98,.12); }
.tl-item:nth-child(even)::before { left: -6px; right: auto; }
.tl-item.game::before { background: var(--cinnabar); border-color: var(--cinnabar); }
.tl-year { font-family: var(--display); font-size: 2rem; color: var(--gold); line-height: 1; }
.tl-item h4 { font-size: 1.3rem; margin: 6px 0; }
.tl-item p { color: var(--paper-dim); font-size: .95rem; }
@media (max-width: 760px) {
  .timeline::before { left: 8px; }
  .tl-item, .tl-item:nth-child(even) { width: 100%; margin: 0; padding: 0 0 36px 36px; text-align: left; }
  .tl-item::before, .tl-item:nth-child(even)::before { left: 2px; right: auto; }
}

/* ===== Story ===== */
.act { display: grid; grid-template-columns: 220px 1fr; gap: 40px; padding: 50px 0; border-top: 1px solid var(--line); }
.act-num { font-family: var(--brush); font-size: 5rem; line-height: 1; color: var(--cinnabar); }
.act-num small { display: block; font-family: var(--body); font-size: .75rem; letter-spacing: .3em; color: var(--paper-faint); text-transform: uppercase; margin-top: 10px; }
.act h3 { font-size: 2.2rem; }
.act .body { color: var(--paper-dim); font-size: 1.04rem; }
.act .body p:first-letter { }
@media (max-width: 760px) { .act { grid-template-columns: 1fr; gap: 10px; } .act-num { font-size: 3.4rem; } }
.spoiler { filter: blur(7px); cursor: pointer; transition: filter .3s; user-select: none; }
.spoiler.shown { filter: none; user-select: auto; cursor: auto; }
.spoiler-note { display: inline-flex; gap: 8px; align-items: center; font-size: .8rem; color: #ef7b6e; border: 1px solid rgba(198,58,44,.5); border-radius: 999px; padding: 4px 12px; margin-bottom: 18px; }

/* ===== Characters ===== */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 30px; }
.input, select.input {
  background: var(--ink-2); border: 1px solid var(--line-2); color: var(--paper); padding: 10px 14px; border-radius: 10px; font: inherit; font-size: .92rem; min-width: 0;
}
.input:focus { outline: none; border-color: var(--gold); }
.chip { background: transparent; border: 1px solid var(--line-2); color: var(--paper-dim); padding: 7px 14px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .85rem; transition: all .2s; }
.chip:hover { color: var(--paper); border-color: var(--paper-faint); }
.chip.on { background: var(--paper); color: var(--ink); border-color: var(--paper); }

.char-card { position: relative; display: block; border-radius: var(--radius); overflow: hidden; cursor: pointer; border: 1px solid var(--line); background: var(--ink-2); color: var(--paper); transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s, border-color .4s; }
.char-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: rgba(212,173,98,.45); color: var(--paper); }
/* radius + isolation on .pic itself: a hovered card (transform) with a scaled, blended image otherwise drops the parent's rounded clip */
.pic { position: relative; aspect-ratio: 1; background: radial-gradient(circle at 50% 40%, #f3ecdc, #d9cfb8); overflow: hidden; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; isolation: isolate; }
.pic img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; filter: contrast(1.05) saturate(.95); transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.char-card:hover .pic img { transform: scale(1.06); }
.pic::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 40px rgba(60,40,20,.35); pointer-events: none; }
.pic .ph { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--brush); font-size: 5.5rem; color: rgba(60,45,30,.35); }
.char-card .info { padding: 14px 16px 16px; border-top: 2px solid var(--fc, var(--gold)); }
.char-card h3 { font-size: 1.35rem; margin: 2px 0 0; }
.char-card .han-name { font-family: var(--han); color: var(--gold); font-size: .85rem; }
.char-card .role { font-size: .78rem; color: var(--paper-dim); margin-top: 2px; line-height: 1.4; }
.char-card .seal-mini { position: absolute; top: 10px; right: 10px; z-index: 2; background: var(--cinnabar); color: #fbe9d0; font-family: var(--brush); font-size: .95rem; line-height: 1; padding: 5px 4px; border-radius: 3px; writing-mode: vertical-rl; box-shadow: 0 2px 8px rgba(0,0,0,.3); }

/* Character detail */
.char-hero { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 50px; align-items: start; padding-top: 130px; }
@media (max-width: 860px) { .char-hero { grid-template-columns: 1fr; padding-top: 100px; } }
.char-portrait { position: sticky; top: 100px; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; border: 1px solid var(--line); box-shadow: var(--shadow); }
.char-portrait::before { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(60,40,20,.35); border-radius: 6px; z-index: 2; pointer-events: none; }
@media (max-width: 860px) { .char-portrait { position: relative; top: 0; max-width: 420px; } }
.char-portrait .ph { font-size: 9rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 24px 0; }
.facts div { background: var(--ink-2); padding: 14px 16px; }
.facts dt { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--paper-faint); }
.facts dd { margin: 4px 0 0; font-weight: 500; }
.rel-list { display: grid; gap: 10px; }
.rel-item { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--ink-2); cursor: pointer; transition: border-color .2s; }
.rel-item:hover { border-color: var(--gold); }
.rel-item .av { width: 48px; height: 48px; flex: none; border-radius: 50%; overflow: hidden; background: #e6dcc6; color: #6b5a44 !important; display: grid; place-items: center; font-family: var(--brush); color: var(--paper-faint); }
.rel-item .av img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.rel-item small { display: block; color: var(--paper-dim); font-size: .82rem; }

/* ===== Relations graph ===== */
.graph-wrap { position: relative; height: calc(100vh - 220px); min-height: 560px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: radial-gradient(circle at 50% 50%, #151a20, var(--ink)); }
.graph-wrap svg { width: 100%; height: 100%; cursor: grab; }
.graph-wrap svg:active { cursor: grabbing; }
.graph-legend { position: absolute; left: 16px; bottom: 16px; background: rgba(10,12,15,.85); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: .78rem; backdrop-filter: blur(8px); }
.graph-legend div { display: flex; align-items: center; gap: 8px; margin: 3px 0; cursor: pointer; user-select: none; }
.graph-legend div.off { opacity: .3; }
.graph-legend i { width: 22px; height: 3px; border-radius: 2px; display: inline-block; }
.graph-panel { position: absolute; right: 16px; top: 16px; width: 300px; max-width: calc(100% - 32px); max-height: calc(100% - 32px); overflow: auto; background: rgba(10,12,15,.9); border: 1px solid var(--line-2); border-radius: 14px; padding: 18px; backdrop-filter: blur(10px); display: none; }
.graph-panel.show { display: block; }
.graph-panel .pic { border-radius: 10px; margin-bottom: 12px; width: 140px; }
.node-label { font-family: var(--body); font-size: 11px; fill: var(--paper); pointer-events: none; paint-order: stroke; stroke: var(--ink); stroke-width: 3px; }
.graph-hint { position: absolute; left: 16px; top: 16px; font-size: .78rem; color: var(--paper-faint); }

/* ===== Atlas ===== */
.region { display: grid; grid-template-columns: 1.2fr 1fr; gap: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--ink-2); margin-bottom: 28px; }
.region:nth-child(even) { grid-template-columns: 1fr 1.2fr; }
.region:nth-child(even) .region-img { order: 2; }
.region-img { position: relative; min-height: 340px; }
.region-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.region-img .han { position: absolute; left: 22px; bottom: 14px; font-family: var(--brush); font-size: 3.4rem; color: rgba(236,228,208,.9); text-shadow: 0 4px 20px rgba(0,0,0,.7); }
.region-body { padding: 36px; }
.region-body ul { padding-left: 1.1em; color: var(--paper-dim); }
@media (max-width: 860px) { .region, .region:nth-child(even) { grid-template-columns: 1fr; } .region:nth-child(even) .region-img { order: 0; } .region-img { min-height: 220px; } .region-body { padding: 24px; } }

/* ===== Martial ===== */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--paper-dim); padding: 12px 16px; font: inherit; font-weight: 600; cursor: pointer; margin-bottom: -1px; }
.tabs button.on { color: var(--gold); border-color: var(--gold); }
.path-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 6px; letter-spacing: .05em; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--paper-faint); font-weight: 600; }
table.data tr:hover td { background: rgba(255,255,255,.02); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }

/* ===== Tools ===== */
.tool { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
@media (max-width: 900px) { .tool { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: .8rem; color: var(--paper-dim); display: flex; justify-content: space-between; }
.field label b { color: var(--gold); font-weight: 600; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; background: var(--line-2); border-radius: 2px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); cursor: pointer; border: 3px solid var(--ink); box-shadow: 0 0 0 1px var(--gold); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); cursor: pointer; border: 3px solid var(--ink); }
.result-big { font-family: var(--display); font-size: 4rem; color: var(--gold); line-height: 1; }
.bar { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; margin: 6px 0 14px; display: flex; }
.bar > i { display: block; height: 100%; }
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.kv b { font-weight: 600; }
.note { font-size: .8rem; color: var(--paper-faint); border-left: 2px solid var(--gold); padding-left: 12px; margin-top: 18px; }
.quiz-opt { display: block; width: 100%; text-align: left; background: var(--ink-2); border: 1px solid var(--line-2); color: var(--paper); padding: 14px 18px; border-radius: 12px; margin-bottom: 10px; cursor: pointer; font: inherit; transition: all .2s; }
.quiz-opt:hover { border-color: var(--gold); transform: translateX(4px); }
.progress { height: 3px; background: var(--line); border-radius: 2px; margin-bottom: 24px; }
.progress i { display: block; height: 100%; background: var(--gold); transition: width .4s; }

/* ===== Glossary ===== */
.gloss { columns: 2 380px; column-gap: 40px; }
.gloss-item { break-inside: avoid; padding: 18px 0; border-bottom: 1px solid var(--line); }
.gloss-item dt { font-family: var(--display); font-size: 1.4rem; font-weight: 600; }
.gloss-item dt span { font-family: var(--han); color: var(--gold); font-size: 1rem; margin-left: 10px; }
.gloss-item dd { margin: 6px 0 0; color: var(--paper-dim); }

/* ===== Gallery ===== */
.masonry { columns: 3 320px; column-gap: 16px; }
.masonry > * { break-inside: avoid; margin-bottom: 16px; border-radius: 12px; overflow: hidden; cursor: zoom-in; position: relative; border: 1px solid var(--line); }
.masonry img, .masonry video { width: 100%; transition: transform .6s; }
.masonry > *:hover img { transform: scale(1.03); }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(5,6,8,.95); display: none; place-items: center; padding: 30px; cursor: zoom-out; }
.lightbox.show { display: grid; }
.lightbox img, .lightbox video { max-height: 90vh; max-width: 94vw; border-radius: 8px; box-shadow: var(--shadow); }

/* ===== Search modal ===== */
.search-modal { position: fixed; inset: 0; z-index: 300; background: rgba(5,6,8,.7); backdrop-filter: blur(6px); display: none; justify-content: center; align-items: flex-start; padding: 12vh 16px; }
.search-modal.show { display: flex; }
.search-box { width: 640px; max-width: 100%; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.search-box input { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 18px 22px; font: inherit; font-size: 1.1rem; color: var(--paper); outline: none; }
.search-results { max-height: 55vh; overflow: auto; }
.search-results a { display: flex; gap: 12px; align-items: baseline; padding: 12px 22px; color: var(--paper); border-bottom: 1px solid var(--line); }
.search-results a:hover, .search-results a.sel { background: rgba(212,173,98,.1); }
.search-results small { color: var(--paper-faint); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; min-width: 80px; }

footer { border-top: 1px solid var(--line); padding: 50px 0; margin-top: 80px; color: var(--paper-faint); font-size: .85rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

.page-enter { animation: pageIn .7s cubic-bezier(.2,.7,.2,1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ===== Combat / Builds / Inner Ways ===== */
.roll-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.roll-grid i { aspect-ratio: 1; border-radius: 3px; display: block; transition: background .3s; }
.pipeline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 20px 0; }
.pipe { background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 14px; font-size: .88rem; display: flex; gap: 10px; align-items: center; }
.pipe b { width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: var(--ink); display: grid; place-items: center; font-size: .72rem; flex: none; }
.pipe-x { color: var(--gold); font-family: var(--display); font-size: 1.4rem; }
.build-cols { display: grid; grid-template-columns: 1fr 340px; gap: 40px; margin-top: 36px; align-items: start; }
.build-cols aside { display: grid; gap: 16px; position: sticky; top: 90px; }
@media (max-width: 900px) { .build-cols { grid-template-columns: 1fr; } .build-cols aside { position: static; } }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 12px 14px 12px 54px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--ink-2); color: var(--paper-dim); }
.steps li::before { content: counter(s); position: absolute; left: 14px; top: 11px; width: 26px; height: 26px; border-radius: 50%; background: var(--cinnabar); color: #fbe9d0; display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.prio { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.prio span { background: var(--ink-2); border: 1px solid rgba(212,173,98,.4); border-radius: 999px; padding: 6px 14px 6px 6px; font-size: .88rem; display: flex; gap: 8px; align-items: center; }
.prio span b { width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: var(--ink); display: grid; place-items: center; font-size: .72rem; }
.prio i { color: var(--gold); font-style: normal; }
ul.pros, ul.cons { list-style: none; padding: 0; color: var(--paper-dim); }
ul.pros li, ul.cons li { padding: 6px 0 6px 24px; position: relative; }
ul.pros li::before { content: "✦"; position: absolute; left: 0; color: #8fd1bd; }
ul.cons li::before { content: "✕"; position: absolute; left: 0; color: #ef7b6e; }
.skills { display: grid; gap: 10px; }
.skill { border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; background: var(--ink-2); }
.skill h4 { font-family: var(--display); font-size: 1.3rem; margin: 4px 0; }
.skill p { margin: 0; font-size: .93rem; }
.combo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 18px; border-radius: 12px; background: linear-gradient(90deg, rgba(198,58,44,.12), rgba(212,173,98,.08)); border: 1px solid rgba(212,173,98,.3); }
.combo span { background: var(--ink); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 12px; font-size: .88rem; }
.combo i { color: var(--gold); font-style: normal; }
.inner-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; align-items: start; }
details.inner { border: 1px solid var(--line); border-top: 2px solid var(--rc, var(--line-2)); border-radius: 12px; background: var(--ink-2); overflow: hidden; transition: border-color .3s, box-shadow .3s; }
details.inner[open] { grid-column: 1 / -1; border-color: color-mix(in srgb, var(--rc) 55%, transparent); box-shadow: var(--shadow); }
details.inner summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 52px 1fr; gap: 6px 14px; padding: 14px 16px; user-select: none; }
details.inner summary::-webkit-details-marker { display: none; }
details.inner summary:hover { background: rgba(255,255,255,.025); }
.in-ico { grid-row: span 2; position: relative; width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--rc) 35%, #1a1d22), #0d0f12); border: 1px solid color-mix(in srgb, var(--rc) 60%, transparent); box-shadow: inset 0 0 14px color-mix(in srgb, var(--rc) 25%, transparent); }
.in-ico img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.in-ico i { font-style: normal; font-family: var(--brush); font-size: 1.6rem; color: var(--rc); }
.in-ico img + i { display: none; }
.in-head { line-height: 1.3; }
.in-head b { font-size: 1rem; }
.in-tags { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .74rem; margin-top: 3px; }
.in-text { grid-column: 2; font-size: .86rem; color: var(--paper-dim); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; line-height: 1.5; }
details.inner[open] .in-text { -webkit-line-clamp: unset; }
@media (max-width: 600px) { details.inner summary { grid-template-columns: 44px 1fr; } .in-ico { width: 44px; height: 44px; } }
.in-glance { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.in-glance .tile { background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.in-glance .tile b { display: block; font-family: var(--display); font-size: 1.9rem; color: var(--gold); line-height: 1; }
.in-glance .tile span { font-size: .78rem; color: var(--paper-faint); }
.in-glance .rar { display: grid; gap: 4px; align-content: center; }
.in-glance .rar span { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--paper-dim); }
.in-glance .rar i { width: 10px; height: 10px; border-radius: 3px; background: var(--rc); box-shadow: 0 0 8px var(--rc); }
.tier-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tier-strip div { padding: 10px 12px; background: var(--ink-2); border-right: 1px solid var(--line); font-size: .76rem; color: var(--paper-dim); line-height: 1.35; }
.tier-strip div:last-child { border-right: 0; background: rgba(212,173,98,.1); }
.tier-strip b { display: block; color: var(--gold); font-size: .9rem; }
@media (max-width: 700px) { .tier-strip { grid-template-columns: repeat(3, 1fr); } .tier-strip div:nth-child(3) { border-right: 0; } .tier-strip div:nth-child(-n+3) { border-bottom: 1px solid var(--line); } }
details.in-rules { margin-bottom: 26px; padding: 14px 18px; }
details.in-rules > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; }
details.in-rules > summary::-webkit-details-marker, details.rule > summary::-webkit-details-marker { display: none; }
details.in-rules[open] > summary .faint { visibility: hidden; }
details.rule { border-bottom: 1px dashed var(--line); }
details.rule > summary { list-style: none; cursor: pointer; padding: 9px 0; font-weight: 600; font-size: .92rem; user-select: none; }
details.rule > summary::after { content: "+"; float: right; color: var(--gold); }
details.rule[open] > summary::after { content: "−"; }
details.rule p { font-size: .88rem; margin: 0 0 10px; }
.in-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; padding: 4px 18px 18px; }
@media (max-width: 800px) { .in-body { grid-template-columns: 1fr; } }
.ladder { display: grid; gap: 0; border-left: 2px solid rgba(212,173,98,.35); margin-left: 12px; }
.ladder div { position: relative; padding: 6px 0 10px 26px; font-size: .9rem; color: var(--paper-dim); }
.ladder b { position: absolute; left: -13px; top: 4px; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 12px; background: var(--ink); border: 2px solid var(--gold); color: var(--gold); display: grid; place-items: center; font-size: .7rem; }
.planner-slot { border: 1px dashed var(--line-2); border-radius: 12px; padding: 14px; }
.synergy { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 12px; margin: 14px 0; font-size: .92rem; }
.pick-list { max-height: 280px; overflow: auto; display: grid; gap: 4px; padding-right: 4px; }
.pick-list label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; font-size: .86rem; }
.pick-list label:hover { border-color: var(--line-2); }
.pick-list input { margin-top: 3px; accent-color: var(--gold); }
.pick-list label.dim { opacity: .45; }
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .vs { grid-template-columns: 1fr; } }

/* ===== Interwoven timeline ===== */
.era-ribbon { display: flex; gap: 4px; border-radius: 12px; overflow: hidden; }
.era-ribbon button { min-width: 0; border: 0; cursor: pointer; text-align: left; padding: 14px 14px 12px; background: linear-gradient(180deg, color-mix(in srgb, var(--ec) 30%, transparent), color-mix(in srgb, var(--ec) 8%, transparent)); color: var(--paper); border-top: 3px solid var(--ec); font: inherit; transition: filter .2s; }
.era-ribbon button:hover { filter: brightness(1.3); }
.era-ribbon b { display: block; font-family: var(--brush); font-size: 1.5rem; font-weight: 400; color: var(--ec); line-height: 1.1; }
.era-ribbon span { display: block; font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.era-ribbon small { color: var(--paper-faint); font-size: .72rem; }
.lane-heads { display: grid; grid-template-columns: 1fr 110px 1fr; margin: 30px 0 10px; font-size: .85rem; color: var(--paper-dim); }
.lane-heads > div:last-child { text-align: left; }
.lane-heads > div:first-child { text-align: right; }
.chron { position: relative; }
#threads { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: visible; }
#threads path { fill: none; stroke-width: 1.5; opacity: .32; stroke-dasharray: 4 5; transition: opacity .25s, stroke-width .25s; }
#threads.focus path { opacity: .05; }
#threads path.on { opacity: 1 !important; stroke-width: 2.5; stroke-dasharray: none; filter: drop-shadow(0 0 6px currentColor); }
.lane-row { display: grid; grid-template-columns: 1fr 110px 1fr; position: relative; }
.lane-row::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.lane-spine { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 18px; z-index: 2; }
.lane-spine i { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 4px var(--ink); }
.lane-spine span { font-family: var(--display); color: var(--paper-dim); font-size: 1.05rem; margin-top: 4px; background: var(--ink); padding: 0 6px; }
.lane-h, .lane-g { padding: 8px 0; position: relative; z-index: 2; }
.lane-h { display: flex; justify-content: flex-end; }
.ev { width: min(100%, 440px); background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; cursor: pointer; transition: transform .25s, border-color .25s, opacity .25s, box-shadow .25s; position: relative; }
.ev.history { border-right: 3px solid var(--ec); }
.ev.game { border-left: 3px solid var(--cinnabar); background: linear-gradient(90deg, rgba(198,58,44,.10), var(--ink-2) 60%); }
.ev:hover, .ev:focus { border-color: rgba(212,173,98,.6); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,.4); outline: none; }
.ev.dim { opacity: .22; }
.ev.lit { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 24px rgba(212,173,98,.25); }
.ev-top { display: flex; justify-content: space-between; gap: 10px; font-size: .78rem; }
.ev-year { color: var(--ec); font-weight: 700; letter-spacing: .05em; }
.ev.game .ev-year { color: #ef7b6e; }
.ev h4 { font-size: 1.25rem; margin: 4px 0; }
.ev p { font-size: .86rem; color: var(--paper-dim); margin: 0; }
.ev-links { display: inline-block; margin-top: 8px; font-size: .72rem; color: var(--gold); letter-spacing: .05em; }
.era-row { display: grid; grid-template-columns: auto auto 1fr; gap: 14px; align-items: baseline; margin: 40px 0 16px; padding: 14px 18px; border-radius: 12px; overflow: hidden; background: linear-gradient(90deg, color-mix(in srgb, var(--ec) 20%, var(--ink-2)), var(--ink-2) 70%); border: 1px solid color-mix(in srgb, var(--ec) 30%, transparent); position: relative; z-index: 2; }
/* accent bar inside the banner, clipped by its rounded corners (a thick border-left curved into separate slivers) */
.era-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ec); }
.era-row span { font-family: var(--brush); font-size: 2rem; color: var(--ec); line-height: 1; }
.era-row b { font-family: var(--display); font-size: 1.5rem; }
.era-row em { font-style: normal; color: var(--paper-dim); font-size: .88rem; }
.chron[data-mode="history"] .lane-row[data-track="game"], .chron[data-mode="game"] .lane-row[data-track="history"] { display: none; }
@media (max-width: 760px) {
  .lane-heads { display: none; }
  .lane-row { grid-template-columns: 56px 1fr; }
  .lane-row::before { left: 28px; }
  .lane-spine { grid-column: 1; grid-row: 1; }
  .lane-h, .lane-g { grid-column: 2; grid-row: 1; justify-content: flex-start; }
  .lane-h:empty, .lane-g:empty { display: none; }
  .era-row { grid-template-columns: auto 1fr; } .era-row em { grid-column: 1 / -1; }
  .era-ribbon { overflow-x: auto; } .era-ribbon button { min-width: 120px; }
}
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); z-index: 120; background: rgba(13,16,20,.97); backdrop-filter: blur(16px); border-left: 1px solid var(--line-2); box-shadow: -30px 0 80px rgba(0,0,0,.6); padding: 70px 32px 40px; overflow-y: auto; transform: translateX(105%); transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.drawer.show { transform: none; }
.drawer-x { position: absolute; top: 18px; right: 20px; background: none; border: 1px solid var(--line-2); color: var(--paper); width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 1rem; }
.ingame { margin-top: 20px; padding: 16px 18px; border-radius: 12px; border: 1px solid rgba(198,58,44,.45); background: rgba(198,58,44,.08); }
.ingame p { margin: 8px 0 0; font-size: .95rem; }
.drawer-people { display: flex; flex-wrap: wrap; gap: 12px; }
.drawer-people a { width: 78px; text-align: center; font-size: .72rem; color: var(--paper-dim); }
.drawer-people .pic { border-radius: 50%; margin-bottom: 4px; }
.fig { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: start; }
.fig-av .pic { border-radius: 12px; }

/* Portrait loading: dark glyph tile → paper + image fade-in once loaded (see pic() in app.js) */
.pic.ld { background: var(--ink-2); }
.pic.ld::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 40%, #f3ecdc, #d9cfb8); opacity: 0; transition: opacity .5s ease; }
.pic.ld .ph { color: rgba(212,173,98,.18); animation: picPulse 1.6s ease-in-out infinite; }
.pic.ld img { position: relative; opacity: 0; transition: opacity .5s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.pic.ld.ok::before, .pic.ld.ok img { opacity: 1; }
.pic.ld.ok .ph { display: none; }
@keyframes picPulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .pic.ld .ph { animation: none; } }

/* Clickable region rows + long-form lore pages */
.region.link { cursor: pointer; transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s; }
.region.link:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.lore-sec { padding: 0 0 30px 22px; margin-bottom: 30px; border-left: 2px solid var(--fc, var(--line-2)); border-bottom: 1px solid var(--line); }
.lore-sec:last-child { border-bottom: 0; }
.lore-sec h3 { margin: 0 0 12px; }
.lore-sec p { color: var(--paper-dim); line-height: 1.8; max-width: 72ch; }
.lore-people { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; margin-top: 10px; }
.lore-people a { color: var(--paper); font-size: .76rem; line-height: 1.3; text-align: center; }
.lore-people .pic { border-radius: 50%; margin-bottom: 6px; }

/* Tools: landing grid + per-tool switcher */
.page-head.compact { padding: 130px 0 40px; }
.page-head.compact h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.page-head .eyebrow a { color: inherit; }
.tool-card .han { font-family: var(--brush); font-size: 2.6rem; color: var(--gold); line-height: 1; display: block; margin-bottom: 10px; }
.tool-card { color: var(--paper); display: flex; flex-direction: column; }
.tool-card p { flex: 1; font-size: .92rem; }
.tool-switch { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 26px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tool-switch a { flex: none; display: flex; align-items: center; gap: 7px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--paper-dim); font-size: .85rem; white-space: nowrap; }
.tool-switch a .han { font-family: var(--brush); color: var(--gold); font-size: 1.05rem; line-height: 1; }
.tool-switch a:hover { border-color: var(--line-2); color: var(--paper); }
.tool-switch a.on { background: rgba(212,173,98,.14); border-color: var(--gold); color: var(--paper); }

/* Compact numeric inputs (Build lab, quick calc) */
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px 12px; margin-top: 10px; }
.mini { display: grid; gap: 4px; font-size: .74rem; color: var(--paper-faint); letter-spacing: .02em; }
.mini .input { width: 100%; padding: 8px 10px; }
.lab-slot { display: grid; grid-template-columns: 1fr 64px 64px; gap: 8px; margin-top: 8px; padding-left: 10px; border-left: 3px solid var(--c); }
.lab-slot .input { width: 100%; min-width: 0; padding: 8px 10px; }
.lab-row { margin-bottom: 12px; }
.lab-row small { display: block; margin-top: 4px; font-size: .74rem; }
.chart { width: 100%; height: auto; margin-top: 10px; }
.chart text { fill: var(--paper-faint); font-size: 11px; font-family: inherit; }
.chart .grid-l { stroke: var(--line); }
.chart .ax { fill: var(--paper-dim); }

/* Numbers: confidence badges, ratings, formulas */
.conf { display: inline-block; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--paper-faint); vertical-align: middle; white-space: nowrap; font-weight: 500; }
.conf-tested { color: #8fd1bd; border-color: #8fd1bd66; }
.conf-listed { color: var(--gold); border-color: #d4ad6266; }
.conf-estimate { color: #ef9a8e; border-color: #ef7b6e55; }
.rate { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: .9rem; border-bottom: 1px dashed var(--line); }
.pips { display: flex; gap: 4px; }
.pips i { width: 18px; height: 6px; border-radius: 3px; background: var(--line-2); }
.pips i.on { background: var(--gold); }
.formula { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; overflow-x: auto; color: var(--paper); }

/* Phones: let the hero title wrap naturally; the scroll cue collides with the buttons */
@media (max-width: 600px) { .hero h1 br { display: none; } .scroll-cue { display: none; } }
.chip-row { display: contents; }
@media (max-width: 600px) {
  .chip-row { display: flex; gap: 6px; flex: 1 1 100%; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .chip-row .chip { flex: none; }
  #charGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  #charGrid .char-card .info { padding: 10px 12px 12px; }
  #charGrid .char-card h3 { font-size: 1.1rem; }
}
@media (max-width: 600px) { [data-pane] .card .grid.g2, [data-pane] .card .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px !important; } }
/* Planner pick lists: tap-friendly rows, no text selection, 2-line effect */
.pick-list label { user-select: none; -webkit-user-select: none; align-items: center; -webkit-tap-highlight-color: transparent; }
.pick-list label:has(input:checked) { border-color: var(--gold); background: rgba(212,173,98,.08); }
.pick-list .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .8rem; line-height: 1.4; margin-top: 2px; }
.in-ico.sm { grid-row: auto; flex: none; width: 34px; height: 34px; border-radius: 9px; }
.in-ico.sm i { font-size: 1.1rem; }
/* In-game icons on martial cards, art pages, mystic table */
.art-ico { float: right; width: 56px; height: 56px; margin: -4px -4px 8px 12px; }
.art-ico.lg { float: none; width: 72px; height: 72px; margin: 0; flex: none; }
.ico-title { display: flex; align-items: center; gap: 14px; }
.ico-cell { display: flex; align-items: center; gap: 10px; }

/* Atlas map */
.am .am-head { max-width: 760px; margin-bottom: 18px; }
.am .am-head h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.am-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; margin-bottom: 4px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.am-chip {
  flex: 0 0 auto; font: 600 .78rem/1 var(--body); letter-spacing: .05em; padding: 10px 14px; min-height: 38px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--paper-faint); border: 1px solid var(--line-2); transition: color .2s, background .2s, border-color .2s;
}
.am-chip:hover { color: var(--paper); }
.am-chip[aria-pressed="true"] { color: var(--ink); background: var(--gold); border-color: var(--gold); }
.am-shell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.am-stage {
  position: relative; width: 100%; aspect-ratio: 1000 / 830; max-height: 70vh; margin: 0 auto; overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); background: #0a0f13;
}
.am-svg { display: block; width: 100%; height: 100%; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.am-svg:active { cursor: grabbing; }
.am-grat { fill: none; stroke: rgba(233, 222, 196, .06); stroke-width: .7; vector-effect: non-scaling-stroke; }
.am-landp { fill: #3a3727; stroke: rgba(212, 173, 98, .55); stroke-width: 1; vector-effect: non-scaling-stroke; }
.am-coast-glow { fill: none; stroke: rgba(212, 173, 98, .2); stroke-width: 7; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.am-no-land .am-grat { stroke: rgba(233, 222, 196, .12); }
.am-it { cursor: pointer; outline: none; }
.am-it text { font-family: var(--body); paint-order: stroke; stroke: rgba(8, 10, 12, .92); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.am-hit, .am-hit-ring { fill: transparent; }
.am-hit-ring { fill: none; stroke: transparent; stroke-width: 12; pointer-events: stroke; }
.am-han { font: 15px var(--brush) !important; fill: var(--paper); }
.am-sub { font-size: 9.5px; letter-spacing: .06em; fill: var(--paper-dim); }
.am-rl { font: italic 10.5px var(--display) !important; fill: rgba(143, 190, 210, .85); letter-spacing: .08em; }
.am-deco { font: 13px var(--brush) !important; fill: rgba(236, 228, 208, .2); letter-spacing: .3em; stroke: none !important; }
/* markers */
.am-ring { fill: var(--ink); stroke: var(--gold); stroke-width: 2; }
.am-ring.fict { stroke-dasharray: 3 2.5; stroke: var(--gold-2); }
.am-core { fill: var(--cinnabar); }
.am-pulse { fill: rgba(212, 173, 98, .35); transform-box: fill-box; transform-origin: center; animation: amPulse 2.8s ease-out infinite; pointer-events: none; }
@keyframes amPulse { 0% { transform: scale(.9); opacity: .8; } 100% { transform: scale(2.6); opacity: 0; } }
.am-palace { fill: none; stroke: rgba(240, 213, 149, .8); stroke-width: 1.3; stroke-dasharray: 2 3; pointer-events: none; }
.am-poi { fill: var(--jade); stroke: var(--ink); stroke-width: 1.5; }
.am-city { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.am-ev { fill: var(--cinnabar); stroke: var(--paper); stroke-width: 1.3; }
.am-city + .am-l .am-han { font-size: 12px !important; fill: var(--paper-dim); }
.am-city + .am-l .am-sub, .am-ev + .am-l .am-sub { font-size: 8.5px; }
.am-it:hover .am-ring, .am-it:focus-visible .am-ring, .am-it.on .am-ring { stroke: #fff2c8; stroke-width: 3; }
.am-it:hover .am-city, .am-it:focus-visible .am-city, .am-it.on .am-city { fill: var(--gold-2); }
.am-it.on .am-core { fill: #ff6a55; }
.am-it:focus-visible .am-hit, .am-it:focus-visible .am-hit-ring { stroke: var(--gold-2); stroke-width: 1.5; fill: rgba(212, 173, 98, .12); }
/* zones & lines */
.am-zone { fill: var(--c); fill-opacity: .15; stroke: var(--c); stroke-opacity: .5; stroke-width: 1.2; vector-effect: non-scaling-stroke; transition: fill-opacity .2s; }
.am-zoneg:hover .am-zone, .am-zoneg:focus-visible .am-zone, .am-zoneg.on .am-zone { fill-opacity: .3; stroke-opacity: .95; stroke-width: 2; }
.am-zoneg .am-han { fill: rgba(246, 238, 218, .82); font-size: 17px !important; }
.am-zoneg .am-sub { fill: rgba(236, 228, 208, .6); }
.am-zoneg[data-id="sixteen"] .am-zone { fill: url(#am-hatch); fill-opacity: 1; stroke-dasharray: 5 3; }
.am-zoneg[data-id="sixteen"]:hover .am-zone, .am-zoneg[data-id="sixteen"].on .am-zone { stroke-width: 2.2; filter: brightness(1.3); }
.am-hexi { fill: rgba(240, 213, 149, .22); stroke: rgba(240, 213, 149, .7); stroke-width: 1.2; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.am-river { fill: none; stroke: #7fb2c9; stroke-opacity: .75; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.am-river.canal { stroke: #d4ad62; stroke-opacity: .8; stroke-width: 1.6; stroke-dasharray: 6 3; }
.am-hitline { fill: none; stroke: transparent; stroke-width: 16; vector-effect: non-scaling-stroke; pointer-events: stroke; }
.am-lineg:hover .am-river, .am-lineg:focus-visible .am-river, .am-lineg.on .am-river { stroke-opacity: 1; stroke-width: 3.2; }
/* journey */
.am-jpath { fill: none; stroke: var(--gold-2); stroke-width: 2.2; stroke-dasharray: 8 7; stroke-linecap: round; vector-effect: non-scaling-stroke; animation: amFlow 1.1s linear infinite; pointer-events: none; }
.am-jpath.dream { stroke: #8fd1bd; }
.am-jpath.side { stroke: var(--paper-dim); stroke-width: 1.6; stroke-dasharray: 3 7; }
@keyframes amFlow { to { stroke-dashoffset: -30; } }
.am-stop circle { fill: var(--cinnabar); stroke: #fbe9d0; stroke-width: 1.6; }
.am-stop.side circle { fill: var(--ink-2); stroke: var(--gold); }
.am-stop text { font: 700 11px var(--body); fill: #fff; stroke: none; }
@media (prefers-reduced-motion: reduce) { .am-pulse, .am-jpath { animation: none; } .am-pulse { opacity: 0; } }
/* overlays */
.am-ctl { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 6px; }
.am-ctl button {
  width: 40px; height: 40px; border-radius: 10px; font: 600 1.25rem/1 var(--body); cursor: pointer; color: var(--paper);
  background: rgba(10, 12, 15, .78); border: 1px solid var(--line-2); backdrop-filter: blur(6px);
}
.am-ctl button:hover { color: var(--ink); background: var(--gold); border-color: var(--gold); }
.am-compass { position: absolute; top: 10px; right: 10px; width: 58px; height: 58px; pointer-events: none; overflow: visible; opacity: .9; }
.am-compass .c1 { fill: rgba(10, 12, 15, .6); stroke: var(--gold); stroke-width: 1; }
.am-compass .c2 { fill: none; stroke: var(--line-2); stroke-dasharray: 2 2; }
.am-compass .c3 { fill: rgba(212, 173, 98, .35); } .am-compass .c4 { fill: rgba(212, 173, 98, .2); } .am-compass .c5 { fill: var(--cinnabar); }
.am-n { font: 12px var(--brush); fill: var(--gold-2); }
.am-scale { position: absolute; left: 14px; bottom: 12px; display: flex; flex-direction: column; gap: 3px; pointer-events: none; font-size: .68rem; color: var(--paper-dim); letter-spacing: .06em; text-shadow: 0 1px 4px #000; }
.am-scale i { display: block; height: 6px; border: 1.5px solid var(--paper-dim); border-top: 0; }
.am-note { margin: 12px 0 0; font-size: .78rem; color: var(--paper-faint); }
.am-tip {
  position: absolute; transform: translate(-50%, -100%); padding: 5px 10px; border-radius: 8px; font-size: .8rem; white-space: nowrap; pointer-events: none; z-index: 3;
  background: rgba(10, 12, 15, .92); border: 1px solid var(--line-2); color: var(--paper); box-shadow: var(--shadow);
}
/* card (side on desktop, bottom sheet on phones) */
.am-card {
  background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden auto; box-shadow: var(--shadow);
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; max-height: 68vh; border-radius: 18px 18px 0 0; overscroll-behavior: contain;
  transform: translateY(105%); visibility: hidden; transition: transform .3s cubic-bezier(.2, .7, .2, 1), visibility 0s .3s;
}
.am-card.open { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.am-card .am-empty { display: none; }
.am-x {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; font-size: 1.4rem; line-height: 1; cursor: pointer;
  color: var(--paper); background: rgba(10, 12, 15, .7); border: 1px solid var(--line-2);
}
.am-pic { aspect-ratio: 16 / 8; overflow: hidden; background: var(--ink-3); }
.am-pic img { width: 100%; height: 100%; object-fit: cover; }
.am-body { padding: 16px 18px 20px; }
.am-body h3 { font-size: 1.7rem; margin-bottom: .3em; outline: none; }
.am-body h3 .han { font-size: 1.3rem; margin-left: 6px; }
.am-body h4 { font: 700 .7rem var(--body); letter-spacing: .24em; text-transform: uppercase; color: var(--gold); margin: 16px 0 6px; }
.am-txt { font-size: .93rem; line-height: 1.65; color: var(--paper-dim); }
.am-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.am-links .btn { padding: 10px 16px; font-size: .84rem; }
.am-people { margin-top: 14px; }
@media (min-width: 900px) {
  .am-shell { grid-template-columns: minmax(0, 1fr) 360px; }
  .am-card { position: sticky; top: 84px; transform: none; visibility: visible; max-height: calc(100vh - 110px); border-radius: var(--radius); }
  .am-card .am-empty { display: block; }
  .am-empty { padding: 56px 28px; text-align: center; }
  .am-empty .han { font-size: 3.6rem; display: block; line-height: 1.2; }
  .am-pic { aspect-ratio: 16 / 9; }
}
@media (max-width: 600px) {
  .am-ctl button { width: 36px; height: 36px; }
  .am-compass { width: 44px; height: 44px; }
}
/* grid columns must be allowed to shrink, or wide tables inside .table-scroll push the page sideways */
.build-cols > *, .tool > *, .vs > * { min-width: 0; }
/* page-enter animation turns #app into a containing block, so the off-canvas timeline drawer briefly widens the page */
html { overflow-x: clip; }

/* Text selection only where there is real text to copy (paragraphs, lists, table cells, form fields) */
body { -webkit-user-select: none; user-select: none; }
p, li, dd, td, blockquote, figcaption, .formula, input, textarea, select, [contenteditable] { -webkit-user-select: text; user-select: text; }

/* Lore illustrations: historical artwork, mini maps, bar timelines */
.lore-figs { display: grid; gap: 14px; margin: 20px 0 8px; }
.lore-figs.n2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .lore-figs.n2 { grid-template-columns: 1fr; } }
.lore-fig { margin: 0; }
.lore-zoom { display: flex; justify-content: center; align-items: center; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #0b0d10; cursor: zoom-in; }
/* whole picture, never enlarged past its real pixel size (upscaling and cover-cropping made scans look soft) */
.lore-zoom img { width: auto; height: auto; max-width: 100%; max-height: 560px; object-fit: contain; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.lore-zoom:hover img { transform: scale(1.02); }
.lore-fig figcaption, .mini-map figcaption, .lore-tl > figcaption { font-size: .82rem; color: var(--paper-dim); margin-top: 8px; line-height: 1.5; }
.lore-fig figcaption small { display: block; color: var(--paper-faint); font-size: .72rem; margin-top: 2px; }
.mini-map { margin: 20px 0 8px; }
.mini-map svg { width: 100%; height: auto; display: block; border-radius: 12px; border: 1px solid var(--line); background: #15130f; }
.mm-sea { fill: #101418; }
.mm-grat { fill: none; stroke: rgba(236,228,208,.06); stroke-width: .6; }
.mm-land path { fill: #2a2620; stroke: rgba(212,173,98,.45); stroke-width: .8; }
.mm-pow { fill-opacity: .16; stroke-opacity: .35; stroke-width: .8; }
.mm-pow.hl { fill-opacity: .42; stroke: #f0d595; stroke-opacity: .9; stroke-width: 1.4; }
.mini-map svg:has(.hl) .mm-pow:not(.hl) { fill-opacity: .08; }
.mm-pref { stroke: #ef7b6e; stroke-width: 1; stroke-dasharray: 3 3; }
.mm-pref.hl { stroke-width: 2; }
.mm-hatch { stroke: rgba(239,123,110,.55); stroke-width: 1.4; }
.mm-riv { fill: none; stroke: #5b8db8; stroke-width: 1.4; stroke-opacity: .7; }
.mm-riv.canal { stroke: #7fc0c8; stroke-dasharray: 4 3; }
.mm-riv.hl { stroke: #8fc4ee; stroke-width: 3; stroke-opacity: 1; }
.mini-map text { font-family: var(--han), var(--body, sans-serif); font-size: 11px; fill: var(--paper-dim); paint-order: stroke; stroke: #101418; stroke-width: 3px; }
.mm-pl { font-size: 13px; fill: rgba(236,228,208,.55); }
.mm-pl.hl { fill: #f0d595; font-size: 15px; }
.mm-city circle { fill: var(--paper); stroke: #101418; stroke-width: 1.5; }
.mm-city.hl circle, .mm-reg.hl path { fill: var(--gold); }
.mm-city.hl text, .mm-ev.hl text, .mm-reg.hl text { fill: #f0d595; font-weight: 600; font-size: 12.5px; }
.mm-ev path { stroke: #ef7b6e; stroke-width: 2.2; }
.mm-reg path { fill: rgba(212,173,98,.6); stroke: #101418; stroke-width: 1; }
.mm-focus { fill: none; stroke: #f0d595; stroke-width: 1.8; stroke-dasharray: 3 3; }
.lore-tl { margin: 20px 0 8px; padding: 16px 18px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-2); }
.lore-tl > figcaption { margin: 0 0 12px; color: var(--gold); letter-spacing: .08em; text-transform: uppercase; font-size: .72rem; }
.tl-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center; min-height: 30px; }
.tl-l { font-size: .82rem; color: var(--paper); text-align: right; line-height: 1.2; }
.tl-track { position: relative; height: 22px; border-left: 1px solid var(--line); }
.tl-track i { position: absolute; top: 4px; height: 14px; border-radius: 4px; min-width: 4px; opacity: .85; }
.tl-track em { position: absolute; top: 4px; font-style: normal; font-size: .68rem; line-height: 14px; white-space: nowrap; pointer-events: none; color: var(--paper-dim); }
.tl-track em.in { transform: translateX(6px); color: #0b0d10; font-weight: 600; }
.tl-track em.out-r { transform: translateX(6px); }
.tl-track em.out-l { margin-right: 6px; }
.tl-axis .tl-track { border-top: 1px solid var(--line); height: 18px; }
.tl-axis b { position: absolute; top: 3px; transform: translateX(-50%); font-size: .68rem; font-weight: 400; color: var(--paper-faint); }
@media (max-width: 600px) { .tl-row { grid-template-columns: 84px 1fr; gap: 8px; } .tl-l { font-size: .72rem; } .tl-track em { display: none; } }
/* mini map labels: Latin names in the body font (fixes odd spacing like “Chang’ an”), hanzi in the serif */
.mini-map text { font-family: "Manrope", "Noto Serif SC", sans-serif; letter-spacing: .01em; }
.mini-map .mm-hz { font-family: var(--han); }
.mini-map .mm-pl { fill: rgba(236,228,208,.5); font-weight: 500; }
.mini-map .mm-pl.hl { fill: #f0d595; font-weight: 600; }
.mm-pow { stroke-linejoin: round; }
.am-dc { visibility: hidden; }

/* ───── lore pages: section kinds, filter, contents, history links ───── */
.k-history { --k: var(--gold); } .k-why { --k: #d17d68; } .k-plot { --k: #9aa4b5; } .k-people { --k: #7fb59a; }
.k-play { --k: #9a9ad8; } .k-open { --k: #b79ad0; } .k-intro { --k: #a8a08c; }
.sec-kind { display: inline-block; margin: 0 0 6px; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--k); }
.lore-sec[data-kind] { border-left-color: color-mix(in srgb, var(--k, var(--line-2)) 55%, transparent); }
.lore-sec[data-kind="history"] { --k: var(--gold); } .lore-sec[data-kind="why"] { --k: #d17d68; } .lore-sec[data-kind="plot"] { --k: #9aa4b5; }
.lore-sec[data-kind="people"] { --k: #7fb59a; } .lore-sec[data-kind="play"] { --k: #9a9ad8; } .lore-sec[data-kind="open"] { --k: #b79ad0; } .lore-sec[data-kind="intro"] { --k: #a8a08c; }
.lore-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; position: sticky; top: 64px; z-index: 5; padding: 10px 0; background: linear-gradient(var(--ink), rgba(10,12,15,.85)); }
.lf-chip { font: inherit; font-size: .8rem; color: var(--paper-dim); background: rgba(255,255,255,.03); border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 13px; cursor: pointer; }
.lf-chip[aria-pressed="true"] { color: var(--ink); background: var(--k, var(--gold)); border-color: transparent; }
.lore-toc { padding: 18px 18px 12px; }
@media (min-width: 900px) { .lore-toc { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; } }
.toc-g { margin-top: 12px; } .toc-g b { display: block; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--k); margin-bottom: 4px; font-weight: 600; }
.toc-i { display: block; width: 100%; text-align: left; background: none; border: 0; font: inherit; font-size: .84rem; line-height: 1.35; color: var(--paper-dim); padding: 4px 0; cursor: pointer; }
.toc-i:hover { color: var(--gold); }
.lore-see { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.lore-see .eyebrow { margin-right: 4px; }
.lore-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 40px; }
.lore-pn a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--paper); background: var(--ink-2); transition: border-color .3s, transform .3s; }
.lore-pn a:hover { border-color: rgba(212,173,98,.45); transform: translateY(-2px); }
.lore-pn small { display: block; color: var(--paper-faint); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px; }
.lore-pn a:last-child { text-align: right; }
@media (max-width: 600px) { .lore-pn { grid-template-columns: 1fr; } .lore-pn a:last-child { text-align: left; } }

/* ───── stories: index groups and cards ───── */
.k-stories { --k: #e0a15a; } .lore-sec[data-kind="stories"] { --k: #e0a15a; }
.story-group { margin-bottom: 46px; } .story-group h3 { margin: 4px 0 16px; }
.story-card { display: block; color: var(--paper); } .story-card h4 { font-family: var(--display); font-size: 1.25rem; margin: 6px 0 2px; }
.story-card p { margin: 8px 0 0; font-size: .92rem; line-height: 1.55; }
.lore-sec .story-cards { margin-top: 14px; }
