/* Dungeons Fusion wiki — same tokens as the landing page (site.css), laid out for reading and looking things up.
   Type scale: 14 meta · 16 UI/tables · 17 body · 20 lead/h3 · pixel headings at 24 / 32 (the pixel font is only crisp at 16/24/32/48).
   Spacing: 4 / 8 / 16 / 24 / 32 / 48 only. */
:root {
  --bg: #15121a;
  --bg-deep: #0f0d12;
  --panel: #221d26;
  --panel-2: #1b171f;
  --border: #3b3342;
  --torch: #ffb238;
  --torch-dark: #b8650f;
  --soul: #5ee6df;
  --emerald: #3ddc84;
  --paper: #eee3cf;
  --muted: #ada190;
  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 32px; --s6: 48px;
  --bar-h: 64px;   /* height of the site bar; wiki.js sets the real value (two rows on phones) */
  --font-pixel: "MC", ui-monospace, monospace;
  --font-body: "Chakra Petch", system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--bar-h) + var(--s3)); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--paper); font: 400 17px/1.6 var(--font-body); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--torch); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #ffd488; }
:focus-visible { outline: 2px solid var(--torch); outline-offset: 3px; }
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }        /* a section reached by an in-page link */
html { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
#content:focus { outline: none; }                  /* focused by the back-to-top button: a landmark, not a control */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: var(--s3); top: -64px; z-index: 60; background: var(--torch); color: #1a1208; padding: var(--s2) var(--s3); font-weight: 600; }
.skip-link:focus { top: var(--s3); }
code { font: 16px/1.4 var(--font-pixel); color: #fff; background: var(--bg-deep); padding: 0 var(--s1); box-shadow: inset 0 0 0 1px var(--border); overflow-wrap: anywhere; }

/* ---------- buttons (landing page styles) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 48px; padding: var(--s2) var(--s4);
  font: 600 17px/1.2 var(--font-body); text-decoration: none; border: 0; border-radius: 0; white-space: nowrap; cursor: pointer; transition: transform .12s, filter .12s; }
.btn:active { transform: translateY(2px); }
.btn--primary { background: var(--torch); color: #1f1405; box-shadow: inset 0 -4px 0 var(--torch-dark), inset 0 2px 0 #ffd488; }
.btn--primary:hover { filter: brightness(1.08); color: #1f1405; }
.btn--sm { min-height: 40px; padding: var(--s1) var(--s3); font-size: 16px; }

/* ---------- top bar ---------- */
/* the bar itself is the site-wide one (bar.css, wiki/site_bar.py, 26/09); only the wiki's search + drawer button are styled here */
.btn--outline { background: rgba(10, 8, 12, .55); color: var(--paper); box-shadow: inset 0 0 0 2px var(--border); transition: box-shadow .16s ease-out, color .16s ease-out; }
.btn--outline:hover { box-shadow: inset 0 0 0 2px var(--torch); color: #fff; }
.wiki-nav__site { display: none; }
.wiki-bar__menu { display: none; }

.search { position: relative; flex: 1 1 auto; max-width: 480px; min-width: 0; }
.search__input { width: 100%; height: 40px; padding: 0 var(--s5) 0 var(--s3); font: 16px/1 var(--font-body); color: var(--paper);
  background: var(--bg-deep); border: 0; border-radius: 0; box-shadow: inset 0 0 0 2px var(--border); -webkit-appearance: none; appearance: none; }
.search__input::placeholder { color: var(--muted); }
.search__input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--torch); }
.search__key { position: absolute; right: var(--s2); top: 50%; translate: 0 -50%; font: 16px/1 var(--font-pixel); color: var(--muted);
  padding: 2px var(--s1); box-shadow: inset 0 0 0 1px var(--border); pointer-events: none; }
.search__input:focus + .search__key { display: none; }
.search__results { position: absolute; left: 0; right: 0; top: calc(100% + var(--s1)); z-index: 50; max-height: min(70vh, 520px); overflow: auto;
  margin: 0; padding: var(--s1); list-style: none; background: var(--panel); box-shadow: inset 0 0 0 2px var(--border), 0 8px 0 #000; }
.search__results a { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: var(--s1) var(--s2); padding: var(--s2); color: var(--paper); text-decoration: none; }
.search__results a[aria-selected="true"], .search__results a:hover { background: rgba(255, 178, 56, .12); box-shadow: inset 3px 0 0 var(--torch); }
.search__results img, .search__results .search__dot { grid-row: span 2; width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; background: var(--bg-deep); }
.search__title { font-weight: 600; line-height: 1.3; }
.search__cat { font-size: 14px; line-height: 1.3; color: var(--muted); }
.search__empty { padding: var(--s3); color: var(--muted); font-size: 16px; }
.search__results mark { background: none; color: var(--torch); }

/* ---------- layout: a dashboard — the menu is a full-height column on the left, the page to its right ---------- */
.wiki-layout { display: grid; grid-template-columns: minmax(0, 1fr); padding-left: 272px;
  min-height: calc(100vh - var(--bar-h) - 90px); min-height: calc(100dvh - var(--bar-h) - 90px); }   /* a short page keeps its footer at the bottom */
.wiki-nav { position: fixed; z-index: 30; top: var(--bar-h); left: 0; bottom: 0; width: 272px;
  overflow-y: auto; overscroll-behavior: contain; padding: var(--s3) var(--s3) var(--s5); background: #110f14; border-right: 1px solid #28222c;
  scrollbar-width: thin; scrollbar-color: transparent transparent; }
.wiki-nav:hover, .wiki-nav:focus-within { scrollbar-color: #4a4152 transparent; }
.nav-group + .nav-group { margin-top: var(--s3); }
.nav-group__title { display: flex; align-items: center; justify-content: space-between; min-height: 32px; padding: 0 var(--s3);
  font: 600 14px/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: #8f8599; cursor: pointer; list-style: none;
  border-radius: 8px; user-select: none; }
.nav-group__title::-webkit-details-marker { display: none; }
.nav-group__title::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .16s ease-out; }
.nav-group:not([open]) > .nav-group__title::after { transform: rotate(-45deg); }
.nav-group__title:hover { color: var(--paper); }
.wiki-nav ul { list-style: none; margin: var(--s1) 0 0; padding: 0; display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: var(--s3); min-height: 40px; padding: 0 var(--s3); color: #cfc5b4; text-decoration: none;
  font-size: 16px; font-weight: 500; line-height: 1.25; border: 1px solid transparent; border-radius: 8px;
  transition: background-color .14s ease-out, color .14s ease-out, border-color .14s ease-out; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.nav-item[aria-current="page"] { color: #fff; font-weight: 600; background: #221e27; border-color: #3a3340; box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.nav-item__icon { flex: none; width: 20px; height: 20px; object-fit: contain; }
.nav-item[aria-current="page"] .nav-item__icon { filter: drop-shadow(0 0 6px rgba(255, 178, 56, .35)); }
.wiki-main { min-width: 0; width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--s5) var(--s6); }

@media (max-width: 899px) {
  :root { --bar-h: 56px; }   /* one row with the ☰ menu (bar.css); wiki.js measures the exact height */
  .wiki-layout { padding-left: 0; }
  .wiki-main { padding: 0 var(--s3) var(--s6); }
  .wiki-nav__site { display: flex; gap: var(--s2); margin-bottom: var(--s4); }
  /* the drawer's link style (block, cream text) must not reach these two buttons */
  .wiki-nav__site .btn { display: inline-flex; align-items: center; justify-content: center; flex: 1 1 0; padding: var(--s1) var(--s3); }
  .wiki-nav__site .btn--primary, .wiki-nav__site .btn--primary:hover { color: #1f1405; background: var(--torch); }
  .wiki-nav__site .btn--outline:hover { background: rgba(10, 8, 12, .55); }
  .wiki-bar__menu { display: inline-flex; flex: none; align-items: center; min-height: 40px; padding: 0 var(--s3); font: 600 16px/1 var(--font-body);
    color: var(--paper); background: var(--bg-deep); border: 0; border-radius: 0; box-shadow: inset 0 0 0 2px var(--border); cursor: pointer; }
  .wiki-bar__menu[aria-expanded="true"] { box-shadow: inset 0 0 0 2px var(--torch); }
  .search__key { display: none; }
  .search__input { padding-right: var(--s2); }
  .wiki-nav { position: fixed; z-index: 45; top: var(--bar-h); left: 0; bottom: 0; width: min(300px, 86vw); height: auto; max-height: none;
    padding: var(--s3) var(--s3) var(--s6); box-shadow: 4px 0 0 #000; transform: translateX(-104%); transition: transform .2s ease-out; visibility: hidden; }
  .wiki-nav.is-open { transform: none; visibility: visible; }
  .wiki-scrim { position: fixed; inset: var(--bar-h) 0 0 0; z-index: 44; background: rgba(0, 0, 0, .55); }
}
.wiki-bar__menu-icon { display: none; }
/* 26/09: the Mục lục button keeps its words on narrow phones — the site's ☰ menu now sits beside it (js/bar.js) */
}

/* ---------- article ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s2); margin: var(--s4) 0 var(--s3); font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--paper); }
.crumbs span[aria-current] { color: var(--paper); }
.article__head { margin: var(--s3) 0 var(--s5); }
.crumbs + .article .article__head { margin-top: 0; }
.article__kicker { font: 16px/1.5 var(--font-pixel); color: var(--torch); text-shadow: 2px 2px 0 #000; margin-bottom: var(--s2); }
.article__head h1 { font: 32px/1.25 var(--font-pixel); color: #fff; text-shadow: 3px 3px 0 #000; text-wrap: balance; overflow-wrap: anywhere; }
.article__lead { margin-top: var(--s3); max-width: 40em; font-size: 20px; line-height: 1.55; }

.toc { margin: 0 0 var(--s5); padding: var(--s3) var(--s4); background: var(--panel-2); box-shadow: inset 3px 0 0 var(--border); max-width: 40em; }
.toc__title { font: 16px/1.5 var(--font-pixel); color: var(--muted); margin-bottom: var(--s2); }
.toc ol { margin: 0; padding-left: var(--s4); columns: 2 14em; column-gap: var(--s5); }
.toc li { font-size: 16px; line-height: 1.5; padding: 2px 0; break-inside: avoid; }

.prose { max-width: 44em; }
.prose > * + * { margin-top: var(--s3); }
.prose h2, .article > h2, section > h2 { font: 24px/1.3 var(--font-pixel); color: #fff; text-shadow: 2px 2px 0 #000; margin-top: var(--s6); scroll-margin-top: calc(var(--bar-h) + var(--s3)); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font: 600 20px/1.35 var(--font-body); color: #fff; margin-top: var(--s5); }
.prose ul, .prose ol { padding-left: var(--s4); }
.prose li + li { margin-top: var(--s1); }
.prose strong { color: #fff; font-weight: 600; }
.callout { padding: var(--s3) var(--s4); background: var(--panel); box-shadow: inset 4px 0 0 var(--torch); }
.note { margin-top: var(--s3); font-size: 16px; color: var(--muted); max-width: 44em; }
.note--warn { padding: var(--s2) var(--s3); color: var(--paper); background: rgba(255, 178, 56, .08); box-shadow: inset 3px 0 0 var(--torch); }
.count { font: 16px/1 var(--font-pixel); color: var(--muted); vertical-align: middle; margin-left: var(--s2); }
.plain { padding-left: var(--s4); }
.plain li + li { margin-top: var(--s1); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin-top: var(--s3); max-width: 100%; box-shadow: inset 0 0 0 2px var(--border); }
.prose .table-wrap { margin-top: var(--s3); }
table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.45; }
th, td { padding: var(--s2) var(--s3); text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
thead th { background: var(--panel-2); color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover > * { background: rgba(255, 255, 255, .025); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.num--none { color: #8f8599; }
.num--yes { color: var(--emerald); }
.table-wrap--wide table { min-width: 760px; }
.tag { font-size: 14px; color: #ffe27a; }

/* ---------- chips (rarity / rank) ---------- */
.chip { display: inline-block; font: 16px/1.5 var(--font-pixel); color: var(--tint); text-shadow: 2px 2px 0 #000; white-space: nowrap;
  padding: 0 var(--s2); background: rgba(0, 0, 0, .35); box-shadow: inset 3px 0 0 var(--tint); }

/* ---------- stats & curses ---------- */
.stats th[scope="row"] { min-width: 240px; width: 36%; font-weight: 400; }
.stats td.num { padding-left: var(--s2); padding-right: var(--s2); }
.stat__name { display: block; color: var(--tint); font-weight: 600; font-size: 17px; }
.stat__desc { display: block; margin-top: var(--s1); color: var(--paper); }
.stat__gear { display: block; margin-top: var(--s1); font-size: 14px; color: var(--muted); }
.stats thead th.num { padding-left: var(--s2); padding-right: var(--s2); }
.stats tr:target > *, .stats tr.is-target > * { background: rgba(255, 178, 56, .1); }
.curses { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s3); }
.curse { padding: var(--s3); background: var(--panel); box-shadow: inset 3px 0 0 #e24a4a; }
.curse h3 { font: 600 17px/1.35 var(--font-body); color: #ff8a8a; }
.curse:target, .curse.is-target { box-shadow: inset 3px 0 0 #e24a4a, 0 0 0 2px var(--torch); }

/* ---------- commands ---------- */
.cmds td:first-child { width: 42%; }
.cmds__usage { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); }
.cmd { display: inline-flex; align-items: center; gap: var(--s2); max-width: 100%; }
.cmd code { overflow-wrap: anywhere; }
.cmd__copy { flex: none; min-height: 32px; padding: 0 var(--s2); font: 600 14px/1 var(--font-body); color: var(--paper); background: rgba(10, 8, 12, .55);
  border: 0; border-radius: 0; box-shadow: inset 0 0 0 2px var(--border); cursor: pointer; }
.cmd__copy:hover { box-shadow: inset 0 0 0 2px var(--torch); color: #fff; }
.cmd__copy.is-copied { color: var(--emerald); box-shadow: inset 0 0 0 2px var(--emerald); }
@media (max-width: 599px) { .cmds thead { display: none; } .cmds tr { display: block; padding: var(--s2) 0; } .cmds td { display: block; width: auto !important; border: 0; padding: var(--s1) var(--s3); } .cmds tr + tr { border-top: 1px solid var(--border); } }

/* ---------- home ---------- */
/* the door into the wiki: the numbers, quick start, eight sections */
.home-stats { list-style: none; margin: var(--s4) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); font-size: 16px; }
.home-stats a { display: inline-flex; align-items: baseline; gap: var(--s2); color: var(--muted); text-decoration: none; }
.home-stats strong { font: 28px/1 var(--font-pixel); color: var(--torch); text-shadow: 2px 2px 0 #000; }
.home-stats a:hover { color: var(--paper); }
.home-stats a:hover strong { color: #ffd488; }
.home-sec { margin-top: var(--s6); }
.home-sec__title { margin: 0 0 var(--s3); font: 600 14px/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: #8f8599; text-shadow: none; }
.quick, .explore { list-style: none; margin: 0; padding: 0; }
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.quick__card { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: var(--s3); align-content: center; min-height: 68px; height: 100%;
  padding: var(--s2) var(--s3); color: var(--paper); text-decoration: none; background: var(--panel); box-shadow: inset 0 0 0 1px #3a3340;
  transition: background-color .14s ease-out, box-shadow .14s ease-out; }
.quick__icon { grid-row: span 2; width: 40px; height: 40px; align-self: center; image-rendering: pixelated; }
.quick__name { font-weight: 600; color: #fff; line-height: 1.3; }
.quick__text { font-size: 14px; color: var(--muted); line-height: 1.45; }
.quick__text code { font-size: 14px; }
.explore { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.explore__card { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: var(--s3); color: var(--paper); text-decoration: none;
  background: var(--panel); box-shadow: inset 0 0 0 1px #3a3340; transition: background-color .14s ease-out, box-shadow .14s ease-out, transform .14s ease-out; }
.explore__icon { width: 56px; height: 56px; margin-bottom: var(--s2); image-rendering: pixelated; }
.explore__name { font-size: 17px; font-weight: 600; color: #fff; line-height: 1.3; }
.explore__num { font-size: 14px; color: var(--paper); }
.explore__num b { font: 22px/1.25 var(--font-pixel); color: var(--torch); font-weight: 400; }
.explore__text { font-size: 14px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.quick__card:hover, .explore__card:hover { background: #2a2530; box-shadow: inset 0 0 0 2px var(--torch); }
.explore__card:hover { transform: translateY(-2px); }
/* gear kinds: one tab bar across Cận chiến / Cung / Nỏ / Giáp / Cổ vật */
.kind-tabs ul { list-style: none; margin: 0 0 var(--s4); padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.kind-tabs a { display: inline-flex; align-items: center; gap: var(--s2); min-height: 40px; padding: 0 var(--s3); color: var(--paper); text-decoration: none;
  background: var(--panel); box-shadow: inset 0 0 0 1px #3a3340; transition: box-shadow .14s ease-out, color .14s ease-out, background-color .14s ease-out; }
.kind-tabs a:hover { color: #fff; box-shadow: inset 0 0 0 2px var(--torch); }
.kind-tabs a[aria-current="page"] { color: #1f1405; font-weight: 600; background: var(--torch); box-shadow: inset 0 -4px 0 var(--torch-dark); }
.kind-tabs img { width: 20px; height: 20px; image-rendering: pixelated; }
.tiles--kinds { margin: 0 0 var(--s5); }
.hero-icon--sm { float: right; width: 64px; height: 64px; margin: 0 0 var(--s2) var(--s3); image-rendering: pixelated; }
.list-title { margin-top: var(--s5) !important; }
@media (max-width: 1199px) { .explore { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 899px) { .quick { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 359px) { .explore { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .explore__card:hover { transform: none; } }
.tiles { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s3); }
.tile { display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto; column-gap: var(--s3); align-items: center; height: 100%; padding: var(--s3);
  background: var(--panel); color: var(--paper); text-decoration: none; box-shadow: inset 0 0 0 2px var(--border); transition: box-shadow .16s ease-out, transform .16s ease-out; }
.tile:hover { box-shadow: inset 0 0 0 2px var(--torch); color: var(--paper); transform: translateY(-2px); }
.tile__icon { grid-row: span 2; width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; background: var(--bg-deep); }
.tile__name { font-weight: 600; color: #fff; line-height: 1.3; }
.tile__meta { font-size: 14px; color: var(--muted); line-height: 1.4; }

/* ---------- lists of things ---------- */
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-bottom: var(--s3); }
.filter__input { flex: 1 1 260px; max-width: 420px; height: 40px; padding: 0 var(--s3); font: 16px/1 var(--font-body); color: var(--paper);
  background: var(--bg-deep); border: 0; border-radius: 0; box-shadow: inset 0 0 0 2px var(--border); -webkit-appearance: none; appearance: none; }
.filter__input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--torch); }
.filter__count { font-size: 14px; color: var(--muted); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: var(--s3); }
.cards--icons { grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); }
.card { display: flex; flex-direction: column; height: 100%; padding: var(--s2); background: var(--panel); color: var(--paper); text-decoration: none;
  box-shadow: inset 0 0 0 2px var(--border); transition: box-shadow .16s ease-out, transform .16s ease-out, background-color .16s ease-out; }
.card:hover { box-shadow: inset 0 0 0 2px var(--torch), 0 6px 0 #000; color: var(--paper); transform: translateY(-3px); background-color: #2a2330; }
.card__img--pixel { transition: transform .16s ease-out; }
.card:hover .card__img--pixel { transform: translateY(-2px); }
.card__img { width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: contain; background: var(--bg-deep); }
.card__img--pixel { width: 64px; height: 64px; aspect-ratio: auto; margin: var(--s2) auto; image-rendering: pixelated; background: none; }
.card__img--empty { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; background: var(--bg-deep); }
.card__img--empty::before { content: "?"; font: 32px/1 var(--font-pixel); color: #4a4152; }
.cards--icons .card__img--empty { width: 64px; height: 64px; aspect-ratio: auto; margin: var(--s2) auto; }
.card__name { margin-top: var(--s2); font-weight: 600; font-size: 16px; line-height: 1.35; color: #fff; overflow-wrap: anywhere; }
.card__meta { margin-top: var(--s1); font-size: 14px; line-height: 1.4; color: var(--muted); }
.cards [hidden] { display: none; }
.kind-chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s3); }
.kind-chip { min-height: 40px; padding: 0 var(--s3); font: 600 16px/1 var(--font-body); color: var(--paper); background: var(--panel); border: 0; border-radius: 0;
  box-shadow: inset 0 0 0 2px var(--border); cursor: pointer; transition: box-shadow .14s ease-out, background-color .14s ease-out, color .14s ease-out; }
.kind-chip span { margin-left: var(--s1); font-weight: 400; color: var(--muted); }
.kind-chip:hover { box-shadow: inset 0 0 0 2px var(--torch); }
.kind-chip[aria-pressed="true"] { color: #1f1405; background: var(--torch); box-shadow: inset 0 -4px 0 var(--torch-dark); }
.kind-chip[aria-pressed="true"] span { color: #4a3208; }

/* ---------- crafting: recipes drawn like the game's crafting screen ---------- */
.recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: var(--s3); margin-top: var(--s3); }
.recipes [hidden] { display: none; }
.recipe { padding: var(--s3); background: var(--panel); box-shadow: inset 0 0 0 2px var(--border); scroll-margin-top: calc(var(--bar-h) + var(--s3)); }
.recipe:target, .recipe.is-target { box-shadow: inset 0 0 0 2px var(--torch); }
.recipe__name { font-weight: 600; color: #fff; line-height: 1.35; overflow-wrap: anywhere; }
.recipe__count { color: var(--emerald); font-weight: 600; }
.recipe__where { font-size: 14px; color: var(--muted); margin-top: 2px; }
.recipe__ui { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s2); }
.recipe__needs { margin-top: var(--s2); font-size: 14px; line-height: 1.45; color: var(--paper); }
.craft-grid { display: grid; grid-template-columns: repeat(3, 40px); gap: 2px; padding: 2px; background: #0b0a0d; }
.craft-list { display: flex; flex-wrap: wrap; gap: 2px; }
.craft-plus { align-self: center; color: var(--muted); font: 16px/1 var(--font-pixel); padding: 0 var(--s1); }
.craft-arrow { width: 24px; height: 16px; flex: none; background: linear-gradient(var(--muted), var(--muted)) 0 6px / 14px 4px no-repeat;
  clip-path: polygon(0 6px, 14px 6px, 14px 0, 24px 8px, 14px 16px, 14px 10px, 0 10px); background-color: var(--muted); }
.craft-arrow--fire { background: linear-gradient(#ffb238, #e24a4a); clip-path: polygon(50% 0, 80% 35%, 100% 70%, 75% 100%, 25% 100%, 0 70%, 20% 35%); width: 16px; height: 20px; }
.slot { position: relative; display: grid; place-items: center; width: 40px; height: 40px; background: #3a3440;
  box-shadow: inset 2px 2px 0 #1b171f, inset -2px -2px 0 #5a5260; text-decoration: none; }
.slot img { width: 32px; height: 32px; image-rendering: pixelated; }
.slot--empty { background: #3a3440; }
.slot--out { width: 48px; height: 48px; }
.slot--out img { width: 36px; height: 36px; }
a.slot:hover { box-shadow: inset 0 0 0 2px var(--torch); }
.slot__n { position: absolute; right: 2px; bottom: 0; font: 16px/1 var(--font-pixel); color: #fff; text-shadow: 2px 2px 0 #000; }
.slot__none { font: 16px/1 var(--font-pixel); color: #8f8599; font-style: normal; }
.pager { display: flex; flex-wrap: wrap; gap: var(--s1); margin: var(--s3) 0; }
.pager a { min-width: 40px; min-height: 40px; display: grid; place-items: center; padding: 0 var(--s2); color: var(--paper); text-decoration: none;
  background: var(--panel); box-shadow: inset 0 0 0 2px var(--border); }
.pager a:hover { box-shadow: inset 0 0 0 2px var(--torch); }
.pager a[aria-current="page"] { color: #1f1405; background: var(--torch); box-shadow: none; }
.forge-list { display: grid; gap: var(--s3); margin-top: var(--s3); }
.forge-family { font: 600 20px/1.35 var(--font-body); color: #fff; margin-top: var(--s4); }
.forge-family:first-child { margin-top: 0; }
.forge-item { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: var(--s3); align-items: stretch; }   /* the note is as tall as its recipe */
.forge-item__desc { padding: var(--s3); background: var(--bg-deep); box-shadow: inset 3px 0 0 var(--torch); font-size: 16px; line-height: 1.55; }
.forge-item__desc p + p { margin-top: var(--s1); }
.tile--hot { box-shadow: inset 0 0 0 2px var(--torch); }
.tile__icon--img img { width: 48px; height: 48px; image-rendering: pixelated; }
@media (max-width: 599px) {
  .recipes { grid-template-columns: minmax(0, 1fr); }
  .forge-item { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- entity pages ---------- */
.entity { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s4); align-items: start; margin-bottom: var(--s5); }
.entity--mob { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
.hero-icon { width: 128px; height: 128px; padding: var(--s3); box-sizing: content-box; image-rendering: pixelated; background: var(--bg-deep); box-shadow: inset 0 0 0 2px var(--border); }
.hero-img { width: 100%; height: auto; background: var(--bg-deep); box-shadow: inset 0 0 0 2px var(--border); }
.facts { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); margin: 0; box-shadow: inset 0 0 0 2px var(--border); }
.facts dt, .facts dd { margin: 0; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--border); }
.facts dt { color: var(--muted); font-size: 16px; background: var(--panel-2); }
.facts dd { overflow-wrap: anywhere; }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }
@media (max-width: 599px) {
  .entity, .entity--mob { grid-template-columns: minmax(0, 1fr); }
  .hero-icon { margin: 0 auto; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dt { border-bottom: 0; padding-bottom: 0; background: none; font-size: 14px; }
}

/* ---------- footer ---------- */
.footer { margin-top: var(--s5); background: #0c0b0e; padding: var(--s4) var(--s3); text-align: center; color: var(--muted); font-size: 16px; border-top: 4px solid #000; }
.footer a { color: var(--paper); }
@media (min-width: 900px) { .footer { margin-left: 272px; } }       /* beside the pinned menu, never under it */

/* ---------- hover cards: point at a weapon, artifact or monster to read it without opening the page ---------- */
.tip { position: fixed; left: 0; top: 0; z-index: 48; width: 336px; max-width: calc(100vw - 16px); pointer-events: none;
  background: var(--panel); border: 2px solid var(--border); box-shadow: 6px 6px 0 #000; font-size: 14px; line-height: 1.5;
  opacity: 0; visibility: hidden; transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(.96); transform-origin: var(--ox, 0) var(--oy, 0);
  transition: opacity .14s ease-out, transform .16s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .16s; will-change: transform, opacity; }
.tip.is-on { opacity: 1; visibility: visible; transform: translate3d(var(--x, 0), var(--y, 0), 0) scale(1);
  transition: opacity .14s ease-out, transform .16s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
.tip__band { padding: var(--s1) var(--s3); font: 16px/1.5 var(--font-pixel); color: var(--torch); text-shadow: 2px 2px 0 #000; background: var(--panel-2);
  border-bottom: 2px solid var(--border); }
.tip__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3); align-items: center; padding: var(--s3) var(--s3) var(--s2); }
.tip__icon { width: 48px; height: 48px; object-fit: contain; background: var(--bg-deep); box-shadow: inset 0 0 0 1px var(--border); }
.tip__icon--pixel { image-rendering: pixelated; padding: 4px; box-sizing: content-box; }
.tip__icon--mob { width: 96px; height: 72px; }
.tip__name { font-weight: 600; font-size: 17px; line-height: 1.3; color: #fff; overflow-wrap: anywhere; }
.tip__tag { margin-top: 2px; font-size: 14px; color: #ffd488; }
.tip__desc { padding: 0 var(--s3) var(--s2); color: var(--paper); }
.tip__stats { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px var(--s3); margin: 0 var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--border); }
.tip__stats dt { color: var(--muted); }
.tip__stats dd { margin: 0; color: var(--emerald); font-weight: 600; overflow-wrap: anywhere; }
.tip__fx { margin: 0 var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--border); }
.tip__fx p + p { margin-top: var(--s1); }
.tip__fx b { font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--torch); margin-right: var(--s1); }
.tip__more { color: var(--muted); }
.tip__drops, .tip__foot { margin: 0 var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--border); color: var(--muted); }
.tip__drops span { color: var(--paper); }
.tip__obtain { color: #ffd488; }
.tip__lbl { color: var(--paper); font-weight: 600; }
.tip__hint { padding: var(--s1) var(--s3); font-size: 13px; color: var(--muted); background: var(--panel-2); text-align: right; }

/* ---------- motion: pages cross-fade (Chrome, Edge, Safari 18+), in-page jumps glide, popovers ease in ---------- */
@view-transition { navigation: auto; }
.wiki-bar { view-transition-name: wiki-bar; }
::view-transition-old(root) { animation: .12s ease-in both vt-out; }
::view-transition-new(root) { animation: .2s cubic-bezier(.2, .8, .2, 1) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.search__results:not([hidden]) { animation: pop-in .14s ease-out; }
.ask:not([hidden]) { animation: rise-in .2s cubic-bezier(.2, .8, .2, 1); }
.ask__msg { animation: pop-in .18s ease-out; }
.ask-fab { transition: transform .16s ease-out, filter .16s ease-out; }
.ask-fab:hover { transform: translateY(-2px); }

/* ---------- "Hỏi wiki": the wiki assistant (built by wiki.js, answers come from /api/wiki-chat) ---------- */
/* on a phone the centred footer line would sit under the floating buttons: keep it above them; wide screens need no room */
@media (max-width: 899px) { .has-ask .footer { padding-bottom: 116px; } }

/* ---------- back to top: shows once the page has been scrolled a screen and a half, sits above "Hỏi wiki" ---------- */
.to-top { position: fixed; right: var(--s3); bottom: var(--s3); z-index: 41; display: grid; place-items: center; width: 48px; height: 48px;
  padding: 0; color: var(--paper); background: var(--panel); border: 0; border-radius: 0; cursor: pointer;
  box-shadow: inset 0 0 0 2px var(--border), 4px 4px 0 #000; opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .16s ease-out, transform .16s ease-out, visibility 0s linear .16s; }
.has-ask .to-top { bottom: calc(var(--s3) + 44px + var(--s2)); }
.to-top.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity .16s ease-out, transform .16s ease-out, visibility 0s; }
.to-top:hover { color: #fff; box-shadow: inset 0 0 0 2px var(--torch), 4px 4px 0 #000; }
.to-top:active { transform: translateY(2px); }
.to-top svg { width: 20px; height: 20px; shape-rendering: crispEdges; }
@media (prefers-reduced-motion: reduce) { .to-top, .to-top.is-on { transition: none; transform: none; } }
.ask-fab { position: fixed; right: var(--s3); bottom: var(--s3); z-index: 42; display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s3); font: 600 16px/1 var(--font-body); color: var(--torch); background: #1b1820; border: 0; border-radius: 0;
  box-shadow: inset 0 0 0 2px var(--torch-dark), 4px 4px 0 #000; cursor: pointer;
  transition: transform .12s, color .14s ease-out, background-color .14s ease-out, box-shadow .14s ease-out; }
.ask-fab:hover { color: #1f1405; background: var(--torch); box-shadow: inset 0 -4px 0 var(--torch-dark), inset 0 2px 0 #ffd488, 4px 4px 0 #000; }
.ask-fab:active { transform: translateY(2px); }
.ask-fab svg { width: 22px; height: 22px; flex: none; shape-rendering: crispEdges; }
.ask-fab[aria-expanded="true"] { visibility: hidden; }

.ask { position: fixed; right: var(--s3); bottom: var(--s3); z-index: 55; width: 400px; height: min(640px, calc(100vh - var(--bar-h) - var(--s5)));
  height: min(640px, calc(100dvh - var(--bar-h) - var(--s5))); display: flex; flex-direction: column; background: var(--panel);
  box-shadow: inset 0 0 0 2px var(--border), 6px 6px 0 #000; }
.ask[hidden] { display: none; }
.ask__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--s2); align-items: start; padding: var(--s3) var(--s3) var(--s2);
  background: var(--panel-2); box-shadow: inset 0 0 0 2px var(--border); }
.ask__title { font: 24px/1.3 var(--font-pixel); color: #fff; text-shadow: 2px 2px 0 #000; }
.ask__sub { grid-column: 1; font-size: 14px; line-height: 1.4; color: var(--muted); margin-top: var(--s1); }
.ask__tools { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: var(--s1); }
.ask__icon-btn { min-width: 40px; min-height: 40px; padding: 0 var(--s2); display: inline-flex; align-items: center; justify-content: center;
  font: 600 14px/1 var(--font-body); color: var(--paper); background: var(--bg-deep); border: 0; border-radius: 0; box-shadow: inset 0 0 0 2px var(--border); cursor: pointer; }
.ask__icon-btn:hover { box-shadow: inset 0 0 0 2px var(--torch); color: #fff; }
.ask__icon-btn svg { width: 16px; height: 16px; shape-rendering: crispEdges; }

.ask__log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--s3); display: flex; flex-direction: column; gap: var(--s3); }
.ask__msg { max-width: 92%; font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }
.ask__msg p + p, .ask__msg p + ul, .ask__msg ul + p { margin-top: var(--s2); }
.ask__msg ul { margin: 0; padding-left: 1.2em; }
.ask__msg li + li { margin-top: var(--s1); }
.ask__msg--me { align-self: flex-end; padding: var(--s2) var(--s3); background: rgba(255, 178, 56, .14); box-shadow: inset 0 0 0 1px rgba(255, 178, 56, .45); white-space: pre-wrap; }
.ask__msg--bot { align-self: flex-start; padding: var(--s2) var(--s3); background: var(--bg-deep); box-shadow: inset 3px 0 0 var(--soul); }
.ask__msg--note { align-self: stretch; max-width: none; padding: var(--s2) var(--s3); font-size: 14px; color: var(--paper); background: rgba(255, 178, 56, .08); box-shadow: inset 3px 0 0 var(--torch); }
.ask__sources { margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.ask__sources ul { list-style: none; padding: 0; margin: var(--s1) 0 0; }
.ask__sources li + li { margin-top: var(--s1); }
.ask__sources a { color: var(--torch); }
.ask__intro { color: var(--paper); }
.ask__intro p { font-size: 16px; }
.ask__try { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.ask__chip { min-height: 40px; padding: var(--s1) var(--s3); font: 500 14px/1.3 var(--font-body); color: var(--paper); text-align: left; background: var(--panel-2);
  border: 0; border-radius: 0; box-shadow: inset 0 0 0 2px var(--border); cursor: pointer; }
.ask__chip:hover { box-shadow: inset 0 0 0 2px var(--torch); color: #fff; }
.ask__typing { align-self: flex-start; display: inline-flex; gap: 6px; padding: var(--s3); background: var(--bg-deep); box-shadow: inset 3px 0 0 var(--soul); }
.ask__typing i { width: 8px; height: 8px; background: var(--soul); animation: ask-blink 1s steps(2, jump-none) infinite; }
.ask__typing i:nth-child(2) { animation-delay: .2s; }
.ask__typing i:nth-child(3) { animation-delay: .4s; }
@keyframes ask-blink { from { opacity: .25; } to { opacity: 1; } }

.ask__form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2); padding: var(--s3) var(--s3) var(--s1); border-top: 2px solid var(--border); }
.ask__input { width: 100%; min-height: 48px; max-height: 144px; resize: none; padding: 12px var(--s3); font: 16px/1.5 var(--font-body); color: var(--paper);
  background: var(--bg-deep); border: 0; border-radius: 0; box-shadow: inset 0 0 0 2px var(--border); -webkit-appearance: none; appearance: none; }
.ask__input::placeholder { color: var(--muted); }
.ask__input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--torch); }
.ask__send { min-height: 48px; align-self: end; }
.ask__send:disabled { filter: grayscale(.7) brightness(.7); cursor: default; }
.ask__meta { display: flex; justify-content: space-between; gap: var(--s2); padding: 0 var(--s3) var(--s2); font-size: 14px; color: var(--muted); }
.ask__meta [data-ask-count].is-over { color: #ff8a8a; }
.ask__fine { padding: 0 var(--s3) var(--s3); font-size: 14px; line-height: 1.4; color: var(--muted); }

@media (max-width: 599px) {
  .ask-fab { right: var(--s3); bottom: var(--s3); }
  .ask { inset: 0; width: auto; height: auto; box-shadow: none; }
  .ask__msg { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .ask__typing i { animation: none; opacity: .8; } }

/* ---------- mouse cursor: the landing page's Lightning Rod ---------- */
@media (pointer: fine) {
  html { cursor: url(../img/cursor/rod-32.png) 1 1, auto; cursor: image-set(url(../img/cursor/rod-32.png) 1x, url(../img/cursor/rod-64.png) 2x) 1 1, auto; }
  a, button, summary, label, [role="button"] {
    cursor: url(../img/cursor/rod-charged-32.png) 1 1, pointer; cursor: image-set(url(../img/cursor/rod-charged-32.png) 1x, url(../img/cursor/rod-charged-64.png) 2x) 1 1, pointer; }
  input, textarea { cursor: text; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  @view-transition { navigation: none; }
  .tip, .tip.is-on { transform: translate3d(var(--x, 0), var(--y, 0), 0); }
}

/* the wiki home page's heading is the logo again (owner 26/09); its words stay as the picture's alt text */
.wiki-logo { margin: 0; line-height: 0; }
.wiki-logo img { width: min(560px, 100%); height: auto; }
