/* Gravebreak Wiki. Same palette and type as the main site (docs/brand-context.md):
   candlelight on near-black, parchment text, ember accent, bronze hairlines.
   Enemy pages lean cold (frost teal, the crypt light); item pages lean warm (amber, home). */
:root {
  --void: #0A0806;
  --soot: #140C08;
  --soot-2: #1B130D;
  --soot-3: #241A12;
  --parchment: #F5E8D1;
  --parchment-2: rgba(245, 232, 209, .74);
  --parchment-3: rgba(245, 232, 209, .52);
  --ember: #F2C46B;
  --ember-dim: rgba(242, 196, 107, .14);
  --bronze: #A07840;
  --line: rgba(160, 120, 64, .22);
  --line-2: rgba(160, 120, 64, .38);
  --umber: #2A1204;
  --frost: #8FD3CC;
  --frost-deep: #1B3A3C;
  --sage: #B9CF8A;
  --coral: #E0806A;
  --r-common: #CBBFAE;
  --r-uncommon: #9BCB7A;
  --r-rare: #7FB2E8;
  --r-epic: #C79BEA;
  --r-legendary: #F2A94B;
  --accent: var(--ember);
  --glow: 242, 196, 107;
  --serif: "Spectral", Georgia, serif;
  --display: "Cinzel", "Times New Roman", serif;
  --top: 64px;
  --side: 248px;
  --radius: 14px;
  color-scheme: dark;
}
.tone-cold { --accent: var(--frost); --glow: 120, 220, 208; }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--void); scroll-padding-top: calc(var(--top) + 20px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--void); color: var(--parchment);
  font: 400 1.0625rem/1.65 var(--serif); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: rgba(242, 196, 107, .45); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ember); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; text-wrap: balance; letter-spacing: .02em; }
p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:hover { color: var(--umber); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ember); color: var(--umber); padding: 8px 14px; border-radius: 8px; font-weight: 500; }
.skip:focus { top: 12px; }
code { font-size: .85em; color: var(--parchment-2); }
kbd { font: 500 .72rem/1 var(--serif); color: var(--parchment-3); border: 1px solid var(--line-2); border-radius: 5px; padding: 3px 6px; }

/* ---------------------------------------------------------------- top bar */
.wtop {
  position: sticky; top: 0; z-index: 50; height: var(--top);
  display: flex; align-items: center; gap: clamp(12px, 2vw, 28px);
  padding: 0 clamp(14px, 2.5vw, 32px);
  background: rgba(10, 8, 6, .82); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand img { width: 92px; height: auto; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .6)); }
.brand span { font: 600 .78rem/1 var(--display); letter-spacing: .32em; text-transform: uppercase; color: var(--parchment-2); padding-left: 10px; border-left: 1px solid var(--line-2); }
.home-link { margin-left: auto; flex: none; font: 600 .72rem/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--parchment-3); text-decoration: none; }
.home-link:hover { color: var(--ember); }

.search { position: relative; flex: 1; max-width: 520px; }
.search > svg { position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 17px; height: 17px; fill: none; stroke: var(--parchment-3); stroke-width: 1.8; pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 44px 0 40px; border-radius: 10px;
  background: var(--soot); border: 1px solid var(--line); color: var(--parchment);
  font: 400 .98rem var(--serif); transition: border-color .2s, background .2s;
}
.search input::placeholder { color: var(--parchment-3); }
.search input:focus { outline: none; border-color: var(--bronze); background: var(--soot-2); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { position: absolute; right: 10px; top: 50%; translate: 0 -50%; }
.search input:focus ~ kbd { opacity: 0; }
.results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-height: min(70vh, 460px); overflow: auto;
  background: var(--soot); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .9);
}
.results li a { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 8px; text-decoration: none; }
.results li img, .results li .noimg { width: 36px; height: 36px; object-fit: contain; border-radius: 7px; background: var(--soot-3); }
.results li small { font: 600 .7rem/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--parchment-3); }
.results li[aria-selected="true"] a, .results li a:hover { background: var(--soot-3); color: var(--parchment); }
.results li mark { background: none; color: var(--ember); }
.results .none { padding: 14px; color: var(--parchment-3); }

.drawer-btn { display: none; }

/* ---------------------------------------------------------------- shell */
.wshell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); max-width: 1480px; margin: 0 auto; }
.wnav {
  position: sticky; top: var(--top); align-self: start; height: calc(100dvh - var(--top)); overflow: auto;
  padding: 26px 16px 40px clamp(14px, 2vw, 28px); border-right: 1px solid var(--line);
  scrollbar-width: thin; scrollbar-color: var(--soot-3) transparent;
}
.wnav-home { display: block; font: 600 .72rem/1 var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--parchment-3); text-decoration: none; padding: 6px 10px 16px; }
.wnav-home.on, .wnav-home:hover { color: var(--ember); }
.wnav-foot { margin-top: 14px; padding: 16px 10px 6px; border-top: 1px solid var(--line); }
.wnav-group { margin-bottom: 4px; }
.wnav-group summary { display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; padding: 7px 10px; border-radius: 8px; }
.wnav-group summary::-webkit-details-marker { display: none; }
.wnav-group summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--parchment-3); border-bottom: 1.5px solid var(--parchment-3); rotate: -45deg; margin-left: 10px; transition: rotate .2s; }
.wnav-group[open] summary::after { rotate: 45deg; }
.wnav-group summary:hover { background: var(--soot); }
.wnav-group summary a { font: 600 .86rem/1.2 var(--display); letter-spacing: .08em; text-decoration: none; flex: 1; }
.wnav-group summary a[aria-current] { color: var(--ember); }
.count { font: 500 .72rem/1 var(--serif); color: var(--parchment-3); margin-left: 8px; font-variant-numeric: tabular-nums; }
.wnav-group ul { margin: 2px 0 10px 10px; border-left: 1px solid var(--line); }
.wnav-group li a { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 14px; margin-left: -1px; border-left: 1px solid transparent; font-size: .92rem; color: var(--parchment-2); text-decoration: none; line-height: 1.35; }
.wnav-group li a:hover { color: var(--parchment); border-left-color: var(--line-2); }
.wnav-group li a[aria-current] { color: var(--accent); border-left-color: var(--accent); }
.pip { width: 5px; height: 5px; rotate: 45deg; background: var(--coral); flex: none; }

main { min-width: 0; padding: 22px clamp(18px, 3.5vw, 56px) 80px; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; font-size: .86rem; color: var(--parchment-3); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }
.crumbs a { text-decoration: none; color: var(--parchment-3); }
.crumbs a:hover { color: var(--ember); }
.crumbs [aria-current] { color: var(--parchment-2); }

.eyebrow { font: italic 500 1rem/1.3 var(--serif); color: var(--accent); }
.lede { font-size: clamp(1.08rem, 1.3vw, 1.22rem); line-height: 1.6; color: var(--parchment-2); max-width: 60ch; }

/* ---------------------------------------------------------------- entry hero */
.hero {
  display: grid; grid-template-columns: minmax(240px, 380px) minmax(0, 1fr); gap: clamp(22px, 3.5vw, 52px);
  align-items: center; margin: 18px 0 28px;
}
.stage {
  position: relative; aspect-ratio: 1; border-radius: 20px; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(circle at 50% 46%, rgba(var(--glow), .26), rgba(var(--glow), .06) 42%, transparent 68%),
    radial-gradient(ellipse 60% 14% at 50% 86%, rgba(0, 0, 0, .55), transparent 70%),
    linear-gradient(180deg, var(--soot-2), var(--void));
  box-shadow: inset 0 0 0 1px var(--line), 0 30px 80px -30px rgba(0, 0, 0, .9);
}
.stage::after { /* hairline frame inset, like the game's panel border */
  content: ""; position: absolute; inset: 10px; border: 1px solid rgba(160, 120, 64, .16); border-radius: 13px; pointer-events: none;
}
.stage img { position: absolute; inset: 9%; width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .55)); }
.stage.portrait img { inset: 4%; width: 92%; height: 92%; }
.stage figcaption { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-size: .78rem; color: var(--parchment-3); font-style: italic; padding: 0 20px; }
.stage .sigil { position: absolute; inset: 0; display: grid; place-items: center; font: 600 2.4rem var(--display); color: rgba(var(--glow), .35); text-align: center; padding: 20px; }
.stage.r-uncommon { --glow: 155, 203, 122; }
.stage.r-rare { --glow: 127, 178, 232; }
.stage.r-epic { --glow: 199, 155, 234; }

.hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.9rem); line-height: 1.04; letter-spacing: .03em; margin: 10px 0 14px; }
.flavor { margin-top: 14px; padding-left: 14px; border-left: 2px solid var(--line-2); font-style: italic; color: var(--parchment-3); max-width: 56ch; }
.facts {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 24px;
  background: var(--soot); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.facts div { padding: 11px 14px 12px; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.facts dt { font: 600 .7rem/1.2 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--parchment-3); }
.facts dd { margin-top: 4px; font-weight: 500; font-size: 1.04rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
.r-common { --rc: var(--r-common); } .r-uncommon { --rc: var(--r-uncommon); } .r-rare { --rc: var(--r-rare); } .r-epic { --rc: var(--r-epic); } .r-legendary { --rc: var(--r-legendary); }
.facts dd[class^="r-"] { color: var(--rc); }

/* ---------------------------------------------------------------- body + toc */
.body { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: clamp(28px, 4vw, 64px); }
.col { min-width: 0; max-width: 820px; }
.col > section { margin-top: 44px; }
.col h2 { display: flex; align-items: center; gap: 12px; font-size: 1.3rem; letter-spacing: .08em; margin-bottom: 16px; }
.col h2::before { content: ""; width: 7px; height: 7px; rotate: 45deg; background: var(--accent); flex: none; }
.col h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.col h3 { font-size: .95rem; letter-spacing: .04em; }
h3.sub { margin: 22px 0 10px; font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--parchment-3); }
.fine { margin-top: 12px; font-size: .88rem; color: var(--parchment-3); }
.empty { color: var(--parchment-3); font-style: italic; }
.prose-p { max-width: 64ch; }

.toc { position: sticky; top: calc(var(--top) + 28px); align-self: start; margin-top: 44px; font-size: .9rem; }
.toc p { font: 600 .7rem/1 var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--parchment-3); margin-bottom: 12px; }
.toc ol { border-left: 1px solid var(--line); }
.toc a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 1px solid transparent; color: var(--parchment-3); text-decoration: none; }
.toc a:hover { color: var(--parchment); }
.toc a.on { color: var(--accent); border-left-color: var(--accent); }

/* quick answer */
.answer {
  position: relative; padding: 18px 22px 18px 24px; border-radius: 12px;
  background: linear-gradient(100deg, rgba(var(--glow), .09), rgba(var(--glow), .02) 60%), var(--soot);
  border: 1px solid var(--line); font-size: 1.04rem; line-height: 1.7;
}
.answer::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 2px; background: var(--accent); border-radius: 2px; }

/* stat bars */
.bars { display: grid; gap: 14px; }
.bars li { display: grid; grid-template-columns: 9.5rem 1fr 4.5rem; align-items: center; gap: 4px 16px; }
.bars .bl { font-size: .95rem; color: var(--parchment-2); }
.bars b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.bars small { grid-column: 2 / -1; font-size: .78rem; color: var(--parchment-3); margin-top: -6px; }
.bt { position: relative; display: block; height: 8px; border-radius: 99px; background: var(--soot-3); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(160, 120, 64, .12); }
.bt span { position: absolute; inset: 0 auto 0 0; width: var(--p); border-radius: inherit; background: linear-gradient(90deg, rgba(var(--glow), .55), rgb(var(--glow))); transform-origin: left; animation: grow .9s cubic-bezier(.16, 1, .3, 1) .15s backwards; }
@keyframes grow { from { transform: scaleX(0); } }
.effects { margin-top: 18px; display: grid; gap: 10px; }
.effects li { padding: 12px 16px; border-radius: 10px; background: var(--soot); border: 1px solid var(--line); }
.statrows { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.statrows li { display: flex; justify-content: space-between; padding: 10px 16px; background: var(--soot); }
.statrows b { font-weight: 500; color: var(--sage); }

/* attacks */
.attacks { display: grid; gap: 12px; }
.attacks li {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 280px); gap: 6px 24px; align-items: center;
  padding: 16px 18px; border-radius: 12px; background: var(--soot); border: 1px solid var(--line);
}
.atk-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.atk-dmg { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; grid-row: span 2; }
.atk-dmg b { font: 600 1.35rem/1 var(--display); color: var(--coral); font-variant-numeric: tabular-nums; }
.atk-dmg small { font-size: .74rem; color: var(--parchment-3); }
.atk-dmg .bt span { background: linear-gradient(90deg, rgba(224, 128, 106, .45), var(--coral)); }
.atk-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .86rem; color: var(--parchment-3); }
.atk-note { grid-column: 1 / -1; font-size: .95rem; color: var(--parchment-2); }
.steps { display: grid; gap: 12px; counter-reset: step; list-style: none; }
.steps li {
  display: grid; gap: 6px; position: relative; padding: 16px 18px 16px 58px;
  border-radius: 12px; background: var(--soot); border: 1px solid var(--line); counter-increment: step;
}
.steps li::before {
  content: counter(step); position: absolute; left: 16px; top: 18px;
  font: 600 1.05rem/1 var(--display); color: var(--accent);
}
.steps .atk-meta a { color: var(--parchment); }
.kind-quest .stage .sigil { font-size: 1.55rem; line-height: 1.15; }
.cat-names { display: grid; gap: 6px; text-align: center; font: 600 .82rem/1.2 var(--display); letter-spacing: .04em; color: rgba(var(--glow), .85); }
.tag {
  display: inline-block; font: 600 .7rem/1 var(--display); letter-spacing: .16em; text-transform: uppercase;
  padding: 5px 8px 4px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--parchment-2); white-space: nowrap;
}
.tag.Boss, .tag.boss { color: var(--coral); border-color: rgba(224, 128, 106, .5); }
.tag.elite { color: var(--ember); border-color: rgba(242, 196, 107, .5); }
.tag.muted { color: var(--parchment-3); }
.tag.common { color: var(--r-common); } .tag.uncommon { color: var(--r-uncommon); border-color: rgba(155, 203, 122, .4); } .tag.rare { color: var(--r-rare); border-color: rgba(127, 178, 232, .4); }

/* traits + fight */
.traits { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.traits div { padding: 14px 16px; border-radius: 12px; background: var(--soot); border: 1px solid var(--line); }
.traits dt { font: 600 .82rem/1.2 var(--display); letter-spacing: .08em; color: var(--accent); margin-bottom: 6px; }
.traits dd { font-size: .95rem; color: var(--parchment-2); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.split > div { padding: 18px 20px; border-radius: 12px; background: var(--soot); border: 1px solid var(--line); }
.split h3 { margin-bottom: 10px; color: var(--parchment-2); font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; }
.split .tips { background: linear-gradient(160deg, rgba(185, 207, 138, .08), transparent 60%), var(--soot); border-color: rgba(185, 207, 138, .25); }
.split .tips h3 { color: var(--sage); }
.prose { display: grid; gap: 8px; }
.prose li { position: relative; padding-left: 18px; }
.prose li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 5px; height: 5px; rotate: 45deg; background: var(--bronze); }
.tips .prose li::before { background: var(--sage); }
.note { margin-top: 18px; padding: 14px 18px; border-radius: 12px; border: 1px dashed var(--line-2); color: var(--parchment-2); font-size: .96rem; }

/* loot / chips */
.loot { display: grid; gap: 8px; }
.loot li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 4.6rem; align-items: center; gap: 14px;
  padding: 6px 14px 6px 6px; border-radius: 12px; background: var(--soot); border: 1px solid var(--line); transition: border-color .2s;
}
.loot li:hover { border-color: var(--line-2); }
.loot li .where { grid-column: 1 / -1; margin: -4px 0 4px 54px; font-size: .8rem; color: var(--parchment-3); }
.loot.uses li { grid-template-columns: minmax(0, 1fr) auto; }
.loot.uses .qty { font: 600 1rem/1 var(--display); color: var(--ember); }
.chip { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.chip img { width: 42px; height: 42px; object-fit: contain; border-radius: 9px; background: radial-gradient(circle, rgba(255, 255, 255, .06), transparent 70%), var(--soot-3); box-shadow: inset 0 0 0 1px var(--line); padding: 2px; flex: none; }
.chip.foe img { object-fit: cover; padding: 0; }
.chip-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:hover .chip-name { color: var(--ember); }
.chip[class*=" r-"] .chip-name { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--rc) 45%, transparent); text-underline-offset: .22em; }
.odds { font: 600 .7rem/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--parchment-2); padding: 6px 9px 5px; border-radius: 99px; background: var(--soot-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.odds.always { color: var(--umber); background: var(--ember); }
.qty { text-align: right; font-variant-numeric: tabular-nums; color: var(--parchment-2); font-size: .95rem; }

/* recipe */
.recipe { padding: 18px; border-radius: 14px; background: linear-gradient(160deg, rgba(242, 196, 107, .07), transparent 55%), var(--soot); border: 1px solid var(--line-2); }
.recipe-where { margin-bottom: 14px; color: var(--parchment-2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.recipe-where b { color: var(--parchment); font-weight: 500; }
.ingredients { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.ingredients li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 11px; background: var(--soot-2); border: 1px solid var(--line); }
.need { font: 600 1rem/1 var(--display); color: var(--ember); font-variant-numeric: tabular-nums; }

/* crypts on enemy pages */
.crypts { display: grid; gap: 8px; margin-top: 14px; }
.crypts li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 16px; border-radius: 12px; background: var(--soot); border: 1px solid var(--line); }
.cname { font: 600 .95rem/1.2 var(--display); letter-spacing: .04em; }
.crypts small { color: var(--parchment-3); font-size: .85rem; }
.crypts small + small::before { content: "· "; }

/* faq */
.faq { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.faq details + details { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 14px 48px 14px 18px; position: relative; font-weight: 500; background: var(--soot); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; translate: 0 -50%; font: 400 1.3rem var(--serif); color: var(--parchment-3); transition: rotate .2s; }
.faq details[open] summary::after { rotate: 45deg; }
.faq summary:hover { color: var(--ember); }
.faq p { padding: 4px 18px 16px; background: var(--soot); color: var(--parchment-2); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card {
  position: relative; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; align-content: start; gap: 6px; height: 100%; padding: 10px 10px 14px; border-radius: 14px; text-decoration: none; text-align: center;
  background: radial-gradient(circle at 50% 38%, rgba(var(--glow), .14), transparent 62%), var(--soot);
  border: 1px solid var(--line); transition: border-color .25s, translate .35s cubic-bezier(.16, 1, .3, 1), box-shadow .35s;
}
.card img { width: 100%; aspect-ratio: 1; object-fit: contain; transition: scale .5s cubic-bezier(.16, 1, .3, 1); }
.card span { font: 600 .86rem/1.25 var(--display); letter-spacing: .04em; }
.card small { font: 600 .7rem/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--parchment-3); }
.card.boss small { color: var(--coral); }
.card:hover { border-color: var(--line-2); translate: 0 -3px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .7); color: var(--parchment); }
.card:hover img { scale: 1.05; }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--soot); scrollbar-width: thin; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 14px; text-align: left; border-bottom: 1px solid rgba(160, 120, 64, .12); white-space: nowrap; }
thead th { position: sticky; top: 0; font: 600 .7rem/1.2 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--parchment-3); background: var(--soot-2); border-bottom-color: var(--line); }
thead th[aria-sort] { color: var(--ember); }
thead button { all: unset; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
thead button::after { content: "↕"; opacity: .35; font-family: var(--serif); letter-spacing: 0; }
thead th[aria-sort="ascending"] button::after { content: "↑"; opacity: 1; }
thead th[aria-sort="descending"] button::after { content: "↓"; opacity: 1; }
.num { text-align: right; }
thead th.num button { flex-direction: row-reverse; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover { background: rgba(245, 232, 209, .03); }
tbody tr.current { background: rgba(var(--glow), .08); }
tbody tr.current th { box-shadow: inset 2px 0 0 var(--accent); }
tbody th { font-weight: 500; padding-right: 28px; }
.tname { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.tname img { width: 34px; height: 34px; object-fit: contain; border-radius: 7px; background: var(--soot-3); }
.tname img.pt { object-fit: cover; }
.tname:hover span { color: var(--ember); }
.tname[class*=" r-"] span { color: color-mix(in srgb, var(--rc) 30%, var(--parchment)); }

/* ---------------------------------------------------------------- category index */
.ihead { margin: 18px 0 30px; max-width: 760px; }
.ihead h1 { font-size: clamp(2.4rem, 5vw, 4rem); margin: 8px 0 12px; }
.cards.grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin-bottom: 48px; }
.cards.portraits { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.table-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.table-head h2 { font-size: 1.3rem; letter-spacing: .08em; }
.filter input { height: 36px; width: 220px; padding: 0 12px; border-radius: 9px; background: var(--soot); border: 1px solid var(--line); color: var(--parchment); font: 400 .95rem var(--serif); }
.filter input:focus { outline: none; border-color: var(--bronze); }

/* ---------------------------------------------------------------- hub */
.hub-hero {
  position: relative; margin: 6px 0 28px; padding: clamp(28px, 4.5vw, 56px) clamp(22px, 4vw, 56px); border-radius: 22px; overflow: hidden; isolation: isolate;
  background: linear-gradient(90deg, rgba(10, 8, 6, .94) 25%, rgba(10, 8, 6, .55) 65%, rgba(10, 8, 6, .2)), url(/assets/gravehold-overview.webp) center 60% / cover;
  box-shadow: inset 0 0 0 1px var(--line), 0 40px 90px -40px rgba(0, 0, 0, .9);
}
.hub-hero h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); line-height: 1.06; margin: 12px 0 14px; max-width: 16ch; }
.big-search {
  margin-top: 22px; display: inline-flex; align-items: center; gap: 12px; padding: 0 14px 0 16px; height: 50px; min-width: min(100%, 360px);
  border-radius: 12px; background: rgba(20, 12, 8, .85); border: 1px solid var(--line-2); color: var(--parchment-3); font: 400 1rem var(--serif); cursor: pointer;
  transition: border-color .2s, color .2s;
}
.big-search svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.big-search kbd { margin-left: auto; }
.big-search:hover { border-color: var(--bronze); color: var(--parchment); }
.cats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1320px) { .cats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cats li:first-child { grid-column: span 2; } }
.cat a {
  display: grid; grid-template-rows: 150px auto; height: 100%; border-radius: 16px; overflow: hidden; text-decoration: none;
  background: var(--soot); border: 1px solid var(--line); transition: border-color .25s, translate .35s cubic-bezier(.16, 1, .3, 1), box-shadow .35s;
}
.cat a:hover { border-color: var(--line-2); translate: 0 -3px; box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .7); color: var(--parchment); }
.cat-art { position: relative; display: flex; justify-content: center; align-items: center; gap: 0; padding: 10px 12px; background: radial-gradient(ellipse 70% 90% at 50% 100%, rgba(var(--glow), .22), transparent 70%), var(--soot-2); border-bottom: 1px solid var(--line); }
.cat-art img { width: 38%; height: auto; max-height: 130px; object-fit: contain; margin: 0 -4%; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .6)); transition: translate .5s cubic-bezier(.16, 1, .3, 1); }
.cat-art img:nth-child(2) { width: 46%; z-index: 1; }
.cat.tone-cold .cat-art img { scale: 1.35; }
.cat a:hover .cat-art img:nth-child(1) { translate: -6px 0; }
.cat a:hover .cat-art img:nth-child(3) { translate: 6px 0; }
.cat-text { display: grid; gap: 6px; padding: 16px 18px 20px; }
.cat-title { font: 600 1.15rem/1.2 var(--display); letter-spacing: .04em; display: flex; align-items: baseline; justify-content: space-between; }
.cat-blurb { font-size: .94rem; color: var(--parchment-2); line-height: 1.5; }
.hub section { margin-top: 56px; }
.hub h2 { display: flex; align-items: center; gap: 12px; font-size: 1.4rem; letter-spacing: .08em; }
.hub h2::before { content: ""; width: 7px; height: 7px; rotate: 45deg; background: var(--ember); }
.hub h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.section-lede { color: var(--parchment-2); margin: 8px 0 18px; }
.cryptlist { display: grid; gap: 12px; counter-reset: c; }
.cryptlist > li {
  counter-increment: c; display: grid; grid-template-columns: minmax(170px, 1fr) minmax(0, 2fr) minmax(0, 1fr); align-items: center; gap: 16px;
  padding: 14px 16px; border-radius: 14px; background: linear-gradient(100deg, rgba(120, 220, 208, .06), transparent 50%), var(--soot); border: 1px solid var(--line);
}
.crypt-name h3 { font-size: 1.02rem; letter-spacing: .04em; }
.crypt-name h3::before { content: counter(c, upper-roman) ". "; color: var(--frost); }
.crypt-name small { color: var(--parchment-3); font-size: .86rem; }
.cfoes { display: flex; flex-wrap: wrap; gap: 8px; }
.cfoe { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 99px; background: var(--soot-2); border: 1px solid var(--line); text-decoration: none; font-size: .92rem; }
.cfoe img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--soot-3); }
.cfoe:hover { border-color: var(--line-2); color: var(--ember); }
.cfoe.boss { justify-self: end; border-color: rgba(224, 128, 106, .35); }
.cfoe.boss small { font: 600 .7rem/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--coral); }
.changes { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.changes li { display: grid; grid-template-columns: 6.5rem minmax(8rem, auto) 1fr; gap: 14px; padding: 10px 16px; background: var(--soot); font-size: .95rem; }
.changes li + li { border-top: 1px solid rgba(160, 120, 64, .12); }
.changes time, .changes .v { color: var(--parchment-3); font-variant-numeric: tabular-nums; }
.changes .ch { color: var(--parchment-2); }

.changes-more { margin-top: 12px; font-size: .95rem; }

/* ---------------------------------------------------------------- patch notes */
.patches { position: relative; max-width: 780px; display: grid; gap: 36px; padding-left: 30px; }
.patches::before { content: ""; position: absolute; left: 6px; top: 12px; bottom: 12px; width: 1px; background: linear-gradient(var(--line-2), transparent); }
.patch { position: relative; scroll-margin-top: calc(var(--top) + 16px); }
.patch::before { content: ""; position: absolute; left: -29px; top: 7px; width: 11px; height: 11px; rotate: 45deg; background: var(--void); border: 1.5px solid var(--bronze); }
.patch.latest::before { background: var(--ember); border-color: var(--ember); }
.patch-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--parchment-3); font-size: .92rem; font-variant-numeric: tabular-nums; }
.ver { font: 600 .72rem/1 var(--display); letter-spacing: .12em; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--parchment-2); }
.ver.now { border-color: transparent; background: var(--ember-dim); color: var(--ember); }
.patch-head h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); letter-spacing: .04em; margin: 8px 0 0; }
.patch-head h2 a { text-decoration: none; color: inherit; }
.patch-head h2 a:hover { color: var(--ember); }
.patch-sum { color: var(--parchment-2); margin-top: 8px; max-width: 64ch; line-height: 1.6; }
.pgroup { --k: var(--bronze); margin-top: 16px; padding: 14px 18px 16px; border-radius: 12px; background: var(--soot); border: 1px solid var(--line); }
.pgroup.k-added { --k: var(--sage); } .pgroup.k-changed { --k: var(--ember); } .pgroup.k-fixed { --k: var(--frost); } .pgroup.k-removed { --k: var(--coral); }
.pgroup h3 { font: 600 .78rem/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--k); margin-bottom: 10px; }
.pgroup ul { display: grid; gap: 7px; }
.pgroup li { position: relative; padding-left: 16px; line-height: 1.55; }
.pgroup li::before { content: ""; position: absolute; left: 1px; top: .68em; width: 5px; height: 5px; rotate: 45deg; background: var(--k); }
.pgroup a { color: var(--parchment); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.pgroup a:hover { color: var(--ember); text-decoration-color: currentColor; }
@media (max-width: 600px) {
  .patches { padding-left: 22px; }
  .patches::before { left: 4px; }
  .patch::before { left: -23px; }
  .pgroup { padding: 12px 14px 14px; }
}

/* ---------------------------------------------------------------- footer */
.wfoot { border-top: 1px solid var(--line); padding: 28px clamp(18px, 3.5vw, 56px) 40px; color: var(--parchment-3); font-size: .88rem; display: grid; gap: 8px; max-width: 1480px; margin: 0 auto; }
.wfoot a { color: var(--parchment-2); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .body { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 940px) {
  :root { --top: 58px; }
  .wshell { grid-template-columns: minmax(0, 1fr); }
  .drawer-btn { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -8px; background: none; border: 0; cursor: pointer; flex: none; }
  .drawer-btn span[aria-hidden] { position: relative; width: 18px; height: 1.5px; background: var(--parchment-2); box-shadow: 0 -6px 0 var(--parchment-2), 0 6px 0 var(--parchment-2); }
  .wnav {
    position: fixed; z-index: 60; top: var(--top); left: 0; height: calc(100dvh - var(--top)); width: min(86vw, 320px);
    background: var(--void); border-right: 1px solid var(--line-2); translate: -102% 0; visibility: hidden;
    transition: translate .35s cubic-bezier(.16, 1, .3, 1), visibility 0s .35s;
  }
  .nav-open .wnav { translate: 0 0; visibility: visible; transition-delay: 0s; box-shadow: 30px 0 80px rgba(0, 0, 0, .7); }
  .nav-open::after { content: ""; position: fixed; inset: var(--top) 0 0 0; z-index: 55; background: rgba(0, 0, 0, .5); }
  .brand img { width: 76px; }
  .home-link { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 1rem; }
  main { padding: 14px 16px 64px; }
  .brand span { display: none; }
  .search kbd { display: none; }
  .search input { padding-right: 12px; }
  .hero { grid-template-columns: 1fr; gap: 18px; margin-top: 12px; }
  .stage { width: min(100%, 360px); justify-self: center; }
  .hero-text { text-align: left; }
  .facts { grid-template-columns: 1fr 1fr; }
  .attacks li { grid-template-columns: 1fr; }
  .atk-dmg { grid-row: auto; }
  .split { grid-template-columns: 1fr; }
  .bars li { grid-template-columns: 7rem 1fr 3.6rem; gap: 4px 10px; }
  .loot li { grid-template-columns: minmax(0, 1fr) auto 3.4rem; gap: 8px; }
  .cryptlist > li { grid-template-columns: 1fr; }
  .cfoe.boss { justify-self: start; }
  .changes li { grid-template-columns: 1fr; gap: 2px; }
  .cards.portraits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cats { grid-template-columns: 1fr; } .cats li:first-child { grid-column: auto; }
  .hub-hero { background: linear-gradient(180deg, rgba(10, 8, 6, .7), rgba(10, 8, 6, .95) 70%), url(/assets/gravehold-overview.webp) center / cover; }
  .big-search { width: 100%; }
  .filter input { width: 100%; }
  .filter { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Stall pages: Restored / Ruined image tabs on the stage */
.stage .views { position: absolute; top: 12px; left: 0; right: 0; z-index: 2; display: flex; justify-content: center; gap: 6px; }
.stage .views button { font: 600 .74rem/1 var(--display); letter-spacing: .14em; text-transform: uppercase; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .45); color: var(--parchment-2); cursor: pointer; }
.stage .views button[aria-selected="true"] { color: var(--ember); border-color: rgba(242, 196, 107, .55); }
.stage .views button:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.stage img[hidden] { display: none; }

/* biomes: in-game scenery photos fill their frame instead of floating like item icons */
.cards.scenery { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cards.scenery .card img, .cards.scenery .ph { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; }
.cards.scenery .card:hover img { scale: 1; }
.cards.scenery .ph { display: grid; place-items: center; background: var(--soot-2); border: 1px dashed var(--line-2); font: 600 .75rem/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--parchment-3); }
.kind-biome .stage img { inset: 0; width: 100%; height: 100%; object-fit: cover; filter: none; }
.tname img[src^="/assets/wiki/biomes/"] { object-fit: cover; border-radius: 6px; }
@media (max-width: 720px) { .cards.scenery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* No text selection or image dragging; form fields stay usable. */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }
img { -webkit-user-drag: none; }
