/* Wikipedia Warlord site. The look borrows from game wikis and from the game itself: dark pixel panels, gold headings,
   rarity colours, and the same pixel-art frames (media/art/ui_*.svg) the game draws its windows and buttons with. */
:root {
  --bg: #1a1510;
  --bg-2: #211b15;
  --panel: #2a231b;
  --panel-2: #342b21;
  --edge: #5b4a35;
  --gold: #e3b341;
  --text: #f0e6d2;
  --muted: #b3a58b;
  --red: #c8402f;
  --link: #8ab4ff;
  --ground: #3a5a2c;
  --common: #d8d2c4;
  --rare: #6aa7ff;
  --unique: #f0b84a;
  --good: #6bb36b;
  --radius: 6px;
  --serif: 'Linux Libertine', 'Georgia', 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8f4ea;
    --bg-2: #f1e8d3;
    --edge: #d4c4a0;
    --gold: #a86f00;
    --text: #2b2218;
    --muted: #6b5d48;
    --link: #0645ad;
    --ground: #7fae5c;
    --common: #7a7466;
    --rare: #1c5fd1;
    --unique: #a86f00;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 68px; }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); }
img { max-width: 100%; height: auto; }
a { color: var(--link); }
code { background: var(--bg-2); border: 1px solid var(--edge); border-radius: 4px; padding: 0 5px; font-size: 0.92em; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); color: var(--gold); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--panel); color: var(--text); padding: 8px 12px; z-index: 30; }
.skip:focus { left: 8px; }

/* ---------------------------------------------------------------- pixel frames (the game's own art) */
.panel {
  border: 12px solid transparent;
  border-image: url(media/art/ui_panel.svg) 8 fill / 12px stretch;
  image-rendering: pixelated;
  color: #f0e6d2;
  --muted: #b3a58b;
  --link: #8ab4ff;
  --gold: #e3b341;
}
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
.btn {
  display: inline-block;
  border: 10px solid transparent;
  border-image: url(media/art/ui_button.svg) 5 fill / 10px stretch;
  image-rendering: pixelated;
  padding: 2px 12px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
  line-height: 1.3;
}
.btn:hover { border-image-source: url(media/art/ui_button_hot.svg); }
.btn.big { font-size: 1.1rem; padding: 6px 20px; }
.btn.small { font-size: 0.9rem; padding: 0 8px; }
.btn.ghost { color: var(--text); text-shadow: none; border-image-source: url(media/art/ui_chip.svg); border-image-slice: 4; border-image-width: 8px; }
.btn.ghost:hover { border-image-source: url(media/art/ui_button.svg); border-image-slice: 5; color: #fff; }
.btn:focus-visible, a:focus-visible, summary:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------------------------------------------------------------- header, menu, footer */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 52px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--edge);
}
.grow { flex: 1; }
.ver { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 700 1.1rem var(--serif); white-space: nowrap; }
.brand img { image-rendering: pixelated; }
.burger { display: none; background: none; border: 0; color: var(--text); font-size: 1.5rem; line-height: 1; padding: 4px 6px; cursor: pointer; }

.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; width: min(1320px, 100%); margin: 0 auto; padding: 0 16px; }
main { min-width: 0; padding-bottom: 8px; }
.menu { position: sticky; top: 52px; align-self: start; max-height: calc(100vh - 52px); overflow-y: auto; padding: 18px 0 24px; border-right: 1px solid var(--edge); }
.menu h2 { font: 700 0.72rem var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 18px 12px 6px; }
.menu h2:first-child { margin-top: 0; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 6px 12px; color: var(--muted); text-decoration: none; border-left: 3px solid transparent; font-size: 0.95rem; }
.menu a:hover { color: var(--text); background: var(--bg-2); }
.menu a[aria-current='page'] { color: var(--text); background: var(--bg-2); border-left-color: var(--gold); }
.menu a span { flex: 1; }
.menu em, .tile em { font-style: normal; font-size: 0.75rem; font-weight: 700; color: var(--muted); background: var(--bg-2); border: 1px solid var(--edge); border-radius: 999px; padding: 0 7px; }
.menu em:empty, .tile em:empty { display: none; }
.ic { width: 22px; height: 22px; vertical-align: -5px; image-rendering: pixelated; flex: none; }
.ic.big { width: 40px; height: 40px; vertical-align: middle; }

.foot { border-top: 1px solid var(--edge); margin-top: 64px; padding: 28px max(16px, calc((100vw - 1288px) / 2)) 40px; color: var(--muted); font-size: 0.85rem; }
.foot .cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; max-width: 760px; margin-bottom: 20px; }
.foot h2 { font: 700 0.72rem var(--sans); letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 8px; }
.foot .cols a { display: block; color: var(--muted); text-decoration: none; padding: 2px 0; }
.foot .cols a:hover { color: var(--text); }
.foot p { margin: 0; }

/* ---------------------------------------------------------------- common bits */
.block { padding: 36px 0 4px; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 46em; }
.fine { font-size: 0.88rem; color: var(--muted); }
.eyebrow { margin: 0 0 0.6em; color: var(--gold); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.8rem; }
figure { margin: 0; }
figcaption { margin-top: 8px; font-size: 0.88rem; color: var(--muted); }
.shot { display: block; width: 100%; border: 2px solid var(--edge); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); background: var(--panel); }
[hidden] { display: none !important; }
.px { image-rendering: pixelated; }

/* ---------------------------------------------------------------- landing */
.hero { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.3fr); gap: 32px; align-items: center; padding: 32px 0 0; }
.hero h1 { margin-bottom: 0.1em; }
.tag { font: 1.4rem var(--serif); color: var(--gold); margin: 0 0 1em; }
.cta { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.btn .ic { vertical-align: -3px; width: 28px; height: 28px; }
.hero-shot { padding: 0; }
.hero-shot img { display: block; width: 100%; height: auto; image-rendering: auto; }

.stage { position: relative; height: 130px; margin: 24px 0 0; border-bottom: 6px solid var(--ground); overflow: hidden; }
.stage img { image-rendering: pixelated; }
.stage .castle { position: absolute; bottom: 0; height: 112px; width: auto; }
.stage .c1 { left: 2%; }
.stage .c2 { right: 2%; }
.stage .goblin { position: absolute; bottom: 0; right: calc(2% + 170px); height: 66px; width: auto; transform: scaleX(-1); }
.stage .walker, .stage .reader, .stage .keeper { position: absolute; bottom: 0; width: 66px; height: 66px; }
.stage .walker img, .stage .reader img, .stage .keeper img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-walker { left: 12%; animation: stroll 14s linear infinite alternate; }
.hero-walker img { animation: show2 0.5s steps(1) infinite; }
.hero-walker img:nth-child(2) { animation-delay: -0.25s; }
.keeper { left: 34%; animation: stroll-short 9s linear infinite alternate; }
.keeper img { animation: show2 0.6s steps(1) infinite; }
.keeper img:nth-child(2) { animation-delay: -0.3s; }
.reader { width: 46px; height: 46px; }
.r1 { left: 58%; }
.r2 { left: 68%; }
.reader img { opacity: 0; animation: show3 1.2s steps(1) infinite; }
.reader img:nth-child(2) { animation-delay: 0.4s; }
.reader img:nth-child(3) { animation-delay: 0.8s; }
.reader.r2 img { animation-duration: 1.5s; }
.reader.r2 img:nth-child(2) { animation-delay: 0.5s; }
.reader.r2 img:nth-child(3) { animation-delay: 1s; }
@keyframes show2 { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 0; } }
@keyframes show3 { 0% { opacity: 1; } 33.3% { opacity: 0; } 100% { opacity: 0; } }
@keyframes stroll { from { transform: translateX(0); } to { transform: translateX(min(480px, 36vw)); } }
@keyframes stroll-short { from { transform: translateX(0); } to { transform: translateX(min(160px, 16vw)); } }

.live { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 20px 0 0; background: var(--edge); border: 1px solid var(--edge); border-radius: var(--radius); overflow: hidden; }
.live div { padding: 12px 8px; text-align: center; background: var(--panel); color: #f0e6d2; }
.live b { display: block; font: 700 1.8rem/1.1 var(--serif); color: #e3b341; }
.live span { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: #b3a58b; }

.loop { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 0; margin: 0; }
.loop li.panel { display: flex; align-items: center; gap: 12px; padding: 6px 10px; font: 700 1.15rem var(--serif); color: #f0e6d2; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; text-align: center; text-decoration: none; color: #f0e6d2; }
.tile:hover { filter: brightness(1.15); }
.tile b { font: 700 1rem var(--serif); }
.tile .ic.big { width: 48px; height: 48px; }
.tile em { color: #b3a58b; background: transparent; border-color: #5b4a35; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery a { display: block; position: relative; color: var(--text); text-decoration: none; }
.gallery .shot { transition: transform 0.15s; }
.gallery a:hover .shot { transform: translateY(-2px); border-color: var(--gold); }
.gallery span { position: absolute; left: 8px; bottom: 8px; padding: 1px 10px; border-radius: 999px; background: rgba(26, 21, 16, 0.85); color: #f0e6d2; font-size: 0.8rem; font-weight: 700; }

.cast { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.cast figure.panel { display: flex; flex-direction: column; align-items: center; padding: 4px; }
.cast .portrait { width: 84px; height: 84px; image-rendering: pixelated; }
.cast figcaption { margin: 2px 0 0; font: 700 0.95rem var(--serif); color: #f0e6d2; }

.board { width: 100%; max-width: 560px; border-collapse: collapse; background: var(--panel); border: 1px solid var(--edge); color: #f0e6d2; }
.board th, .board td, table.data th, table.data td { padding: 8px 14px; text-align: left; border-bottom: 1px solid var(--edge); }
.board th, table.data th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

.install { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 10px; max-width: 640px; }
.install li.panel { display: flex; align-items: center; gap: 14px; padding: 4px 10px; color: #f0e6d2; }
.install li b { font: 700 1.5rem var(--serif); color: #e3b341; width: 1.2em; text-align: center; }
.install li span { flex: 1; }
.install .btn { margin: 0; }
.install code { background: rgba(0, 0, 0, 0.3); border-color: #5b4a35; color: #f0e6d2; }
.install a:not(.btn) { color: #8ab4ff; }

details { margin: 0 0 8px; max-width: 640px; background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius); color: #f0e6d2; }
summary { cursor: pointer; padding: 10px 16px; font-weight: 600; }
details p { margin: 0; padding: 0 16px 12px; color: #b3a58b; }
details a { color: #8ab4ff; }

/* ---------------------------------------------------------------- wiki pages: guide, mechanics, gear */
.crumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
main h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); display: flex; align-items: center; gap: 12px; }
main h1 .ic.big { width: 36px; height: 36px; }
main h2[id] { margin-top: 1.6em; padding-bottom: 0.2em; border-bottom: 1px solid var(--edge); font-size: 1.35rem; }
ul.plain, ol.plain { padding-left: 1.2em; margin: 0.4em 0 0.8em; }
ul.plain li, ol.plain li { margin-bottom: 0.3em; }
ul.plain li::marker { color: var(--gold); }
.more { font-size: 0.9rem; margin: 0 0 1em; color: var(--muted); }
.callout { margin: 1.2em 0; padding: 12px 16px; border-left: 4px solid var(--gold); background: var(--bg-2); border-radius: 0 var(--radius) var(--radius) 0; }
.callout b:first-child { color: var(--gold); }
.tablewrap { overflow-x: auto; margin: 1em 0; border: 1px solid var(--edge); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; background: var(--bg-2); font-size: 0.95rem; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.hl td { background: color-mix(in srgb, var(--gold) 10%, transparent); }
.res { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.res img { width: 20px; height: 20px; image-rendering: pixelated; }

.roadmap { display: grid; gap: 12px; margin: 1em 0; }
.roadmap .step { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; padding: 10px 14px; }
.roadmap .when { font: 700 1.05rem var(--serif); color: #e3b341; }
.roadmap p { margin: 0; color: #f0e6d2; }

/* ---------------------------------------------------------------- gear database */
.filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 1em 0 1.4em; }
.filters input[type='search'] { flex: 1 1 220px; max-width: 340px; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--edge); background: var(--bg-2); color: var(--text); font: inherit; }
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--edge); background: var(--bg-2); color: var(--muted); font: inherit; font-size: 0.88rem; cursor: pointer; }
.chip[aria-pressed='true'] { background: var(--gold); border-color: var(--gold); color: #1a1510; font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card { padding: 12px 14px; border: 2px solid var(--edge); border-left-width: 6px; border-radius: var(--radius); background: var(--panel); color: #f0e6d2; }
.card header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.card header img { width: 36px; height: 36px; image-rendering: pixelated; }
.card h3 { margin: 0; font-size: 1.1rem; color: #f0e6d2; }
.card .meta { font-size: 0.8rem; color: #b3a58b; text-transform: uppercase; letter-spacing: 0.05em; }
.card p { margin: 0 0 6px; font-size: 0.95rem; color: #d9cdb4; }
.card .range { font-size: 0.85rem; color: #b3a58b; }
.card.weapon { border-color: #c8402f; }
.card.armor { border-color: #3b64c9; }
.rar-common { color: var(--common); font-weight: 700; }
.rar-rare { color: var(--rare); font-weight: 700; }
.rar-unique { color: var(--unique); font-weight: 700; }
.tier { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 1em 0; }
.tier .card.common { border-color: #d8d2c4; }
.tier .card.rare { border-color: #6aa7ff; }
.tier .card.unique { border-color: #f0b84a; box-shadow: 0 0 8px rgba(240, 184, 74, 0.35); }
.tier h3 { text-transform: capitalize; }
.tier .card.common h3 { color: #d8d2c4; }
.tier .card.rare h3 { color: #6aa7ff; }
.tier .card.unique h3 { color: #f0b84a; }
.keeper-card { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; }
.keeper-card > img { width: 96px; height: 96px; image-rendering: pixelated; }
.empty { color: var(--muted); font-style: italic; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 900px) {
  .burger { display: block; }
  .ver { display: none; }
  .shell { grid-template-columns: 1fr; gap: 0; }
  .menu { display: none; position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--edge); padding-top: 8px; }
  body.menu-open .menu { display: block; }
  .hero { grid-template-columns: 1fr; }
  .loop, .tiles { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .foot .cols { grid-template-columns: repeat(2, 1fr); }
  .tier { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .live { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: 1fr; }
  .stage .c2, .stage .goblin, .keeper { display: none; }
  .roadmap .step { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-walker, .keeper, .hero-walker img, .keeper img, .reader img { animation: none; }
  .hero-walker img:first-child, .keeper img:first-child, .reader img:first-child { opacity: 1; }
}
