@charset "UTF-8";
/* RISEN LEGION — portal design system.
   Display face: ANVYL (military capitals). Accent face: Satyr SP (runic). Both ship from /assets/fonts.
   Order: fonts → tokens → base → primitives → header → palette → hero → home sections → cards →
   inner pages → wiki → news → footer → overlays → motion → responsive. */

/* ---------- fonts ---------- */
@font-face { font-family: 'Anvyl'; src: url('/assets/fonts/anvyl.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Satyr'; src: url('/assets/fonts/satyr.woff2') format('woff2'); font-display: swap; }

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #09090a;
  --bg-2: #0f0e0e;
  --surface: #141312;
  --surface-2: #1c1a18;
  --surface-3: #25221f;
  --bone: #ece4d4;
  --bone-2: #cfc6b4;
  --muted: #9b958a;
  --gold: #d4a85a;
  --gold-2: #f2d396;
  --gold-dim: #8a6d3b;
  --gold-glow: rgba(212, 168, 90, .35);
  --blood: #b3261e;
  --blood-2: #e0443a;
  --blood-deep: #4a0f0d;
  --line: rgba(236, 228, 212, .09);
  --line-2: rgba(236, 228, 212, .17);
  --max: 1360px;
  --display: 'Anvyl', Impact, 'Arial Narrow', sans-serif;
  --rune: 'Satyr', 'Anvyl', Georgia, serif;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --header-h: 84px;
  --cut: 18px;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--bone); font-family: var(--sans); font-size: 16px; line-height: 1.65; overflow-x: clip; -webkit-font-smoothing: antialiased; }
body::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 90; opacity: .05; background-image: url('/assets/ui/paper-grain.svg'); mix-blend-mode: overlay; }
body.menu-open, body.is-intro { overflow: hidden; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2c2925; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: .95; letter-spacing: .01em; text-wrap: balance; }
h1 { font-size: clamp(3rem, 8vw, 7.5rem); }
h2 { font-size: clamp(2.4rem, 5.4vw, 5.2rem); }
h3 { font-size: 1.9rem; }
p { margin-bottom: 1.1rem; }
em { font-style: normal; color: var(--gold); }
kbd { font-family: var(--sans); font-size: .62rem; letter-spacing: .06em; padding: 2px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; color: var(--muted); background: rgba(236, 228, 212, .03); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 4px; }
[hidden] { display: none !important; }
::selection { background: var(--blood); color: var(--bone); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 20px; background: var(--gold); color: var(--bg); padding: 12px 20px; z-index: 200; }
.skip-link:focus { top: 10px; }

/* ---------- primitives ---------- */
.container { width: min(var(--max), calc(100% - 96px)); margin-inline: auto; }
.muted { color: var(--muted); }
.section { position: relative; padding-block: clamp(80px, 11vw, 160px); }
.eyebrow { display: flex; align-items: center; gap: 14px; font-family: var(--rune); font-size: .95rem; letter-spacing: .14em; line-height: 1.4; color: var(--gold); margin-bottom: 1.4rem; }
.eyebrow::before { content: ''; width: 36px; height: 1px; background: linear-gradient(90deg, var(--blood-2), var(--gold)); flex-shrink: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 48px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-heading h2 { margin-bottom: 0; }
.section-heading > p { max-width: 400px; color: var(--muted); margin-bottom: 0; }
.section-heading .text-link { flex-shrink: 0; }

.text-link { display: inline-flex; align-items: center; gap: 8px; color: var(--gold-2); font-size: .82rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; border: 0; padding: 0 0 4px; background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px; transition: background-size .5s var(--ease), color .25s; }
.text-link:hover { color: var(--bone); background-size: 100% 1px; }

.button { position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 52px; padding: 0 30px; border: 0; background: var(--gold); color: #17130c; font-family: var(--display); font-size: 1.05rem; letter-spacing: .08em; overflow: hidden; clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); transition: color .35s, transform .45s var(--ease), box-shadow .45s var(--ease); }
.button::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--blood); transform: translateY(101%); transition: transform .5s var(--ease); }
.button:hover { color: var(--bone); }
.button:hover::before { transform: none; }
.button span { display: inline-block; transition: transform .4s var(--ease); }
.button:hover span { transform: translateX(4px); }
.button-ghost { background: rgba(236, 228, 212, .04); color: var(--bone); box-shadow: inset 0 0 0 1px var(--line-2); }
.button-ghost::before { background: var(--bone); }
.button-ghost:hover { color: var(--bg); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- header ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; background: linear-gradient(90deg, var(--blood), var(--gold-2)); transform: scaleX(var(--scroll, 0)); transform-origin: left; pointer-events: none; }
/* The blur sits on a pseudo-element: backdrop-filter on the header would trap the fixed mobile menu inside it. */
.site-header { position: sticky; top: 0; z-index: 50; transition: transform .5s var(--ease); }
.site-header::before { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(9, 9, 10, .55); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-bottom: 1px solid var(--line); transition: background .4s, opacity .4s; }
.site-header.is-scrolled::before { background: rgba(9, 9, 10, .88); }
.page-home .site-header { margin-bottom: calc(var(--header-h) * -1); }
.page-home .site-header:not(.is-scrolled)::before { opacity: 0; }
.site-header.is-hidden { transform: translateY(-100%); }
.header-inner { position: relative; z-index: 52; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; font-family: var(--display); font-size: 1.35rem; letter-spacing: .1em; line-height: 1; }
.brand img { width: 40px; height: 40px; object-fit: contain; transition: transform .7s var(--ease), filter .4s; }
.brand:hover img { transform: rotate(-12deg) scale(1.1); filter: drop-shadow(0 0 12px var(--gold-glow)); }
.brand span { white-space: nowrap; }
.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav a { position: relative; padding: 10px 16px; font-family: var(--display); font-size: 1rem; letter-spacing: .1em; color: var(--bone-2); transition: color .25s; }
.site-nav a::before { content: ''; position: absolute; left: 50%; bottom: 2px; width: 5px; height: 5px; background: var(--blood-2); transform: translateX(-50%) rotate(45deg) scale(0); transition: transform .4s var(--ease); }
.site-nav a:hover, .site-nav a[aria-current='page'] { color: var(--gold-2); }
.site-nav a:hover::before, .site-nav a[aria-current='page']::before { transform: translateX(-50%) rotate(45deg) scale(1); }
.site-nav .nav-home { display: none; }
.site-nav .nav-cta { margin-left: 12px; padding: 10px 18px; color: var(--bg); background: var(--gold); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); transition: background .3s, color .3s; }
.site-nav .nav-cta::before { display: none; }
.site-nav .nav-cta:hover { background: var(--blood); color: var(--bone); }
.header-tools { display: flex; align-items: center; gap: 8px; }
.search-toggle { display: inline-flex; align-items: center; gap: 10px; height: 42px; background: rgba(236, 228, 212, .04); border: 1px solid var(--line-2); color: var(--muted); padding: 0 12px; font-size: .74rem; transition: border-color .25s, color .25s, background .25s; }
.search-toggle svg { width: 16px; height: 16px; flex-shrink: 0; }
.search-toggle:hover { border-color: var(--gold-dim); color: var(--bone); background: rgba(236, 228, 212, .08); }
.menu-toggle { display: none; align-items: center; gap: 10px; height: 42px; background: none; border: 1px solid var(--line-2); padding: 0 12px; font-family: var(--display); font-size: .9rem; letter-spacing: .1em; }
.menu-icon { position: relative; width: 20px; height: 12px; display: block; }
.menu-icon i { position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: transform .45s var(--ease), opacity .25s, top .45s var(--ease); }
.menu-icon i:nth-child(1) { top: 0; }
.menu-icon i:nth-child(2) { top: 5px; right: 6px; }
.menu-icon i:nth-child(3) { top: 10px; }
.menu-toggle[aria-expanded='true'] .menu-icon i:nth-child(1) { top: 5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded='true'] .menu-icon i:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded='true'] .menu-icon i:nth-child(3) { top: 5px; transform: rotate(-45deg); }

/* ---------- search palette ---------- */
.palette { width: min(700px, calc(100% - 32px)); max-height: min(74vh, 700px); padding: 0; border: 1px solid rgba(212, 168, 90, .4); background: rgba(16, 15, 14, .97); color: var(--bone); box-shadow: 0 60px 140px -30px #000, 0 0 0 1px #000; margin: min(11vh, 110px) auto auto; overflow: hidden; }
.palette[open] { display: flex; flex-direction: column; animation: paletteIn .4s var(--ease) both; }
.palette::backdrop { background: rgba(5, 5, 6, .75); backdrop-filter: blur(8px); animation: fadeIn .3s both; }
.palette-form { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.palette-form svg { width: 20px; height: 20px; color: var(--gold); flex-shrink: 0; }
.palette-input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--bone); font-size: 1.1rem; padding: 6px 0; outline: none; }
.palette-input::placeholder { color: #77726a; }
.palette-input::-webkit-search-cancel-button { display: none; }
.palette-close { background: none; border: 0; padding: 0; }
.palette-results { overflow: auto; padding: 8px; overscroll-behavior: contain; }
.palette-group { font-family: var(--rune); font-size: .8rem; letter-spacing: .14em; color: var(--gold); padding: 14px 12px 6px; margin: 0; }
.palette-item { display: flex; align-items: center; gap: 14px; padding: 10px 12px; color: var(--bone-2); border-left: 2px solid transparent; transition: background .2s, border-color .2s; }
.palette-item[aria-selected='true'], .palette-item:hover { background: rgba(212, 168, 90, .08); border-left-color: var(--blood-2); color: var(--bone); }
.palette-thumb { width: 42px; height: 42px; object-fit: cover; object-position: 50% 12%; background: var(--surface-2); flex-shrink: 0; }
.palette-mark { width: 42px; height: 42px; display: grid; place-items: center; background: var(--surface-2); color: var(--gold); font-family: var(--rune); font-size: 1rem; flex-shrink: 0; }
.palette-text { min-width: 0; flex: 1; }
.palette-title { display: block; font-size: .95rem; line-height: 1.35; }
.palette-sub { display: block; font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-go { font-size: .66rem; color: var(--gold-dim); letter-spacing: .1em; flex-shrink: 0; opacity: 0; transition: opacity .2s; }
.palette-item[aria-selected='true'] .palette-go { opacity: 1; }
.palette-empty { padding: 36px 16px; text-align: center; color: var(--muted); font-size: .9rem; margin: 0; }
.palette-hint { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 12px 22px; border-top: 1px solid var(--line); font-size: .68rem; color: #77726a; }
.palette-hint kbd { margin-right: 4px; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; isolation: isolate; overflow: hidden; background: #050505; }
.hero-media { position: absolute; inset: -4%; z-index: -3; transform: translate3d(var(--px, 0), calc(var(--py, 0px) + var(--hero-shift, 0px)), 0) scale(var(--hero-scale, 1)); will-change: transform; }
.hero-media picture, .hero-image { width: 100%; height: 100%; }
.hero-image { object-fit: cover; object-position: 62% 40%; filter: saturate(.55) contrast(1.12) brightness(.82); animation: heroZoom 2.8s var(--ease) both; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -2; background: radial-gradient(ellipse 70% 60% at 30% 70%, rgba(179, 38, 30, .22), transparent 70%), linear-gradient(90deg, rgba(9, 9, 10, .94) 0%, rgba(9, 9, 10, .6) 45%, rgba(9, 9, 10, .1) 100%); }
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, var(--bg) 2%, transparent 40%), linear-gradient(180deg, rgba(9, 9, 10, .7), transparent 22%); pointer-events: none; }
.embers { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: screen; }
.hero-inner { padding-top: calc(var(--header-h) + 60px); padding-bottom: 40px; }
.hero-kicker { display: flex; align-items: center; gap: 16px; font-family: var(--rune); font-size: 1.05rem; letter-spacing: .16em; color: var(--gold); margin-bottom: 26px; animation: riseIn 1.2s .3s var(--ease) both; }
.hero-kicker::before { content: ''; width: 48px; height: 1px; background: linear-gradient(90deg, var(--blood-2), var(--gold)); }
.hero-title { margin: 0 0 28px; font-size: inherit; line-height: inherit; }
.hero-brand { display: block; font-family: var(--display); font-size: clamp(4rem, 15vw, 15rem); line-height: .82; letter-spacing: .005em; color: var(--bone); text-shadow: 0 10px 60px rgba(0, 0, 0, .6); }
.hero-brand .split-word { display: inline-block; white-space: nowrap; }
.hero-tag { display: block; margin-top: 18px; font-family: var(--display); font-size: clamp(1.5rem, 3.2vw, 3rem); letter-spacing: .04em; color: var(--bone-2); animation: riseIn 1.2s .9s var(--ease) both; }
.hero-tag em { color: var(--gold); text-shadow: 0 0 40px var(--gold-glow); }
.hero-description { max-width: 540px; color: var(--bone-2); font-size: 1.04rem; line-height: 1.8; margin-bottom: 36px; animation: riseIn 1.2s 1.05s var(--ease) both; }
.hero .actions { animation: riseIn 1.2s 1.2s var(--ease) both; }
.hero-foot { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 24px 36px; border-top: 1px solid var(--line); animation: fadeIn 1.4s 1.5s both; }
.hero-news { display: inline-flex; align-items: center; gap: 14px; min-width: 0; color: var(--bone-2); font-size: .86rem; transition: color .25s; }
.hero-news:hover { color: var(--gold-2); }
.hero-news-badge { flex-shrink: 0; font-family: var(--display); font-size: .82rem; letter-spacing: .12em; padding: 5px 10px; background: var(--blood); color: var(--bone); }
.hero-news-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-scroll { display: inline-flex; align-items: center; gap: 14px; flex-shrink: 0; font-family: var(--rune); font-size: .85rem; letter-spacing: .2em; color: var(--muted); transition: color .3s; }
.hero-scroll::after { content: ''; width: 1px; height: 38px; background: linear-gradient(var(--gold-2), transparent); animation: scrollHint 2.2s var(--ease-io) infinite; }
.hero-scroll:hover { color: var(--gold-2); }

.split-char { display: inline-block; animation: charIn 1.3s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms + 350ms); }

/* ---------- marquee band ---------- */
/* The wrapper clips the tilted band so its corners never widen the page. */
.marquee-wrap { position: relative; z-index: 2; overflow: hidden; padding-block: 14px; margin-block: -14px; }
.marquee { position: relative; overflow: hidden; padding-block: 22px; background: var(--blood-deep); border-block: 1px solid rgba(224, 68, 58, .35); transform: rotate(-1.2deg) scale(1.03); }
.marquee-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.marquee-track span { display: flex; align-items: center; gap: 36px; padding-right: 36px; font-family: var(--display); font-size: clamp(1.4rem, 2.6vw, 2.4rem); letter-spacing: .08em; color: var(--bone); white-space: nowrap; }
.marquee-track i { font-style: normal; color: var(--gold); font-family: var(--rune); }

/* ---------- stats ---------- */
.stats-strip { position: relative; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.stats-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat { position: relative; display: flex; flex-direction: column; gap: 10px; padding: clamp(28px, 4vw, 48px) 28px; border-left: 1px solid var(--line); overflow: hidden; transition: background .4s; }
.stat:last-child { border-right: 1px solid var(--line); }
.stat::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--blood), var(--gold)); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.stat:hover { background: var(--surface); }
.stat:hover::after { transform: none; }
.stat-value { font-family: var(--display); font-size: clamp(2.8rem, 5vw, 4.6rem); line-height: .9; color: var(--bone); font-variant-numeric: tabular-nums; }
.stat:hover .stat-value { color: var(--gold-2); }
.stat-label { font-family: var(--rune); font-size: .85rem; letter-spacing: .12em; color: var(--muted); }

/* ---------- saga (trilogy, pinned horizontal) ---------- */
.saga { position: relative; background: var(--bg); }
.saga-sticky { position: relative; overflow: hidden; padding-block: clamp(80px, 9vw, 130px); }
.saga-head { display: flex; justify-content: space-between; align-items: end; gap: 40px; margin-bottom: 44px; }
.saga-head h2 { margin: 0; }
.saga-head-side { display: flex; flex-direction: column; align-items: end; gap: 18px; max-width: 360px; text-align: right; }
.saga-head-side p { color: var(--muted); margin: 0; }
.saga-meter { width: 180px; height: 2px; background: var(--line-2); overflow: hidden; }
.saga-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--blood), var(--gold)); transform: scaleX(var(--saga, 0)); transform-origin: left; }
.saga-track { display: flex; gap: 28px; padding-inline: max(48px, calc((100% - var(--max)) / 2)); will-change: transform; transform: translate3d(var(--saga-x, 0px), 0, 0); }
.saga-track > .load-error, .saga-track > .muted { width: 100%; }
.saga .game-card { position: relative; flex: 0 0 auto; width: min(76vw, 1040px); height: min(68vh, 640px); min-height: 520px; overflow: hidden; background: #000; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.saga .game-media { position: absolute; inset: 0; }
.saga .game-cover { width: 100%; height: 100%; object-fit: cover; object-position: 70% 30%; filter: saturate(.8) brightness(.8); transform: scale(1.06); transition: transform 1.6s var(--ease), filter .8s; }
.saga .game-card:hover .game-cover { transform: scale(1.12); filter: saturate(1) brightness(.92); }
.saga .game-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5, 5, 6, .95) 0%, rgba(5, 5, 6, .7) 38%, transparent 75%), linear-gradient(0deg, rgba(5, 5, 6, .8), transparent 45%); }
.saga .game-index { position: absolute; right: 36px; top: 20px; z-index: 1; font-family: var(--display); font-size: clamp(6rem, 13vw, 12rem); line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(242, 211, 150, .45); }
.saga .game-body { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; max-width: 520px; padding: clamp(28px, 4vw, 56px); }
.saga .game-body h3 { font-size: clamp(2.6rem, 4.6vw, 4.4rem); margin-bottom: 14px; }
.saga .game-body .status { margin-bottom: 20px; }
.saga .game-body .muted { color: var(--bone-2); font-size: .98rem; }
.saga-end { flex: 0 0 auto; width: min(40vw, 420px); min-height: 520px; height: min(68vh, 640px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 24px; padding: 48px; border: 1px solid var(--line-2); background: radial-gradient(ellipse at 30% 30%, rgba(179, 38, 30, .25), transparent 70%), var(--surface); transition: background .5s, border-color .4s; }
.saga-end strong { font-family: var(--display); font-weight: 400; font-size: clamp(2.2rem, 3.4vw, 3.4rem); line-height: .95; }
.saga-end span { font-family: var(--rune); color: var(--gold); letter-spacing: .14em; }
.saga-end:hover { border-color: var(--gold); background: radial-gradient(ellipse at 30% 30%, rgba(179, 38, 30, .45), transparent 70%), var(--surface-2); }
.saga.is-pinned .saga-sticky { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-block: calc(var(--header-h) + 16px) 28px; }
.saga.is-pinned .saga-head { margin-bottom: clamp(18px, 3vh, 36px); }
.saga.is-pinned .saga-head h2 { font-size: clamp(2.2rem, min(5vw, 7vh), 4.6rem); }
.saga.is-pinned .game-card, .saga.is-pinned .saga-end { height: calc(100vh - var(--header-h) - 44px - clamp(150px, 24vh, 230px)); min-height: 340px; max-height: 640px; }

/* ---------- game cards (games page, DLC) ---------- */
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.game-card { position: relative; display: flex; flex-direction: column; min-height: 600px; overflow: hidden; background: #000; isolation: isolate; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); transition: transform .6s var(--ease), opacity .9s var(--ease); }
.game-card::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow .4s; }
.game-card:hover::after { box-shadow: inset 0 0 0 1px var(--gold-dim), inset 0 -120px 120px -60px rgba(179, 38, 30, .35); }
.game-media { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.game-cover { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; filter: saturate(.7) brightness(.85); transition: transform 1.6s var(--ease), filter .8s; }
.game-card:hover .game-cover { transform: scale(1.08); filter: saturate(1) brightness(.95); }
.game-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 5, 6, .15) 0%, rgba(5, 5, 6, .35) 35%, rgba(5, 5, 6, .97) 72%); }
.game-index { position: absolute; top: 18px; left: 22px; z-index: 1; font-family: var(--display); font-size: 3rem; line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(242, 211, 150, .6); }
.game-placeholder { position: relative; display: grid; place-items: center; width: 100%; height: 100%; background: radial-gradient(ellipse at 50% 70%, #4a2420, #0b0b0c 70%); }
.game-monogram { font-family: var(--display); font-size: 6rem; color: rgba(242, 211, 150, .3); }
.game-number { display: none; }
.game-body { position: relative; display: flex; flex-direction: column; flex: 1; justify-content: flex-end; padding: 30px; }
.game-body h3 { font-size: clamp(2rem, 2.6vw, 2.6rem); margin-bottom: 12px; }
.game-body .eyebrow { font-size: .8rem; margin-bottom: 14px; }
.game-body .status { font-size: .8rem; color: var(--gold-2); letter-spacing: .03em; margin-bottom: 18px; }
.game-body .muted { font-size: .9rem; color: var(--bone-2); margin: 18px 0 0; }
.game-body > .text-link { margin-top: 16px; align-self: start; }
.progress-label { display: flex; justify-content: space-between; font-family: var(--rune); font-size: .78rem; letter-spacing: .1em; color: var(--muted); margin-bottom: 8px; }
.progress-track { position: relative; height: 4px; background: rgba(236, 228, 212, .12); overflow: hidden; }
.game-progress { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 4px; border: 0; background: transparent; color: var(--gold); transform-origin: left; transition: transform 1.6s var(--ease) .2s; }
.game-progress::-webkit-progress-bar { background: transparent; }
.game-progress::-webkit-progress-value { background: linear-gradient(90deg, var(--blood), var(--gold-2)); box-shadow: 0 0 12px var(--gold-glow); }
.game-progress::-moz-progress-bar { background: linear-gradient(90deg, var(--blood), var(--gold-2)); }
.game-download { padding-top: 24px; }
.game-download > .button { min-height: 50px; }
.game-download > .button::after { content: '\2193'; font-family: var(--sans); font-size: 1.1rem; transition: transform .4s var(--ease); }
.game-download > .button:hover::after { transform: translateY(3px); }
.download-details { margin: 10px 0 0; font-size: .74rem; color: var(--muted); line-height: 1.6; }
[data-games='all'] > .game-card:first-child { grid-column: span 2; grid-row: span 2; }
[data-games='all'] > .game-card:first-child .game-body { max-width: 560px; }
[data-games='all'] > .game-card:first-child .game-body h3 { font-size: clamp(2.6rem, 4.4vw, 4.4rem); }
.dlc-section .game-card { min-height: 520px; }

/* ---------- realms (interactive map) ---------- */
.realms { position: relative; overflow: hidden; background: radial-gradient(ellipse 60% 70% at 70% 50%, rgba(179, 38, 30, .12), transparent 70%), var(--bg-2); border-block: 1px solid var(--line); }
.realms-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.realm-map { position: relative; aspect-ratio: 1240 / 1080; overflow: hidden; background: #0c0b0a; box-shadow: 0 40px 100px -40px #000, inset 0 0 0 1px var(--line-2); }
.realm-map img { position: absolute; top: 0; left: -29.0323%; width: 154.8387%; height: 100%; max-width: none; object-fit: cover; filter: sepia(.35) saturate(.8) brightness(.85); transition: transform 1.2s var(--ease); transform-origin: var(--fx, 50%) var(--fy, 50%); }
.realm-map.is-focused img { transform: scale(1.18); }
.realm-map::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 120px 30px rgba(9, 9, 10, .85); }
.realm-pin { position: absolute; left: var(--x); top: var(--y); z-index: 2; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0; border: 0; background: none; display: grid; place-items: center; transition: left 1.2s var(--ease), top 1.2s var(--ease); }
.realm-pin::before { content: ''; width: 14px; height: 14px; background: var(--gold); transform: rotate(45deg); box-shadow: 0 0 0 4px rgba(9, 9, 10, .7), 0 0 20px var(--gold-glow); transition: background .3s, transform .4s var(--ease); }
.realm-pin::after { content: ''; position: absolute; inset: 6px; border: 1px solid var(--gold); transform: rotate(45deg); opacity: 0; }
.realm-pin:hover::before { transform: rotate(45deg) scale(1.25); }
.realm-pin[aria-pressed='true']::before { background: var(--blood-2); transform: rotate(45deg) scale(1.3); }
.realm-pin[aria-pressed='true']::after { animation: pinPulse 2s var(--ease) infinite; border-color: var(--blood-2); }
.realm-pin-label { position: absolute; top: calc(100% - 2px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: var(--display); font-size: .82rem; letter-spacing: .08em; color: var(--bone); text-shadow: 0 2px 8px #000, 0 0 2px #000; pointer-events: none; opacity: .85; }
.realm-pin[aria-pressed='true'] .realm-pin-label { color: var(--gold-2); opacity: 1; }
.realm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 32px; }
.realm-chip { padding: 8px 14px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: .78rem; transition: color .25s, border-color .25s, background .25s; }
.realm-chip:hover { color: var(--bone); border-color: var(--gold-dim); }
.realm-chip[aria-pressed='true'] { color: var(--bg); background: var(--gold); border-color: var(--gold); }
.realm-panel { position: relative; min-height: 330px; }
.realm-panel-inner { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 26px; align-items: start; animation: realmIn .7s var(--ease) both; }
.realm-emblem { width: 110px; height: 110px; object-fit: contain; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .7)); animation: emblemIn .9s var(--ease) both; }
.realm-name { font-family: var(--display); font-size: clamp(1.9rem, 3vw, 2.8rem); line-height: .95; margin: 0 0 10px; }
.realm-caption { font-family: var(--rune); letter-spacing: .1em; color: var(--gold); font-size: .9rem; margin-bottom: 18px; }
.realm-text { color: var(--bone-2); font-family: var(--serif); font-size: 1.04rem; line-height: 1.8; margin-bottom: 22px; }

/* ---------- faces (character marquee) ---------- */
.faces { overflow: hidden; }
.faces-rows { display: grid; gap: 18px; margin-top: 8px; }
.faces-row { position: relative; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.faces-track { display: flex; gap: 18px; width: max-content; animation: marquee 70s linear infinite; }
.faces-row:nth-child(2) .faces-track { animation-direction: reverse; animation-duration: 80s; }
.faces-row:hover .faces-track, .faces-row:focus-within .faces-track { animation-play-state: paused; }
.face { position: relative; flex: 0 0 auto; width: 190px; height: 250px; overflow: hidden; background: radial-gradient(ellipse at 50% 85%, #3a1d19, #111 70%); clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); }
.face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 10%; filter: grayscale(.85) contrast(1.05) brightness(.8); transition: filter .6s, transform 1s var(--ease); }
.face::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5, 5, 6, .95), transparent 55%); transition: opacity .4s; }
.face-name { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 1; font-family: var(--display); font-size: 1.05rem; line-height: 1.05; letter-spacing: .04em; }
.face:hover img, .face:focus-visible img { filter: none; transform: scale(1.06); }
.face:hover .face-name { color: var(--gold-2); }

/* ---------- cinema (trailer) ---------- */
.cinema { position: relative; }
.cinema-frame { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; box-shadow: 0 60px 140px -50px #000; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.cinema-frame video { width: 100%; height: 100%; display: block; object-fit: cover; background: #000; }
.cinema-play { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; border: 0; background: radial-gradient(ellipse at center, rgba(9, 9, 10, .2), rgba(9, 9, 10, .75)); color: var(--bone); transition: background .5s; }
.cinema-play-icon { position: relative; width: clamp(84px, 10vw, 124px); aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(242, 211, 150, .6); background: rgba(9, 9, 10, .35); backdrop-filter: blur(6px); transition: transform .6s var(--ease), background .4s, border-color .4s; }
.cinema-play-icon::before { content: ''; margin-left: 6%; border-style: solid; border-width: 14px 0 14px 24px; border-color: transparent transparent transparent var(--gold-2); }
.cinema-play-icon::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 1px solid rgba(242, 211, 150, .25); animation: ring 2.4s var(--ease) infinite; }
.cinema-play-label { font-family: var(--display); font-size: 1.2rem; letter-spacing: .14em; }
.cinema-play:hover { background: radial-gradient(ellipse at center, rgba(179, 38, 30, .25), rgba(9, 9, 10, .7)); }
.cinema-play:hover .cinema-play-icon { transform: scale(1.1); background: var(--blood); border-color: var(--blood-2); }
.cinema-play:hover .cinema-play-icon::before { border-left-color: var(--bone); }
.cinema-frame.is-playing .cinema-play { display: none; }

/* ---------- library (books teaser) ---------- */
.library-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 100px); align-items: center; }
.library-copy p { color: var(--muted); max-width: 460px; }
.library-books { display: flex; justify-content: center; gap: clamp(24px, 4vw, 56px); perspective: 1600px; padding-block: 20px; }
.book3d { position: relative; width: clamp(150px, 16vw, 230px); aspect-ratio: 2 / 3; transform-style: preserve-3d; transform: rotateY(-24deg) rotateX(4deg); transition: transform .9s var(--ease); }
.book3d:nth-child(2) { transform: rotateY(-24deg) rotateX(4deg) translateY(40px); }
.book3d:hover { transform: rotateY(-6deg) rotateX(0) translateY(-10px); }
.book3d-cover { position: absolute; inset: 0; overflow: hidden; background: #000; box-shadow: 20px 30px 60px -10px rgba(0, 0, 0, .8); transform: translateZ(14px); }
.book3d-cover img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; filter: saturate(.8); }
.book3d-cover::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(0, 0, 0, .55) 0, rgba(255, 255, 255, .12) 3%, transparent 9%), linear-gradient(0deg, rgba(5, 5, 6, .92), transparent 55%); }
.book3d-title { position: absolute; left: 18px; right: 14px; bottom: 16px; z-index: 2; font-family: var(--display); font-size: clamp(1.1rem, 1.6vw, 1.5rem); line-height: 1; }
.book3d-num { position: absolute; top: 14px; right: 14px; z-index: 2; font-family: var(--rune); color: var(--gold-2); letter-spacing: .1em; }
.book3d::before { content: ''; position: absolute; top: 3px; bottom: 3px; right: -1px; width: 26px; background: repeating-linear-gradient(90deg, #e8dfcc 0 1px, #c9bea6 1px 2px); transform: rotateY(90deg) translateZ(1px) translateX(13px); transform-origin: right; }
.book3d::after { content: ''; position: absolute; left: 10%; right: -10%; bottom: -26px; height: 30px; background: radial-gradient(ellipse, rgba(0, 0, 0, .7), transparent 70%); transform: translateZ(-10px); }

/* ---------- chronicle (latest news) ---------- */
.chronicle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.chronicle-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: clamp(26px, 3vw, 40px); background: var(--surface); border-top: 2px solid var(--blood); overflow: hidden; transition: background .4s, transform .6s var(--ease), opacity .9s var(--ease); }
.chronicle-card::after { content: '→'; position: absolute; right: 28px; bottom: 22px; font-size: 1.4rem; color: var(--gold); transition: transform .5s var(--ease); }
.chronicle-card:hover { background: var(--surface-2); }
.chronicle-card:hover::after { transform: translateX(6px); }
.chronicle-meta { display: flex; flex-wrap: wrap; gap: 10px 16px; font-family: var(--rune); font-size: .82rem; letter-spacing: .1em; color: var(--gold); }
.chronicle-card h3 { font-size: clamp(1.6rem, 2.4vw, 2.3rem); margin: 0; line-height: 1; }
.chronicle-card p { color: var(--muted); margin: 0; padding-right: 40px; font-size: .92rem; }

/* ---------- help ---------- */
.help-section { position: relative; overflow: hidden; background: var(--bg-2); border-top: 1px solid var(--line); }
.help-section::before { content: ''; position: absolute; width: 900px; height: 900px; right: -300px; top: -300px; background: radial-gradient(circle, rgba(179, 38, 30, .14), transparent 60%); pointer-events: none; }
.help-grid { position: relative; display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line-2); }
.help-card { position: relative; display: grid; grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1.2fr) auto; align-items: center; gap: 28px; padding: 26px 18px; border-bottom: 1px solid var(--line-2); overflow: hidden; isolation: isolate; transition: padding .5s var(--ease), opacity .9s var(--ease), transform .9s var(--ease); }
.help-card::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--blood-deep), rgba(179, 38, 30, .35) 60%, transparent); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.help-card:hover { padding-left: 32px; }
.help-card:hover::before { transform: none; }
.help-symbol { font-family: var(--rune); font-size: 1.6rem; color: var(--gold-dim); transition: color .3s; }
.help-card:hover .help-symbol { color: var(--gold-2); }
.help-card h3 { font-size: clamp(1.6rem, 2.6vw, 2.4rem); margin: 0; }
.help-card .muted { margin: 0; font-size: .92rem; }
.help-card .text-link { justify-self: end; white-space: nowrap; }

/* ---------- section dots ---------- */
.section-dots { position: fixed; right: 26px; top: 50%; z-index: 40; display: flex; flex-direction: column; gap: 14px; transform: translateY(-50%); opacity: 0; pointer-events: none; transition: opacity .5s; }
.section-dots.is-visible { opacity: 1; pointer-events: auto; }
.section-dot { position: relative; display: block; width: 10px; height: 10px; border: 1px solid var(--gold-dim); transform: rotate(45deg); transition: background .3s, border-color .3s, transform .4s var(--ease); }
.section-dot:hover, .section-dot[aria-current='true'] { background: var(--gold); border-color: var(--gold); transform: rotate(45deg) scale(1.2); }
.section-dot span { position: absolute; right: 22px; top: 50%; transform: rotate(-45deg) translate(6px, -50%); transform-origin: right center; white-space: nowrap; font-family: var(--display); font-size: .8rem; letter-spacing: .1em; color: var(--bone); opacity: 0; pointer-events: none; transition: opacity .3s; }
.section-dot:hover span, .section-dot:focus-visible span { opacity: 1; }

/* ---------- inner pages ---------- */
.page-intro { position: relative; isolation: isolate; overflow: hidden; padding-block: clamp(70px, 9vw, 130px) clamp(50px, 6vw, 80px); border-bottom: 1px solid var(--line); background: #070707; }
.page-intro::before { content: ''; position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center 30%; filter: saturate(.5) brightness(.45); transform: scale(1.06); animation: heroZoom 2.4s var(--ease) both; }
.page-intro::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(9, 9, 10, .95), rgba(9, 9, 10, .55) 60%, rgba(9, 9, 10, .3)), linear-gradient(0deg, var(--bg), transparent 60%), radial-gradient(ellipse at 20% 100%, rgba(179, 38, 30, .25), transparent 60%); }
.page-intro[data-art='games']::before { background-image: url('/assets/store/07_ch3_march_to_ungo.webp'); }
.page-intro[data-art='books']::before { background-image: url('/assets/games/legacy-v2.webp'); }
.page-intro[data-art='news']::before { background-image: url('/assets/store/camp.webp'); }
.page-intro[data-art='wiki']::before { background-image: url('/assets/backgrounds/world-map.webp'); }
.page-intro .container { position: relative; }
.page-intro-glyph { position: absolute; right: 0; bottom: -0.15em; font-family: var(--display); font-size: clamp(9rem, 24vw, 22rem); line-height: .8; color: transparent; -webkit-text-stroke: 1px rgba(242, 211, 150, .22); pointer-events: none; user-select: none; }
.page-intro h1 { max-width: 980px; margin-bottom: 26px; animation: riseIn 1.1s .15s var(--ease) both; }
.page-intro .eyebrow { animation: riseIn 1.1s .05s var(--ease) both; }
.page-intro .lead { max-width: 640px; font-size: 1.06rem; color: var(--bone-2); animation: riseIn 1.1s .3s var(--ease) both; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-family: var(--rune); font-size: .82rem; letter-spacing: .12em; color: var(--muted); margin-bottom: 30px; }
.crumbs a { transition: color .25s; }
.crumbs a:hover { color: var(--gold-2); }
.crumbs .crumb-sep { color: var(--blood-2); }
.crumbs [aria-current] { color: var(--gold); }
.games-section { padding-top: clamp(56px, 6vw, 90px); }
.border-section { border-top: 1px solid var(--line); }

/* ---------- wiki ---------- */
.spoiler-note { font-size: .82rem; color: #e1d3b0; display: flex; gap: 12px; align-items: start; }
.spoiler-note::before { content: '✧'; color: var(--gold); flex-shrink: 0; }
.wiki-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 50px; padding-block: 50px 120px; align-items: start; }
.wiki-sidebar { position: sticky; top: calc(var(--header-h) + 16px); }
.wiki-search-label { display: block; font-family: var(--rune); font-size: .85rem; letter-spacing: .12em; margin-bottom: 10px; color: var(--gold); }
.wiki-search { width: 100%; border: 1px solid var(--line-2); background: var(--surface); color: var(--bone); padding: 14px; border-radius: 0; font-size: .85rem; transition: border-color .25s, box-shadow .3s; }
.wiki-search::placeholder { color: #807a70; }
.wiki-search:focus { outline: none; border-color: var(--gold-dim); box-shadow: 0 0 0 3px rgba(212, 168, 90, .15); }
.wiki-search:disabled { opacity: .5; }
.wiki-filters { display: flex; flex-direction: column; gap: 2px; margin-top: 26px; }
.filter-button { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; color: var(--muted); border: 0; border-left: 2px solid transparent; text-align: left; font-family: var(--display); font-size: 1rem; letter-spacing: .06em; background: transparent; line-height: 1.2; transition: color .25s, background .25s, border-color .25s, padding-left .35s var(--ease); }
.filter-button:hover { color: var(--bone); background: var(--surface); padding-left: 18px; }
.filter-button[aria-pressed='true'] { color: var(--gold-2); background: linear-gradient(90deg, rgba(179, 38, 30, .18), transparent); border-left-color: var(--blood-2); }
.filter-count { font-family: var(--sans); font-size: .66rem; min-width: 28px; text-align: center; padding: 2px 7px; background: rgba(236, 228, 212, .06); color: var(--muted); }
.filter-button[aria-pressed='true'] .filter-count { background: var(--gold); color: var(--bg); }
.sidebar-note { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 22px; color: var(--muted); font-size: .74rem; line-height: 1.7; }
.wiki-count { min-height: 24px; font-family: var(--rune); color: var(--gold); font-size: .85rem; letter-spacing: .1em; margin-bottom: 22px; }
.wiki-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; outline: none; }
.wiki-card { position: relative; display: flex; flex-direction: column; min-height: 260px; overflow: hidden; background: var(--surface); isolation: isolate; clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); transition: background .4s, transform .6s var(--ease), opacity .9s var(--ease); }
.wiki-card::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--blood), var(--gold)); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.wiki-card:hover { background: var(--surface-2); }
.wiki-card:hover::after { transform: none; }
.wiki-card-body { position: relative; z-index: 1; display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.wiki-card .eyebrow { font-size: .74rem; margin-bottom: 12px; }
.wiki-card .eyebrow::before { width: 18px; }
.wiki-card h2 { font-size: 1.65rem; line-height: 1; margin-bottom: 12px; overflow-wrap: anywhere; }
.wiki-card:hover h2 { color: var(--gold-2); }
.wiki-card .muted { font-size: .84rem; line-height: 1.65; }
.wiki-card .text-link { font-size: .7rem; padding-top: 10px; margin-top: auto; align-self: start; }
.wiki-card-portrait { width: 100%; height: 240px; object-fit: cover; object-position: 50% 8%; background: radial-gradient(ellipse at 50% 90%, #3a1d19, #0d0d0e 75%); filter: grayscale(.4) brightness(.9); transition: transform 1.2s var(--ease), filter .6s; }
.wiki-card-portrait[src*='/factions/'], .wiki-card-portrait[src*='world-map'] { object-fit: contain; padding: 22px; }
.wiki-card:hover .wiki-card-portrait { transform: scale(1.05); filter: none; }
.empty-state, .load-error { grid-column: 1 / -1; padding: 30px; border: 1px solid var(--line-2); color: var(--muted); font-size: .92rem; }
.wiki-article { outline: none; scroll-margin-top: calc(var(--header-h) + 16px); }
.back-link { margin-bottom: 34px; }
.article-header { position: relative; display: flex; align-items: center; gap: 34px; padding-bottom: 36px; margin-bottom: 36px; border-bottom: 1px solid var(--line-2); }
.article-header::after { content: ''; position: absolute; left: 0; bottom: -1px; width: 120px; height: 2px; background: linear-gradient(90deg, var(--blood), var(--gold)); }
.article-header h1 { font-size: clamp(2.4rem, 5vw, 4.6rem); margin-bottom: 20px; overflow-wrap: anywhere; }
.article-portrait { width: 150px; height: 210px; object-fit: contain; flex-shrink: 0; background: var(--surface); }
.article-lead { font-family: var(--serif); font-size: 1.12rem; color: var(--bone-2); line-height: 1.8; margin: 0; }
.article-prose { max-width: 820px; font-family: var(--serif); font-size: 1.14rem; line-height: 1.9; color: #d9d1c0; overflow-wrap: anywhere; }
.article-prose p { white-space: pre-line; margin-bottom: 1.35em; }
.article-prose h2 { font-size: clamp(1.8rem, 2.6vw, 2.4rem); color: var(--bone); margin: 2.4rem 0 1.1rem; line-height: 1; }
.article-prose ul { padding-left: 1.3em; }
.article-prose li { padding-left: .35em; margin-bottom: .7em; }
.article-prose li::marker { color: var(--blood-2); }
.article-prose blockquote { margin: 1.8rem 0; border-left: 2px solid var(--blood-2); padding: 8px 0 8px 26px; color: var(--gold-2); font-style: italic; white-space: pre-line; }
.spoiler-section { margin: 26px 0; border: 1px solid rgba(179, 38, 30, .35); background: linear-gradient(180deg, rgba(74, 15, 13, .25), transparent); }
.spoiler-section[open] { border-color: rgba(224, 68, 58, .5); }
.spoiler-section > summary { display: flex; align-items: center; gap: 14px; list-style: none; padding: 20px 24px; font-family: var(--display); font-size: 1.15rem; letter-spacing: .06em; color: var(--gold-2); cursor: pointer; transition: background .25s; }
.spoiler-section > summary::-webkit-details-marker { display: none; }
.spoiler-section > summary::before { content: '✦'; font-family: var(--sans); color: var(--blood-2); font-size: .9rem; }
.spoiler-section > summary::after { content: ''; margin-left: auto; width: 9px; height: 9px; border-right: 1px solid var(--gold); border-bottom: 1px solid var(--gold); transform: rotate(45deg); transition: transform .45s var(--ease); }
.spoiler-section[open] > summary::after { transform: rotate(-135deg); }
.spoiler-section > summary:hover { background: rgba(179, 38, 30, .12); }
.spoiler-body { padding: 0 26px 14px; }
.spoiler-section[open] > .spoiler-body { animation: fadeUp .55s var(--ease) both; }
.spoiler-body > p:first-child, .spoiler-body > ul:first-child, .spoiler-body > blockquote:first-child { margin-top: 24px; }
.spoiler-body > h2:first-child { margin-top: 26px; }
.article-contents { padding: 16px 22px; border: 1px solid var(--line-2); margin-bottom: 30px; font-size: .84rem; }
.article-contents summary { cursor: pointer; font-family: var(--display); letter-spacing: .06em; color: var(--gold-2); }
.article-contents p { margin: 14px 0 0; }
.related-articles { margin-top: 50px; border-top: 1px solid var(--line-2); padding-top: 32px; }
.related-articles h2 { font-size: 2.2rem; }
.related-links { display: flex; gap: 10px; flex-wrap: wrap; }
.related-link { font-size: .82rem; color: var(--bone-2); border: 1px solid var(--line-2); padding: 10px 15px; transition: border-color .25s, background .25s, color .25s, transform .4s var(--ease); }
.related-link:hover { border-color: var(--gold); color: var(--gold-2); background: rgba(212, 168, 90, .06); transform: translateY(-2px); }
.character-appearance { width: 250px; max-width: 100%; margin: 0; flex-shrink: 0; }
.character-appearance .article-portrait { width: 250px; height: 370px; max-width: 100%; object-fit: contain; background: radial-gradient(ellipse at 50% 85%, #3a1d19, var(--surface) 70%); transition: transform .7s var(--ease), box-shadow .7s var(--ease); }
.appearance-link { display: block; }
.appearance-link:hover .article-portrait { transform: translateY(-5px); box-shadow: 0 30px 60px -30px #000, 0 0 0 1px var(--gold-dim); }
.appearance-caption { font-size: .7rem; line-height: 1.6; color: var(--muted); padding-top: 12px; overflow-wrap: anywhere; }
.appearance-caption > span { display: block; }
.appearance-hint { color: var(--gold); margin-top: 6px; }
.article-header-character { align-items: flex-start; }
.article-header-character > div { min-width: 0; }
.spoiler-controls { display: flex; flex-wrap: wrap; gap: 12px 22px; padding: 18px 0; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.spoiler-controls .text-link { font-size: .72rem; line-height: 1.6; text-align: left; }
.spoiler-chapter { border-bottom: 1px solid var(--line); }
.spoiler-chapter:last-child { border-bottom: 0; }
.spoiler-chapter > summary { padding: 18px 0; color: var(--bone); font-family: var(--display); font-size: 1.3rem; letter-spacing: .03em; line-height: 1.2; cursor: pointer; transition: color .25s, padding-left .35s var(--ease); }
.spoiler-chapter > summary:hover { color: var(--gold-2); padding-left: 8px; }
.spoiler-chapter[open] > summary { color: var(--gold-2); }
.spoiler-chapter-body { padding: 0 0 8px 18px; border-left: 1px solid rgba(224, 68, 58, .35); margin-bottom: 18px; }
.spoiler-chapter[open] > .spoiler-chapter-body { animation: fadeUp .45s var(--ease) both; }
.spoiler-chapter-body > p:first-child, .spoiler-chapter-body > ul:first-child { margin-top: 0; }
.spoiler-chapter-body > :last-child { margin-bottom: 0; }

/* ---------- news ---------- */
.news-section { padding-top: clamp(56px, 6vw, 90px); }
.news-feed { position: relative; display: grid; gap: 40px; max-width: 1040px; padding-left: 48px; }
.news-feed::before { content: ''; position: absolute; left: 10px; top: 10px; bottom: 0; width: 1px; background: linear-gradient(var(--blood-2), var(--line-2) 40%, transparent); }
.news-card { position: relative; background: var(--surface); padding: clamp(26px, 4vw, 52px); overflow-wrap: anywhere; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); transition: background .4s, transform .6s var(--ease), opacity .9s var(--ease); }
.news-card:hover { background: var(--surface-2); }
.news-item { position: relative; }
.news-feed > .news-card::before { content: none; }
.news-card .news-dot { position: absolute; }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 22px; font-family: var(--rune); font-size: .86rem; letter-spacing: .1em; color: var(--muted); }
.news-version { color: var(--gold-2); padding: 3px 10px; border: 1px solid rgba(212, 168, 90, .4); }
.news-card h2 { font-size: clamp(2rem, 3.4vw, 3.2rem); margin-bottom: 20px; }
.news-summary { font-family: var(--serif); font-size: 1.08rem; color: var(--bone-2); max-width: 800px; }
.news-card h3 { font-size: 1.5rem; color: var(--gold-2); margin: 32px 0 14px; }
.news-changes { padding-left: 22px; margin: 0; color: var(--muted); font-size: .95rem; }
.news-changes li { padding-left: 4px; margin-bottom: 12px; }
.news-changes li::marker { color: var(--blood-2); }
.news-actions { align-items: center; margin-top: 32px; gap: 22px; }
.news-card > .download-details { margin-top: 14px; }
.news-feed::after { content: ''; }

/* ---------- footer ---------- */
.site-footer { position: relative; overflow: hidden; padding-block: 90px 34px; background: #060606; border-top: 1px solid var(--line); }
.site-footer::before { content: ''; position: absolute; left: 50%; top: -1px; width: 70%; height: 1px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, var(--blood-2), var(--gold), var(--blood-2), transparent); }
.footer-giant { display: block; margin: 0 0 60px; font-family: var(--display); font-size: clamp(3.4rem, 13.5vw, 14rem); line-height: .8; letter-spacing: .01em; white-space: nowrap; color: transparent; -webkit-text-stroke: 1px rgba(236, 228, 212, .14); transition: -webkit-text-stroke-color .6s; user-select: none; }
.site-footer:hover .footer-giant { -webkit-text-stroke-color: rgba(212, 168, 90, .35); }
.footer-inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; align-items: start; }
.footer-brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--display); font-size: 1.3rem; letter-spacing: .1em; }
.footer-brand img { width: 36px; height: 36px; object-fit: contain; }
.footer-note { font-size: .82rem; color: var(--muted); margin: 16px 0 0; max-width: 380px; line-height: 1.8; }
.footer-col h4 { font-family: var(--rune); font-weight: 400; font-size: .9rem; letter-spacing: .14em; color: var(--gold); margin: 6px 0 20px; }
.footer-links, .footer-wiki-links { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; font-size: .88rem; color: var(--bone-2); }
.footer-links a, .footer-wiki-links a { transition: color .25s, transform .4s var(--ease); }
.footer-links a:hover, .footer-wiki-links a:hover { color: var(--gold-2); transform: translateX(6px); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--line); font-size: .72rem; letter-spacing: .06em; color: #6f6a62; }
.footer-bottom a:hover { color: var(--gold-2); }
.redirect-page { position: relative; min-height: 78vh; display: grid; align-content: center; padding-block: 80px; overflow: hidden; }
.redirect-page::before { content: attr(data-glyph); position: absolute; right: -1%; top: 50%; transform: translateY(-50%); font-family: var(--display); font-size: clamp(10rem, 30vw, 30rem); line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(224, 68, 58, .3); pointer-events: none; user-select: none; }
.redirect-page > * { position: relative; }
.redirect-page h1 { max-width: 900px; }
.noscript-note { padding: 18px; background: var(--blood-deep); color: var(--bone); text-align: center; font-size: .88rem; }

/* ---------- overlays: back to top, cursor, intro ---------- */
.to-top { position: fixed; right: 24px; bottom: 24px; z-index: 45; width: 50px; height: 50px; border: 1px solid var(--gold-dim); background: rgba(9, 9, 10, .85); color: var(--gold-2); display: grid; place-items: center; opacity: 0; transform: translateY(16px); pointer-events: none; backdrop-filter: blur(8px); clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); transition: opacity .35s, transform .5s var(--ease), background .25s, color .25s; }
.to-top svg { width: 18px; height: 18px; }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--blood); color: var(--bone); }
.cursor-ring { position: fixed; left: 0; top: 0; z-index: 150; width: 36px; height: 36px; margin: -18px 0 0 -18px; border: 1px solid rgba(242, 211, 150, .55); border-radius: 50%; pointer-events: none; transform: translate3d(var(--cx, -100px), var(--cy, -100px), 0) scale(var(--cs, 1)); transition: transform .18s var(--ease), border-color .3s, background .3s, opacity .3s; mix-blend-mode: difference; }
.cursor-ring.is-active { --cs: 1.8; border-color: var(--gold-2); background: rgba(242, 211, 150, .12); }
.cursor-ring.is-hidden { opacity: 0; }
.intro-curtain { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: #050505; animation: curtainUp 1s 1.9s var(--ease-io) forwards; }
.intro-curtain::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: linear-gradient(90deg, transparent, var(--blood-2), var(--gold), var(--blood-2), transparent); transform: scaleX(0); animation: lineGrow 1.2s .2s var(--ease) forwards; }
.intro-stack { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.intro-stack img { width: 84px; height: 84px; opacity: 0; animation: emblemIn 1s .1s var(--ease) forwards; filter: drop-shadow(0 0 24px rgba(224, 68, 58, .5)); }
.intro-word { font-family: var(--display); font-size: clamp(2.4rem, 7vw, 5rem); letter-spacing: .18em; line-height: 1; color: var(--bone); clip-path: inset(0 100% 0 0); animation: wipeIn 1.1s .5s var(--ease) forwards; }
.intro-sub { font-family: var(--rune); letter-spacing: .3em; color: var(--gold); font-size: .95rem; opacity: 0; animation: fadeIn .8s 1s forwards; }

/* ---------- motion ---------- */
@keyframes heroZoom { from { transform: scale(1.18); filter: saturate(.55) contrast(1.12) brightness(.3); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: none; } }
@keyframes charIn { from { opacity: 0; transform: translateY(.55em) rotate(6deg); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes scrollHint { 0% { transform: scaleY(0); transform-origin: top; } 48% { transform: scaleY(1); transform-origin: top; } 52% { transform: scaleY(1); transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes paletteIn { from { opacity: 0; transform: translateY(-16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes pinPulse { 0% { opacity: .9; transform: rotate(45deg) scale(1); } 100% { opacity: 0; transform: rotate(45deg) scale(2.4); } }
@keyframes ring { 0% { opacity: .8; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes realmIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes emblemIn { from { opacity: 0; transform: scale(.7) rotate(-10deg); } to { opacity: 1; transform: none; } }
@keyframes curtainUp { to { transform: translateY(-100%); visibility: hidden; } }
@keyframes lineGrow { to { transform: scaleX(1); } }
@keyframes wipeIn { to { clip-path: inset(0 0 0 0); } }
@keyframes menuIn { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes vtOut { to { opacity: 0; transform: scale(.97); } }
@keyframes vtIn { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }

body.is-intro .hero *, body.is-intro .hero-foot { animation-play-state: paused !important; }
[data-reveal] { transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0ms); }
@media (prefers-reduced-motion: no-preference) {
  html.js [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(40px); }
  html.js .game-card:not(.is-in) .game-progress { transform: scaleX(0); }
}
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: vtOut .35s var(--ease-io) both; }
::view-transition-new(root) { animation: vtIn .7s var(--ease) both; }
#wiki-article { view-transition-name: wiki-article; }
#wiki-results { view-transition-name: wiki-results; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .container { width: calc(100% - 64px); }
  .site-nav a { padding-inline: 11px; font-size: .92rem; }
  .search-toggle kbd { display: none; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [data-games='all'] > .game-card:first-child { grid-column: auto; grid-row: auto; }
  .wiki-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wiki-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 32px; }
  .help-card { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.2fr); }
  .help-card .text-link { grid-column: 2 / -1; justify-self: start; }
  .section-dots { display: none; }
}
@media (max-width: 960px) {
  :root { --header-h: 72px; }
  .menu-toggle { display: inline-flex; }
  .search-toggle span { display: none; }
  .site-nav { display: none; position: fixed; inset: 0; z-index: 51; padding: calc(var(--header-h) + 30px) 28px 40px; background: radial-gradient(ellipse at 80% 0%, rgba(179, 38, 30, .3), transparent 55%), #070707; flex-direction: column; align-items: stretch; justify-content: center; gap: 0; overflow: auto; }
  .site-nav.is-open { display: flex; animation: menuIn .55s var(--ease) both; }
  .brand, .header-tools { position: relative; z-index: 53; }
  .site-nav a { font-size: clamp(2.6rem, 11vw, 4rem); line-height: 1; padding: 14px 0; border-bottom: 1px solid var(--line); animation: riseIn .7s var(--ease) both; }
  .site-nav a::before { left: auto; right: 6px; bottom: 50%; transform: translateY(50%) rotate(45deg) scale(0); }
  .site-nav a[aria-current='page']::before { transform: translateY(50%) rotate(45deg) scale(1.6); }
  .site-nav a:nth-child(1) { animation-delay: .08s; }
  .site-nav a:nth-child(2) { animation-delay: .13s; }
  .site-nav a:nth-child(3) { animation-delay: .18s; }
  .site-nav a:nth-child(4) { animation-delay: .23s; }
  .site-nav a:nth-child(5) { animation-delay: .28s; }
  .site-nav a:nth-child(6) { animation-delay: .33s; }
  .site-nav .nav-home { display: block; }
  .site-nav .nav-cta { margin: 30px 0 0; padding: 18px 20px; font-size: 1.3rem; text-align: center; border: 0; }
  .realms-layout, .library-layout { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat { border-bottom: 1px solid var(--line); }
  .stat:last-child { border-right: 0; }
  .saga-head { flex-direction: column; align-items: start; }
  .saga-head-side { align-items: start; text-align: left; }
  .saga-track { flex-direction: column; padding-inline: 32px; transform: none; }
  .saga .game-card, .saga-end { width: 100%; height: auto; min-height: 560px; }
  .saga-end { min-height: 260px; }
  .wiki-layout { grid-template-columns: 1fr; padding-top: 30px; gap: 26px; }
  .wiki-sidebar { position: static; }
  .wiki-filters { flex-direction: row; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
  .filter-button { border: 1px solid var(--line-2); padding: 9px 12px; font-size: .9rem; gap: 10px; }
  .filter-button:hover { padding-left: 12px; }
  .filter-button[aria-pressed='true'] { border-color: var(--blood-2); }
  .sidebar-note { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-inner > :first-child { grid-column: 1 / -1; }
  .chronicle-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .container { width: calc(100% - 36px); }
  .brand { font-size: 1.15rem; gap: 10px; }
  .brand img { width: 34px; height: 34px; }
  .menu-toggle .menu-label { display: none; }
  .hero-inner { padding-top: calc(var(--header-h) + 40px); }
  .hero-brand { font-size: clamp(3.4rem, 19vw, 6rem); }
  .hero::before { background: radial-gradient(ellipse at 30% 80%, rgba(179, 38, 30, .25), transparent 70%), linear-gradient(90deg, rgba(9, 9, 10, .9), rgba(9, 9, 10, .55)); }
  .hero-description { font-size: .95rem; }
  .hero-foot { flex-direction: column; align-items: flex-start; }
  .hero-scroll { display: none; }
  .actions .button { flex: 1 1 auto; padding-inline: 20px; }
  .section-heading { display: block; }
  .section-heading > p, .section-heading > .text-link { margin-top: 20px; }
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 22px 18px; }
  .stat:last-child { grid-column: 1 / -1; }
  .saga-track { padding-inline: 18px; gap: 18px; }
  .saga .game-card { min-height: 540px; }
  .saga .game-media::after { background: linear-gradient(0deg, rgba(5, 5, 6, .97) 30%, rgba(5, 5, 6, .3) 75%, transparent); }
  .saga .game-index { font-size: 5rem; right: 18px; }
  .game-grid { grid-template-columns: 1fr; gap: 18px; }
  [data-games='all'] > .game-card:first-child { grid-column: auto; }
  .game-card { min-height: 540px; }
  .game-body { padding: 24px; }
  .realm-panel-inner { grid-template-columns: 1fr; gap: 16px; }
  .realm-emblem { width: 84px; height: 84px; }
  .realm-pin-label { display: none; }
  .face { width: 150px; height: 200px; }
  .book3d { width: 42vw; }
  .help-card { grid-template-columns: 1fr; gap: 10px; padding: 24px 6px; }
  .help-card:hover { padding-left: 14px; }
  .help-card .text-link { grid-column: auto; }
  .wiki-results { grid-template-columns: 1fr; }
  .article-header { flex-direction: column; align-items: start; gap: 24px; }
  .article-portrait { width: 120px; height: 165px; }
  .article-prose { font-size: 1.06rem; }
  .character-appearance { width: min(250px, 100%); align-self: center; }
  .character-appearance .article-portrait { width: 250px; height: 340px; }
  .spoiler-section > summary { padding: 16px; font-size: 1rem; }
  .spoiler-body { padding-inline: 16px; }
  .spoiler-chapter-body { padding-left: 12px; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-giant { margin-bottom: 40px; }
  .news-feed { padding-left: 0; }
  .news-feed::before { display: none; }
  .news-actions .button { width: 100%; }
  .to-top { right: 14px; bottom: 14px; width: 44px; height: 44px; }
  .palette { margin-top: 14px; max-height: calc(100vh - 28px); }
  .palette-hint { display: none; }
  .marquee { transform: none; margin-block: 0; }
}
@media (hover: none) { .cursor-ring { display: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .hero-media { transform: none; }
  .marquee-track, .faces-track { width: auto; }
  .faces-row { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .intro-curtain, .cursor-ring { display: none; }
}
