/* valenmor.com: dark ink and gold, like the launcher (scripts/launcher.gd).
   Pixel fonts at whole multiples of their 16 px grid; body text in the system font. */

@font-face {
  font-family: "ThaleahFat";
  src: url("/static/fonts/ThaleahFat.594e662b5a.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "m5x7";
  src: url("/static/fonts/m5x7.47c3f0b01f.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #17120d;
  --ink-2: #1f1812;
  --ink-3: #2a2018;
  --line: #3e3125;
  --line-2: #574533;
  --gold: #edc773;
  --gold-hi: #f6dc9c;
  --gold-lo: #9b7a3a;
  --muted: #a89478;
  --text: #eee3cf;
  --text-2: #d3c4aa;
  --bad: #ed6b5c;
  --good: #9cc77a;
  --note: #8fb8e0;
  --font-title: "ThaleahFat", ui-serif, Georgia, serif;
  --font-pixel: "m5x7", ui-monospace, "Cascadia Mono", Menlo, monospace;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --gutter: 16px;
  --radius: 0;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font-body);
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; }
img { height: auto; }

.pixel, .icon, img.icon {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.px-icon { image-rendering: pixelated; flex: none; }

/* --- pixel type: whole multiples of the fonts' 16 px grid --------------------- */

h1, h2, h3, .brand-name, .fact-n, .big-404 {
  font-family: var(--font-title);
  font-weight: 400;
  font-synthesis: none;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  font-smooth: never;
  letter-spacing: 0;
  color: var(--gold);
  text-wrap: balance;
}
h1 { font-size: 64px; line-height: 64px; margin: 0 0 24px; }
h2 { font-size: 48px; line-height: 48px; margin: 0 0 24px; }
h3 { font-size: 32px; line-height: 32px; margin: 32px 0 12px; }

.badge, .btn, .site-nav a, .footer-nav a, .fact-l, .map-label, .platform-rec,
.wiki-nav-title, .toc-title, .pn-label, .crumbs, .wiki-sections h2, kbd,
.wiki-nav summary, .lang-current, .footer-lang a {
  font-family: var(--font-pixel);
  font-weight: 400;
  font-synthesis: none;
  -webkit-font-smoothing: none;
  font-smooth: never;
  letter-spacing: 0;
}

@media (max-width: 699px) {
  h1 { font-size: 48px; line-height: 48px; }
  h2 { font-size: 32px; line-height: 40px; }
}

/* --- basics ------------------------------------------------------------------- */

a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold-hi); }
:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; }
p { margin: 0 0 1em; }
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--ink-3);
  border: 1px solid var(--line);
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}
.small { font-size: 0.875rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -64px; z-index: 10;
  background: var(--gold); color: var(--ink); padding: 8px 16px; font-weight: 600;
}
.skip-link:focus { top: 8px; }
main { flex: 1 0 auto; }

.wrap { width: min(1120px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.wrap.narrow { width: min(760px, 100% - 2 * var(--gutter)); }

.section { padding: 72px 0; }
.section-tight { padding-top: 24px; }
@media (max-width: 699px) { .section { padding: 48px 0; } }

.lead { font-size: 1.1875rem; color: var(--text-2); max-width: 62ch; }
.prose { max-width: 70ch; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--gold); }

/* --- buttons and badges --------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 4px 20px 6px;
  font-size: 32px; line-height: 24px;
  text-decoration: none; white-space: nowrap;
  border: 2px solid var(--ink);
  outline-offset: 3px;
  transition: transform 80ms ease, background-color 120ms ease, box-shadow 80ms ease;
}
.btn-primary {
  background: var(--gold); color: var(--ink);
  box-shadow: inset 0 -4px 0 var(--gold-lo), inset 0 2px 0 var(--gold-hi), 0 0 0 2px var(--gold-lo);
}
.btn-primary:hover { background: var(--gold-hi); color: var(--ink); }
.btn-primary:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 var(--gold-lo), 0 0 0 2px var(--gold-lo); }
.btn-ghost {
  background: rgba(23, 18, 13, 0.6); color: var(--gold);
  box-shadow: inset 0 0 0 2px var(--gold-lo);
}
.btn-ghost:hover { color: var(--gold-hi); box-shadow: inset 0 0 0 2px var(--gold); background: rgba(23, 18, 13, 0.85); }
.btn:focus-visible { outline: 3px solid #fff4d6; }
.btn .px-icon { width: 16px; height: 16px; margin-top: 2px; }

.badge {
  display: inline-block; margin: 0 0 16px;
  font-size: 32px; line-height: 24px; padding: 2px 12px 6px;
  color: var(--ink); background: var(--gold);
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--gold-lo);
}

/* --- header and footer -------------------------------------------------------- */

.site-header {
  position: relative; z-index: 5;
  background: rgba(23, 18, 13, 0.92);
  border-bottom: 2px solid var(--line);
}
.page-home .site-header { position: absolute; inset: 0 0 auto; background: linear-gradient(rgba(23, 18, 13, 0.85), rgba(23, 18, 13, 0)); border-bottom: 0; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; min-height: 72px; padding: 8px 0; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-emblem { flex: none; }
.brand-name { font-size: 32px; line-height: 32px; color: var(--gold); }
.site-nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; list-style: none; margin: 0; padding: 0; }
.site-nav a { font-size: 32px; line-height: 32px; color: var(--text); text-decoration: none; padding: 4px 0; display: inline-block; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--gold); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--gold); }
.lang-switch { padding: 2px 8px !important; box-shadow: inset 0 0 0 2px var(--line-2); }
.lang-switch:hover { box-shadow: inset 0 0 0 2px var(--gold); }
@media (max-width: 559px) {
  .header-row { justify-content: center; }
  .site-nav { width: 100%; }
  .site-nav ul { justify-content: center; gap: 4px 20px; }
}

.site-footer { border-top: 2px solid var(--line); background: var(--ink-2); padding: 48px 0 32px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-about p { margin: 12px 0 0; max-width: 46ch; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav a, .footer-lang a, .lang-current { font-size: 32px; line-height: 40px; text-decoration: none; }
.footer-nav a { color: var(--text-2); }
.footer-nav a:hover, .footer-nav a[aria-current="page"] { color: var(--gold); }
.footer-lang { display: flex; flex-direction: column; align-items: flex-start; }
.lang-current { color: var(--muted); }
.footer-legal { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 799px) { .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .footer-about { grid-column: 1 / -1; } }

/* --- home: hero --------------------------------------------------------------- */

.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(92vh, 860px);
  display: flex; align-items: flex-end;
  padding: 128px 0 56px;
  border-bottom: 2px solid var(--line);
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(23, 18, 13, 0.15), rgba(23, 18, 13, 0.55) 70%),
    linear-gradient(180deg, rgba(23, 18, 13, 0.35) 0%, rgba(23, 18, 13, 0.2) 35%, rgba(23, 18, 13, 0.92) 88%, var(--ink) 100%);
}
.hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-title { margin: 8px 0 20px; line-height: 0; }
.logo { width: var(--logo-s); height: auto; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.45)); }
@media (min-width: 560px) { .logo { width: var(--logo-m); } }
@media (min-width: 900px) { .logo { width: var(--logo-l); } }
.hero-tagline { font-size: 1.25rem; line-height: 1.5; max-width: 40ch; color: var(--text); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6); margin-bottom: 28px; }
.hero-note { margin: 18px 0 0; color: var(--text-2); font-size: 0.9375rem; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6); }

/* the download picker: Windows unless site.js says Linux */
.dl { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.dl-main { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.dl-alt { margin: 0; font-size: 0.9375rem; display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: center; }
.dl-for-linux, .dl-alt-windows, .dl-other-os { display: none !important; }
html[data-os="linux"] .dl-for-windows, html[data-os="linux"] .dl-alt-linux { display: none !important; }
html[data-os="linux"] .dl-for-linux { display: inline-flex !important; }
html[data-os="linux"] .dl-alt-windows { display: inline !important; }
html[data-os="mac"] .dl-other-os, html[data-os="mobile"] .dl-other-os { display: block !important; }
.dl-other-os { color: var(--text-2); font-size: 0.9375rem; max-width: 52ch; text-align: center; margin: 0 auto; }
@media (max-width: 459px) { .dl-main { flex-direction: column; align-items: stretch; width: 100%; } .dl-main .btn { white-space: normal; text-align: center; } }

/* --- home: about, facts, cards, world, join ------------------------------------- */

.about .lead-prose { font-size: 1.125rem; color: var(--text); }
.facts {
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px;
  background: var(--line);
  border: 2px solid var(--line);
}
.facts li { background: var(--ink-2); padding: 20px 8px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fact-n { font-size: 64px; line-height: 64px; }
.fact-l { font-size: 32px; line-height: 24px; color: var(--text-2); }
@media (max-width: 899px) { .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 459px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fact-n { font-size: 48px; line-height: 48px; } }

.features { background: var(--ink-2); border-block: 2px solid var(--line); }
.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 24px;
}
.card { background: var(--ink); border: 2px solid var(--line); display: flex; flex-direction: column; }
.card-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 2px solid var(--line); background: var(--ink-3); }
.card-body { padding: 20px 20px 8px; }
.card-body h3 { margin: 0 0 12px; }
.card-body p { color: var(--text-2); font-size: 1rem; }

.world-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 48px; align-items: center; }
@media (max-width: 899px) { .world-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.world-map { margin: 0; }
.map-frame { position: relative; border: 2px solid var(--line-2); box-shadow: 0 0 0 4px var(--ink), 0 0 0 6px var(--line); background: #1d4a49; container-type: inline-size; }
.map-img { display: block; width: 100%; }
.map-label {
  position: absolute; transform: translate(-50%, -50%);
  font-size: 32px; line-height: 24px; white-space: nowrap; pointer-events: none;
  color: #fff6df; text-shadow: 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 2px 0 var(--ink), 0 -2px 0 var(--ink);
}
.map-anchor-start { transform: translate(-25%, -50%); }
.map-anchor-end { transform: translate(-75%, -50%); }
.map-region { color: rgba(255, 246, 223, 0.8); }
@container (max-width: 559px) { .map-label { font-size: 16px; line-height: 12px; text-shadow: 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 1px 0 var(--ink), 0 -1px 0 var(--ink); } }
.link-arrow::after { content: " →"; }

.join-box { text-align: left; background: var(--ink-2); border: 2px solid var(--line-2); box-shadow: 0 0 0 4px var(--ink), 0 0 0 6px var(--line); padding: 40px 40px 32px; }
.join { padding-bottom: 96px; }
@media (max-width: 699px) { .join-box { padding: 28px 20px 24px; } }
.steps { list-style: none; counter-reset: step; margin: 8px 0 28px; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; position: relative; padding-left: 52px; min-height: 36px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 36px; height: 36px; display: grid; place-items: center;
  font: 32px/24px var(--font-pixel); padding-bottom: 4px;
  color: var(--ink); background: var(--gold); box-shadow: inset 0 -3px 0 var(--gold-lo);
}
.join .dl { align-items: flex-start; }
.join .dl-main, .join .dl-alt { justify-content: flex-start; }

/* --- inner pages ---------------------------------------------------------------- */

.page-head { padding: 56px 0 8px; }
.page-head h1 { margin-bottom: 16px; }
.center-page { min-height: 60vh; display: flex; align-items: center; }
.center-page .prose { margin-inline: auto; }
.big-emblem { margin-bottom: 16px; }
.big-404 { font-size: 128px; line-height: 128px; margin: 0 0 8px; color: var(--line-2); }
.center-actions { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 24px; }
.notfound-other { margin-top: 48px; padding-top: 32px; border-top: 2px solid var(--line); }
.notfound-other h2 { font-size: 32px; line-height: 32px; }

.platforms { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 699px) { .platforms { grid-template-columns: minmax(0, 1fr); } }
.platform { background: var(--ink-2); border: 2px solid var(--line); padding: 28px 24px 20px; display: flex; flex-direction: column; align-items: flex-start; }
.platform h2 { margin-bottom: 8px; }
.platform-system { color: var(--text-2); margin-bottom: 20px; }
.platform-file { margin: 16px 0 0; color: var(--muted); font-size: 0.9375rem; }
.platform-rec { display: none; font-size: 32px; line-height: 24px; color: var(--good); margin: -8px 0 16px; }
html[data-os="windows"] .platform-windows, html[data-os="linux"] .platform-linux { border-color: var(--gold-lo); box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--gold-lo); }
html[data-os="windows"] .platform-windows .platform-rec, html[data-os="linux"] .platform-linux .platform-rec { display: block; }
.platforms + .dl-other-os { margin-top: 20px; }
.platform .btn { max-width: 100%; white-space: normal; }
@media (max-width: 459px) { .platform { padding: 24px 16px 16px; } .platform .btn { padding-inline: 14px; } }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; }
@media (max-width: 899px) { .two-col { grid-template-columns: minmax(0, 1fr); gap: 40px; } }
.two-col h3 { margin-top: 24px; }
.shot { margin: 24px 0 0; border: 2px solid var(--line); background: var(--ink-2); }
.shot img { display: block; width: 100%; }
.req { border-collapse: collapse; width: 100%; }
.req th, .req td { text-align: left; vertical-align: top; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); }
.req th { color: var(--gold); font-weight: 600; width: 32%; padding-right: 16px; }
.req td { color: var(--text-2); }
@media (max-width: 459px) { .req th, .req td { display: block; width: auto; padding: 4px 0; } .req th { padding-top: 12px; border-bottom: 0; } }
.note-box { background: var(--ink-2); border: 2px solid var(--line); border-left: 6px solid var(--gold-lo); padding: 28px 28px 12px; align-self: start; }
.note-box h2 { font-size: 32px; line-height: 32px; }

/* --- wiki ------------------------------------------------------------------------- */

.wiki-search { position: relative; max-width: 560px; margin: 8px 0 0; }
.wiki-search input {
  width: 100%; min-height: 48px; padding: 10px 14px;
  font: inherit; color: var(--text); background: var(--ink-2);
  border: 2px solid var(--line-2); border-radius: 0;
}
.wiki-search input::placeholder { color: var(--muted); opacity: 1; }
.wiki-search input:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 0; border-color: var(--gold); }
.wiki-search-big { margin-top: 24px; }
.wiki-results { list-style: none; margin: 0; padding: 0; }
.wiki-results:not(:empty) { margin-top: 8px; border: 2px solid var(--line); background: var(--ink-2); max-height: 60vh; overflow: auto; }
.wiki-results li + li { border-top: 1px solid var(--line); }
.wiki-results a { display: block; padding: 10px 14px; text-decoration: none; color: var(--text); }
.wiki-results a:hover, .wiki-results a:focus-visible { background: var(--ink-3); outline-offset: -3px; }
.wiki-results .r-title { color: var(--gold); font-weight: 600; }
.wiki-results .r-section { color: var(--muted); font-size: 0.8125rem; margin-left: 8px; }
.wiki-results .r-snippet { display: block; color: var(--text-2); font-size: 0.875rem; margin-top: 2px; }
.wiki-results mark { background: none; color: var(--gold-hi); font-weight: 600; }
.wiki-results .r-empty { padding: 10px 14px; color: var(--muted); }

.wiki-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 24px; }
.wiki-section-card { background: var(--ink-2); border: 2px solid var(--line); padding: 20px 20px 12px; }
.wiki-sections h2 { font-size: 32px; line-height: 24px; margin: 0 0 12px; color: var(--gold); }
.wiki-section-card ul { list-style: none; margin: 0; padding: 0; }
.wiki-section-card li { padding: 8px 0; border-top: 1px solid var(--line); }
.wiki-section-card li a { font-weight: 600; text-decoration: none; }
.wiki-section-card li a:hover { text-decoration: underline; }
.wiki-section-card .summary { display: block; color: var(--text-2); font-size: 0.9375rem; }

.wiki-layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 48px; padding: 40px 0 80px; align-items: start; }
.wrap.wiki-layout, .page-wiki .site-header .wrap, .page-wiki .site-footer .wrap { width: min(1280px, 100% - 2 * var(--gutter)); }
.wiki-side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; padding-right: 4px; }
.wiki-side .wiki-search { margin: 0 0 20px; }
.wiki-nav summary { display: none; }
.wiki-nav nav { padding-bottom: 8px; }
.wiki-nav-title { font-size: 32px; line-height: 24px; color: var(--muted); margin: 16px 0 6px; }
.wiki-nav-title:first-child { margin-top: 0; }
.wiki-nav ul { list-style: none; margin: 0; padding: 0; }
.wiki-nav li a { display: block; padding: 4px 10px; color: var(--text-2); text-decoration: none; border-left: 2px solid var(--line); font-size: 0.9375rem; }
.wiki-nav li a:hover { color: var(--gold); border-left-color: var(--gold-lo); }
.wiki-nav li a[aria-current="page"] { color: var(--gold); border-left: 4px solid var(--gold); padding-left: 8px; background: var(--ink-2); font-weight: 600; }
@media (max-width: 899px) {
  .wiki-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 24px; }
  .wiki-side { position: static; max-height: none; overflow: visible; }
  .wiki-nav { border: 2px solid var(--line); background: var(--ink-2); }
  .wiki-nav summary { display: block; cursor: pointer; padding: 8px 14px; font-size: 32px; line-height: 32px; color: var(--gold); }
  .wiki-nav nav { padding: 0 14px 12px; }
}

.crumbs { font-size: 32px; line-height: 24px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { text-decoration: none; }
.wiki-article h1 { margin-bottom: 20px; }
.toc { border-left: 2px solid var(--line); padding: 4px 0 4px 16px; margin: 0 0 32px; }
.toc-title { font-size: 32px; line-height: 24px; color: var(--muted); margin: 0 0 6px; }
.toc ul { list-style: none; margin: 0; padding: 0; columns: 2 220px; column-gap: 24px; }
.toc li { padding: 2px 0; break-inside: avoid; }
.toc a { text-decoration: none; font-size: 0.9375rem; }
.toc a:hover { text-decoration: underline; }
.toc-inline { border: 0; padding: 0; margin-top: 24px; }
.toc-inline ul { columns: auto; display: flex; flex-wrap: wrap; gap: 8px 20px; }

.wiki-body { max-width: none; }
.wiki-body > p, .wiki-body > ul, .wiki-body > ol, .wiki-body > h2, .wiki-body > h3, .wiki-body > .callout, .wiki-body > hr { max-width: 760px; }
.wiki-body h2 { font-size: 32px; line-height: 32px; margin: 40px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--line); scroll-margin-top: 16px; }
.wiki-body h3 { font-size: 32px; line-height: 32px; margin: 28px 0 10px; color: var(--gold-hi); scroll-margin-top: 16px; }
.wiki-body h2:first-child { margin-top: 0; }
.wiki-body img:not(.icon):not(.sprite) { display: block; max-width: 100%; height: auto; border: 2px solid var(--line); }
.wiki-figure { margin: 0 0 1.5em; }
.wiki-figure figcaption { color: var(--muted); font-size: 0.875rem; margin-top: 6px; }
img.sprite { image-rendering: pixelated; vertical-align: middle; margin-right: 6px; }
a.external::after { content: " ↗"; font-size: 0.8em; }
.wiki-body hr { border: 0; border-top: 2px solid var(--line); margin: 32px 0; }

.table-wrap { overflow-x: auto; margin: 0 0 1.25em; max-width: 100%; }
.wiki-table { border-collapse: collapse; min-width: min(100%, 480px); font-size: 0.9375rem; }
.wiki-table th, .wiki-table td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: middle; }
.wiki-table th { background: var(--ink-3); color: var(--gold); font-weight: 600; }
.wiki-table tbody tr:nth-child(even) td { background: var(--ink-2); }
.wiki-table td .ref { white-space: nowrap; }

.callout { background: var(--ink-2); border: 2px solid var(--line); border-left: 6px solid var(--note); padding: 14px 18px 2px; margin: 0 0 1.25em; }
.callout-tip { border-left-color: var(--good); }
.callout-note { border-left-color: var(--note); }
.callout-warning { border-left-color: var(--bad); }
.callout-title { font-family: var(--font-pixel); font-size: 32px; line-height: 24px; margin: 0 0 8px !important; -webkit-font-smoothing: none; font-smooth: never; color: var(--note); }
.callout-tip .callout-title { color: var(--good); }
.callout-warning .callout-title { color: var(--bad); }

kbd {
  display: inline-block; min-width: 1.6em; text-align: center;
  font-size: 32px; line-height: 18px; padding: 1px 6px 5px; margin: 0 1px;
  vertical-align: 1px;
  color: var(--text); background: var(--ink-3);
  border: 2px solid var(--line-2); border-bottom-width: 4px;
}

.ref { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
a.ref { text-decoration: none; }
a.ref:hover { text-decoration: underline; }
.ref .icon, img.icon { width: 32px; height: 32px; flex: none; }

.prevnext { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin: 56px 0 16px; max-width: 760px; }
.prevnext a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 2px solid var(--line); background: var(--ink-2); text-decoration: none; }
.prevnext a:hover { border-color: var(--gold-lo); }
.prevnext .next { text-align: right; grid-column: 2; }
.pn-label { font-size: 32px; line-height: 24px; color: var(--muted); }
.pn-title { color: var(--gold); font-weight: 600; }
@media (max-width: 459px) { .prevnext { grid-template-columns: minmax(0, 1fr); } .prevnext .next { grid-column: 1; } }

/* --- credits ---------------------------------------------------------------------- */

.credits { padding: 24px 0 72px; }
.credit-group { padding: 40px 0 8px; border-top: 2px solid var(--line); scroll-margin-top: 16px; }
.credit-group h2 { font-size: 48px; line-height: 48px; }
@media (max-width: 699px) { .credit-group h2 { font-size: 32px; line-height: 32px; } }
.credit-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 16px; }
.credit { background: var(--ink-2); border: 1px solid var(--line); padding: 14px 18px 4px; }
.credit p { margin: 0 0 10px; }
.credit-name { font-weight: 600; color: var(--text); }
.credit-by { color: var(--text-2); }
.credit-note { color: var(--muted); font-size: 0.9375rem; }
.credit-license { font-size: 0.9375rem; }
.name-list { color: var(--text-2); line-height: 1.8; }
.sheets { margin: 8px 0 24px; border: 2px solid var(--line); background: var(--ink-2); }
.sheets summary { cursor: pointer; padding: 12px 16px; color: var(--gold); font-weight: 600; }
.sheets .table-wrap { margin: 0; padding: 0 16px 16px; }
.credit-table { font-size: 0.8125rem; width: 100%; }
.credit-table code { font-size: 0.75rem; background: none; border: 0; padding: 0; color: var(--muted); }

/* --- motion --------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .btn-primary:active { transform: none; }
}
