.page-wiki .site-head { position: fixed; left: 0; right: 0; }
/* Wiki: dark game handbook, same world as the home page */
.w-hero { padding: clamp(110px, 10vw, 140px) 0 clamp(26px, 3vw, 40px); position: relative; overflow: hidden; }
.w-hero::after { content: ""; position: absolute; right: -2%; top: 50px; width: min(420px, 36vw); aspect-ratio: 1.4; background: url("../assets/cut/Bookshelf_RoyalGold.webp") center / contain no-repeat; opacity: 0.9; filter: drop-shadow(0 30px 24px rgba(0,0,0,0.55)); transform: rotate(8deg); pointer-events: none; }
.w-hero .wrap { position: relative; z-index: 1; }
.w-title { font-family: var(--f-display); font-stretch: 62%; font-weight: 900; text-transform: uppercase; font-size: clamp(3.6rem, 9vw, 7.4rem); line-height: 0.84; color: var(--paper); margin: 0 0 14px; }
.w-title span { color: var(--yellow); display: block; }
.w-lede { color: rgba(247,242,228,0.8); max-width: 52ch; font-size: clamp(1.02rem, 1.4vw, 1.18rem); margin: 0 0 24px; }
.w-search { position: relative; max-width: 620px; }
.w-search svg { position: absolute; left: 18px; top: 50%; translate: 0 -50%; width: 22px; height: 22px; color: var(--ink-soft); pointer-events: none; }
.w-search input { width: 100%; font: inherit; font-size: 1.1rem; padding: 16px 18px 16px 52px; border-radius: 14px; border: 0; background: var(--paper); color: var(--ink); box-shadow: 0 16px 30px -14px rgba(0,0,0,0.7); caret-color: var(--pink-ink); }
.w-search input::placeholder { color: #776b55; }
.w-search input:focus { outline: 3px solid var(--yellow); outline-offset: 3px; }
.w-count { min-height: 1.4em; margin: 10px 0 0; color: var(--yellow); font-size: 0.95rem; }
.w-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.w-quick a { text-decoration: none; font-family: var(--f-display); font-stretch: 80%; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.82rem; color: var(--paper); padding: 8px 12px; border-radius: 999px; background: #26242b; transition: background 0.2s, color 0.2s; }
.w-quick a:hover { background: var(--yellow); color: var(--ink); }

.w-layout { padding-bottom: 100px; scroll-margin-top: 80px; }
.w-side { position: sticky; top: 92px; }
.w-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: calc(100vh - 120px); overflow: auto; }
.w-nav a { display: block; text-decoration: none; padding: 8px 12px; border-radius: 8px; color: rgba(247,242,228,0.7); font-family: var(--f-display); font-stretch: 80%; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; font-size: 0.9rem; transition: background 0.2s, color 0.2s; }
.w-nav a:hover { color: var(--paper); background: #222126; }
.w-nav a[aria-current] { color: var(--ink); background: var(--yellow); }
.w-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(56px, 7vw, 88px); min-width: 0; }

.w-sec { scroll-margin-top: 92px; min-width: 0; }
.w-sec > h2 { font-family: var(--f-display); font-stretch: 64%; font-weight: 900; text-transform: uppercase; font-size: clamp(2.4rem, 4.6vw, 3.8rem); line-height: 0.9; color: var(--paper); margin: 0 0 10px; }
.w-intro { color: rgba(247,242,228,0.75); max-width: 70ch; margin: 0 0 22px; }
.w-sub { font-family: var(--f-display); font-stretch: 78%; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; color: var(--yellow); margin: 26px 0 10px; }

/* cards */
.w-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 14px; }
.w-cards--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.w-card { position: relative; border-radius: 16px; background: #222126; color: var(--paper); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.25s var(--ease-out), background 0.25s; }
.w-card:hover { transform: translateY(-3px); background: #29272e; }
.w-card-art { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; background: radial-gradient(80% 80% at 50% 62%, color-mix(in srgb, var(--c, #ffd21f) 34%, #222126) 0%, #19181c 80%); }
.w-card-art img { position: absolute; inset: 9%; width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 12px 10px rgba(0,0,0,0.5)); transition: transform 0.35s var(--ease-out); }
.w-card:hover .w-card-art img { transform: translateY(-5px) scale(1.04); }
.w-card-photo { aspect-ratio: 16 / 9; background: #0f0e11; position: relative; }
.w-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.w-card-photo .stamp { position: absolute; left: 50%; top: 50%; translate: -50% -50%; color: var(--yellow); font-size: 1.3rem; mix-blend-mode: normal; }
.w-card-body { padding: 14px 16px 16px; display: grid; gap: 8px; align-content: start; flex: 1; }
.w-card h3 { font-family: var(--f-display); font-stretch: 68%; font-weight: 900; text-transform: uppercase; font-size: 1.6rem; line-height: 0.95; margin: 0; }
.w-card p { margin: 0; color: rgba(247,242,228,0.72); font-size: 0.92rem; }
.w-big { font-family: var(--f-display); font-stretch: 70%; font-weight: 900; font-size: 1.8rem; line-height: 1; color: var(--yellow); }
.w-big small { font-family: var(--f-body); font-weight: 400; font-size: 0.85rem; color: rgba(247,242,228,0.6); margin-left: 4px; }
.w-pill { justify-self: start; display: inline-block; font-family: var(--f-display); font-stretch: 80%; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; padding: 4px 9px 3px; border-radius: 999px; background: var(--c, var(--yellow)); color: #0f0e11; }
.w-pill--ghost { background: #2f2d35; color: var(--paper); }
.w-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.w-tags span { font-size: 0.78rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: #2f2d35; color: rgba(247,242,228,0.86); }
.w-tags span.y { background: var(--yellow); color: var(--ink); }
.w-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.9rem; margin: 0; }
.w-kv dt { color: rgba(247,242,228,0.6); }
.w-kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; font-weight: 700; }
.w-strip { height: 6px; background: var(--c, var(--yellow)); }

/* single-series stat bars */
.w-bar { display: grid; grid-template-columns: 6.5em 1fr 2.6em; gap: 8px; align-items: center; font-size: 0.82rem; color: rgba(247,242,228,0.7); }
.w-bar i { height: 6px; border-radius: 3px; background: #34313a; overflow: hidden; display: block; }
.w-bar i b { display: block; height: 100%; width: var(--v); border-radius: 3px; background: var(--yellow); }
.w-bar span:last-child { text-align: right; font-weight: 700; color: var(--paper); font-variant-numeric: tabular-nums; }

/* drop odds as labelled chips */
.w-odds { display: flex; flex-wrap: wrap; gap: 5px; }
.w-odds span { display: inline-flex; align-items: center; gap: 5px; font-size: 0.76rem; padding: 3px 8px 3px 6px; border-radius: 999px; background: #2f2d35; color: var(--paper); font-variant-numeric: tabular-nums; }
.w-odds span i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1.5px #19181c; }

/* keycaps */
.w-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.w-key { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: #222126; color: var(--paper); }
.w-key b { font-weight: 700; font-size: 0.95rem; }
.w-key .caps { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.w-key .cap { max-width: 100%; font-family: var(--f-display); font-stretch: 80%; font-weight: 800; font-size: 0.78rem; text-transform: uppercase; padding: 4px 8px 3px; border-radius: 6px; background: var(--paper); color: var(--ink); box-shadow: 0 3px 0 #a89f8a; white-space: nowrap; }
.w-key small { grid-column: 1 / -1; color: rgba(247,242,228,0.6); font-size: 0.8rem; }

/* dark tables */
.w-tbl { overflow-x: auto; border-radius: 14px; background: #222126; -webkit-overflow-scrolling: touch; }
.w-tbl.has-more { -webkit-mask-image: linear-gradient(90deg, #000 86%, transparent); mask-image: linear-gradient(90deg, #000 86%, transparent); }
.w-tbl table { width: 100%; border-collapse: collapse; font-size: 0.93rem; color: var(--paper); font-variant-numeric: tabular-nums; }
.w-tbl th, .w-tbl td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #2f2d35; vertical-align: top; }
.w-tbl thead th { font-family: var(--f-display); font-stretch: 80%; font-weight: 800; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--yellow); white-space: nowrap; background: #1d1c21; position: sticky; top: 0; }
.w-tbl tbody th { font-weight: 700; white-space: nowrap; }
.w-tbl tbody tr:last-child > * { border-bottom: 0; }
.w-tbl tbody tr:hover { background: #29272e; }
.w-tbl .n { text-align: right; white-space: nowrap; }
.w-tbl .sub { display: block; font-weight: 400; color: rgba(247,242,228,0.6); font-size: 0.84rem; min-width: 16ch; white-space: normal; }
.w-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 8px; vertical-align: 0; }
.w-more summary { cursor: pointer; color: var(--yellow); font-family: var(--f-display); font-stretch: 80%; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.85rem; margin: 16px 0 10px; }
.w-note { color: rgba(247,242,228,0.55); font-size: 0.85rem; margin: 12px 0 0; max-width: 72ch; }

.w-empty { color: var(--paper); background: #222126; border-radius: 14px; padding: 22px; }

@media (max-width: 900px) {
  .w-layout { grid-template-columns: minmax(0, 1fr); }
  .w-side { display: none; }
  .w-hero::after { opacity: 0.25; right: -30%; }
}
@media (max-width: 560px) {
  .w-quick { flex-wrap: nowrap; overflow-x: auto; margin-right: calc(-1 * var(--gutter)); padding-bottom: 6px; scrollbar-width: none; }
  .w-quick a { flex: none; }
  .w-keys { grid-template-columns: 1fr; }
  .w-key { grid-template-columns: 1fr; }
  .w-key .caps { justify-content: flex-start; }
  .w-key .cap { white-space: normal; }
  .w-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .w-card h3 { overflow-wrap: anywhere; }
  .w-kv { grid-template-columns: minmax(0, 1fr) auto; font-size: 0.82rem; }
  .w-cards--wide { grid-template-columns: minmax(0, 1fr); }
  .w-card h3 { font-size: 1.25rem; }
  .w-big { font-size: 1.4rem; }
  .w-card-body { padding: 10px 12px 12px; }
}

/* bestiary */
.b-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.b-card { font: inherit; text-align: left; cursor: pointer; border: 2px solid transparent; padding: 0; }
.b-card { text-decoration: none; }
.b-card:hover { border-color: var(--c); }
.b-card .w-card-body { gap: 4px; padding: 10px 12px 12px; }
.b-name { font-family: var(--f-display); font-stretch: 68%; font-weight: 900; text-transform: uppercase; font-size: 1.25rem; line-height: 0.95; color: var(--paper); }
.b-mini { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: rgba(247,242,228,0.65); }
.b-mini i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.b-profile { margin-top: 20px; scroll-margin-top: 92px; }
.b-prof { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-radius: 26px; overflow: hidden; color: var(--paper);
  background: radial-gradient(90% 120% at 25% 55%, color-mix(in srgb, var(--c) 30%, #18171b) 0%, #141317 70%); box-shadow: 0 40px 80px -40px rgba(0,0,0,0.9); }
.b-stage { position: relative; min-height: 420px; }
.b-glow { position: absolute; inset: 8% 6% 16%; border-radius: 50%; background: radial-gradient(closest-side, var(--c), transparent); opacity: 0.55; filter: blur(26px); }
.b-pad { position: absolute; left: 14%; right: 14%; bottom: 11%; height: 12%; border-radius: 50%; background: radial-gradient(closest-side, #2a2830, #121115); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 85%, #000), 0 0 44px 6px color-mix(in srgb, var(--c) 45%, transparent); }
.b-img { position: absolute; left: 50%; bottom: 17%; translate: -50% 0; width: 76%; max-height: 74%; object-fit: contain; filter: drop-shadow(0 26px 20px rgba(0,0,0,0.6)); animation: hover 5s ease-in-out infinite; }
.b-img.in { animation: lootin 0.6s var(--ease-thunk), hover 5s ease-in-out 0.6s infinite; }
@keyframes hover { 50% { transform: translateY(-12px); } }
@keyframes lootin { from { opacity: 0; transform: translateY(-60px) scale(0.7) rotate(-8deg); } }
.b-info { padding: clamp(22px, 3.4vw, 44px) clamp(20px, 3.4vw, 44px) clamp(22px, 3.4vw, 44px) 0; display: grid; align-content: center; gap: 14px; }
.b-top { display: flex; align-items: center; gap: 14px; }
.b-top .w-pill { background: var(--c); }
.b-danger { display: flex; gap: 5px; }
.b-danger i { width: 26px; height: 9px; border-radius: 3px; background: rgba(255,255,255,0.12); transform: skewX(-18deg); }
.b-danger i.on { background: var(--c); }
.b-prof-name { font-family: var(--f-display); font-stretch: 62%; font-weight: 900; text-transform: uppercase; font-size: clamp(3.2rem, 6.4vw, 5.6rem); line-height: 0.84; margin: 0; }
.b-tag { font-size: clamp(1.1rem, 1.6vw, 1.3rem); margin: -4px 0 0; color: var(--c); font-weight: 700; max-width: 30ch; }
.b-facts { margin: 0; display: grid; gap: 10px; }
.b-facts dt { font-family: var(--f-display); font-stretch: 80%; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem; color: rgba(247,242,228,0.55); margin-bottom: 2px; }
.b-facts dd { margin: 0; font-size: 1.05rem; color: rgba(247,242,228,0.92); max-width: 40ch; }
.b-weak { background: var(--yellow); padding: 10px 14px 12px; transform: rotate(-1deg); box-shadow: var(--shadow-slip); max-width: 420px; }
.b-weak dt { color: var(--ink); }
.b-weak dd { font-family: var(--f-hand); color: var(--pen); font-size: 1.3rem; line-height: 1.2; }
@media (max-width: 860px) {
  .b-prof { grid-template-columns: minmax(0, 1fr); }
  .b-stage { min-height: 300px; }
  .b-info { padding: 0 20px 24px; }
}
@media (prefers-reduced-motion: reduce) { .b-img, .b-img.in { animation: none; } }

/* topic hub */
.t-hub { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.t-hub[hidden] { display: none; }
.t-tile { position: relative; display: flex; align-items: flex-end; min-height: 210px; border-radius: 20px; overflow: hidden; text-decoration: none; color: var(--paper); isolation: isolate;
  background: radial-gradient(80% 90% at 70% 40%, color-mix(in srgb, var(--c) 40%, #222126) 0%, #19181c 75%); transition: transform 0.3s var(--ease-out); }
.t-tile:hover { transform: translateY(-4px); }
.t-art { position: absolute; right: -4%; top: 6%; width: 62%; height: 78%; object-fit: contain; filter: drop-shadow(0 18px 14px rgba(0,0,0,0.55)); transition: transform 0.4s var(--ease-out); z-index: -1; }
.t-tile:hover .t-art { transform: translateY(-8px) rotate(-3deg) scale(1.05); }
.t-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 0.6s var(--ease-out); }
.t-tile--photo::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(10,9,12,0.92) 0%, rgba(10,9,12,0.2) 70%); }
.t-tile:hover .t-photo { transform: scale(1.05); }
.t-txt { display: grid; gap: 2px; padding: 18px 20px; }
.t-txt b { font-family: var(--f-display); font-stretch: 64%; font-weight: 900; text-transform: uppercase; font-size: clamp(2rem, 3vw, 2.6rem); line-height: 0.9; }
.t-txt small { font-size: 0.92rem; color: rgba(247,242,228,0.75); }
.w-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 22px; text-decoration: none; color: var(--paper); font-family: var(--f-display); font-stretch: 80%; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.9rem; padding: 10px 14px 10px 10px; border-radius: 999px; background: #26242b; }
.w-back[hidden] { display: none; }
.w-back svg { width: 18px; height: 18px; }
.w-back:hover { background: var(--yellow); color: var(--ink); }
.w-drops { font-size: 0.9rem; }
.w-drops b { color: var(--paper); }
.w-body { gap: 64px; }
@media (max-width: 900px) { .t-hub { grid-template-columns: repeat(2, minmax(0, 1fr)); } .t-tile { min-height: 170px; } }
@media (max-width: 480px) { .t-hub { grid-template-columns: minmax(0, 1fr); } .t-tile { min-height: 140px; } .t-art { width: 46%; } }

.b-profile[hidden], .b-grid[hidden] { display: none; }
.b-profile { margin-top: 0; }
.b-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.b-pager a { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 16px; background: #222126; color: var(--paper); text-decoration: none; transition: background 0.2s; }
.b-pager a:hover { background: #2b2930; }
.b-pager a.next { justify-content: flex-end; text-align: right; }
.b-pager img { width: 64px; height: 64px; object-fit: contain; }
.b-pager span { display: grid; font-family: var(--f-display); font-stretch: 70%; font-weight: 900; text-transform: uppercase; font-size: 1.2rem; line-height: 1; }
.b-pager small { font-family: var(--f-body); font-weight: 400; text-transform: none; font-size: 0.8rem; color: rgba(247,242,228,0.6); margin-bottom: 2px; }
@media (max-width: 480px) { .b-pager img { width: 44px; height: 44px; } .b-pager span { font-size: 1rem; } }

.w-in-topic .w-hero { padding-bottom: 18px; }
.w-in-topic .w-hero::after { display: none; }
.w-in-topic .w-title { font-size: clamp(2.2rem, 4vw, 3rem); }
.w-in-topic .w-title span { display: inline; }
