/*
 * Кодекс VirusSwords.
 *
 * Obsidian with a purple cast for the page, soul fire for what you can act on, enchantment
 * gold for what is rare. Headings are cut like an altar inscription (Forum), the text is
 * plain (Onest). Anything the game itself draws - slots, tooltips, the workbench - is drawn
 * the way the game draws it, square and grey, in its pixel font; everything around it is soft.
 */
:root {
  --bg: #150f1c;
  --bg-2: #1b1424;
  --surface: #20182c;
  --surface-2: #291f39;
  --line: #3a2d50;
  --line-soft: #2b2140;
  --ink: #f1ebf8;
  --ink-2: #cfc5dd;
  --muted: #9d92ae;
  --soul: #6fe4dc;
  --soul-soft: rgba(111, 228, 220, .12);
  --soul-line: rgba(111, 228, 220, .45);
  --gold: #f1b94d;
  --focus: #6fe4dc;
  --code-bg: #2a2038;
  /* In-game UI, as it is in the game. */
  --tip-bg: rgba(16, 0, 16, 0.95);
  --tip-b1: #5000ff;
  --tip-b2: #28007f;
  --slot: #8b8b8b;
  --slot-hi: #ffffff;
  --slot-lo: #373737;
  --gui: #c6c6c6;
  --display: "Forum", "Cormorant Garamond", Georgia, serif;
  --body: "Onest", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --pixel: "Press Start 2P", ui-monospace, monospace;
  --r-box: 12px;
  --r-small: 7px;
  color-scheme: dark;
}

/* --- base ------------------------------------------------------------------------- */
* { box-sizing: border-box; }
/* The filters hide cards with the hidden attribute; a card's own display must not win over it. */
[hidden] { display: none !important; }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 20px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15.5px/1.62 var(--body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--soul); text-decoration-color: var(--soul-line); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
::selection { background: rgba(111, 228, 220, .3); }
h1, h2, h3, h4 { text-wrap: balance; margin: 0; font-weight: 400; }
h2 { font: 400 clamp(2.1rem, 3.4vw, 2.75rem)/1.05 var(--display); letter-spacing: -.005em; }
h3 { font: 400 1.5rem/1.15 var(--display); }
h4 { font: 600 1rem/1.35 var(--body); }
p { margin: 0; }
b, strong { font-weight: 600; color: var(--ink); }
code, kbd { font: .84em var(--mono); background: var(--code-bg); padding: .12em .4em; border-radius: 5px; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 8px 14px; background: var(--soul); color: var(--bg); border-radius: var(--r-small); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* --- shell -------------------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); max-width: 1380px; margin: 0 auto; }
main { min-width: 0; padding: 0 48px 96px; }
section { padding-block: 84px 0; display: grid; gap: 22px; scroll-margin-top: 8px; }
.sec-head { display: grid; gap: 10px; max-width: 70ch; }
.lead { color: var(--ink-2); font-size: 1.05rem; line-height: 1.6; max-width: 66ch; }
.prose { max-width: 70ch; display: grid; gap: 12px; color: var(--ink-2); }
section > p, section > .stack > p { max-width: 74ch; color: var(--ink-2); }
section > h3 { margin-top: 18px; }

/* --- side rail ---------------------------------------------------------------------- */
.side { position: sticky; top: 0; z-index: 10; height: 100vh; padding: 30px 20px 26px 26px; display: flex; flex-direction: column; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; flex: none; image-rendering: pixelated; }
.brand-name { font: 400 1.65rem/1 var(--display); }
.search { position: relative; }
.search input { width: 100%; font: inherit; font-size: .92rem; padding: 9px 34px 9px 34px; border: 1px solid var(--line); border-radius: var(--r-small); background: var(--bg-2); color: var(--ink); appearance: none; }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--soul-line); box-shadow: 0 0 0 3px var(--soul-soft); }
.search input::-webkit-search-cancel-button { filter: invert(.7); }
.search-icon { position: absolute; left: 11px; top: 11px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search-key { position: absolute; right: 9px; top: 8px; font-size: .72rem; color: var(--muted); background: transparent; }
.search input:focus ~ .search-key, .search input:not(:placeholder-shown) ~ .search-key { display: none; }
.search-hint { margin-top: 7px; font-size: .8rem; color: var(--soul); min-height: 1.25em; }
.nav { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.nav a { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 0 6px 14px; border-left: 2px solid var(--line-soft); color: var(--ink-2); text-decoration: none; font-size: .94rem; }
.nav a:hover { color: var(--ink); border-left-color: var(--line); }
.nav a.on { color: var(--ink); border-left-color: var(--soul); }
.nav .count { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; font-size: .78rem; line-height: 1.5; color: var(--muted); }

/* --- hero: the held blade ---------------------------------------------------------- */
.hero {
  margin-top: 28px; position: relative; overflow: hidden; border-radius: 18px; border: 1px solid var(--line-soft);
  background:
    radial-gradient(42% 60% at 74% 46%, rgba(111, 228, 220, .16), transparent 70%),
    radial-gradient(70% 90% at 100% 0%, rgba(120, 60, 200, .22), transparent 60%),
    linear-gradient(180deg, #1d1529, #160f1e);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-areas: "text stage" "bar bar";
  gap: 28px 36px; padding: 52px 48px 30px;
}
.hero-text { grid-area: text; display: grid; gap: 22px; align-content: center; }
.hero h1 { font: 400 clamp(3rem, 6.4vw, 5.4rem)/.9 var(--display); letter-spacing: -.015em; }
.facts { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 24px; }
.facts a { display: grid; gap: 3px; color: var(--muted); font-size: .84rem; text-decoration: none; }
.facts b { font: 400 1.85rem/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.facts a:hover, .facts a:hover b { color: var(--soul); }
.stage { grid-area: stage; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 26px; }
.held { width: 188px; height: 188px; display: grid; place-items: center; position: relative; }
.held::after { content: ""; position: absolute; bottom: 4px; left: 50%; width: 110px; height: 14px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(rgba(0, 0, 0, .55), transparent 70%); }
.held img { width: 168px; height: 168px; image-rendering: pixelated; filter: drop-shadow(0 0 22px rgba(111, 228, 220, .28)); animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(-6px) rotate(-2deg); } 50% { transform: translateY(6px) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .held img { animation: none; } }
.stage-tip { display: grid; gap: 12px; justify-items: start; min-width: 0; }
.stage-tip .tip { width: 100%; max-width: 380px; }
.text-btn { font: 600 .9rem var(--body); color: var(--soul); background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--soul-line); text-underline-offset: 4px; }
.text-btn:hover { text-decoration-color: currentColor; }
.hotbar-wrap { grid-area: bar; display: grid; justify-items: center; gap: 10px; padding-top: 4px; }
.hotbar { display: flex; padding: 3px; background: #2b2b2b; border: 2px solid #000; box-shadow: inset 0 0 0 2px #5a5a5a; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.hslot { position: relative; width: 62px; height: 62px; flex: none; border: 0; padding: 6px; margin: 0; cursor: pointer;
  background: #8b8b8b; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff; }
.hslot + .hslot { margin-left: 2px; }
.hslot img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.hslot .hkey { position: absolute; right: 3px; bottom: 1px; font: 8px/1 var(--pixel); color: #fff; text-shadow: 1px 1px 0 #3f3f3f; }
.hslot.sel::after { content: ""; position: absolute; inset: -4px; border: 3px solid #fff; box-shadow: 0 0 0 1px #000, inset 0 0 0 1px #000; pointer-events: none; }
.hslot:focus-visible { outline-offset: 5px; }
.hotbar-note { font-size: .8rem; color: var(--muted); text-align: center; }

/* --- in-game pieces ------------------------------------------------------------------ */
.paint { background-clip: text; -webkit-background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
@keyframes shimmer { to { background-position: 100% 0; } }
@media (prefers-reduced-motion: reduce) { .paint { animation: none !important; } }
.tip { background: var(--tip-bg); color: #aaa; padding: 10px 12px 12px; border: 2px solid; border-image: linear-gradient(var(--tip-b1), var(--tip-b2)) 1;
  box-shadow: 0 0 0 2px rgba(16, 0, 16, .95); font-size: 13px; line-height: 1.45; min-width: 0; }
.tname { font: 11px/1.7 var(--pixel); font-weight: 400; word-break: break-word; }
.tlore { margin-top: 6px; display: grid; gap: 1px; }
.tlore .gap { height: 7px; }
.tlore em { font-style: italic; }
.tstats { margin-top: 8px; color: #555; }
.tstats b { color: #aaa; font-weight: 400; }
.trar { margin-top: 6px; color: #555; }
.trar .paint { font-weight: 600; }
.slot { width: 80px; height: 80px; flex: none; padding: 7px; background: var(--slot); box-shadow: inset 3px 3px 0 var(--slot-lo), inset -3px -3px 0 var(--slot-hi); display: grid; place-items: center; }
.slot img { width: 100%; height: 100%; image-rendering: pixelated; }
.slot.sm { width: 46px; height: 46px; padding: 4px; box-shadow: inset 2px 2px 0 var(--slot-lo), inset -2px -2px 0 var(--slot-hi); }

/* --- item tiles: a game slot and the name under it --------------------------------------- */
.islot { display: inline-grid; justify-items: center; align-content: start; gap: 7px; text-decoration: none; color: var(--ink-2); border-radius: var(--r-small); padding: 4px; }
.islot-cell { width: 54px; height: 54px; padding: 5px; display: grid; place-items: center; background: var(--slot); box-shadow: inset 2px 2px 0 var(--slot-lo), inset -2px -2px 0 var(--slot-hi); position: relative; }
.islot-cell img { width: 100%; height: 100%; image-rendering: pixelated; }
.islot:hover .islot-cell::after, .islot.open .islot-cell::after { content: ""; position: absolute; inset: 2px; background: rgba(255, 255, 255, .38); pointer-events: none; }
.islot.open .islot-cell { outline: 2px solid var(--soul); outline-offset: 2px; }
.islot.named { width: 108px; padding: 6px 4px 8px; }
.islot.named .islot-cell { width: 66px; height: 66px; padding: 6px; box-shadow: inset 3px 3px 0 var(--slot-lo), inset -3px -3px 0 var(--slot-hi); }
.islot-name { font-size: .82rem; line-height: 1.25; text-align: center; text-wrap: balance; hyphens: auto; overflow-wrap: anywhere; max-width: 100%; }
.islot:hover .islot-name, .islot.open .islot-name { color: var(--ink); }
.islot.dim { opacity: .28; filter: grayscale(1); }
.islot.dim:hover { opacity: .6; }

/* --- start: the road, one step after another ------------------------------------------------ */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; counter-reset: s; max-width: 980px; }
.steps li { counter-increment: s; position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; align-content: start; padding: 0 0 26px; }
.steps li::before { content: counter(s); grid-row: span 2; width: 36px; height: 36px; display: grid; place-items: center; font: 400 1.3rem/1 var(--display); color: var(--bg); background: var(--soul); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); margin-top: -4px; }
.steps h4 { font-size: 1.02rem; margin-bottom: 4px; }
.steps p { color: var(--ink-2); font-size: .93rem; }
.steps li:last-child::before { background: var(--gold); }

/* --- rarity --------------------------------------------------------------------------- */
.rarities { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--line-soft); border-radius: var(--r-box); overflow: hidden; background: var(--surface); }
.rarity { display: grid; grid-template-columns: 210px 112px minmax(140px, .8fr) minmax(0, 1.6fr); gap: 18px; align-items: center; padding: 11px 16px; }
.rarity + .rarity { border-top: 1px solid var(--line-soft); }
.rname { justify-self: start; background: var(--tip-bg); padding: 8px 11px 7px; font: 10px/1.6 var(--pixel); box-shadow: inset 0 0 0 2px #28007f; }
.swatches { display: flex; gap: 3px; }
.sw { width: 18px; height: 14px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3); }
.rmotion { font-size: .86rem; color: var(--muted); }
.rused { font-size: .9rem; color: var(--ink-2); }

/* --- weapons: the lines ---------------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: 500 .86rem var(--body); padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); cursor: pointer; }
.chip:hover { border-color: var(--muted); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--soul-soft); border-color: var(--soul-line); color: var(--ink); }
.lines { display: grid; border-top: 1px solid var(--line-soft); }
.line { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.line-title { font-size: 1.3rem; color: var(--ink); }
.line-row, .chain-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 2px 4px; }
.chain-row { align-items: center; }
.arrow { color: var(--soul); font-size: .9rem; padding: 0 4px; margin-top: 34px; }
.chain-row .arrow { margin-top: 0; }
.inventory { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; align-items: start; }
.inv-group { display: grid; gap: 8px; align-content: start; padding: 14px 14px 10px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-box); }
.inv-title { font: 600 .9rem/1.3 var(--body); color: var(--ink-2); }
.inv-row { display: flex; flex-wrap: wrap; gap: 2px; }
.empty { color: var(--muted); padding: 12px 0; }

/* --- the inspector: one item, beside the page ---------------------------------------------- */
.inspect-wrap { position: fixed; inset: 0; z-index: 40; }
.inspect-veil { position: absolute; inset: 0; background: rgba(9, 5, 14, .62); backdrop-filter: blur(2px); }
.inspect { position: absolute; top: 0; right: 0; bottom: 0; width: min(500px, 100vw); overflow-y: auto; overscroll-behavior: contain; background: var(--bg-2); border-left: 1px solid var(--line); padding: 26px 24px 40px; box-shadow: -24px 0 60px rgba(0, 0, 0, .45); }
.inspect:focus { outline: none; }
.inspect-close { position: sticky; top: 0; float: right; z-index: 2; width: 36px; height: 36px; margin: -8px -6px 0 8px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink-2); cursor: pointer; }
.inspect-close:hover { color: var(--ink); border-color: var(--muted); }
.inspect-close svg { width: 13px; height: 13px; }
.inspect-enter-active, .inspect-leave-active { transition: opacity .2s ease; }
.inspect-enter-active .inspect, .inspect-leave-active .inspect { transition: transform .24s cubic-bezier(.2, .8, .2, 1); }
.inspect-enter-from, .inspect-leave-to { opacity: 0; }
.inspect-enter-from .inspect, .inspect-leave-to .inspect { transform: translateX(40px); }
@media (prefers-reduced-motion: reduce) {
  .inspect-enter-active, .inspect-leave-active, .inspect-enter-active .inspect, .inspect-leave-active .inspect { transition: none; }
}
.card { display: grid; gap: 22px; }
.card-top { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 14px; align-items: start; padding-right: 40px; }
.card h3 { font: 600 .95rem/1.3 var(--body); color: var(--ink); }
.obtain { display: grid; gap: 10px; }
.obtain-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.obtain-text { margin: 0; font-size: .92rem; color: var(--ink-2); }
.card-chain { display: grid; gap: 8px; }
.card-chain .islot { padding: 2px; }
.card dl { margin: 0; display: grid; gap: 8px; }

/* --- tables --------------------------------------------------------------------------------- */
.tbl { overflow-x: auto; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-box); }
table { border-collapse: collapse; width: 100%; font-size: .91rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
thead th { font: 600 .8rem/1.3 var(--body); color: var(--muted); background: var(--bg-2); white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { font-weight: 600; white-space: nowrap; }
td { color: var(--ink-2); }
td b { color: var(--ink); }
.dot { display: inline-block; width: 10px; height: 10px; margin-right: 9px; vertical-align: 0; transform: rotate(45deg); }
.twocol { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-box); padding: 22px; display: grid; gap: 12px; align-content: start; }
.panel h3 { font-size: 1.55rem; }
.panel .tbl { background: var(--bg-2); }
.inline-icons { display: block; line-height: 1.95; }
.inline-icons img { width: 24px; height: 24px; vertical-align: -6px; margin-right: 4px; image-rendering: pixelated; }
.kin-list { display: flex; flex-direction: column; gap: 4px; }
.kin-list > div { white-space: nowrap; }
.kin-list img { width: 28px; height: 28px; vertical-align: middle; margin-right: 6px; image-rendering: pixelated; }
.stars { color: var(--gold); letter-spacing: 1px; }

/* --- sanctums ---------------------------------------------------------------------------------- */
.flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.flow .step { flex: 1 1 140px; background: var(--surface); border: 1px solid var(--line-soft); border-top: 2px solid var(--soul); border-radius: var(--r-small); padding: 12px 14px; display: grid; gap: 4px; align-content: start; }
.flow .step b { font: 400 1.25rem/1.1 var(--display); }
.flow .step span { font-size: .84rem; color: var(--muted); }
.flow .to { align-self: center; color: var(--soul); }
.sanctum { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; overflow: hidden; display: grid; }
.sanctum figure { margin: 0; background: #120d18; overflow-x: auto; }
.sanctum figure img { display: block; width: 100%; min-width: 760px; max-width: none; height: auto; }
.sanctum figure.terra-figure { display: flex; flex-direction: column; align-items: center; padding: 32px 16px 0; background: radial-gradient(circle at 50% 40%, #1f3a22 0%, #120d18 70%); overflow: hidden; }
.sanctum figure.terra-figure img { width: 160px; min-width: 0; image-rendering: pixelated; filter: drop-shadow(0 0 18px #4cf064); }
.sanctum figure.cube-figure { background: radial-gradient(circle at 50% 40%, #1c2f46 0%, #120d18 70%); }
.cube-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sanctum figure.cube-figure img { width: 88px; filter: drop-shadow(0 0 10px #4cc8ff55); }
.sanctum figure.terra-figure figcaption { align-self: stretch; margin: 26px -16px 0; }
.sanctum figcaption { padding: 9px 18px; font-size: .8rem; color: var(--muted); background: #120d18; border-top: 1px solid var(--line-soft); }
.stack { display: grid; gap: 20px; }
figure.rooms { margin: 18px 0; background: #120d18; border-radius: var(--r-box); overflow: hidden; border: 1px solid var(--line-soft); }
figure.rooms img { display: block; width: 100%; height: auto; }
figure.rooms figcaption { padding: 9px 16px; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line-soft); }
.sanctum-body { padding: 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }
.sanctum-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sanctum-title h3 { font-size: 2rem; }
.sanctum-info { display: grid; gap: 14px; align-content: start; }
.kv { display: grid; gap: 0; font-size: .91rem; margin: 0; }
.kv div { display: grid; grid-template-columns: 118px 1fr; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line-soft); }
.kv div:first-child { border-top: 0; padding-top: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink-2); }
.boss { display: grid; gap: 12px; align-content: start; padding: 18px; background: var(--bg-2); border-radius: var(--r-box); border: 1px solid var(--line-soft); }
.boss-name { font: 400 1.5rem/1.1 var(--display); color: var(--gold); }
.guides { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; margin: 14px 0 28px; }
.guide-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line-soft); border-radius: var(--r-box); background: var(--surface); }
.guide-card h4 { margin: 0 0 4px; }
.guide-card p { margin: 0 0 4px; color: var(--ink-2); font-size: .92rem; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 26px); grid-auto-rows: 26px; gap: 3px; padding: 5px; background: #8b8b8b; flex: none; }
.gslot { background: #6f6f6f; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #a9a9a9; display: grid; place-items: center; font: 400 .6rem/1 var(--pixel); color: #fff; text-shadow: 1px 1px 0 #3f3f3f; }
.gslot.core { background: #b58f5a; }
.gslot.r-wind { background: #b9c7e6; color: #26324d; text-shadow: none; }
.gslot.r-brick { background: #5a2a2e; }
.gslot.r-emerald { background: #2fae57; }
.gslot img { width: 20px; height: 20px; image-rendering: pixelated; }
.guide-item { width: 90px; height: 90px; flex: none; padding: 12px; background: #8b8b8b; box-shadow: inset 3px 3px 0 #373737, inset -3px -3px 0 #fff; display: grid; place-items: center; }
.guide-item img { width: 64px; height: 64px; image-rendering: pixelated; }
.boss-stats { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; align-content: flex-start; }
.pill { font: 500 .76rem/1 var(--body); padding: 5px 9px; border-radius: 999px; background: transparent; border: 1px solid var(--line); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sanctum-title .pill { border-color: var(--soul-line); color: var(--soul); }
.attacks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.attacks li { font-size: .91rem; color: var(--ink-2); padding-left: 16px; position: relative; }
.attacks li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }
.attacks b { color: var(--ink); }
.sleeping { font-size: .87rem; background: transparent; border: 1px dashed var(--line); border-radius: var(--r-small); padding: 10px 12px; color: var(--ink-2); }

/* --- achievements ------------------------------------------------------------------------------ */
.group { margin-top: 14px; font-size: 1.45rem; }
.advs { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.adv { display: grid; grid-template-columns: 58px 1fr; gap: 14px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-box); padding: 14px; align-items: start; }
.frame { width: 54px; height: 54px; display: grid; place-items: center; padding: 8px; background: #3b3542; }
.frame img { width: 100%; height: 100%; image-rendering: pixelated; }
.f-task { border: 3px solid #c9c4ce; border-radius: 3px; }
.f-goal { border: 3px solid #e8c35a; border-radius: 16px; }
.f-challenge { background: linear-gradient(160deg, #7a47c0, #3d2266); clip-path: polygon(50% 0, 63% 16%, 84% 10%, 82% 32%, 100% 44%, 86% 60%, 94% 82%, 72% 84%, 60% 100%, 44% 88%, 22% 96%, 18% 74%, 0 62%, 14% 46%, 6% 24%, 28% 20%); padding: 12px; }
.gem { width: 22px; height: 22px; background: var(--gem); transform: rotate(45deg); box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .3), inset 3px 3px 0 rgba(255, 255, 255, .35); }
.adv-head { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.adv h4 { font: 400 1.25rem/1.15 var(--display); }
.ftag { font: 500 .72rem/1 var(--body); padding: 4px 8px; border-radius: 999px; }
.t-task { background: var(--surface-2); color: var(--muted); }
.t-goal { background: #3a3014; color: #f0cf6a; }
.t-challenge { background: #2e2046; color: #c9a8ff; }
.quote { font-style: italic; color: var(--ink-2); font-size: .93rem; margin-top: 4px; }
.cond { font-size: .84rem; color: var(--muted); margin-top: 4px; }

footer { margin-top: 72px; padding-top: 20px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: .82rem; display: grid; gap: 4px; }

/* --- Крафт: the workbench as the game draws it, and the badges for how a thing is come by --- */
.crafts { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.craft { margin: 0; display: grid; gap: 12px; align-content: start; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-box); padding: 16px; }
.craft.small { background: none; border: 0; padding: 0; gap: 4px; }
.craft-table { display: flex; align-items: center; gap: 12px; width: max-content; max-width: 100%; padding: 8px; background: var(--gui);
  box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #555, 0 0 0 2px #000; }
.craft-grid { display: grid; grid-template-columns: repeat(3, 36px); grid-auto-rows: 36px; gap: 2px; }
.cslot { display: grid; place-items: center; background: #8b8b8b; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff; text-decoration: none; }
.cslot img { width: 28px; height: 28px; image-rendering: pixelated; }
a.cslot:hover { background: #a3a3a3; }
a.cslot:focus-visible { outline: 2px solid var(--soul); outline-offset: 1px; }
.cslot.out { width: 52px; height: 52px; }
.cslot.out img { width: 40px; height: 40px; }
.craft-arrow { width: 26px; height: 18px; flex: none; background: #8b8b8b;
  clip-path: polygon(0 32%, 58% 32%, 58% 0, 100% 50%, 58% 100%, 58% 68%, 0 68%); }
.craft.small .craft-grid { grid-template-columns: repeat(3, 28px); grid-auto-rows: 28px; }
.craft.small .cslot img { width: 22px; height: 22px; }
.craft.small .cslot.out { width: 40px; height: 40px; }
.craft.small .cslot.out img { width: 32px; height: 32px; }
.craft.small .craft-arrow { width: 20px; height: 14px; }
.craft figcaption { display: grid; gap: 4px; font-size: .9rem; color: var(--ink-2); }
.craft figcaption b { color: var(--ink); font: 400 1.25rem/1.15 var(--display); }
.craft figcaption b a { color: inherit; text-decoration: none; }
.craft figcaption b a:hover { color: var(--soul); }
.craft .any { justify-self: start; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--soul-soft); color: var(--ink); }
.craft .small-note { display: block; }
.callout { border-left: 3px solid var(--gold); background: var(--surface); padding: 13px 18px; border-radius: 0 var(--r-small) var(--r-small) 0; color: var(--ink-2); max-width: 80ch; }
.mbadge { display: inline-flex; align-items: center; gap: 7px; font: 500 .8rem/1 var(--body); padding: 5px 10px 5px 8px; border-radius: 999px; color: var(--ink); text-decoration: none; white-space: nowrap; border: 1px solid var(--line); background: var(--bg-2); }
.mbadge::before { content: ""; width: 8px; height: 8px; transform: rotate(45deg); background: var(--m, var(--muted)); }
a.mbadge:hover { border-color: var(--muted); }
.m-craft { --m: #c98a4a; }
.m-forge { --m: #ff6a3a; }
.m-evolve { --m: #b57cff; }
.m-assemble { --m: #4cc3d6; }
.m-loot { --m: #c8c45a; }
.m-drop { --m: #e5506a; }
.m-trial { --m: #5ad37a; }
.m-grows { --m: #6f9cff; }
.m-gift { --m: #e9b44a; }
.m-place { --m: #a0a0b8; }
.m-secret { --m: #e8e8f0; }
.methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.method { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-box); padding: 16px; display: grid; gap: 10px; align-content: start; }
.method header { display: flex; justify-content: space-between; align-items: center; }
.method p { margin: 0; color: var(--ink-2); }
.mitems { display: flex; flex-wrap: wrap; gap: 6px; }
.mitem { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 3px; border-radius: var(--r-small); background: var(--bg-2); border: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; font-size: .86rem; }
.mitem:hover { border-color: var(--soul-line); }
.mitem img { width: 24px; height: 24px; image-rendering: pixelated; }

/* --- abilities: one plain card each - name, chips, text --------------------------------- */
.abilities { display: grid; gap: 8px; }
.ability { background: var(--surface); border: 1px solid var(--line-soft); border-left: 3px solid var(--c); border-radius: var(--r-small); padding: 12px 14px 13px; display: grid; gap: 7px; min-width: 0; }
.ability header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 10px; }
.ability h4 { font: 400 1.3rem/1.15 var(--display); color: var(--c); }
.ability p { color: var(--ink-2); font-size: .9rem; line-height: 1.58; }
.ability .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ability .chip { display: inline-flex; align-items: center; gap: 5px; font: 500 .74rem/1 var(--body); padding: 4px 8px; border-radius: 999px; cursor: default;
  background: var(--bg-2); color: var(--ink-2); border: 1px solid var(--line-soft); max-width: 100%; line-height: 1.25; }
.ability .chip svg { width: 13px; height: 13px; flex: none; }
.ability .chip.rest { color: var(--gold); }

/* --- narrow screens ------------------------------------------------------------------------------ */
@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "text" "stage" "bar"; padding: 40px 32px 26px; }
  .stage { justify-self: start; }
  .rarity { grid-template-columns: 200px 112px minmax(0, 1fr); }
  .rused { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 20; height: auto; padding: 10px 16px 0; background: rgba(21, 15, 28, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-soft);
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 14px; overflow: visible; }
  .brand-name { font-size: 1.35rem; }
  .brand-mark { width: 26px; height: 26px; }
  .search { flex: 1 1 180px; }
  .search input { padding-block: 7px; }
  .search-icon { top: 9px; }
  .search-key, .side-foot { display: none; }
  .search-hint:empty { display: none; }
  .search-hint { position: absolute; top: 100%; left: 0; margin-top: 4px; padding: 3px 8px; background: var(--bg-2); border-radius: 5px; }
  .nav { flex-direction: row; overflow-x: auto; overflow-y: hidden; width: calc(100% + 32px); margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .nav a { white-space: nowrap; padding: 9px 10px 10px; border-left: 0; border-bottom: 2px solid transparent; }
  .nav a.on { border-bottom-color: var(--soul); }
  .nav .count { display: none; }
  main { padding: 0 16px 64px; }
  section { padding-block: 56px 0; scroll-margin-top: 104px; }
  html { scroll-padding-top: 108px; }
  .line { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .hero { padding: 30px 18px 20px; margin-top: 16px; border-radius: 14px; gap: 22px; }
  .facts { gap: 12px 22px; }
  .facts b { font-size: 1.6rem; }
  .stage { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 12px; justify-self: stretch; }
  .held { width: 112px; height: 112px; }
  .held img { width: 100px; height: 100px; }
  .held::after { width: 70px; bottom: 0; }
  .stage-tip { justify-items: stretch; }
  .stage-tip .tip { max-width: none; }
  .hslot { width: 46px; height: 46px; padding: 4px; }
  .hotbar-wrap { justify-items: stretch; }
  .hotbar { justify-self: center; }
  .rarity { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .rmotion, .rused { grid-column: 1 / -1; }
  .islot.named { width: 86px; }
  .islot-name { font-size: .76rem; }
  .islot.named .islot-cell { width: 58px; height: 58px; }
  .inventory { grid-template-columns: minmax(0, 1fr); }
  .inv-group { padding: 12px 8px 8px; }
  .arrow { padding: 0 1px; }
  .inspect { top: auto; width: 100%; max-height: 88dvh; border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; padding: 22px 16px 32px; }
  .inspect-enter-from .inspect, .inspect-leave-to .inspect { transform: translateY(60px); }
  .card-top { grid-template-columns: minmax(0, 1fr); padding-right: 0; }
  .card-top .slot { width: 64px; height: 64px; }
  .crafts, .methods, .advs { grid-template-columns: minmax(0, 1fr); }
  .craft-grid { grid-template-columns: repeat(3, 30px); grid-auto-rows: 30px; }
  .cslot img { width: 24px; height: 24px; }
  .kv div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .sanctum-body { padding: 18px 16px; }
  .panel { padding: 18px 16px; }
}

/* --- armour sets: the helmet in its slot, where it is made, what the full set gives ----------- */
.sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.set { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 16px; align-items: start; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-box); padding: 16px; }
.set-body { display: grid; gap: 6px; }
.set h4 { font: 400 1.4rem/1.1 var(--display); }
.set-where { font-size: .87rem; color: var(--muted); }
.set-bonus { font-size: .92rem; color: var(--ink-2); }
@media (max-width: 640px) {
  .sets { grid-template-columns: minmax(0, 1fr); }
  .set { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .set .slot { width: 56px; height: 56px; padding: 5px; box-shadow: inset 2px 2px 0 var(--slot-lo), inset -2px -2px 0 var(--slot-hi); }
}
td.inline-icons { display: table-cell; }

/* --- bloodlines: one card each, edged in the blood's own colour ---------------------------------- */
.bloods { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.blood { display: grid; gap: 8px; align-content: start; background: var(--surface); border: 1px solid var(--line-soft); border-top: 3px solid var(--b); border-radius: var(--r-small) var(--r-small) var(--r-box) var(--r-box); padding: 16px; }
.blood h4 { font: 400 1.4rem/1.1 var(--display); }
.blood-motto { font-size: .9rem; color: var(--ink-2); }
.blood-home { font-size: .86rem; color: var(--ink-2); }
.blood-blades { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* --- search: what it found, to jump straight to ---------------------------------------------- */
.found-box { position: absolute; top: calc(100% + 6px); left: 0; width: 340px; z-index: 30; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-small); box-shadow: 0 18px 44px rgba(0, 0, 0, .5); }
.found { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.found-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 5px 8px 5px 5px; border-radius: 5px; color: var(--ink); text-decoration: none; font-size: .9rem; }
.found-item img { width: 28px; height: 28px; image-rendering: pixelated; background: var(--slot); box-shadow: inset 1px 1px 0 var(--slot-lo), inset -1px -1px 0 var(--slot-hi); padding: 2px; }
.found-item.on { background: var(--soul-soft); }
.found-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.found-kind { font-size: .75rem; color: var(--muted); }
.found-box .search-hint { margin: 4px 6px 3px; min-height: 0; }

/* --- inspector: stepping to the neighbours --------------------------------------------------------- */
.inspect-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.step-btn { display: grid; gap: 6px; justify-items: start; text-align: left; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-small); color: var(--ink); font: inherit; cursor: pointer; min-width: 0; }
.step-btn.next { grid-column: 2; justify-items: end; text-align: right; }
.step-btn:hover { border-color: var(--soul-line); }
.step-dir { font-size: .76rem; color: var(--muted); }
.step-name { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; max-width: 100%; }
.step-btn.next .step-name { flex-direction: row-reverse; }
.step-name img { width: 26px; height: 26px; flex: none; image-rendering: pixelated; }
.inspect-keys { margin-top: 12px; font-size: .78rem; color: var(--muted); }
html.inspecting { overflow: hidden; }
html.inspecting body { padding-right: var(--scrollbar, 0px); }
@media (hover: none) { .inspect-keys { display: none; } }
@media (max-width: 900px) {
  .found-box { width: auto; right: 0; }
  .found-box .search-hint { position: static; display: block; padding: 0; background: none; }
}
.hint-clear { font-size: .8rem; padding: 0; }

/* --- an altar's price, as its screen shows it: slots with the stack counted in the corner ---------- */
.price { margin: 0; display: grid; gap: 8px; }
.price-head { font-size: .88rem; color: var(--ink-2); }
.price-when { color: var(--muted); }
.price-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; justify-self: start; padding: 8px; background: var(--gui); box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #555, 0 0 0 2px #000; }
.pslot { position: relative; width: 40px; height: 40px; display: grid; place-items: center; background: #8b8b8b; box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #fff; text-decoration: none; }
.pslot img { width: 30px; height: 30px; image-rendering: pixelated; }
a.pslot:hover { background: #a3a3a3; }
.pslot.out { width: 48px; height: 48px; }
.pslot.out img { width: 38px; height: 38px; }
.pcount { position: absolute; right: 2px; bottom: 1px; font: 8px/1 var(--pixel); color: #fff; text-shadow: 1px 1px 0 #3f3f3f; }
.price-plus { font: 12px/1 var(--pixel); color: #3f3f3f; padding: 0 2px; }
.price-row .craft-arrow { width: 22px; height: 16px; margin: 0 4px; }
.price-words { font-size: .84rem; color: var(--muted); }
.prices { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.price.boxed { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-box); padding: 16px; align-content: start; }
.price-title { font: 400 1.35rem/1.1 var(--display); }
.price-title a { color: var(--ink); text-decoration: none; }
.price-title a:hover { color: var(--soul); }
.price-owner { font-size: .84rem; color: var(--ink-2); }
@media (max-width: 640px) { .prices { grid-template-columns: minmax(0, 1fr); } }

/* --- weapons: the bar over them, and the table view ---------------------------------------- */
.weapon-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.seg button { font: 500 .84rem var(--body); padding: 5px 13px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--soul-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--soul-line); }
.wtable td, .wtable th { vertical-align: middle; }
.wtable thead th { padding: 0; }
.sort { font: inherit; color: inherit; background: none; border: 0; padding: 10px 14px; width: 100%; text-align: inherit; cursor: pointer; white-space: nowrap; }
th.num .sort { text-align: right; }
.sort:hover { color: var(--ink); }
.wname { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.wname:hover { color: var(--soul); }
.islot-cell.sm { width: 34px; height: 34px; padding: 3px; flex: none; }
.rname.sm { font-size: 8px; padding: 6px 8px 5px; white-space: nowrap; }

/* --- the card: whose blade it is, and a link to it --------------------------------------------- */
.card-owner { font-size: .9rem; color: var(--ink-2); margin-top: -8px; }
.inspect-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-top: 18px; }
.copied { font-size: .8rem; color: var(--soul); word-break: break-all; }
/*
 * The enchantment over the codex.
 *
 * style.css lays the page out; this file makes it a world. Each section and each sanctum has
 * the colours of its own place (--w1, the light; --w2, the second light), and the page eases
 * into them as it scrolls: the sky behind, the motes in the air, the glow at the edges of every
 * card, the rule under every heading. The held blade stands on a magic circle in the light of
 * its rarity, with the purple glint of an enchanted item running over it.
 */
@property --w1 { syntax: "<color>"; inherits: true; initial-value: #8a5cff; }
@property --w2 { syntax: "<color>"; inherits: true; initial-value: #6fe4dc; }

:root {
  --w1: #8a5cff;
  --w2: #6fe4dc;
  transition: --w1 1.4s ease, --w2 1.4s ease;
}
:root[data-world="hero"]      { --w1: #8a5cff; --w2: #6fe4dc; }
:root[data-world="start"]     { --w1: #6fe4dc; --w2: #8a5cff; }
:root[data-world="rarity"]    { --w1: #d26bff; --w2: #f1b94d; }
:root[data-world="weapons"]   { --w1: #ff4f45; --w2: #ff9a3c; }
:root[data-world="materials"] { --w1: #42d3c6; --w2: #8a5cff; }
:root[data-world="craft"]     { --w1: #e6a04f; --w2: #6fe4dc; }
:root[data-world="growth"]    { --w1: #f1b94d; --w2: #ff6a3a; }
:root[data-world="sanctums"]  { --w1: #b57cff; --w2: #f1b94d; }
:root[data-world="forge"]     { --w1: #ff5a2a; --w2: #ffb347; }
:root[data-world="temple"]    { --w1: #f5d58a; --w2: #8fd3ff; }
:root[data-world="jungle"]    { --w1: #4fd66e; --w2: #c8e05a; }
:root[data-world="night"]     { --w1: #5b6cff; --w2: #b57cff; }
:root[data-world="factory"]   { --w1: #3fd0e0; --w2: #d8e4f0; }
:root[data-world="castle"]    { --w1: #e03a3a; --w2: #f1b94d; }
:root[data-world="cube"]      { --w1: #4cc8ff; --w2: #b57cff; }
:root[data-world="terra"]     { --w1: #6be36b; --w2: #2fae57; }
:root[data-world="raids"]     { --w1: #f1b94d; --w2: #b57cff; }
:root[data-world="blood"]     { --w1: #e0303f; --w2: #ff7a2e; }
:root[data-world="trophies"]  { --w1: #e8c35a; --w2: #9d6bff; }
:root[data-world="admin"]     { --w1: #6f9cff; --w2: #9aa7c0; }
@media (prefers-reduced-motion: reduce) { :root { transition: none; } }

/* --- the sky and the air ------------------------------------------------------------------- */
body { background: transparent; }
::selection { background: color-mix(in srgb, var(--w1) 40%, transparent); }
html { scrollbar-color: color-mix(in srgb, var(--w1) 45%, #3a2d50) transparent; }
.sky {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(70vw 60vh at 88% -8%, color-mix(in srgb, var(--w1) 26%, transparent), transparent 70%),
    radial-gradient(60vw 55vh at -6% 104%, color-mix(in srgb, var(--w2) 18%, transparent), transparent 70%),
    radial-gradient(40vw 40vh at 50% 50%, color-mix(in srgb, var(--w1) 6%, transparent), transparent 80%),
    linear-gradient(180deg, #170f20, #120c19 60%, #0f0a15);
}
/* A faint grid of blocks under it all, as if the codex were written on deepslate. */
.sky::after {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background:
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px) 0 0 / 32px 32px;
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 80%);
}
.motes { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }

/* --- experience bar: how far into the codex ----------------------------------------------------- */
.xp { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 60; background: rgba(10, 6, 14, .7); pointer-events: none; }
.xp-fill {
  position: absolute; inset: 0; transform-origin: 0 50%;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(5.555% - 2px), rgba(0, 0, 0, .55) calc(5.555% - 2px) 5.555%),
    linear-gradient(180deg, #c6ff5a, #80ff20 45%, #3c9c0e);
  box-shadow: 0 0 12px rgba(128, 255, 32, .55);
}

/* --- the frame of every card: a thin line of the world's light round a dark slab ---------------- */
.panel, .sanctum, .adv, .set, .blood, .price.boxed, .inv-group, .method, .craft:not(.small), .guide-card,
.tbl, .rarities, .found-box, .step-btn {
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 90%, var(--w1)) 0%, var(--surface) 38%, color-mix(in srgb, var(--surface) 94%, #000) 100%) padding-box,
    linear-gradient(150deg, color-mix(in srgb, var(--w1) 60%, transparent) 0%, rgba(255, 255, 255, .06) 30%, rgba(255, 255, 255, .03) 70%, color-mix(in srgb, var(--w2) 50%, transparent) 100%) border-box;
  box-shadow: 0 24px 60px -36px color-mix(in srgb, var(--w1) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.panel .tbl, .boss .tbl { background: rgba(0, 0, 0, .22) padding-box, linear-gradient(rgba(255, 255, 255, .06), rgba(255, 255, 255, .06)) border-box; box-shadow: none; }
.boss {
  background: linear-gradient(180deg, rgba(0, 0, 0, .28), rgba(0, 0, 0, .12)) padding-box,
              linear-gradient(160deg, color-mix(in srgb, var(--w1) 45%, transparent), transparent 60%) border-box;
  border: 1px solid transparent;
}
thead th { background: color-mix(in srgb, var(--bg-2) 85%, var(--w1)); }
.flow .step { border-top-color: var(--w1); box-shadow: 0 -10px 30px -22px var(--w1) inset; }
.flow .to, .arrow { color: var(--w1); }
.ability { box-shadow: 0 18px 40px -34px var(--c); }

/* --- section heads: an emblem in a diamond, the title, a rule of light ------------------------- */
.sec-title { display: flex; align-items: center; gap: 18px; }
.sec-title h2 {
  background: linear-gradient(180deg, #ffffff 10%, #e9e0f7 50%, color-mix(in srgb, var(--w1) 45%, #cbbbe6) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 14px color-mix(in srgb, var(--w1) 35%, transparent));
}
.emblem {
  position: relative; flex: none; width: 54px; height: 54px; display: grid; place-items: center;
}
.emblem::before {
  content: ""; position: absolute; inset: 7px; transform: rotate(45deg); border-radius: 4px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--w1) 35%, #1b1424), #140e1c 70%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--w1) 70%, transparent), 0 0 24px -2px color-mix(in srgb, var(--w1) 60%, transparent), inset 0 0 12px rgba(0, 0, 0, .6);
}
.emblem img { position: relative; width: 30px; height: 30px; image-rendering: pixelated; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--w1) 70%, transparent)); }
.sec-rule { flex: 1 1 auto; max-width: 340px; height: 1px; position: relative; background: linear-gradient(90deg, var(--w1), color-mix(in srgb, var(--w2) 50%, transparent) 60%, transparent); }
.sec-rule::before { content: ""; position: absolute; left: 0; top: -3px; width: 7px; height: 7px; transform: rotate(45deg); background: var(--w1); box-shadow: 0 0 10px var(--w1); }
.sec-rule::after { content: ""; position: absolute; left: 40%; top: -2px; width: 5px; height: 5px; transform: rotate(45deg); background: var(--w2); opacity: .8; }
section > h3, .panel h3, .group { position: relative; }
section > h3::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 12px; vertical-align: .18em; transform: rotate(45deg); background: var(--w1); box-shadow: 0 0 10px var(--w1); }

/* --- the hero: a blade on a magic circle ------------------------------------------------------- */
.hero {
  isolation: isolate;
  border: 1px solid transparent;
  background:
    radial-gradient(38% 58% at 76% 48%, color-mix(in srgb, var(--h1, #8a5cff) 30%, transparent), transparent 72%),
    radial-gradient(60% 80% at 100% 0%, color-mix(in srgb, var(--h3, #6fe4dc) 18%, transparent), transparent 62%),
    radial-gradient(50% 70% at 0% 100%, rgba(111, 228, 220, .08), transparent 70%),
    linear-gradient(180deg, rgba(31, 21, 44, .92), rgba(18, 12, 26, .9)) padding-box,
    linear-gradient(140deg, color-mix(in srgb, var(--h1, #8a5cff) 70%, transparent), rgba(255, 255, 255, .05) 35%, rgba(255, 255, 255, .03) 65%, color-mix(in srgb, var(--h3, #6fe4dc) 60%, transparent)) border-box;
  box-shadow: 0 40px 90px -50px color-mix(in srgb, var(--h1, #8a5cff) 80%, transparent);
  transition: background .6s ease;
}
/* Stars over the hero, still: a few dozen points of light. */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .7;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff, transparent), radial-gradient(1px 1px at 24% 72%, #cfc5ff, transparent),
    radial-gradient(1.5px 1.5px at 38% 34%, #fff, transparent), radial-gradient(1px 1px at 47% 88%, #b8f4ef, transparent),
    radial-gradient(1px 1px at 58% 12%, #fff, transparent), radial-gradient(1.5px 1.5px at 66% 64%, #ffe7b0, transparent),
    radial-gradient(1px 1px at 72% 26%, #fff, transparent), radial-gradient(1px 1px at 81% 81%, #cfc5ff, transparent),
    radial-gradient(1.5px 1.5px at 90% 40%, #fff, transparent), radial-gradient(1px 1px at 96% 10%, #b8f4ef, transparent),
    radial-gradient(1px 1px at 6% 52%, #fff, transparent), radial-gradient(1px 1px at 32% 8%, #ffe7b0, transparent),
    radial-gradient(1px 1px at 52% 50%, #fff, transparent), radial-gradient(1px 1px at 86% 58%, #fff, transparent),
    radial-gradient(1px 1px at 18% 92%, #cfc5ff, transparent), radial-gradient(1px 1px at 63% 94%, #fff, transparent);
}
.hero-kicker { font-size: .86rem; color: color-mix(in srgb, var(--h3, #6fe4dc) 70%, #cfc5dd); letter-spacing: .02em; }
.hero h1 { display: grid; gap: .06em; }
.h1-line {
  display: block; width: max-content; max-width: 100%;
  background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, .95) 50%, transparent 62%) -160% 0 / 260% 100% no-repeat,
              linear-gradient(180deg, #ffffff 0%, #efe7fb 42%, color-mix(in srgb, var(--h1, #8a5cff) 40%, #c9b8ea) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 24px color-mix(in srgb, var(--h1, #8a5cff) 45%, transparent));
  animation: title-glint 3.2s ease .5s 1 both;
}
.h1-line + .h1-line { animation-delay: .75s; }
@keyframes title-glint { from { background-position: -160% 0, 0 0; } to { background-position: 260% 0, 0 0; } }
.facts a { padding: 8px 14px 9px; border-radius: 10px; background: rgba(0, 0, 0, .22); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.facts a:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--h1, #8a5cff) 60%, transparent), 0 0 24px -8px var(--h1, #8a5cff); }

.held { width: 300px; height: 320px; perspective: 700px; }
.held::after { display: none; }
.beam {
  position: absolute; left: 50%; bottom: 58px; width: 110px; height: 300px; transform: translateX(-50%);
  background: linear-gradient(0deg, color-mix(in srgb, var(--h1, #8a5cff) 55%, transparent), color-mix(in srgb, var(--h3, #6fe4dc) 18%, transparent) 55%, transparent);
  filter: blur(14px); opacity: .75; border-radius: 50% 50% 0 0;
  animation: beam 4s ease-in-out infinite;
}
@keyframes beam { 0%, 100% { opacity: .55; } 50% { opacity: .85; } }
.circle {
  position: absolute; left: 50%; bottom: -46px; width: 300px; height: 300px; margin-left: -150px;
  transform: rotateX(74deg); overflow: visible;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--h1, #8a5cff) 80%, transparent));
}
.circle-spin { transform-origin: 0 0; animation: spin 46s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.circle .ring { fill: none; stroke: color-mix(in srgb, var(--h1, #8a5cff) 85%, #fff); stroke-width: 1.6; opacity: .9; }
.circle .ring.thin { stroke-width: .8; opacity: .6; }
.circle .ring.dashed { stroke-dasharray: 4 6; }
.circle .tick { stroke: color-mix(in srgb, var(--h3, #6fe4dc) 80%, #fff); stroke-width: 1; opacity: .7; }
.circle .rune { fill: color-mix(in srgb, var(--h3, #6fe4dc) 85%, #fff); opacity: .9; }
.circle .star { fill: color-mix(in srgb, var(--h1, #8a5cff) 14%, transparent); stroke: color-mix(in srgb, var(--h1, #8a5cff) 80%, #fff); stroke-width: .9; opacity: .8; }
.sparks { position: absolute; left: 50%; top: 50%; width: 320px; height: 320px; margin: -170px 0 0 -160px; pointer-events: none; }
.held-item { position: relative; display: block; width: 176px; height: 176px; margin-top: -40px; animation: bob 3.2s ease-in-out infinite, held-in .7s cubic-bezier(.2, .9, .3, 1.3) both; }
.held-item img { display: block; width: 100%; height: 100%; image-rendering: pixelated; animation: none; filter: drop-shadow(0 0 18px color-mix(in srgb, var(--h1, #8a5cff) 70%, transparent)) drop-shadow(0 12px 10px rgba(0, 0, 0, .5)); }
@keyframes held-in { from { opacity: 0; scale: .6; } to { opacity: 1; scale: 1; } }

/* The glint of an enchanted item: a purple shine running over the picture, and only over it. */
.glint::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 32%, rgba(165, 80, 255, .55) 44%, rgba(255, 230, 255, .85) 50%, rgba(165, 80, 255, .55) 56%, transparent 68%) 0 0 / 300% 100% no-repeat;
  -webkit-mask: var(--mask) center / contain no-repeat; mask: var(--mask) center / contain no-repeat;
  animation: glint 3.4s ease-in-out infinite;
}
@keyframes glint { 0% { background-position: 130% 0; } 60%, 100% { background-position: -40% 0; } }

/* --- item tiles: each slot glows in its rarity's colours ------------------------------------------- */
.islot-cell { isolation: isolate; transition: transform .18s ease, box-shadow .18s ease; }
.islot-cell::before {
  content: ""; position: absolute; inset: -10px; z-index: -1; border-radius: 50%; opacity: .45; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--r1, #8a5cff) 70%, transparent), transparent);
  transition: opacity .2s ease;
}
.islot.rare .islot-cell::before { opacity: .7; animation: rare-pulse 3.6s ease-in-out infinite; }
@keyframes rare-pulse { 0%, 100% { opacity: .5; } 50% { opacity: .85; } }
.islot:hover .islot-cell, .islot:focus-visible .islot-cell { transform: translateY(-3px); box-shadow: inset 3px 3px 0 var(--slot-lo), inset -3px -3px 0 var(--slot-hi), 0 10px 22px -8px color-mix(in srgb, var(--r1, #8a5cff) 90%, transparent); }
.islot:hover .islot-cell::before { opacity: 1; }
.islot-cell img { position: relative; z-index: 1; }
.islot:hover .islot-cell::after, .islot.open .islot-cell::after {
  z-index: 2; background: linear-gradient(115deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, .12) 40%, rgba(170, 100, 255, .25) 60%, rgba(255, 255, 255, .3));
}
.islot.named .islot-name { transition: color .15s ease; }
.islot.dim .islot-cell::before { display: none; }
@media (prefers-reduced-motion: reduce) { .islot.rare .islot-cell::before { animation: none; } .islot-cell { transition: none; } }

/* --- weapon lines: each line in the colour of its blades, linked by running energy ---------------- */
.line { --lw: var(--w1); position: relative; padding-left: 16px; border-bottom-color: rgba(255, 255, 255, .05);
  background: linear-gradient(90deg, color-mix(in srgb, var(--lw) 13%, transparent), transparent 55%); }
.line::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(var(--lw), transparent); box-shadow: 0 0 12px var(--lw); }
[data-key="hell"]    { --lw: #ff5a2a; }
[data-key="cleaver"] { --lw: #9be04a; }
[data-key="blood"]   { --lw: #e0303f; }
[data-key="axe"]     { --lw: #f1b94d; }
[data-key="sky"]     { --lw: #8fd3ff; }
[data-key="night"]   { --lw: #5b6cff; }
[data-key="jungle"]  { --lw: #4fd66e; }
[data-key="terra"]   { --lw: #6be36b; }
[data-key="techno"]  { --lw: #3fd0e0; }
[data-key="abyss"]   { --lw: #b57cff; }
.line-title { color: color-mix(in srgb, var(--lw) 35%, #fff); text-shadow: 0 0 18px color-mix(in srgb, var(--lw) 50%, transparent); }
.energy { position: relative; display: inline-block; width: 34px; height: 12px; margin-top: 33px; flex: none; }
.energy::before {
  content: ""; position: absolute; left: 0; right: 7px; top: 5px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--lw, var(--w1)) 30%, #fff 50%, var(--lw, var(--w1)) 70%, transparent) 0 0 / 200% 100%;
  box-shadow: 0 0 8px var(--lw, var(--w1)); animation: energy 1.6s linear infinite;
}
.energy::after { content: ""; position: absolute; right: 1px; top: 2px; width: 7px; height: 7px; border-top: 2px solid var(--lw, var(--w1)); border-right: 2px solid var(--lw, var(--w1)); transform: rotate(45deg); filter: drop-shadow(0 0 4px var(--lw, var(--w1))); }
.chain-row .energy { margin-top: 0; }
@keyframes energy { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .energy::before { animation: none; } }

/* --- the start: a quest log, step after step along a line of light ------------------------------- */
.steps { grid-template-columns: minmax(0, 1fr); max-width: 760px; gap: 0; position: relative; }
.steps::before { content: ""; position: absolute; left: 17px; top: 14px; bottom: 30px; width: 2px; background: linear-gradient(var(--w1), color-mix(in srgb, var(--w2) 60%, transparent) 80%, var(--gold)); box-shadow: 0 0 14px color-mix(in srgb, var(--w1) 60%, transparent); }
.steps li { padding-bottom: 22px; }
.steps li::before { position: relative; z-index: 1; color: #120c19; background: linear-gradient(135deg, #fff, var(--w1) 60%); box-shadow: 0 0 18px var(--w1); clip-path: none; transform: rotate(45deg); width: 30px; height: 30px; margin: 0 0 0 3px; border-radius: 4px; font-size: 0; }
.steps li::after { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 30px; display: grid; place-items: center; z-index: 2; font: 400 1.15rem/1 var(--display); color: #120c19; }
.steps li:last-child::before { background: linear-gradient(135deg, #fff, var(--gold) 60%); box-shadow: 0 0 22px var(--gold); }
.steps h4 { font: 400 1.35rem/1.15 var(--display); color: var(--ink); }

/* --- rarity rows: the shimmer stands out on a plate of night ---------------------------------------- */
.rname { box-shadow: inset 0 0 0 2px #28007f, 0 0 18px -6px #5000ff; }
.rex { width: 34px; height: 34px; padding: 3px; background: var(--slot); box-shadow: inset 2px 2px 0 var(--slot-lo), inset -2px -2px 0 var(--slot-hi); display: grid; place-items: center; }
.rex img { width: 100%; height: 100%; image-rendering: pixelated; }

/* --- sanctums: their pictures framed like a window onto the world ----------------------------------- */
.sanctum figure { position: relative; }
.sanctum > figure:not(.terra-figure)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; pointer-events: none; background: linear-gradient(transparent, color-mix(in srgb, #0f0a15 70%, var(--w1))); opacity: .65; }
.sanctum-title h3 { font-size: 2.3rem; text-shadow: 0 0 26px color-mix(in srgb, var(--w1) 55%, transparent); }

/* --- boss bars, as the game draws them over a boss -------------------------------------------------- */
.bossbar { display: grid; gap: 6px; justify-items: center; margin-bottom: 6px; }
.bossbar-name { font: 10px/1.4 var(--pixel); color: #fff; text-shadow: 2px 2px 0 #3f3f3f; text-align: center; }
.bossbar-track { position: relative; width: min(100%, 364px); height: 10px; background: var(--bb-dark); box-shadow: 0 0 0 2px #000, inset 0 2px 0 rgba(255, 255, 255, .12); overflow: hidden; }
.bossbar-fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); transition: transform 1.6s cubic-bezier(.2, .8, .2, 1);
  background: linear-gradient(180deg, var(--bb-light) 0 30%, var(--bb) 30% 70%, var(--bb-deep) 70%); box-shadow: 0 0 14px var(--bb); }
.bossbar.full .bossbar-fill { transform: scaleX(1); }
.bossbar-notch { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(0, 0, 0, .55) calc(10% - 2px) 10%); }
.bb-red    { --bb: #e8392c; --bb-light: #ff7a63; --bb-deep: #8e1a12; --bb-dark: #3a0b08; }
.bb-white  { --bb: #e9e9f2; --bb-light: #ffffff; --bb-deep: #9a9aae; --bb-dark: #2a2a33; }
.bb-green  { --bb: #3fd43a; --bb-light: #8dff7a; --bb-deep: #1d7a17; --bb-dark: #0b2a09; }
.bb-purple { --bb: #b23be8; --bb-light: #db8aff; --bb-deep: #5d1786; --bb-dark: #24092f; }
.bb-blue   { --bb: #2f8df0; --bb-light: #7ec0ff; --bb-deep: #164d8c; --bb-dark: #08203a; }
.bb-yellow { --bb: #f2d23a; --bb-light: #fff28a; --bb-deep: #8c7612; --bb-dark: #2e2706; }
@media (prefers-reduced-motion: reduce) { .bossbar-fill { transition: none; } }

/* --- advancements, as the toast that slides in at the corner of the game ---------------------------- */
.toast { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 10px; padding: 7px 10px 7px 7px; margin-bottom: 4px;
  background: #212121; border-radius: 4px; box-shadow: inset 0 0 0 2px #555, inset 0 0 0 4px #212121, inset 0 0 0 5px #000, 0 10px 24px -14px #000; }
.toast .frame { width: 40px; height: 40px; padding: 6px; }
.toast .frame.f-challenge { padding: 9px; }
.toast-head { font: 8px/1.5 var(--pixel); color: #ffff55; }
.toast.t-challenge .toast-head { color: #ff55ff; }
.toast-title { font: 9px/1.5 var(--pixel); color: #fff; word-break: break-word; }
/* As the game paints the advancement's name: green for a task or a goal, purple for a challenge. */
.toast .toast-title { color: #55ff55; }
.toast.t-challenge .toast-title { color: #c76bff; }
.adv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.adv:hover .toast { box-shadow: inset 0 0 0 2px #8b8b8b, inset 0 0 0 4px #212121, inset 0 0 0 5px #000, 0 0 26px -8px var(--w1); }

/* --- odds and ends ------------------------------------------------------------------------------------ */
.chip[aria-pressed="true"], .seg button[aria-pressed="true"] { background: color-mix(in srgb, var(--w1) 18%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--w1) 70%, transparent), 0 0 18px -6px var(--w1); border-color: transparent; }
.nav a.on { border-left-color: var(--w1); text-shadow: 0 0 14px color-mix(in srgb, var(--w1) 60%, transparent); }
.side { background: linear-gradient(180deg, rgba(18, 12, 26, .55), rgba(18, 12, 26, .2)); }
.inspect { background: linear-gradient(180deg, color-mix(in srgb, #1b1424 92%, var(--w1)), #1b1424 30%) ; box-shadow: -30px 0 80px -20px color-mix(in srgb, var(--w1) 35%, #000); }
footer { position: relative; border-top: 0; padding-top: 34px; }
footer::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--w1) 30%, var(--w2) 70%, transparent); }
footer::after { content: ""; position: absolute; top: -4px; left: 50%; width: 9px; height: 9px; transform: translateX(-50%) rotate(45deg); background: var(--w1); box-shadow: 0 0 14px var(--w1); }

@media (max-width: 900px) {
  .side { background: rgba(18, 12, 26, .9); }
  .xp { height: 3px; }
}
@media (max-width: 640px) {
  .held { width: 240px; height: 230px; }
  .held-item { width: 120px; height: 120px; margin-top: -20px; }
  .circle { width: 230px; height: 230px; margin-left: -115px; bottom: -40px; }
  .beam { height: 210px; bottom: 40px; width: 80px; }
  .sparks { transform: scale(.75); }
  .emblem { width: 44px; height: 44px; }
  .emblem img { width: 24px; height: 24px; }
  .sec-title { gap: 12px; }
  .sec-rule { display: none; }
  .energy { width: 22px; margin-top: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .beam, .circle-spin, .held-item, .h1-line, .glint::after { animation: none !important; }
}
.rhead { display: inline-flex; align-items: center; gap: 10px; justify-self: start; }
.rarity { grid-template-columns: 256px 112px minmax(140px, .8fr) minmax(0, 1.6fr); }
@media (max-width: 1100px) { .rarity { grid-template-columns: 250px 112px minmax(0, 1fr); } }
@media (max-width: 640px) { .rarity { grid-template-columns: minmax(0, 1fr) auto; } }

/* The stage stands the blade on its circle and hangs its tooltip under it, as the game does on hover. */
.stage { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 4px; align-self: center; }
.stage-tip { justify-items: center; width: 100%; max-width: 400px; position: relative; z-index: 2; }
.stage-tip .tip { max-width: none; }
.facts { gap: 10px; }
.facts a { padding: 7px 12px 8px; }
.facts b { font-size: 1.6rem; }
.hero { grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.facts { gap: 8px; }
.facts a { padding: 6px 10px 7px; }

/* --- the card in the inspector: the item on a halo of its rarity ------------------------------------ */
.card-relic { position: relative; width: 96px; height: 96px; display: grid; place-items: center; }
.card-halo { position: absolute; inset: -18px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--r1) 55%, transparent), color-mix(in srgb, var(--r2) 18%, transparent) 60%, transparent); animation: halo 4s ease-in-out infinite; }
.card-halo::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--r1) 70%, transparent); animation: spin 30s linear infinite; }
@keyframes halo { 0%, 100% { opacity: .75; scale: .96; } 50% { opacity: 1; scale: 1.04; } }
.card-pic { position: relative; display: block; width: 84px; height: 84px; animation: bob 3.2s ease-in-out infinite; }
.card-pic img { width: 100%; height: 100%; image-rendering: pixelated; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--r1) 70%, transparent)) drop-shadow(0 8px 6px rgba(0, 0, 0, .5)); }
.card-top { grid-template-columns: 96px minmax(0, 1fr); gap: 20px; }
.inspect { background:
  radial-gradient(420px 260px at 20% 0%, color-mix(in srgb, var(--r1, var(--w1)) 18%, transparent), transparent 70%),
  linear-gradient(180deg, color-mix(in srgb, #1b1424 94%, var(--w1)), #1b1424 30%); }
@media (prefers-reduced-motion: reduce) { .card-halo, .card-halo::after, .card-pic { animation: none; } }

/* --- bloodlines: each card lit by its blood ------------------------------------------------------ */
.blood { position: relative; overflow: hidden; border-top: 1px solid transparent; }
.blood::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--b) 24%, transparent), transparent 60%); }
.blood > * { position: relative; }
.blood h4 { display: flex; align-items: center; gap: 12px; color: color-mix(in srgb, var(--b) 40%, #fff); text-shadow: 0 0 20px color-mix(in srgb, var(--b) 60%, transparent); }
.blood-gem { width: 14px; height: 14px; flex: none; transform: rotate(45deg); background: linear-gradient(135deg, #fff, var(--b) 55%, color-mix(in srgb, var(--b) 50%, #000)); box-shadow: 0 0 14px var(--b); }
.blood:hover { box-shadow: 0 24px 60px -30px var(--b); }

/* --- armour sets, each in the light of its metal ---------------------------------------------------- */
.set { position: relative; overflow: hidden; --sc: var(--w1); }
.set::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(90% 120% at 0% 50%, color-mix(in srgb, var(--sc) 22%, transparent), transparent 60%); }
.set > * { position: relative; }
.set .slot { box-shadow: inset 3px 3px 0 var(--slot-lo), inset -3px -3px 0 var(--slot-hi), 0 0 26px -4px var(--sc); }
.set h4 { color: color-mix(in srgb, var(--sc) 35%, #fff); }
.set-molten    { --sc: #ff6a2a; }
.set-paladin   { --sc: #f5e6b0; }
.set-nightking { --sc: #5b6cff; }
.set-terra     { --sc: #4fd66e; }
.set-demon     { --sc: #e0303f; }

/* --- sanctum pictures carry their name, like a place card in a game ---------------------------------- */
.figure-title {
  position: absolute; left: 22px; bottom: 44px; z-index: 2; pointer-events: none;
  font: 400 clamp(1.8rem, 3.6vw, 3rem)/1 var(--display); color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .5), 0 0 30px color-mix(in srgb, var(--w1) 80%, transparent);
}
.sanctum figure > figcaption { position: relative; z-index: 2; }

/* --- the rail: a seam of light along its edge --------------------------------------------------------- */
.side::after { content: ""; position: absolute; right: 0; top: 12%; bottom: 12%; width: 1px; background: linear-gradient(transparent, color-mix(in srgb, var(--w1) 70%, transparent), transparent); opacity: .6; pointer-events: none; }
.brand-mark { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--w1) 80%, transparent)); }
.brand-name { background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--w1) 45%, #d9cdef)); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (max-width: 900px) { .side::after { display: none; } .figure-title { left: 14px; bottom: 40px; } }

/* --- the atlas: the world cut through, sanctums marked --------------------------------------------- */
.atlas { margin: 0; display: grid; gap: 10px; }
.atlas-scroll { overflow-x: auto; border-radius: 16px; box-shadow: 0 30px 80px -40px color-mix(in srgb, var(--w1) 70%, transparent), 0 0 0 1px rgba(255, 255, 255, .06); background: #0e0a13; }
.atlas-svg { display: block; width: 100%; min-width: 860px; height: auto; }
.atlas figcaption { font-size: .84rem; color: var(--muted); }
.atlas-star { fill: #fff; animation: twinkle 3.6s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.atlas-clouds { animation: drift 40s linear infinite alternate; }
.atlas-clouds.night { animation-duration: 55s; animation-direction: alternate-reverse; }
@keyframes drift { from { transform: translateX(-24px); } to { transform: translateX(24px); } }
.atlas-pulse { animation: pulse-glow 3.2s ease-in-out infinite; }
@keyframes pulse-glow { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
.atlas-blink { animation: blink 1.6s steps(2, jump-none) infinite; }
.atlas-blink.slow { animation-duration: 2.8s; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.atlas-windows { animation: pulse-glow 4.6s ease-in-out infinite; }
.atlas-ember { fill: #ffb347; animation: ember 5s ease-in infinite; }
@keyframes ember { 0% { opacity: 0; transform: translateY(18px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-22px); } }
.atlas-lava { animation: pulse-glow 2.6s ease-in-out infinite; }
.atlas-portal-face { animation: portal 3s ease-in-out infinite; }
@keyframes portal { 0%, 100% { fill: #6a22c8; } 50% { fill: #a24bff; } }
.atlas-ruler line { stroke: rgba(255, 255, 255, .45); stroke-width: 1; }
.atlas-ruler text { font: 10px var(--pixel); fill: rgba(255, 255, 255, .8); paint-order: stroke; stroke: rgba(0, 0, 0, .7); stroke-width: 3px; }
.atlas-world { font: 400 22px var(--display); fill: rgba(255, 255, 255, .85); paint-order: stroke; stroke: rgba(0, 0, 0, .6); stroke-width: 4px; }
.pin { cursor: pointer; }
.pin-glow { fill: var(--pin); opacity: .28; animation: pin-pulse 2.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pin-pulse { 0%, 100% { opacity: .2; transform: scale(.9); } 50% { opacity: .45; transform: scale(1.12); } }
.pin-gem { fill: #120c19; stroke: var(--pin); stroke-width: 2.5; filter: drop-shadow(0 0 6px var(--pin)); }
.pin-icon { image-rendering: pixelated; }
.pin-label { font: 600 14px var(--body); fill: #fff; text-anchor: middle; paint-order: stroke; stroke: rgba(10, 6, 14, .85); stroke-width: 5px; stroke-linejoin: round; }
.pin:hover .pin-gem, .pin:focus-visible .pin-gem { fill: color-mix(in srgb, var(--pin) 35%, #120c19); stroke-width: 3.5; }
.pin:hover .pin-label { fill: var(--pin); }
.pin:focus { outline: none; }
.pin:focus-visible .pin-glow { opacity: .7; }
@media (prefers-reduced-motion: reduce) {
  .atlas-star, .atlas-clouds, .atlas-pulse, .atlas-blink, .atlas-windows, .atlas-ember, .atlas-lava, .atlas-portal-face, .pin-glow { animation: none; }
}

/* --- the game's tooltip under the pointer ----------------------------------------------------------- */
.hovertip { position: fixed; z-index: 70; width: max-content; max-width: 320px; pointer-events: none; filter: drop-shadow(0 14px 24px rgba(0, 0, 0, .55)); }
.hovertip .tip { font-size: 12.5px; }

/* --- the mastery track ------------------------------------------------------------------------------ */
.mtrack { position: relative; height: 120px; margin: 6px 14px 4px; }
.mtrack-rail { position: absolute; left: 0; right: 0; top: 56px; height: 8px; border-radius: 8px; background: rgba(0, 0, 0, .45); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); overflow: hidden; }
.mtrack-fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0); transition: transform 1.8s cubic-bezier(.2, .8, .2, 1);
  background: linear-gradient(90deg, #6fe4dc, #8a5cff 45%, #f1b94d 80%, #ffffff); box-shadow: 0 0 16px rgba(241, 185, 77, .6); }
.mtrack.lit .mtrack-fill { transform: scaleX(1); }
.mmark { position: absolute; top: 60px; transform: translateX(-50%); display: grid; justify-items: center; }
.mgem { position: absolute; top: -8px; width: 14px; height: 14px; transform: rotate(45deg) scale(.4); opacity: 0; border-radius: 2px;
  background: linear-gradient(135deg, #fff, #8a5cff); box-shadow: 0 0 10px #8a5cff; transition: transform .4s ease var(--delay), opacity .4s ease var(--delay); }
.mmark.star .mgem { background: linear-gradient(135deg, #fff, var(--gold)); box-shadow: 0 0 12px var(--gold); }
.mmark.big .mgem { width: 18px; height: 18px; top: -10px; background: linear-gradient(135deg, #fff, #6fe4dc); box-shadow: 0 0 16px #6fe4dc; }
.mtrack.lit .mgem { transform: rotate(45deg) scale(1); opacity: 1; }
.mlabel { position: absolute; top: 16px; display: grid; justify-items: center; white-space: nowrap; font-size: .76rem; color: var(--ink-2); text-align: center; }
.mmark.up .mlabel { top: auto; bottom: 16px; }
.mlabel b { font: 400 1.05rem/1 var(--display); color: var(--ink); }
.mmark.star .mlabel span { color: var(--gold); }
.mmark.big .mlabel span { color: #6fe4dc; }
@media (max-width: 640px) { .mtrack { height: 132px; margin-inline: 18px; } .mlabel { font-size: .68rem; } }
@media (prefers-reduced-motion: reduce) { .mtrack-fill, .mgem { transition: none; } }

/* --- trials: the five waves, the three levels, the fourth form ----------------------------------------- */
.waves { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 6px 0 4px; }
.wave { display: grid; justify-items: center; gap: 2px; width: 62px; padding: 8px 0 7px; border-radius: 10px; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--w1) 45%, transparent); }
.wave-n { font: 400 1.5rem/1 var(--display); color: var(--ink); }
.wave-t { font-size: .72rem; color: var(--muted); }
.wave.boss { width: 78px; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, #e8392c 40%, transparent), rgba(0, 0, 0, .35)); box-shadow: inset 0 0 0 1px #e8392c, 0 0 24px -6px #e8392c; }
.wave.boss .wave-t { color: #ff8a7a; }
.waves .energy { margin-top: 0; }
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.tier { position: relative; overflow: hidden; display: grid; gap: 8px; align-content: start; padding: 16px 16px 14px; border-radius: var(--r-box); background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px var(--tc), 0 18px 40px -30px var(--tc); }
.tier-1 { --tc: color-mix(in srgb, #c98a4a 70%, transparent); }
.tier-2 { --tc: color-mix(in srgb, #cfd6e0 70%, transparent); }
.tier-3 { --tc: color-mix(in srgb, #f1b94d 85%, transparent); }
.tier-n { position: absolute; right: 12px; top: -10px; font: 400 4.4rem/1 var(--display); color: var(--tc); opacity: .35; pointer-events: none; }
.tier h4 { font: 400 1.35rem/1.1 var(--display); }
.tier .kv div { grid-template-columns: 104px 1fr; }
.fourths { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.fourth { position: relative; overflow: hidden; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 14px; align-items: start; padding: 16px; border-radius: var(--r-box);
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--b) 22%, transparent), rgba(0, 0, 0, .28) 60%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--b) 55%, transparent); }
.fourth-relic { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--b) 45%, transparent), transparent); }
.fourth-relic img { width: 40px; height: 40px; image-rendering: pixelated; filter: drop-shadow(0 0 8px var(--b)); animation: bob 3.4s ease-in-out infinite; }
.fourth-blood { font-size: .78rem; color: color-mix(in srgb, var(--b) 60%, #fff); }
.fourth h4 { font: 400 1.3rem/1.15 var(--display); margin: 2px 0 4px; }
.fourth-where { font-size: .84rem; color: var(--muted); margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .fourth-relic img { animation: none; } }

/* --- the admin's terminal ----------------------------------------------------------------------------- */
.term { margin: 0; border-radius: var(--r-box); overflow: hidden; background: #0b0810; box-shadow: 0 0 0 1px color-mix(in srgb, var(--w1) 40%, transparent), 0 26px 60px -36px color-mix(in srgb, var(--w1) 80%, transparent); }
.term-bar { display: flex; align-items: center; gap: 12px; padding: 9px 14px; font: 500 .82rem var(--body); color: var(--ink-2); background: linear-gradient(180deg, #221a2e, #1a1424); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.term-dots { display: inline-flex; gap: 6px; }
.term-dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.term-dots i:nth-child(2) { background: #febc2e; }
.term-dots i:nth-child(3) { background: #28c840; }
.term-body { margin: 0; padding: 16px 18px 18px; overflow-x: auto; font: .84rem/1.75 var(--mono); color: #e8e2f2; background:
  linear-gradient(rgba(255, 255, 255, .015) 50%, transparent 50%) 0 0 / 100% 4px, radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--w1) 10%, transparent), transparent 60%); }
.term-body code { font: inherit; background: none; padding: 0; white-space: pre; }
.t-c { color: #7d7392; }
.t-p { color: #80ff20; }
.t-k { color: #8fd3ff; }
.t-v { color: #f1b94d; }
.t-ok { color: #6fe4dc; }
.term-caret { display: inline-block; width: 8px; height: 1.05em; margin-left: 6px; vertical-align: -2px; background: #80ff20; animation: caret 1.1s steps(2, jump-none) infinite; }
@keyframes caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .term-caret { animation: none; } }

/* --- a blade's numbers as bars ----------------------------------------------------------------------- */
.statbars { display: grid; gap: 6px; margin-top: -6px; }
.statbar { display: grid; grid-template-columns: 74px minmax(0, 1fr) 34px; align-items: center; gap: 10px; font-size: .84rem; color: var(--ink-2); }
.statbar-track { height: 8px; border-radius: 8px; background: rgba(0, 0, 0, .4); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); overflow: hidden; }
.statbar-fill { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, color-mix(in srgb, var(--r1) 60%, #8a5cff), var(--r1)); box-shadow: 0 0 10px var(--r1); animation: statbar .9s cubic-bezier(.2, .8, .2, 1) both; transform-origin: 0 50%; }
@keyframes statbar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.statbar-value { font: 400 1.1rem/1 var(--display); color: var(--ink); text-align: right; }
@media (prefers-reduced-motion: reduce) { .statbar-fill { animation: none; } }
.twocol > .panel:has(> .mtrack) { grid-column: 1 / -1; }
.term-body code { white-space: pre-wrap; overflow-wrap: anywhere; }
.twocol:has(.mtrack) { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
@media (max-width: 900px) { .twocol:has(.mtrack) { grid-template-columns: minmax(0, 1fr); } }

/* --- each section's rune, large and faint behind its heading ---------------------------------------- */
.sec-head { position: relative; }
.sec-rune { position: absolute; right: 0; top: -34px; width: 120px; height: 168px; fill: var(--w1); opacity: .07; pointer-events: none; shape-rendering: crispEdges; filter: drop-shadow(0 0 18px var(--w1)); }
@media (max-width: 900px) { .sec-rune { width: 80px; height: 112px; top: -20px; } }
.atlas.idle * { animation-play-state: paused !important; }
.mtrack { margin-inline: 26px 34px; }

/* --- the bloodline tree: a trunk of forms per blood, the crown at the top --------------------------- */
.btree { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; align-items: start; }
.btrunk { position: relative; overflow: hidden; display: grid; gap: 12px; padding: 18px 18px 16px; border-radius: var(--r-box);
  background: radial-gradient(120% 60% at 20% 100%, color-mix(in srgb, var(--b) 20%, transparent), transparent 70%),
              linear-gradient(180deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .32));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--b) 45%, transparent), 0 24px 60px -36px var(--b); }
.btrunk-title { display: flex; align-items: center; gap: 12px; font: 400 1.45rem/1.1 var(--display); color: color-mix(in srgb, var(--b) 40%, #fff); text-shadow: 0 0 20px color-mix(in srgb, var(--b) 60%, transparent); }
.bforms { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 16px; }
.bforms::before { content: ""; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 3px; border-radius: 3px;
  background: linear-gradient(0deg, var(--b), color-mix(in srgb, var(--b) 50%, #fff) 70%, #fff);
  box-shadow: 0 0 14px var(--b); transform-origin: 50% 100%; transform: scaleY(0); transition: transform 1.2s cubic-bezier(.3, .7, .2, 1) calc(var(--ti) * 120ms); }
.btree.lit .bforms::before { transform: scaleY(1); }
.bform { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 14px; align-items: start;
  opacity: 0; transform: translateY(8px); transition: opacity .5s ease, transform .5s ease; transition-delay: calc(var(--ti) * 120ms + var(--fi) * 260ms + 200ms); }
.btree.lit .bform { opacity: 1; transform: none; }
.bnode { position: relative; z-index: 1; width: 38px; height: 38px; display: grid; place-items: center; }
.bnode::before { content: ""; position: absolute; inset: 5px; transform: rotate(45deg); border-radius: 4px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--b) 55%, #fff), color-mix(in srgb, var(--b) 60%, #000));
  box-shadow: 0 0 0 2px #120c19, 0 0 16px var(--b); }
.bnode span { position: relative; font: 400 1rem/1 var(--display); color: #120c19; font-weight: 700; }
.bform.crown .bnode::before { inset: 2px; background: linear-gradient(135deg, #fff, var(--gold) 50%, color-mix(in srgb, var(--b) 60%, #000)); box-shadow: 0 0 0 2px #120c19, 0 0 22px var(--gold), 0 0 40px -6px var(--b); animation: crown-glow 3s ease-in-out infinite; }
@keyframes crown-glow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.25); } }
.bform.sealed .bnode::before { background: #1a1424; box-shadow: 0 0 0 2px color-mix(in srgb, var(--b) 50%, transparent); border: 1px dashed color-mix(in srgb, var(--b) 70%, transparent); }
.bform.sealed .bnode span { color: var(--muted); }
.btrunk.dual .bforms::before { background: linear-gradient(0deg, var(--b) 0 45%, var(--b2) 62%, color-mix(in srgb, var(--b2) 50%, #fff) 90%, #fff); box-shadow: 0 0 14px var(--b2); }
.btrunk-then { font-size: .9rem; color: color-mix(in srgb, var(--b2) 60%, #fff); text-shadow: 0 0 14px var(--b2); }
.bform.seal .bnode::before { border-radius: 50%; transform: none; inset: 3px; background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--b) 40%, #fff), color-mix(in srgb, var(--b) 70%, #000)); box-shadow: 0 0 0 2px #120c19, 0 0 20px var(--b); }
.bform.seal .bnode span { color: #fff; font-size: 1.1rem; }
.bform-name { font-size: .78rem; color: color-mix(in srgb, var(--b) 55%, #fff); margin-top: 2px; }
.bform.crown .bform-name { color: var(--gold); }
.bform-perk { font-size: .88rem; color: var(--ink-2); line-height: 1.5; }
.bform-blades { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 6px; }
.bform-blades .islot { padding: 2px; }
.bform-blades .islot-cell { width: 44px; height: 44px; padding: 4px; }
.babyss { align-content: start; }
.babyss-flow { display: grid; justify-items: center; gap: 4px; padding: 6px 0; }
.babyss-crowns { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.babyss-crown .islot-cell { box-shadow: inset 2px 2px 0 var(--slot-lo), inset -2px -2px 0 var(--slot-hi), 0 0 16px -2px var(--c); }
.babyss-stream { width: 4px; height: 46px; border-radius: 4px; background: linear-gradient(180deg, var(--gold), var(--b) 50%, #000) 0 0 / 100% 200%; box-shadow: 0 0 16px var(--b); animation: stream 1.8s linear infinite; }
@keyframes stream { to { background-position: 0 -200%; } }
.babyss-heart .islot-cell { width: 72px; height: 72px; box-shadow: inset 3px 3px 0 var(--slot-lo), inset -3px -3px 0 var(--slot-hi), 0 0 34px -2px var(--b), 0 0 60px -10px #000; }
.babyss-heart .islot-name { color: color-mix(in srgb, var(--b) 40%, #fff); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .bforms::before, .bform { transition: none; }
  .bform.crown .bnode::before, .babyss-stream { animation: none; }
}
@media (max-width: 640px) { .btree { grid-template-columns: minmax(0, 1fr); } }

/* --- comparing two blades ------------------------------------------------------------------------- */
.versus { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; margin-top: -6px; border-radius: var(--r-small);
  background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--w1) 50%, transparent); }
.versus-pic { width: 44px; height: 44px; padding: 4px; background: var(--slot); box-shadow: inset 2px 2px 0 var(--slot-lo), inset -2px -2px 0 var(--slot-hi); }
.versus-pic img { width: 100%; height: 100%; image-rendering: pixelated; }
.versus-title { font-size: .84rem; color: var(--ink-2); }
.versus-nums { display: flex; gap: 14px; font: 400 1.05rem var(--display); margin-top: 2px; }
.versus-nums .up { color: #6be36b; }
.versus-nums .down { color: #ff6a5a; }
.versus-nums .same { color: var(--muted); }
.pin-btn { justify-self: start; font-size: .82rem; margin-top: 2px; }

/* --- back to the top ---------------------------------------------------------------------------- */
.totop { position: fixed; right: 22px; bottom: 22px; z-index: 30; width: 46px; height: 46px; border: 0; padding: 0; cursor: pointer; display: grid; place-items: center;
  color: #120c19; background: none; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s ease, transform .25s ease; }
.totop::before { content: ""; position: absolute; inset: 7px; transform: rotate(45deg); border-radius: 5px; background: linear-gradient(135deg, #fff, var(--w1) 60%); box-shadow: 0 0 18px var(--w1), 0 0 0 2px #120c19; }
.totop svg { position: relative; width: 16px; height: 16px; }
.totop.shown { opacity: 1; transform: none; pointer-events: auto; }
.totop:hover::before { box-shadow: 0 0 28px var(--w1), 0 0 0 2px #120c19; }
@media (max-width: 640px) { .totop { right: 14px; bottom: 14px; } }
@media (prefers-reduced-motion: reduce) { .totop { transition: none; } }
