/* Wiki pages - builds on styles.css tokens. Loaded after it. */

.wiki-top {
  position: relative;
  overflow: hidden;
  background:
    url("assets/textures/bg-far.webp") center top / auto 420px repeat,
    var(--sky);
  isolation: isolate;
}

.wiki-top::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 5, 3, 0.64), transparent 48%, rgba(8, 5, 3, 0.28)),
    linear-gradient(180deg, rgba(8, 10, 18, 0.12), rgba(26, 16, 9, 0.7) 86%, #3a2414);
  content: "";
  pointer-events: none;
}

.wiki-top .nav,
.wiki-hero {
  position: relative;
  z-index: 1;
}

.wiki-hero {
  padding-block: clamp(44px, 6vw, 84px) clamp(64px, 8vw, 104px);
  text-align: center;
}

.wiki-hero .eyebrow a {
  color: inherit;
  text-decoration: none;
}

.wiki-hero .eyebrow a:hover {
  color: var(--bone);
}

.wiki-hero h1 {
  margin: 18px auto 16px;
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  letter-spacing: -0.02em;
}

.wiki-lead {
  max-width: 640px;
  margin: 0 auto;
  color: #d7cbb8;
  font-size: clamp(1rem, 1.5vw, 1.16rem);
}

.wiki-ground {
  position: relative;
  z-index: 1;
  height: 34px;
  background:
    linear-gradient(180deg, rgba(96, 60, 32, 0.94) 0 3px, transparent 3px),
    url("assets/textures/dirt.webp") center top / 360px auto;
  box-shadow: inset 0 3px 0 rgba(22, 15, 3, 0.72);
}

.wiki-ground::before {
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 20px;
  background: url("assets/textures/grass-surface.png") left bottom / 128px 20px repeat-x;
  content: "";
  image-rendering: pixelated;
  pointer-events: none;
}

.wiki-main {
  position: relative;
  padding-block: clamp(56px, 7vw, 96px);
  background: var(--bedrock);
}

.wiki-section {
  margin-top: clamp(56px, 6vw, 80px);
}

.wiki-section:first-child {
  margin-top: 0;
}

.wiki-section h2 {
  margin: 10px 0 24px;
  color: var(--bone);
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  letter-spacing: -0.02em;
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
}

.wiki-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.wiki-card {
  padding: 16px 16px 18px;
  border: 2px solid var(--ink);
  border-top: 3px solid rgba(217, 160, 90, 0.55);
  background: rgba(60, 34, 18, 0.86);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.45);
}

.wiki-card figure {
  display: grid;
  height: 96px;
  margin: 0 0 14px;
  border: 2px solid rgba(217, 160, 90, 0.28);
  background: #000;
  place-items: center;
}

.wiki-card-tall figure {
  height: 168px;
}

.wiki-card img {
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.wiki-card h3 {
  margin: 0 0 8px;
  color: var(--crust);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.wiki-card p {
  margin: 0;
  color: var(--ash);
  font-size: 0.92rem;
}

/* /wiki landing: the big link cards (three fit one row on wide screens) */
.wiki-index {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(18px, 3vw, 32px);
}

.wiki-index-card {
  display: flex;
  flex-direction: column;
  padding: 22px 22px 26px;
  border: 3px solid var(--ink);
  border-top: 4px solid var(--crust);
  background: rgba(60, 34, 18, 0.86);
  box-shadow: 8px 8px 0 var(--ink);
  text-align: center;
  text-decoration: none;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.wiki-index-card:hover {
  transform: translate(2px, 2px);
  box-shadow: 5px 5px 0 var(--ink);
  filter: brightness(1.08);
}

.wiki-index-card figure {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  justify-content: center;
  gap: 8px 12px;
  margin: 0 0 18px;
  padding: 14px;
  border: 2px solid rgba(217, 160, 90, 0.28);
  background: #000;
}

.wiki-index-card figure.wiki-icons-characters {
  gap: 2px;
  padding: 14px 4px;
}

.wiki-index-card img {
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.wiki-index-card h2 {
  margin: 0;
  color: var(--bone);
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
}

/* /wiki/maps: prose blocks, the palette table + swatches, map screenshots */
.wiki-copy {
  max-width: 720px;
  color: var(--ash);
}

.wiki-copy p {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.wiki-copy code {
  color: var(--bone);
}

.wiki-copy a {
  color: var(--crust);
}

.wiki-copy-after {
  margin-top: 16px;
}

.wiki-table-wrap {
  overflow-x: auto;
}

.wiki-table {
  width: 100%;
  border: 2px solid var(--ink);
  background: rgba(60, 34, 18, 0.86);
  border-collapse: collapse;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.45);
}

.wiki-table th,
.wiki-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(217, 160, 90, 0.22);
  color: var(--ash);
  font-size: 0.92rem;
  text-align: left;
  white-space: nowrap;
}

.wiki-table td:last-child {
  white-space: normal;
}

.wiki-table th {
  color: var(--crust);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.wiki-table code {
  color: var(--bone);
}

.sw {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border: 2px solid var(--ink);
  vertical-align: middle;
}

.sw-terrain { background: #855c33; }
.sw-air { background: #120f0f; }
.sw-rock { background: #8c8c94; }
.sw-water { background: #2599f2; }
.sw-lava { background: #eb731a; }
.sw-mud { background: #715f4e; }
.sw-spawn { background: #fff; }
.sw-spawn-red { background: #d91a1a; }
.sw-spawn-blue { background: #1a1a99; }
.sw-flag-red { background: #ff8ca6; }
.sw-flag-blue { background: #8ca6ff; }
.sw-crate { background: #fae626; }
.sw-health { background: #33bf40; }

.wiki-shot-frame {
  max-width: 720px;
  margin: 24px 0 0;
}

.wiki-shot {
  width: 100%;
  height: auto;
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.45);
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.wiki-shot-frame figcaption {
  margin-top: 10px;
  color: var(--ash);
  font-size: 0.85rem;
}

@media (max-width: 680px) {
  .wiki-index {
    grid-template-columns: 1fr;
  }

  .wiki-grid {
    grid-template-columns: 1fr;
  }
}
