/* Hallmark · route: custom (bespoke) · structure: full-bleed photographic fold → report ticker → dossier → relics → ritual → hunt → book of souls → statement footer
 * idea: "the whole site is a leaked Undead-Hunters report; souls are the single currency for cards, burns and giveaways"
 * paper: oklch(12% 0.012 160) · accent: oklch(80% 0.13 85) gold · signal: oklch(82% 0.22 152) necrotic green
 * display: Cormorant Garamond (roman) · body: Geist · outlier: JetBrains Mono (report labels + figures)
 * axes: dark / classical-serif / warm-gold (+ chromatic-green signal) · gates: all-pass · studied: no · context: inferred
 * Hallmark · pre-emit critique: P5 H4 E4 S5 R4 V5
 */

:root {
  /* paper & ink — tinted toward the throne-room green-black, never pure */
  --color-paper:    oklch(12% 0.012 160);
  --color-paper-2:  oklch(15% 0.014 160);
  --color-paper-3:  oklch(20% 0.016 160);
  --color-paper-4:  oklch(26% 0.018 150);
  --color-ink:      oklch(92% 0.016 85);
  --color-ink-2:    oklch(74% 0.016 85);
  --color-ink-3:    oklch(54% 0.014 95);
  --color-line:     oklch(30% 0.020 120);
  --color-line-2:   oklch(40% 0.030 100);

  /* accent — old gold, the metal of her crown */
  --color-gold:     oklch(80% 0.130 85);
  --color-gold-2:   oklch(64% 0.120 78);
  --color-gold-3:   oklch(40% 0.080 75);
  --color-gold-ink: oklch(14% 0.020 85);

  /* signal — necrotic green, used only for souls / life / live data */
  --color-soul:     oklch(82% 0.220 152);
  --color-soul-2:   oklch(60% 0.180 152);
  --color-soul-3:   oklch(30% 0.080 152);
  --color-danger:   oklch(66% 0.190 25);
  --color-focus:    var(--color-soul);

  /* achievement rarities */
  --r-common:    oklch(62% 0.010 250);  /* Shade      grey   */
  --r-rare:      oklch(72% 0.170 145);  /* Mist       green  */
  --r-epic:      oklch(66% 0.150 252);  /* Rot        blue   */
  --r-legendary: oklch(66% 0.200 305);  /* Soulfire   purple */
  --r-mythic:    oklch(74% 0.170 350);  /* Radiance   pink   */
  --r-unique:    oklch(85% 0.140 88);   /* Eternity   gold + glow */

  /* holographic foil stops (relic cards only) */
  --holo-a: oklch(85% 0.14 85 / 0.55);
  --holo-b: oklch(85% 0.20 152 / 0.45);
  --holo-c: oklch(80% 0.10 320 / 0.35);
  --holo-white: oklch(98% 0.01 90 / 0.35);

  --font-display: "Cormorant Garamond", "Cormorant", ui-serif, Georgia, serif;
  --font-body:    "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;

  --text-xs:   0.6875rem;
  --text-sm:   0.8125rem;
  --text-base: 1.0625rem;
  --text-md:   1.25rem;
  --text-lg:   1.5625rem;
  --text-xl:   2rem;
  --text-2xl:  clamp(2.4rem, 4.2vw, 4.25rem);
  --text-display: clamp(2.5rem, 11vw, 10.5rem);

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 7rem;
  --space-4xl: 10rem;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-micro: 120ms;
  --dur-short: 220ms;
  --dur-long: 480ms;

  --rule: 1px solid var(--color-line);
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-card: 10px;

  --z-base: 0;
  --z-raise: 10;
  --z-sticky: 100;
  --z-nav: 200;

  --container: 1440px;
  --gutter: clamp(1.25rem, 4vw, 4.5rem);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-style: normal; overflow-wrap: anywhere; min-width: 0; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
::selection { background: var(--color-gold-3); color: var(--color-ink); }

.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-ink-3);
}
.num { font-variant-numeric: tabular-nums; }

/* ─────────────── grain ─────────────── */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: var(--z-nav);
  opacity: 0.07; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ─────────────── nav · edge-aligned, weightless ─────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-nav);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: var(--space-lg) var(--gutter);
  transition: background-color var(--dur-short) var(--ease-out), padding var(--dur-short) var(--ease-out);
}
.nav.is-scrolled {
  padding-block: var(--space-md);
  background: color-mix(in oklch, var(--color-paper) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 0.7rem;
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-md);
  letter-spacing: 0.22em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
}
.logo { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 1px solid var(--color-gold-3); border-radius: 50%; color: var(--color-gold); background: color-mix(in oklch, var(--color-paper) 60%, transparent); }
.logo svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.wordmark small { color: var(--color-gold); }
.nav-links { display: flex; gap: var(--space-xl); justify-self: center; }
.nav-links a { text-decoration: none; white-space: nowrap; transition: color var(--dur-micro) var(--ease-out); }
.nav-links a:hover { color: var(--color-ink); }
.nav-right { justify-self: end; display: flex; align-items: center; gap: var(--space-md); }
.lang { display: inline-flex; border: 1px solid var(--color-line-2); border-radius: var(--radius-sm); overflow: hidden; }
.lang button {
  padding: 0.55rem 0.7rem; border: 0; background: transparent; color: var(--color-ink-3);
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.14em;
  transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.lang button + button { border-left: 1px solid var(--color-line-2); }
.lang button:hover { color: var(--color-ink); }
.lang button[aria-pressed="true"] { color: var(--color-gold-ink); background: var(--color-gold); }
.lang button:focus-visible { outline-offset: -3px; }
#xlink .x-ico { width: 13px; height: 13px; fill: currentColor; flex: none; }
#xlink .long { text-transform: none; letter-spacing: 0.06em; }

/* teaser (prod for now): only nav + hero. Toggled by the inline script in <head>. */
.teaser .nav-links { visibility: hidden; }
.teaser .hero-scroll, .teaser .page { display: none; }

/* buttons — full eight states */
.btn {
  --btn-bg: transparent; --btn-fg: var(--color-ink); --btn-line: var(--color-line-2);
  display: inline-flex; align-items: center; gap: var(--space-sm);
  padding: 0.7rem 1.15rem; border: 1px solid var(--btn-line); border-radius: var(--radius-sm);
  background: var(--btn-bg); color: var(--btn-fg); text-decoration: none; white-space: nowrap;
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.14em; text-transform: uppercase;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), transform 100ms var(--ease-out);
}
.btn:hover, .btn.is-hover { --btn-line: var(--color-gold); --btn-fg: var(--color-gold); }
.btn:active, .btn.is-active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.35; cursor: not-allowed; }
.btn[aria-disabled="true"]:hover { --btn-line: var(--color-line-2); --btn-fg: var(--color-ink); }
.btn[hidden] { display: none; }
.btn-gold { --btn-bg: var(--color-gold); --btn-fg: var(--color-gold-ink); --btn-line: var(--color-gold); }
.btn-gold:hover, .btn-gold.is-hover { --btn-bg: var(--color-ink); --btn-line: var(--color-ink); --btn-fg: var(--color-gold-ink); }
.btn[data-state="loading"] { --btn-fg: var(--color-gold-ink); pointer-events: none; }
.btn[data-state="loading"]::before {
  content: ""; width: 0.8em; height: 0.8em; border-radius: 50%;
  border: 1.5px solid currentColor; border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
.btn[data-state="success"] { --btn-bg: var(--color-soul-3); --btn-line: var(--color-soul-2); --btn-fg: var(--color-soul); pointer-events: none; }
.btn[data-state="error"] { --btn-bg: transparent; --btn-line: var(--color-danger); --btn-fg: var(--color-danger); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────── hero · the fold is the portrait ─────────────── */
.hero {
  position: relative; height: 100svh; min-height: 560px;
  overflow: hidden; z-index: var(--z-base);
  isolation: isolate;
}
.hero-art { position: absolute; inset: -4%; will-change: transform; }
.hero-art img {
  width: 100%; height: 100%; object-fit: cover; object-position: 62% 18%;
  filter: saturate(0.92) contrast(1.04);
}
.hero-smoke { position: absolute; inset: 0; width: 100%; height: 100%; mix-blend-mode: screen; pointer-events: none; }
.hero-veil {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, color-mix(in oklch, var(--color-paper) 92%, transparent) 0%, color-mix(in oklch, var(--color-paper) 55%, transparent) 30%, transparent 62%),
    linear-gradient(0deg, var(--color-paper) 0%, color-mix(in oklch, var(--color-paper) 40%, transparent) 26%, transparent 55%),
    linear-gradient(180deg, color-mix(in oklch, var(--color-paper) 70%, transparent) 0%, transparent 28%);
}
.hero-inner {
  position: relative; height: 100%; display: grid;
  grid-template-rows: 1fr auto; padding: var(--space-3xl) var(--gutter) var(--space-xl);
}
.hero-top { display: flex; flex-direction: column; gap: var(--space-md); max-width: 34ch; align-self: center; }
.hero-top .mono { color: var(--color-gold); }
.hero-lead {
  font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); line-height: 1.25;
  color: var(--color-ink);
}
.hero-bottom { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: var(--space-lg); }
.hero-name {
  font-family: var(--font-display); font-weight: 500; font-size: var(--text-display);
  line-height: 0.86; letter-spacing: -0.02em; text-transform: uppercase;
  display: grid;
}
.hero-name span { display: block; white-space: nowrap; }
.hero-name span:nth-child(2) { padding-left: 0.28em; color: var(--color-gold); }
.hero-scroll { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-sm); text-decoration: none; }
.hero-scroll .line { width: 1px; height: 64px; background: var(--color-line-2); position: relative; overflow: hidden; }
.hero-scroll .line::after {
  content: ""; position: absolute; inset: 0; background: var(--color-gold);
  transform: translateY(-100%); animation: drip 2200ms var(--ease-in-out) infinite;
}
@keyframes drip { 0% { transform: translateY(-100%); } 60% { transform: translateY(100%); } 100% { transform: translateY(100%); } }

/* orchestrated entrance — once */
.reveal { opacity: 0; transform: translateY(14px); animation: reveal var(--dur-long) var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 110ms + 120ms); }
@keyframes reveal { to { opacity: 1; transform: none; } }

.page { position: relative; background: var(--color-paper); }
.page section, .lore-plate, #seals, #blessings, #curses { scroll-margin-top: 5.5rem; }

/* ─────────────── active event strip ─────────────── */
.event { border-block: var(--rule); background: var(--color-paper-2); }
.event-inner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: var(--space-xl); align-items: center; padding-block: var(--space-md); }
.event-status { display: inline-flex; align-items: center; gap: var(--space-sm); color: var(--color-soul); white-space: nowrap; }
.event-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--color-soul); animation: pulse 1600ms var(--ease-in-out) infinite; }
.event-title { font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); line-height: 1.1; }
.event-meta { white-space: nowrap; }
.event-meta b { font-weight: 500; color: var(--color-ink); }
.event-meta b.soul { color: var(--color-soul); }
.event-meta .sep { color: var(--color-gold-2); }

/* ─────────────── dossier ─────────────── */
.dossier { padding-block: var(--space-4xl) var(--space-3xl); }
.dossier-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-3xl); align-items: start; }
.stamp-card { position: sticky; top: 7rem; border: var(--rule); padding: var(--space-lg); background: var(--color-paper-2); }
.stamp-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: var(--space-sm) var(--space-lg); }
.stamp-card dt { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-ink-3); }
.stamp-card dd { margin: 0; font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-ink); }
.stamp-card dd.live { color: var(--color-soul); }
.stamp {
  display: inline-block; margin-bottom: var(--space-lg); padding: 0.35rem 0.7rem;
  border: 1.5px solid var(--color-danger); color: var(--color-danger); border-radius: var(--radius-xs);
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.2em; text-transform: uppercase;
  transform: rotate(-2deg); transform-origin: left center;
}
.dossier h2 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-2xl); line-height: 1.02; margin-bottom: var(--space-xl); }
.dossier h2 em { font-style: normal; color: var(--color-gold); }
.dossier-text { max-width: 62ch; display: grid; gap: var(--space-md); font-size: var(--text-md); line-height: 1.6; color: var(--color-ink-2); }
.dossier-text p:first-child { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.3; color: var(--color-ink); }
.dossier-text .mistake { font-family: var(--font-display); font-size: var(--text-xl); color: var(--color-gold); }
.dossier-text .verdict { font-family: var(--font-display); font-size: var(--text-lg); color: var(--color-ink); }
.redact { background: var(--color-ink-3); color: transparent; user-select: none; border-radius: 1px; }
.dossier-src { margin-top: var(--space-xl); padding-top: var(--space-md); border-top: var(--rule); max-width: 62ch; }

/* ─────────────── relics ─────────────── */
.relics { padding-block: var(--space-3xl); border-top: var(--rule); background: var(--color-paper-2); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: var(--space-md); margin-bottom: var(--space-2xl); max-width: 60ch; }
.section-head h2 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-2xl); line-height: 1.02; }
.section-head p { color: var(--color-ink-2); font-size: var(--text-md); }
.sample-tag {
  display: inline-flex; align-items: center; gap: var(--space-sm); max-width: 100%;
  padding: 0.3rem 0.6rem; border: 1px dashed var(--color-line-2); border-radius: var(--radius-xs);
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-ink-3);
}
.relics-layout { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: var(--space-2xl); align-items: start; }
.relic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-lg); align-items: stretch; position: sticky; top: 6rem; }
.relic-col { display: flex; flex-direction: column; }
.relic-col .relic-meta { flex: 1; grid-template-rows: auto auto 1fr auto; }
.relic-actions { margin-top: var(--space-md); display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.lore-plate { position: sticky; top: 6rem; border: var(--rule); background: var(--color-paper); padding: var(--space-xl); display: flex; flex-direction: column; gap: var(--space-md); }
/* collapsed: the plate takes exactly the height of the three cards, the story fills whatever room is left */
.relics-layout:has(.lore-text[data-collapsed]) { align-items: stretch; }
.relics-layout:has(.lore-text[data-collapsed]) .lore-plate { position: static; height: 0; min-height: 100%; }
.lore-plate h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-xl); line-height: 1.15; }
.lore-plate h3 em { font-style: normal; color: var(--color-gold); }
.lore-facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: var(--space-xs) var(--space-md); padding-block: var(--space-sm); border-block: var(--rule); }
.lore-facts dt { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-ink-3); }
.lore-facts dd { margin: 0; font-family: var(--font-mono); font-size: var(--text-sm); }
.lore-facts dd.live { color: var(--color-soul); }
.lore-text { position: relative; display: grid; gap: var(--space-sm); color: var(--color-ink-2); font-size: var(--text-sm); line-height: 1.6; }
.lore-text[data-collapsed] { flex: 1 1 0; min-height: 4rem; overflow: hidden; }
.lore-text[data-collapsed]::after { content: ""; position: absolute; inset: auto 0 0 0; height: 5rem; background: linear-gradient(180deg, transparent, var(--color-paper)); pointer-events: none; }
.lore-text .mistake { font-family: var(--font-display); font-size: var(--text-md); color: var(--color-gold); }
.lore-text .verdict { font-family: var(--font-display); font-size: var(--text-md); color: var(--color-ink); }
.lore-plate .dossier-src { margin-top: var(--space-sm); max-width: none; }
.relic {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; --sheen: 0;
  position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius-card); overflow: hidden;
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform var(--dur-short) var(--ease-out);
  transform-style: preserve-3d; background: var(--color-paper-3);
}
.relic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
.relic .sheen {
  position: absolute; inset: 0; pointer-events: none; opacity: var(--sheen);
  transition: opacity var(--dur-short) var(--ease-out);
  background:
    radial-gradient(circle at var(--mx) var(--my), var(--holo-white), transparent 38%),
    conic-gradient(from 0deg at var(--mx) var(--my), var(--holo-a), var(--holo-b), var(--holo-c), var(--holo-a));
  mix-blend-mode: color-dodge;
}
.relic-meta { margin-top: var(--space-lg); display: grid; gap: var(--space-sm); }
.relic-meta h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-xl); line-height: 1.1; }
.relic-meta h3 small { display: block; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-ink-3); margin-top: var(--space-xs); }
.relic-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm) var(--space-md); margin-top: var(--space-sm); padding-top: var(--space-md); border-top: var(--rule); }
.relic-stats div { display: grid; gap: 2px; }
.relic-stats b { font-weight: 500; font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-ink); }
.relic-stats b.live { color: var(--color-soul); }
.relic-stats b.gold { color: var(--color-gold); }
.usd { font-family: var(--font-mono); font-weight: 400; font-size: 0.85em; color: var(--color-ink-3); white-space: nowrap; }
.usd:empty { display: none; }
.relic-recipe { margin-top: var(--space-sm); color: var(--color-ink-2); font-size: var(--text-sm); }



.allies-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-lg); margin: 0 0 var(--space-lg); padding: var(--space-sm) 0; border-top: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); scroll-margin-top: 5.5rem; }
.allies-lead { display: grid; gap: 2px; }
.allies-lead h3 { margin: 0; font-size: 10px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-ink-3); }
.allies-lead p { margin: 0; font-size: var(--text-xs); color: var(--color-ink-2); }
.ally-list { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.ally-pill { display: inline-flex; align-items: center; gap: var(--space-sm); padding: 4px 12px 4px 4px; border: 1px solid var(--color-line-2); border-radius: var(--radius-sm); background: var(--color-paper-2); color: inherit; text-decoration: none; transition: border-color var(--dur-short) var(--ease-out); }
a.ally-pill:hover { border-color: var(--color-gold-3); }
.ally-pill.is-off { opacity: 0.5; filter: grayscale(1); }
.ally-av { flex: none; display: grid; place-items: center; width: 32px; height: 32px; overflow: hidden; border: 1px solid var(--color-soul-2); border-radius: 4px; background: radial-gradient(80% 60% at 50% 30%, var(--color-soul-3), var(--color-paper)); font-family: var(--font-display); font-size: var(--text-md); color: var(--color-soul); }
.ally-av img { width: 100%; height: 100%; object-fit: cover; }
.ally-txt { display: grid; line-height: 1.2; }
.ally-txt b { font-family: var(--font-display); font-weight: 500; font-size: var(--text-sm); color: var(--color-ink); }
.ally-txt b i { font-style: normal; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-ink-3); }
.ally-txt small { font-size: 10px; letter-spacing: 0.04em; text-transform: none; color: var(--color-soul); }
.ally-add { border-style: dashed; background: transparent; }
.ally-add .ally-av { border-style: dashed; border-color: var(--color-gold-3); background: none; color: var(--color-gold); font-family: var(--font-mono); }
.ally-add .ally-txt small { color: var(--color-ink-3); }
.chip.ally { border-style: dashed; }
.how-ladder .t-a span { color: var(--color-ink-2); }
.how-ladder .t-a b { color: var(--color-soul); }
.souls { padding-block: var(--space-4xl); border-top: var(--rule); }
.souls-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-2xl); align-items: stretch; }
/* the right column takes exactly the table's height; the profile rides along while the table scrolls */
.soul-field { contain: size; align-self: stretch; min-height: 0; display: flex; flex-direction: column; gap: var(--space-md); }
.well { position: relative; flex: 1; min-height: 240px; overflow: hidden; border: 1px solid var(--color-line); border-radius: var(--radius-sm); background: radial-gradient(70% 55% at 50% 46%, oklch(16% 0.03 160), var(--color-paper) 75%); cursor: crosshair; }
.well canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.well-tip { position: absolute; z-index: 2; transform: translate(-50%, -100%); padding: 3px 8px; border: 1px solid var(--color-gold-3); border-radius: 3px; background: oklch(9% 0.01 150 / 0.95); color: var(--color-gold); font-size: var(--text-xs); letter-spacing: 0.04em; white-space: nowrap; pointer-events: none; }
.well-foot { position: absolute; left: var(--space-md); right: var(--space-md); bottom: var(--space-md); display: grid; gap: 2px; pointer-events: none; }
.well-foot b { font-family: var(--font-display); font-weight: 500; font-size: var(--text-xl); line-height: 1; color: var(--color-ink); }
.well-foot span { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-ink-3); }
.board tr.row.is-hl td { background: color-mix(in oklch, var(--color-gold) 7%, transparent); }
.me-gate, .me-prof { display: grid; gap: var(--space-sm); padding: var(--space-md); border: 1px solid var(--color-line-2); border-radius: var(--radius-sm); background: color-mix(in oklch, var(--color-paper) 86%, transparent); }
.me-gate h4, .me-prof h4 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: var(--text-md); line-height: 1.15; color: var(--color-ink); }
.me-gate p, .me-prof p { margin: 0; font-size: var(--text-sm); color: var(--color-ink-2); }
.me-gate .btn, .me-prof .btn { justify-content: center; }
.me-find { display: flex; gap: var(--space-xs); }
.me-find input { flex: 1; min-width: 0; padding: 0.6rem 0.7rem; border: 1px solid var(--color-line-2); border-radius: var(--radius-sm); background: var(--color-paper); color: var(--color-ink); font-family: var(--font-mono); font-size: var(--text-xs); }
.me-find input:focus { outline: none; border-color: var(--color-gold); }
.me-err { margin: 0; font-size: var(--text-xs); color: var(--color-danger); }
.me-note { margin: 0; font-size: 11px; line-height: 1.45; letter-spacing: 0.02em; text-transform: none; color: var(--color-ink-3); }
.me-link { justify-self: start; padding: 0; border: 0; background: none; color: var(--color-ink-3); font-size: var(--text-xs); letter-spacing: 0.08em; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.me-link:hover { color: var(--color-gold); }
.me-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-sm); font-size: var(--text-xs); color: var(--color-ink-3); }
.me-top .me-link { text-decoration: none; }
.me-top > span, .me-head > span, .me-goals small { text-transform: none; letter-spacing: 0.04em; }
.me-head { display: grid; gap: 2px; }
.me-head small { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-gold); }
.me-head b { font-family: var(--font-display); font-weight: 500; font-size: var(--text-xl); line-height: 1; color: var(--color-soul); }
.me-head .is-neg { color: var(--color-danger); }
.me-head span { font-size: var(--text-xs); color: var(--color-ink-3); }
.me-row { display: flex; justify-content: space-between; gap: var(--space-sm); padding: var(--space-xs) 0; border-top: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-ink-2); }
.me-row b { font-weight: 500; color: var(--color-ink); }
.me-prof h5 { margin: var(--space-xs) 0 0; font-size: 10px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-ink-3); }
.me-goals { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-xs); }
.me-goals li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: var(--space-sm); }
.me-goals li .ach { width: 30px; height: 30px; }
.me-goals li .ach > svg { width: 15px; height: 15px; }
.me-goals li > div > span { display: block; font-size: var(--text-xs); color: var(--color-ink); }
.me-goals li > div > small { display: block; font-size: 10px; color: var(--color-ink-3); }
.me-goals li > b { font-weight: 500; font-size: var(--text-xs); color: var(--color-soul); }
.me-bar { position: relative; display: block; height: 2px; margin-top: 3px; background: var(--color-line); }
.me-bar i { position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--color-soul); }
.me-done { font-size: var(--text-xs); color: var(--color-ink-2); }
.me-have { display: flex; flex-wrap: wrap; gap: 8px; padding: 3px; }
.me-have .ach { width: 30px; height: 30px; } .me-have .ach > svg { width: 15px; height: 15px; }
.me-have .mark { width: 30px; height: 30px; } .me-have .mark > svg { width: 15px; height: 15px; }
.board tr.row.is-me td { background: color-mix(in oklch, var(--color-soul) 7%, transparent); }
.board tr.row.is-me td:first-child { box-shadow: inset 2px 0 0 var(--color-soul); }
.board-wrap { min-width: 0; }
.board { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; table-layout: fixed; }
.board col.c-rank { width: 3.2rem; }
.board col.c-wallet { width: 10.5rem; }
.board col.c-souls { width: 7.5rem; }
.board tr.row.is-open td { background: var(--color-paper-2); }
.board tr.detail td { position: relative; overflow-wrap: anywhere; }
.board th { text-align: left; padding: 0 var(--space-sm) var(--space-sm) 0; border-bottom: 1px solid var(--color-line-2); }
.board th.right { text-align: right; }
.board td { padding: var(--space-sm) var(--space-sm) var(--space-sm) 0; border-bottom: var(--rule); font-family: var(--font-mono); font-size: var(--text-sm); vertical-align: top; }
.board tr.row { cursor: pointer; }
.row-tog { display: inline-grid; place-items: center; width: 20px; height: 20px; margin: -2px -4px 0 6px; padding: 0; vertical-align: middle; border: 0; background: none; color: var(--color-ink-3); cursor: pointer; }
.row-tog svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-short) var(--ease-out); }
.board tr.row:hover .row-tog { color: var(--color-ink); }
.board tr.row.is-open .row-tog { color: var(--color-gold); }
.board tr.row.is-open .row-tog svg { transform: rotate(180deg); }
.board tr.row:hover td { background: var(--color-paper-2); }
.board td.rank { color: var(--color-gold-2); width: 3ch; }
.board td.wallet { color: var(--color-ink); white-space: nowrap; }
.board td.wallet small { display: block; font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-gold); margin-top: 2px; }
.board tr.is-spurned td.wallet small { color: var(--color-danger); }
.board tr.is-spurned td.wallet { color: var(--color-ink-2); }
.board td.soulz { color: var(--color-soul); text-align: right; white-space: nowrap; padding-right: 0; }
.board th.right { padding-right: 0; }
.board th:first-child, .board td:first-child { padding-left: var(--space-md); }
.board th:last-child, .board td:last-child { padding-right: var(--space-md); }
.board td.soulz.is-neg { color: var(--color-danger); }
.board td.achs, .board th.c-achs { padding-left: var(--space-md); text-align: left; }
.board td.achs { display: table-cell; }
.board td.achs .ach-sum { display: inline-flex; }
.board td.achs { padding-top: 6px; }
.achs { display: flex; flex-wrap: wrap; gap: 4px; }
.board tr.detail td { background: var(--color-paper-2); padding: var(--space-md) var(--space-md) var(--space-md) 3ch; }
.board tr.detail[hidden] { display: none; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-lg); }
.detail-grid h5 { font-family: var(--font-mono); font-weight: 500; font-size: var(--text-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-ink-3); margin: 0 0 var(--space-sm); }
.cards { display: grid; justify-items: start; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border: 1px solid var(--color-line-2); border-radius: 2px; font-size: var(--text-xs); letter-spacing: 0.06em; color: var(--color-ink-2); white-space: nowrap; }
.chip b { font-weight: 500; color: var(--color-ink); }
.chip.st-tamed { border-color: var(--color-ink-3); color: var(--color-ink); }
.chip.st-bound { border-color: var(--color-gold-2); color: var(--color-gold); }
.chip.st-bound b { color: var(--color-gold); }
.chip.st-sworn { border-color: var(--color-soul-2); color: var(--color-soul); background: var(--color-soul-3); }
.chip.st-sworn b { color: var(--color-soul); }
.chip.is-capped { opacity: 0.7; }
.chip .half { margin-left: 6px; padding: 0 4px; border-left: 1px solid currentColor; font-style: normal; }
.chip.tier-M { border-style: double; }
.breakdown { display: grid; gap: 2px; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-ink-2); }
.breakdown div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-md); }
.breakdown div b { font-weight: 500; color: var(--color-ink); }
.breakdown div.sum { margin-top: var(--space-xs); padding-top: var(--space-xs); border-top: 1px solid var(--color-line-2); color: var(--color-ink); }
.breakdown div.sum b { color: var(--color-soul); }
.breakdown div.neg b { color: var(--color-danger); }
.board-hint { margin-top: var(--space-md); }

/* achievement badge — Steam-style tile with a rarity frame */
.ach { --rc: var(--r-common); position: relative; width: 36px; height: 36px; padding: 0; border: 1.5px solid var(--rc); border-radius: 4px; background: radial-gradient(circle at 50% 35%, color-mix(in oklch, var(--rc) 26%, var(--color-paper-3)), var(--color-paper) 75%); display: grid; place-items: center; cursor: help; box-shadow: inset 0 0 0 2px oklch(0% 0 0 / 0.55), inset 0 0 0 3px color-mix(in oklch, var(--rc) 35%, transparent); }
.ach svg { width: 18px; height: 18px; fill: none; stroke: var(--rc); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ach.r-rare { --rc: var(--r-rare); } .ach.r-epic { --rc: var(--r-epic); } .ach.r-legendary { --rc: var(--r-legendary); }
.ach.r-mythic { --rc: var(--r-mythic); } .ach.r-unique { --rc: var(--r-unique); }
/* the tier reads from the colour; V and VI also glow */
.ach.r-mythic { box-shadow: 0 0 12px color-mix(in oklch, var(--rc) 55%, transparent); }
.ach.r-unique { box-shadow: 0 0 20px color-mix(in oklch, var(--rc) 75%, transparent), 0 0 4px var(--rc); }
.ach.r-none { border-color: var(--color-line-2); }
.ach.r-none { --rc: var(--color-ink-2); }
.ach-card.r-none { --rc: var(--color-ink-2); }
.ach.is-locked { --rc: var(--color-line-2); border-width: 1px; outline: none; box-shadow: none; }
.ach.is-locked > img.ic, .ach.is-locked > svg { opacity: 0.45; filter: grayscale(1); }
/* painted icons fill the medallion or tile; the coloured ring of rarity / blessing / curse stays on the border */
.ach > img.ic, .mark > img.ic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; z-index: 0; }
.ach:has(> img.ic), .mark:has(> img.ic) { overflow: visible; }
.ach .ach-tip, .mark .ach-tip { z-index: 3; }
.mark .cnt { z-index: 2; }
/* large views: the full square art with a light rounding */
.ach-card > .ach, .ach-card > .mark { width: 56px; height: 56px; border-radius: 6px; }
.ach.lg { width: 56px; height: 56px; }
.ach.lg svg { width: 28px; height: 28px; }
/* effects go on the art only: a filter on the button would trap its tooltip under the next rows */
.ach:hover > img.ic, .ach:focus-visible > img.ic, .ach.is-open > img.ic, .mark:hover > img.ic, .mark:focus-visible > img.ic, .mark.is-open > img.ic { filter: brightness(1.2); }
.ach:hover, .ach:focus-visible, .ach.is-open, .mark:hover, .mark:focus-visible, .mark.is-open { z-index: 30; }
.ach-tip { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translate(calc(-50% + var(--tx, 0px)), 4px); width: 320px; max-width: calc(100vw - 32px); display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--space-md); align-items: start; text-align: left; padding: var(--space-sm) var(--space-md); background: oklch(9% 0.01 150 / 0.97); border: 1px solid var(--rc); border-radius: 4px; text-align: left; z-index: 40; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out), visibility 0s linear var(--dur-short); cursor: default; }
/* no room above (the fixed nav, the top of the screen): open downwards */
.ach-tip.is-below { bottom: auto; top: calc(100% + 10px); transform: translate(calc(-50% + var(--tx, 0px)), -4px); }
.tip-art { width: 64px; height: 64px; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--rc); border-radius: 6px; background: var(--color-paper-3); }
.tip-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tip-art svg { width: 30px; height: 30px; fill: none; stroke: var(--rc); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tip-body { display: block; min-width: 0; }
.ach-tip b.tip-h { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-sm); }
.ach-tip b.tip-h > span:first-child { color: var(--color-ink); }
.tip-lvl { flex: none; font-family: var(--font-mono); font-weight: 500; font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--rc); }
.tip-body > b + p { margin-top: var(--space-xs); }
.ach:hover .ach-tip, .ach:focus-visible .ach-tip, .ach.is-open .ach-tip { opacity: 1; visibility: visible; transform: translate(calc(-50% + var(--tx, 0px)), 0); transition-delay: 0s; }
.ach-tip b { display: block; font-family: var(--font-display); font-weight: 500; font-size: var(--text-md); line-height: 1.1; color: var(--rc); white-space: normal; overflow-wrap: anywhere; }
.ach-tip small { display: block; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--rc); opacity: 0.8; margin: 2px 0 var(--space-xs); }
.ach-tip p { font-family: var(--font-body); font-size: var(--text-xs); color: var(--color-ink-2); line-height: 1.45; white-space: normal; }
.ach-tip em { display: block; margin-top: var(--space-xs); font-style: normal; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-soul); }
.ach-tip .prog { display: block; height: 3px; margin-top: var(--space-xs); background: var(--color-paper-3); position: relative; }
.ach-tip .prog i { position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--rc); }
.ach-tip .nxt { margin: 4px 0 0; text-transform: none; letter-spacing: 0; opacity: 1; color: var(--color-ink-2); }
/* negative marks — a dark diamond, not a medallion */
.marks { display: inline-flex; gap: 4px; margin-left: var(--space-sm); padding-left: var(--space-sm); border-left: 1px dashed var(--color-line-2); }
.mark { --rc: var(--color-danger); position: relative; width: 34px; height: 34px; padding: 0; border: 1.5px solid var(--rc); border-radius: 4px; background: linear-gradient(180deg, oklch(20% 0.06 25), oklch(12% 0.03 25)); display: grid; place-items: center; cursor: help; box-shadow: inset 0 0 0 2px oklch(0% 0 0 / 0.6), inset 0 0 0 3px color-mix(in oklch, var(--rc) 35%, transparent), 0 0 10px color-mix(in oklch, var(--rc) 35%, transparent); }
.mark svg { width: 17px; height: 17px; fill: none; stroke: var(--rc); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mark:hover .ach-tip, .mark:focus-visible .ach-tip, .mark.is-open .ach-tip { opacity: 1; visibility: visible; transform: translate(calc(-50% + var(--tx, 0px)), 0); transition-delay: 0s; }
.mark .ach-tip em { color: var(--color-danger); }
.r-common { color: var(--r-common); } .r-rare { color: var(--r-rare); } .r-epic { color: var(--r-epic); } .r-legendary { color: var(--r-legendary); } .r-mythic { color: var(--r-mythic); } .r-unique { color: var(--r-unique); }

/* achievement summary in a row */
.ach-sum { display: inline-flex; align-items: center; gap: var(--space-md); }
.ach-sum > b { font-family: var(--font-mono); font-weight: 500; color: var(--color-ink); white-space: nowrap; }
.ach-sum .ach-tip b { font-family: var(--font-display); white-space: normal; }
.ach-sum b small { color: var(--color-ink-3); font-size: inherit; }
.ach-sum .top { display: inline-flex; gap: 8px; width: calc(3 * 30px + 2 * 8px); flex: none; }
.ach-sum .top .ach { width: 30px; height: 30px; }
.ach-sum .top .ach svg { width: 15px; height: 15px; }

/* achievement cards — the same card for the master list and for a wallet's own panel */
.ach-cards { margin-top: var(--space-lg); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-md); }
.ach-card { --rc: var(--r-common); display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--space-md); padding: var(--space-md); border: 1px solid var(--color-line); border-radius: var(--radius-sm); background: var(--color-paper-2); align-items: stretch; }
.ach-card.is-locked { --rc: var(--color-line-2); }
.ach-card.is-locked .ach > img.ic, .ach-card.is-locked .ach > svg { opacity: 0.5; filter: grayscale(1); }
.ach-card.is-done { border-color: color-mix(in oklch, var(--rc) 45%, var(--color-line)); }
.ach-card .ach { cursor: default; }
.ach-card .ach .ach-tip { display: none; }
.ach-card h5 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: var(--text-md); line-height: 1.1; color: var(--color-ink); display: flex; justify-content: space-between; gap: var(--space-sm); align-items: baseline; }
.ach-card h5 em { font-style: normal; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--rc); white-space: nowrap; }
.ach-card.is-locked h5 em { color: var(--color-ink-3); }
.ach-card p { margin: 4px 0 0; font-size: var(--text-xs); color: var(--color-ink-2); line-height: 1.45; }
.ach-card > div { display: flex; flex-direction: column; }
.ach-card > .ach, .ach-card > .mark { align-self: start; }
.ach-card .meta { margin-top: auto; padding-top: 6px; }
.ach-cards .ach-card > div > p { min-height: calc(2 * 1.45em); }
.bless-cards .ach-card > div > p { min-height: calc(4 * 1.45em); }
.bless-cards .ach-card .meta { flex-direction: column; align-items: flex-start; gap: 2px; }
.ach-card .bar { margin-top: var(--space-sm); height: 4px; background: var(--color-paper-3); border-radius: 2px; position: relative; overflow: hidden; }
.ach-card .bar i { position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--rc); }
.ach-card.is-locked .bar i { background: var(--color-ink-3); }
.ach-card .meta { margin-top: 6px; display: flex; justify-content: space-between; gap: var(--space-sm); font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-ink-3); flex-wrap: wrap; }
.ach-card .meta b { font-weight: 500; color: var(--color-ink-2); }
.ach-card .meta .val { color: var(--color-soul); }
.ach-card.is-locked .meta .val { color: var(--color-ink-3); }
.ach-card .ladder { list-style: none; margin: var(--space-sm) 0 0; padding: 0; display: grid; }
.ach-card .ladder li { display: grid; grid-template-columns: minmax(0, 1fr) auto 4.5rem; gap: var(--space-md); padding: 3px 0; border-top: 1px solid var(--color-line); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.04em; }
.ach-card .ladder li b { font-weight: 500; color: inherit; }
.ach-card .ladder li.head { border-top: 0; color: var(--color-ink-3); text-transform: uppercase; letter-spacing: 0.12em; font-size: 10px; }
.ach-card .ladder li.head b { color: var(--color-ink-3); font-weight: 400; }
.ach-card .ladder li b:last-child { text-align: right; }
.ach-card .ladder li b.sv { color: var(--color-soul); }
.ach-card.is-locked .ladder li b.sv { color: var(--color-ink-3); }
.ach-head { margin-top: var(--space-3xl); display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-xl); flex-wrap: wrap; }
.ach-head h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-xl); line-height: 1.05; }
.ach-head p { color: var(--color-ink-2); font-size: var(--text-sm); max-width: 56ch; margin-top: var(--space-xs); }
.tiers { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.tiers li { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 8px; border: 1px solid currentColor; border-radius: 999px; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em; }
.tiers li span { text-transform: uppercase; }
.tiers li b { font-weight: 500; }
.wallet-achs { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-sm); }
.detail-grid .ach-card h5 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-base); letter-spacing: 0; text-transform: none; color: var(--color-ink); margin: 0; }
.detail-grid .ach-card h5 em { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; white-space: normal; text-align: right; }
.detail-grid .ach-card .meta { font-family: var(--font-mono); }
.wallet-achs .ach-card { padding: var(--space-sm) var(--space-md); grid-template-columns: 40px minmax(0, 1fr); background: var(--color-paper); }
.wallet-achs .ach-card > .ach, .wallet-achs .ach-card > .mark { width: 44px; height: 44px; border-radius: 5px; }
.wallet-achs .ach-card .ach svg { width: 18px; height: 18px; }
.wallet-achs .ach-card h5 { font-size: var(--text-base); }
.wallet-achs .ach-card p { display: none; }
.ach-card.neg { --rc: var(--color-danger); border-color: color-mix(in oklch, var(--color-danger) 45%, var(--color-line)); }
.ach-card.neg .meta .val { color: var(--color-danger); }
.ach-card .mark { cursor: default; }
.ach-card .mark .ach-tip { display: none; }
.mark.bless { --rc: var(--color-gold); background: linear-gradient(180deg, oklch(26% 0.05 80), oklch(14% 0.03 80)); }
.mark.bless .ach-tip em { color: var(--color-gold); }
.mark .cnt { position: absolute; right: -5px; bottom: -5px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: var(--rc); color: var(--color-gold-ink); font-family: var(--font-mono); font-style: normal; font-weight: 500; font-size: 9px; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--color-paper); }
.bless-head h3 { color: var(--color-gold) !important; }
.ach-card.pos { --rc: var(--color-gold); border-color: color-mix(in oklch, var(--color-gold) 45%, var(--color-line)); }
.ach-card.pos h5 em { color: var(--color-gold); }
.bless-cards .ach-card.pos { background: color-mix(in oklch, var(--color-gold) 6%, var(--color-paper-2)); }
.how { margin-top: var(--space-3xl); padding-top: var(--space-lg); border-top: var(--rule); display: grid; gap: var(--space-md); }
.how-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-sm) var(--space-lg); }
.how h4 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-xl); line-height: 1.05; color: var(--color-ink); margin: 0; }
.how-formula { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.5rem; margin: 0; font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-ink-3); }
.how-formula b { font-weight: 500; color: var(--color-ink-2); }
.how-formula i { font-style: normal; color: var(--color-ink-3); }
.how-formula .is-seal { color: var(--color-soul); } .how-formula .is-bless { color: var(--color-gold); } .how-formula .is-curse { color: var(--color-danger); } .how-formula .is-total { color: var(--color-soul); }
.how-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }
.how-panel { display: grid; gap: var(--space-sm); align-content: start; padding: var(--space-md); border: 1px solid var(--color-line); border-radius: var(--radius-sm); background: var(--color-paper-2); }
.how-panel h5 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: var(--text-md); line-height: 1.15; color: var(--color-ink); }
.how-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md) var(--space-xl); }
.how-step { display: grid; gap: var(--space-xs); align-content: start; }
.how-ladder { list-style: none; margin: 0; padding: 0; display: grid; }
.how-ladder li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-md); padding: 3px 0; border-top: 1px solid var(--color-line); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.04em; color: var(--color-ink-2); }
.how-ladder li b { font-weight: 500; color: var(--color-ink); text-align: right; font-variant-numeric: tabular-nums; }
.how-ladder li.head { border-top: 0; color: var(--color-ink-3); text-transform: uppercase; letter-spacing: 0.12em; font-size: 10px; }
.how-ladder li.head b { color: var(--color-ink-3); font-weight: 400; }
/* card tiers in the formula only: yellow, pink, red */
.how-ladder .t-l span { color: oklch(86% 0.150 95); } .how-ladder .t-m span { color: oklch(74% 0.170 350); } .how-ladder .t-u span { color: oklch(64% 0.210 25); }
.how-age li:nth-child(3) b { color: color-mix(in oklch, var(--color-soul) 60%, var(--color-ink-2)); } .how-age li:nth-child(4) b { color: color-mix(in oklch, var(--color-soul) 80%, var(--color-ink)); } .how-age li:nth-child(5) b { color: var(--color-soul); }
.how-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-xs) var(--space-lg); padding-top: var(--space-sm); border-top: 1px solid var(--color-line); font-size: var(--text-xs); letter-spacing: 0.02em; text-transform: none; color: var(--color-ink-3); }
.how-meta em { font-style: normal; text-transform: uppercase; letter-spacing: 0.12em; color: var(--color-ink-3); }
.how-meta em + span { color: var(--color-ink-2); }
.how-side { display: grid; gap: var(--space-md); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.how-kind { --c: var(--color-soul); text-decoration: none; transition: border-color var(--dur-short) var(--ease-out); }
.how-kind:hover { border-color: color-mix(in oklch, var(--c) 55%, var(--color-line)); }
.how-kind h5 { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-sm); }
.how-kind h5 em { font-style: normal; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.04em; color: var(--c); white-space: nowrap; }
.how-kind p { margin: 0; font-size: var(--text-xs); line-height: 1.45; color: var(--color-ink-2); }
.how-kind.is-bless { --c: var(--color-gold); } .how-kind.is-curse { --c: var(--color-danger); }
.marks-head { margin-top: var(--space-2xl); display: grid; gap: var(--space-xs); max-width: 60ch; }
.marks-head h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-xl); line-height: 1.05; color: var(--color-danger); }
.marks-head p { color: var(--color-ink-2); font-size: var(--text-sm); }
.marks-cards .ach-card.neg { background: color-mix(in oklch, var(--color-danger) 6%, var(--color-paper-2)); }
.ach-card.neg h5 em { color: var(--color-danger); }

/* ─────────────── footer · statement ─────────────── */
.footer { padding-block: var(--space-4xl) var(--space-xl); border-top: var(--rule); background: var(--color-paper-2); }
.footer-statement { font-family: var(--font-display); font-weight: 500; font-size: clamp(2.6rem, 8.5vw, 8.5rem); line-height: 0.92; letter-spacing: -0.02em; max-width: 12ch; }
.footer-statement span { color: var(--color-gold); }
html[lang="ru"] .footer-statement { max-width: 16ch; }
.footer-row { margin-top: var(--space-3xl); display: flex; flex-wrap: wrap; gap: var(--space-md) var(--space-2xl); align-items: baseline; padding-top: var(--space-md); border-top: var(--rule); }
.footer-row a { text-decoration: none; white-space: nowrap; }
.footer-row a:hover { color: var(--color-gold); }
.footer-row .spacer { flex: 1; }

/* ─────────────── responsive ─────────────── */
@media (max-width: 1080px) {
  .dossier-grid, .souls-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-2xl); }
  .soul-field { contain: none; }
  .well { flex: none; height: 320px; }
  .stamp-card, .chosen { position: static; }
  .relics-layout { grid-template-columns: minmax(0, 1fr); }
  .ach-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lore-plate, .relic-grid { position: static; }
  .relics-layout:has(.lore-text[data-collapsed]) .lore-plate { height: auto; min-height: 0; }
  .lore-text[data-collapsed] { flex: none; max-height: 11rem; }
  .event-inner { grid-template-columns: minmax(0, 1fr) auto; }
  .event-meta { grid-column: 1 / -1; white-space: normal; }
  }
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav { grid-template-columns: 1fr auto; }
  #xlink .long { display: none; }
  .hero-inner { padding-top: var(--space-2xl); }
  .hero-bottom { grid-template-columns: minmax(0, 1fr); }
  .hero-scroll { display: none; }
  .hero-art img { object-position: 58% 10%; }
  .relic-grid { grid-template-columns: minmax(0, 1fr); max-width: 420px; }
  .event-inner { grid-template-columns: minmax(0, 1fr); gap: var(--space-sm); }
  .ledger li { grid-template-columns: minmax(0, 1fr); gap: var(--space-xs); }
  .ach-cards, .wallet-achs { grid-template-columns: minmax(0, 1fr); }
  .board-wrap { overflow-x: clip; }
  .ach-sum { gap: var(--space-sm); }
  .ach-sum .top { gap: 7px; width: calc(3 * 24px + 2 * 7px); }
  .ach-sum .top .ach { width: 24px; height: 24px; }
  .ach-sum .top .ach svg { width: 12px; height: 12px; }
  .board td.wallet { white-space: normal; }
  .board col.c-wallet { width: 7.5rem; }
  .board col.c-souls { width: 5.5rem; }
  .board th:first-child, .board td:first-child { padding-left: var(--space-xs); }
  .board th:last-child, .board td:last-child { padding-right: var(--space-xs); }
  .board td.achs, .board th.c-achs { padding-left: var(--space-sm); }
      .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .how-cards, .how-side { grid-template-columns: minmax(0, 1fr); }
        .board tr.detail td { padding-left: var(--space-sm); }
}
@media (max-width: 480px) {
  .ach-sum .top { display: none; }
  .board td.achs { padding-top: var(--space-sm); }
  .nav { padding-inline: var(--space-md); }
  .wordmark { font-size: var(--text-base); letter-spacing: 0.14em; gap: 0.5rem; }
  .logo { width: 30px; height: 30px; }
  .logo svg { width: 18px; height: 18px; }
  .nav-right { gap: var(--space-sm); }
  .lang button { padding: 0.45rem 0.5rem; }
  #xlink { padding: 0.55rem 0.75rem; }
}
@media (max-width: 420px) {
  .relic-stats { grid-template-columns: minmax(0, 1fr); }
  .countdown { gap: var(--space-md); }
}

/* ─────────────── motion discipline ─────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 120ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .ticker-track { animation: none; }
}
html.no-motion *, html.no-motion *::before, html.no-motion *::after { animation: none !important; }
html.no-motion .reveal { opacity: 1; transform: none; }
html.no-motion { scroll-behavior: auto; }

