/* Wiki pages. Builds on styles.css tokens; dense, readable reference tables. */
.inner main { padding: clamp(1.5rem, 1rem + 2vw, 2.5rem) var(--gutter) clamp(4rem, 3rem + 4vw, 6rem); }
.wrap { max-width: var(--max); margin-inline: auto; }

.wnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.wnav a, .wnav-soon {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.5rem; padding: 0.35rem 0.85rem;
  border: 1px solid var(--line); border-radius: 4px; font-size: var(--step--1); font-weight: 500; text-decoration: none;
}
.wnav a { color: var(--ink); }
.wnav a:hover { border-color: var(--brass-deep); color: var(--brass); }
.wnav a[aria-current="page"] { background: var(--brass); color: var(--on-brass); border-color: var(--brass); }
.wnav-soon { color: var(--ink-muted); border-style: dashed; }
.wnav-soon .soon-tag { font-size: 0.625rem; }

.wiki-head { margin-top: clamp(2rem, 4vw, 3.5rem); }
.wiki-head h1 { font-family: var(--font-display); font-weight: 700; font-size: var(--step-3); line-height: 1; }
.wiki-head .section-lede { max-width: 44rem; }

.wcards { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.wcard > a, .wcard-soon { display: block; height: 100%; padding: 1.25rem 1.35rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-decoration: none; }
.wcard h2 { font-size: var(--step-1); font-weight: 700; line-height: 1.25; }
.wcard p { margin-top: 0.4rem; color: var(--ink-muted); font-size: 1.0625rem; }
.wcard > a h2 { color: var(--brass); }
.wcard > a h2::after { content: " →"; }
.wcard > a:hover { border-color: var(--brass-deep); background: var(--surface-2); }
.wcard-soon { border-style: dashed; background: transparent; }
.wcard-soon h2 { color: var(--ink-muted); }

.wiki-notes { margin-top: 1.75rem; display: grid; gap: 0.75rem; max-width: 52rem; }
.wiki-notes p { padding: 0.85rem 1rem; background: var(--surface); border-left: 3px solid var(--brass); border-radius: 0 4px 4px 0; font-size: 1.0625rem; color: var(--ink-muted); }
.wiki-notes strong { color: var(--ink); }
.wiki-source { margin-top: 2.5rem; max-width: 52rem; font-size: var(--step--1); color: var(--ink-muted); }

/* Filters */
.filters {
  position: sticky; top: calc(var(--logo-solid-h) + 1.5rem); z-index: 5; /* below the solid header (logo + padding) */ margin-top: 2rem; padding: 0.9rem 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0.75rem; align-items: end;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.f-field { display: grid; gap: 0.3rem; min-width: 0; }
.f-field label { font-size: 0.875rem; font-weight: 700; color: var(--ink-muted); }
.filters input, .filters select {
  width: 100%; min-height: 2.75rem; padding: 0.5rem 0.7rem; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--bg-deep); border: 1px solid oklch(0.45 0.02 100); border-radius: 4px;
}
.filters select { appearance: none; padding-right: 1.9rem; background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%), linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%); background-position: right 1rem center, right 0.65rem center; background-size: 0.35rem 0.35rem; background-repeat: no-repeat; }
.filters input:focus-visible, .filters select:focus-visible { outline-offset: 1px; border-color: var(--brass); }
.f-search { grid-column: span 2; }
.f-count { grid-column: 1 / -1; font-size: var(--step--1); color: var(--ink-muted); white-space: nowrap; margin-top: -0.25rem; }
html:not(.js) .filters { display: none; }
/* Sticky only where the bar is one or two rows; on narrower screens it scrolls away. */
@media (max-width: 60rem) {
  .filters { position: static; grid-template-columns: 1fr 1fr; }
  .f-search { grid-column: 1 / -1; }
}

/* ---------- Phase 2 pages ---------- */
.cat-label { display: block; font-size: 0.8125rem; color: var(--ink-muted); }
.stat-kind { display: block; font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.tag-newbie { color: var(--brass); border-color: var(--brass-deep); }
.desc { margin-top: 0.3rem; font-size: 0.9375rem; color: var(--ink-muted); max-width: 34rem; }
.effect { display: block; margin-top: 0.2rem; font-size: 0.875rem; color: var(--c-cyan); }
.who { font-size: 0.9375rem; min-width: 9rem; }
.wtable-equip .where, .wtable-spells .where { min-width: 14rem; font-size: 0.9375rem; }
.wtable-zones .where { min-width: 0; }
.wiki-h2 { font-size: var(--step-2); font-weight: 700; line-height: 1.25; margin-top: 2.75rem; }
.facts { margin: 0.9rem 0 0; padding-left: 1.2rem; display: grid; gap: 0.35rem; color: var(--ink-muted); }
.facts strong { color: var(--ink); }

/* Guía */
.guide { margin-top: 1rem; max-width: 46rem; }
.guide section p { margin-top: 0.75rem; color: var(--ink-muted); }
.guide section p strong { color: var(--ink); }
.g-n { display: inline-block; min-width: 1.6em; font-family: var(--font-display); color: var(--brass); }
.g-warn { margin-top: 2.75rem; padding: 0.25rem 1.25rem 1.25rem; border: 1px solid var(--line); border-left: 4px solid var(--brass); border-radius: 6px; background: var(--surface); }
.g-warn .wiki-h2 { margin-top: 1rem; }

/* Mapa: our own SVG schematic (no game graphics). */
.map-wrap { margin-top: 1.25rem; max-width: 46rem; }
.worldmap { display: block; width: 100%; height: auto; background: oklch(0.12 0.02 240); border: 1px solid var(--line); border-radius: 6px; }
.worldmap .cell { stroke: oklch(0.1 0.01 100); stroke-width: 1; }
.worldmap .sea, .sw.sea { fill: oklch(0.24 0.05 240); background: oklch(0.24 0.05 240); }
.worldmap .none, .sw.none { fill: oklch(0.34 0.02 120); background: oklch(0.34 0.02 120); }
.worldmap .b1, .sw.b1 { fill: oklch(0.55 0.11 145); background: oklch(0.55 0.11 145); }
.worldmap .b2, .sw.b2 { fill: oklch(0.62 0.12 100); background: oklch(0.62 0.12 100); }
.worldmap .b3, .sw.b3 { fill: oklch(0.58 0.14 55); background: oklch(0.58 0.14 55); }
.worldmap .b4, .sw.b4 { fill: oklch(0.5 0.16 28); background: oklch(0.5 0.16 28); }
.worldmap .city, .sw.city { fill: oklch(0.45 0.06 90); background: oklch(0.45 0.06 90); }
.worldmap .city.start, .sw.city.start { fill: var(--brass); background: var(--brass); }
.worldmap g:hover .cell { stroke: var(--ink); stroke-width: 2; }
.worldmap .door, .sw-door { fill: oklch(0.95 0.02 100); stroke: #000; stroke-width: 1.5; }
.worldmap .cave, .sw-cave { fill: #000; stroke: oklch(0.9 0.02 100); stroke-width: 1.5; }
.city-label { font: 700 15px var(--font-body); fill: var(--ink); paint-order: stroke; stroke: #000; stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.city-label.start { fill: oklch(0.97 0.05 98); font-size: 17px; }
.legend { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.9375rem; color: var(--ink-muted); }
.legend li { display: inline-flex; align-items: center; gap: 0.45rem; }
.sw { width: 1rem; height: 1rem; border-radius: 2px; display: inline-block; }
.sw-door { display: inline-block; width: 0.7rem; height: 0.7rem; background: oklch(0.95 0.02 100); outline: 1.5px solid #000; }
.sw-cave { display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 50%; background: #000; outline: 1.5px solid oklch(0.9 0.02 100); }

/* Table */
.table-wrap { margin-top: 0.5rem; }
.wtable { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.4; }
.wtable thead th {
  background: var(--bg-deep);
  text-align: left; font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted);
  padding: 0.6rem 0.6rem; border-bottom: 1px solid var(--line);
}
.wtable td, .wtable tbody th { padding: 0.75rem 0.6rem; border-bottom: 1px solid oklch(0.26 0.014 100); vertical-align: top; text-align: left; font-weight: 400; }
.wtable tbody tr:hover { background: oklch(0.17 0.01 100); }
.wtable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cname { display: block; font-weight: 700; font-size: 1.0625rem; color: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.tag { font-size: 0.75rem; padding: 0.1rem 0.4rem; border: 1px solid var(--line); border-radius: 3px; color: var(--ink-muted); white-space: nowrap; }
.tag-poison { color: var(--c-green); border-color: oklch(0.5 0.12 142); }
.spells { margin-top: 0.3rem; font-size: 0.875rem; color: var(--c-cyan); }
.places, .loot { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.where { min-width: 18rem; }
.wtable tbody th { width: 16rem; }
.mapno { font-size: 0.8125rem; color: var(--ink-muted); white-space: nowrap; }
.qty { font-size: 0.8125rem; color: var(--brass); font-variant-numeric: tabular-nums; }
.more { border: 0; }
.more summary { font-size: 0.875rem; font-weight: 500; color: var(--brass); padding: 0.25rem 0 0; cursor: pointer; list-style: revert; }
.more summary::after { content: none; }
.more[open] summary { margin-bottom: 0.2rem; }
.loot-cell { min-width: 11rem; font-size: 0.9375rem; }
.loot .muted { font-size: 0.8125rem; }
.empty { padding: 2rem 0; color: var(--ink-muted); }
.wtable tr[hidden] { display: none !important; }

/* Phones: each row becomes a card with labelled values. */
@media (max-width: 52rem) {
  .wtable thead { display: none; }
  .wtable, .wtable tbody, .wtable tr, .wtable td, .wtable tbody th { display: block; }
  .wtable tr { padding: 1rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem 0.75rem; }
  .wtable tr:hover { background: none; }
  .wtable tbody th { grid-column: 1 / -1; padding: 0; border: 0; width: auto; }
  .wtable td { padding: 0; border: 0; text-align: left !important; }
  .wtable td::before { content: attr(data-label); display: block; font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
  .wtable td.where, .wtable td.loot-cell, .wtable td.who { grid-column: 1 / -1; min-width: 0; }
}

/* Sprite icons: unmodified game frames on the black they were drawn on, in a fixed box. */
.crow { display: flex; align-items: flex-start; gap: 0.75rem; }
.sprite { flex: none; width: 56px; height: 56px; display: grid; place-items: center; background: #000; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.sprite-win { position: relative; overflow: hidden; display: block; }
.sprite-win img { position: absolute; max-width: none; }
.sprite.native img { image-rendering: pixelated; }
