/* =====================================================================
   THE WIKI (wiki/pew-pew-pest-control/): only the wiki's pages load this.
   They wear the game's night palette from css/style.css, with Zakk's
   electric violet for the page you're on. Colors and fonts still come
   from the :root block at the top of style.css.
   ===================================================================== */

.wiki-main { padding-block: clamp(22px, 3.5vw, 48px) clamp(36px, 5vw, 64px); }
.wiki-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: clamp(28px, 4vw, 60px); align-items: start; }
.wiki-article { min-width: 0; max-width: 80ch; }

/* ---------- the sidebar: search and the list of pages ---------- */
.wiki-side { position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.wiki-side > summary { display: none; }
.wiki-side-in { display: grid; gap: 16px; padding-bottom: 8px; }
.wiki-pages { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; border-left: 2px solid var(--line); }
.wiki-pages a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-left: -2px; padding: 7px 10px 7px 14px; border-left: 3px solid transparent; color: var(--fg-soft); font: 600 15px/1.3 var(--font-body); text-decoration: none; }
.wiki-pages a:hover { color: var(--fg); border-left-color: color-mix(in srgb, var(--fg) 40%, transparent); }
.wiki-pages a[aria-current="page"] { color: var(--fg); border-left-color: var(--violet-light); background: linear-gradient(90deg, rgba(185, 110, 255, .16), transparent 85%); }
.wiki-flag { font: 700 9px/1 var(--font-label); letter-spacing: .14em; text-transform: uppercase; color: var(--violet-light); padding: 3px 5px 2px; border: 1px solid color-mix(in srgb, var(--violet-light) 55%, transparent); }

.wiki-search { position: relative; }
.wiki-search input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1.5px solid color-mix(in srgb, var(--fg) 28%, transparent); border-radius: 0; background: var(--night-2); color: var(--fg); font: 500 15px/1.3 var(--font-body); }
.wiki-search input::placeholder { color: var(--fg-soft); opacity: 1; }
.wiki-search input:focus { outline: 3px solid var(--violet-light); outline-offset: 0; border-color: var(--violet-light); }
.wiki-hits { margin: 6px 0 0; padding: 4px 0; list-style: none; background: var(--night-2); border: 1.5px solid var(--line); max-height: 60vh; overflow: auto; }
.wiki-hits a { display: block; padding: 8px 12px; color: var(--fg); text-decoration: none; font: 600 15px/1.3 var(--font-body); }
.wiki-hits a small { display: block; margin-top: 2px; font: 600 10px/1.4 var(--font-label); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-soft); }
.wiki-hits a:hover, .wiki-hits a:focus-visible { background: rgba(185, 110, 255, .18); outline-offset: -3px; }
.wiki-hits .none { padding: 8px 12px; color: var(--fg-soft); font-size: 15px; }

/* phones and narrow windows: the list folds into a "Wiki pages" button above the article */
@media (max-width: 900px) {
  .wiki-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .wiki-side { position: static; max-height: none; overflow: visible; border: 1.5px solid var(--line); background: var(--night-2); }
  .wiki-side > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 16px; cursor: pointer; list-style: none; font: 700 12px/1 var(--font-label); letter-spacing: .14em; text-transform: uppercase; color: var(--fg); }
  .wiki-side > summary::-webkit-details-marker { display: none; }
  .wiki-side > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .15s ease; }
  .wiki-side[open] > summary::after { transform: rotate(-135deg) translateY(-3px); }
  .wiki-side-in { padding: 4px 16px 16px; }
}

/* ---------- the page head ---------- */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0 0 18px; padding: 0; list-style: none; font: 600 10.5px/1.6 var(--font-label); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-soft); }
.crumbs li { font-size: inherit; line-height: inherit; }
.crumbs li + li::before { content: "/"; margin: 0 .6em; opacity: .5; }
.crumbs a { color: var(--fg-soft); text-decoration: none; }
.crumbs a:hover { color: var(--fg); text-decoration: underline; }
.wiki-head { display: grid; gap: 12px; justify-items: start; margin-bottom: 26px; }
.wiki-head h1 { margin: 4px 0 0; font: 400 clamp(38px, 6vw, 70px) / .98 var(--font-display); color: var(--cream); text-shadow: 0 4px 0 #7c1018, 0 9px 24px rgba(0, 0, 0, .5); text-wrap: balance; }
.wiki-lede { max-width: 62ch; font: 500 clamp(17px, 1.7vw, 19px) / 1.6 var(--font-body); color: rgba(246, 242, 231, .9); }
.wiki-spoiler { padding: 10px 14px; border: 2px dashed rgba(229, 72, 72, .7); color: var(--fg); font-size: 15.5px; max-width: 62ch; }
.wiki-spoiler b { color: #ff8a80; }

/* "On this page" */
.wiki-toc { margin: 0 0 30px; padding: 14px 16px 16px; background: var(--night-2); border-top: 3px solid var(--violet-light); }
.wiki-toc .wiki-toc-h { margin: 0 0 10px; padding: 0; border: 0; font: 700 11px/1 var(--font-label); letter-spacing: .16em; text-transform: uppercase; color: var(--fg-soft); text-shadow: none; }
.wiki-toc ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.wiki-toc a { display: inline-block; padding: 6px 11px; border: 1.5px solid color-mix(in srgb, var(--violet-light) 45%, transparent); color: var(--fg); text-decoration: none; font: 600 14px/1.25 var(--font-body); }
.wiki-toc a:hover { background: var(--violet-light); border-color: var(--violet-light); color: var(--night); }

/* ---------- the article ----------
   The plain-text rules sit inside :where() so that anything with a class of its own (the breadcrumbs,
   "On this page", the tables, the pager) wins over them without a fight. */
.wiki-article > h2, .wiki-article section > h2 { margin: 44px 0 14px; padding-top: 20px; border-top: 1px solid var(--line); font: 400 clamp(27px, 3.2vw, 36px) / 1.08 var(--font-display); color: var(--crumb); text-shadow: 0 2px 0 #5a3b05; text-wrap: balance; }
.wiki-article :where(h3) { margin: 28px 0 8px; font: 800 19px/1.3 var(--font-body); color: var(--cream); }
.wiki-article :where(h4) { margin: 20px 0 6px; font: 800 16px/1.3 var(--font-body); color: var(--cream); }
.wiki-article :where(p, li) { font-size: 17px; line-height: 1.65; }
.wiki-article :where(p + p) { margin-top: 12px; }
.wiki-article :where(p + ul, p + ol, ul + p, ol + p, .wtable-wrap + p, .note + p) { margin-top: 12px; }
.wiki-article :where(ul, ol) { margin: 10px 0 0; padding-left: 22px; display: grid; gap: 7px; }
.wiki-article :where(li)::marker { color: var(--crumb); }
.wiki-article strong { color: var(--cream); }
.wiki-article kbd { display: inline-block; min-width: 1.7em; font: 700 12px/1 var(--font-label-plain); padding: .3em .45em .25em; border: 1px solid color-mix(in srgb, var(--fg) 40%, transparent); border-bottom-width: 3px; border-radius: 4px; background: var(--night-2); color: var(--fg); text-align: center; vertical-align: 1px; }
.wiki-article .soft { color: var(--fg-soft); }
.wiki-article [id] { scroll-margin-top: 84px; }
@media (max-width: 680px) { .wiki-article [id] { scroll-margin-top: 12px; } }

/* call-outs: a tip, a warning, a note from the studio */
.note { margin: 18px 0; padding: 14px 18px; background: var(--night-2); border-left: 4px solid var(--crumb); }
.note.warn { border-left-color: #e54848; }
.note.violet { border-left-color: var(--violet-light); }
.note > b:first-child { font: 700 11px/1 var(--font-label); letter-spacing: .14em; text-transform: uppercase; color: var(--crumb); margin-right: .5em; }
.note.warn > b:first-child { color: #ff8a80; }
.note.violet > b:first-child { color: var(--violet-light); }
.note p + p { margin-top: 8px; }

/* a small label tape, for "Newest update" and the like */
.tape.tape-mini { padding: .45em .7em .4em; font-size: 9.5px; vertical-align: .25em; margin-left: .4em; }

/* key-value lists */
.wfacts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 20px; margin: 14px 0 0; }
.wfacts dt { font: 700 11px/1.75 var(--font-label); letter-spacing: .12em; text-transform: uppercase; color: var(--fg-soft); }
.wfacts dd { margin: 0; min-width: 0; font-size: 16.5px; line-height: 1.55; }
@media (max-width: 520px) { .wfacts { grid-template-columns: minmax(0, 1fr); gap: 2px; } .wfacts dd { margin-bottom: 8px; } }

/* ---------- tables ---------- */
.wtable-wrap { margin: 16px 0 6px; overflow-x: auto; }
.wtable { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.5; }
.wtable caption { caption-side: top; text-align: left; padding: 0 0 8px; font: 700 11px/1.5 var(--font-label); letter-spacing: .12em; text-transform: uppercase; color: var(--fg-soft); }
.wtable th { padding: 9px 12px; border-bottom: 2px solid var(--fg); text-align: left; vertical-align: bottom; font: 700 10.5px/1.35 var(--font-label); letter-spacing: .12em; text-transform: uppercase; color: var(--crumb); }
.wtable td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.wtable tbody tr:nth-child(even) > * { background: rgba(246, 242, 231, .035); }
.wtable tbody th { border-bottom: 1px solid var(--line); font: 800 15.5px/1.4 var(--font-body); letter-spacing: 0; text-transform: none; color: var(--cream); vertical-align: top; }
.wtable .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wtable .nowrap { white-space: nowrap; }
.wtable p { font-size: inherit; line-height: inherit; margin: 0 0 6px; }
.wtable tr:target > * { background: rgba(185, 110, 255, .2); }
/* phones: a stacked table turns each row into a little block, with the column names written in */
@media (max-width: 640px) {
  .wtable.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .wtable.stack, .wtable.stack tbody, .wtable.stack tr, .wtable.stack td, .wtable.stack tbody th { display: block; width: 100%; }
  .wtable.stack tr { padding: 12px 2px; border-bottom: 1px solid var(--line); }
  .wtable.stack tbody tr:nth-child(even) > * { background: none; }
  .wtable.stack td, .wtable.stack tbody th { padding: 2px 0; border: 0; text-align: left; white-space: normal; }
  .wtable.stack tbody th { font-size: 17px; margin-bottom: 2px; }
  .wtable.stack td[data-label]::before { content: attr(data-label) ": "; font: 700 10px/1.6 var(--font-label); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-soft); }
}

/* secret achievements and other spoilers: folded until tapped */
details.secret { display: block; }
details.secret > summary { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px; border: 1.5px dashed color-mix(in srgb, var(--violet-light) 70%, transparent); color: var(--violet-light); font: 700 10.5px/1.6 var(--font-label); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; list-style: none; }
details.secret > summary::-webkit-details-marker { display: none; }
details.secret > summary::before { content: "+"; font: 700 14px/1 var(--font-label-plain); }
details.secret[open] > summary::before { content: "\2212"; }
details.secret > div { margin-top: 6px; }

/* ---------- the hub ---------- */
.wiki-hub-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px clamp(24px, 4vw, 48px); align-items: start; margin-top: 8px; }
.wiki-hub-top .ticket { margin-top: 6px; transform: rotate(1deg); }
.wiki-hub-top .ticket dd { font-size: 18px; line-height: 24px; }
@media (max-width: 1080px) { .wiki-hub-top { grid-template-columns: minmax(0, 1fr); } .wiki-hub-top .ticket { transform: none; max-width: 520px; } }
.wiki-shot { margin: 0; }
.wiki-shot img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; box-shadow: 0 12px 28px rgba(0, 0, 0, .5); }
.wiki-shot figcaption { margin-top: 8px; font-size: 14px; color: var(--fg-soft); }
.wiki-dir { margin-top: 22px; }
.wiki-dir .card { transition: transform .15s ease; }
.wiki-dir .card:hover { transform: rotate(0deg) translateY(-3px); }
.wiki-dir .card h3 { margin: 0; font-size: 18px; color: var(--card-ink); }
.wiki-dir .card h3 a { color: var(--card-ink); text-decoration: none; }
.wiki-dir .card h3 a::after { content: ""; position: absolute; inset: 0; }
.wiki-dir .card h3 a:focus-visible { outline: none; }
.wiki-dir .card:has(a:focus-visible) { outline: 3px solid var(--violet-light); outline-offset: 4px; }
.wiki-dir .card p { font-size: 14.5px; }

/* ---------- the bottom of each page ---------- */
.wiki-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 52px; padding-top: 22px; border-top: 2px solid var(--fg); }
.wiki-pager a { display: grid; gap: 4px; padding: 14px 16px; background: var(--night-2); color: var(--fg); text-decoration: none; font: 700 17px/1.3 var(--font-body); border: 1.5px solid transparent; }
.wiki-pager a:hover { border-color: var(--violet-light); }
.wiki-pager span { font: 700 10px/1.4 var(--font-label); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-soft); }
.wiki-pager .wiki-next { grid-column: 2; text-align: right; }
@media (max-width: 520px) { .wiki-pager { grid-template-columns: minmax(0, 1fr); } .wiki-pager .wiki-next { grid-column: 1; } }
.wiki-stamp { margin-top: 22px; font-size: 14.5px; color: var(--fg-soft); }
.wiki-stamp a { overflow-wrap: anywhere; }
.wiki-main > .ad-slot { margin-top: clamp(26px, 4vw, 44px); padding-top: 26px; border-top: 1px solid var(--line); }

/* ---------- handwriting (the default look): the small label type gets the same lift the rest of the site gives it ---------- */
html:not(.font-plain) :is(.wiki-flag, .crumbs ol, .wiki-toc .wiki-toc-h, .note > b:first-child, .wfacts dt, .wtable caption, .wtable thead th,
  details.secret > summary, .wiki-pager span, .wiki-hits a small, .wiki-side > summary) { font-size-adjust: .58; }
html:not(.font-plain) .wtable.stack td[data-label]::before { font-size-adjust: .58; letter-spacing: normal; text-transform: none; }
/* text set with the font shorthand loses the page's handwriting lift (the shorthand resets it), so it gets it back here */
html:not(.font-plain) :is(.wiki-pages a, .wiki-search input, .wiki-hits a, .wiki-hits .none, .wiki-lede, .wiki-spoiler, .wiki-toc a, .wiki-article :where(h3, h4),
  .wtable, .wtable tbody th, .wiki-pager a, .wiki-dir .card h3, .wiki-dir .card p, .wiki-shot figcaption, .wfacts dd) { font-size-adjust: .46; }
html:not(.font-plain) .wtable tbody th { font-weight: 700; }
html:not(.font-plain) .wiki-head h1 { font-weight: 700; line-height: 1.15; padding-bottom: .1em; }
html:not(.font-plain) .wiki-article > h2, html:not(.font-plain) .wiki-article section > h2 { font-weight: 700; line-height: 1.15; }
