/* Player wiki (intent player-wiki, R21, R25). Built on the site.css tokens; on a 360 px
   screen nothing scrolls sideways except wide tables, which scroll inside their own box,
   and every link or button a finger hits is at least 44 px tall. */

.wiki {
  padding: 18px 0 72px;
}

.wiki-shell {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.wiki-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Bar: breadcrumbs and the compact search */
.wiki-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
}

.wiki-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.wiki-crumbs li {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.wiki-crumbs li + li::before {
  content: "/";
  padding: 0 8px;
  opacity: 0.6;
}

.wiki-crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--gold);
}

.wiki-crumbs a:hover {
  color: var(--gold-bright);
}

.wiki-crumbs [aria-current] {
  overflow-wrap: anywhere;
  color: var(--text);
}

/* Search */
.wiki-search {
  position: relative;
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 640px;
}

.wiki-search-compact {
  max-width: 380px;
}

.wiki-search-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(212, 165, 116, 0.32);
  border-radius: 999px;
  color: var(--text-strong);
  font: inherit;
  background: rgba(8, 12, 18, 0.82);
}

.wiki-search-input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.wiki-search-button {
  flex: 0 0 auto;
}

.wiki-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 15;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-dark);
  box-shadow: var(--shadow-md);
}

.wiki-suggest a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 10px;
  color: var(--text-strong);
}

.wiki-suggest a span {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.wiki-suggest a:hover,
.wiki-suggest [aria-selected="true"] a {
  background: rgba(212, 165, 116, 0.12);
}

/* Headings */
.wiki-hero {
  display: grid;
  gap: 16px;
  padding: 18px 0 6px;
}

.wiki h1 {
  max-width: none;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.wiki h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
}

.wiki h3 {
  font-size: 1.05rem;
}

.wiki-head {
  display: grid;
  gap: 10px;
}

.wiki-head .section-kicker {
  margin: 0;
}

.wiki-entry-head {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 16px;
}

.wiki-entry-head > div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

/* Item picture next to its name and description: the HD art of the client (320 px), large
   enough to see the item. */
.wiki-icon {
  width: 160px;
  height: 160px;
  object-fit: contain;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: radial-gradient(circle at 50% 45%, rgba(212, 165, 116, 0.12), rgba(10, 14, 21, 0.86) 70%);
}

@media (max-width: 640px) {
  .wiki-icon {
    width: 104px;
    height: 104px;
    padding: 6px;
  }
}

.wiki-lead {
  max-width: 46rem;
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
}

.wiki-muted,
.wiki-version {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.wiki-empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.wiki-block {
  display: grid;
  gap: 14px;
}

/* Cards: sections, questions, classes, pages */
.wiki-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wiki-card a {
  display: grid;
  gap: 6px;
  height: 100%;
  min-height: 44px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(16, 22, 31, 0.94), rgba(10, 14, 21, 0.92));
  transition: border-color 160ms ease, background-color 160ms ease;
}

.wiki-card a:hover,
.wiki-card a:focus-visible {
  border-color: rgba(212, 165, 116, 0.5);
}

.wiki-card strong {
  color: var(--gold-bright);
  font-size: 1.06rem;
}

.wiki-card span {
  color: var(--text-muted);
  font-size: 0.94rem;
}

.wiki-card .wiki-count,
.wiki-count {
  display: inline-block;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.06);
}

.wiki-cards-questions strong {
  font-size: 1.12rem;
}

/* Article + related */
.wiki-layout {
  display: grid;
  gap: 26px;
  min-width: 0;
}

@media (min-width: 1000px) {
  .wiki-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
  }
}

.wiki-article {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.wiki-prose {
  max-width: 48rem;
  min-width: 0;
  overflow-wrap: break-word;
}

.wiki-prose h2 {
  margin: 0 0 10px;
}

.wiki-prose p {
  margin: 0 0 12px;
}

.wiki-prose a {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: rgba(212, 165, 116, 0.4);
  text-underline-offset: 3px;
}

.wiki-prose a:hover {
  color: var(--gold-bright);
}

.wiki-prose ul,
.wiki-prose ol {
  padding-left: 1.3em;
}

.wiki-prose li {
  margin: 4px 0;
}

/* Tables written in page text: on a narrow screen they scroll inside their own box (R25). */
.wiki-prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-collapse: collapse;
  background: rgba(10, 14, 21, 0.86);
  font-size: 0.94rem;
}

.wiki-prose th,
.wiki-prose td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
  vertical-align: top;
}

.wiki-prose th {
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg-dark);
}

.wiki-prose td {
  min-width: 7em;
}

/* Icon of a reference entry inside page text, e.g. an ore in a table row (R46). */
.wiki-prose .wiki-inline-icon {
  display: inline-block;
  width: 32px;
  height: 32px;
  margin: -6px 6px -6px 0;
  object-fit: contain;
  vertical-align: middle;
}

/* The name stays on the icon's line; a wide table scrolls inside its box (R25). */
.wiki-prose td:has(> .wiki-inline-icon) {
  white-space: nowrap;
}

.wiki-hint {
  color: var(--text-muted);
}

.wiki-prose .wiki-skill-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wiki-skill-list li {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.wiki-skill-list p {
  margin: 6px 0 0;
}

.wiki-skill-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Facts of an entry */
.wiki-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 10px;
  margin: 0;
}

.wiki-facts > div {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(16, 22, 31, 0.72);
  min-width: 0;
}

.wiki-facts dt {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.wiki-facts dd {
  margin: 2px 0 0;
  color: var(--text-strong);
  overflow-wrap: anywhere;
}

.wiki-facts a {
  color: var(--gold);
}

/* Entry card (R3): tags under the name, the main numbers large, «where to get it» as chips. */
.wiki-tags,
.wiki-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wiki-tags li {
  padding: 3px 10px;
  border: 1px solid rgba(212, 165, 116, 0.35);
  border-radius: 999px;
  color: var(--gold-bright);
  font-size: 0.86rem;
  background: rgba(212, 165, 116, 0.08);
}

.wiki-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 0;
}

.wiki-stats > div {
  display: grid;
  min-width: 92px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(10, 14, 21, 0.86);
}

.wiki-stats dd {
  margin: 0;
  color: var(--text-strong);
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.6rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.wiki-stats dt {
  order: 2;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.wiki-sources {
  display: grid;
  gap: 12px;
  margin: 8px 0 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-panel);
}

.wiki-sources h2 {
  font-size: 1.3rem;
}

.wiki-source h3 {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.wiki-chips a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--gold);
  background: rgba(16, 22, 31, 0.72);
}

.wiki-chips a:hover {
  border-color: var(--gold);
}

.wiki-related {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-panel);
}

.wiki-related h2 {
  font-size: 1.3rem;
}

.wiki-related h3 {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wiki-related ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wiki-related a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--gold);
}

.wiki-related a:hover {
  color: var(--gold-bright);
}

/* Media */
.wiki-art,
.wiki-video {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.wiki-art img,
.wiki-video video {
  width: 100%;
  height: auto;
}

/* A class portrait stands beside the heading; on a narrow screen it wraps under the text. */
.wiki-entry-head--portrait {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

.wiki-entry-head--portrait > div {
  flex: 1 1 18rem;
}

.wiki-portrait {
  flex: 0 0 auto;
  width: min(240px, 62vw);
  margin: 0 auto;
  border: 0;
  background: #070a0f;
}

/* A section cover is a wide band: the 3:2 art cropped to its middle 2:1. On a wide screen it
   stands to the right of the heading, on a phone under it. */
.wiki-hero {
  display: grid;
  gap: 18px;
}

@media (min-width: 900px) {
  .wiki-hero--cover {
    grid-template-columns: minmax(0, 1fr) minmax(0, 46%);
    align-items: center;
  }
}

.wiki-cover img {
  display: block;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}

/* Tables (R24, R25) */
.wiki-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.wiki-filter-field {
  display: grid;
  gap: 4px;
  flex: 1 1 200px;
  min-width: 0;
}

.wiki-filter label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.wiki-filter input,
.wiki-filter select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-strong);
  font: inherit;
  background: rgba(8, 12, 18, 0.82);
}

.wiki-filter-actions {
  display: flex;
  gap: 8px;
}

.js-wiki-table .wiki-filter-actions .button-primary {
  display: none;
}

.wiki-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(10, 14, 21, 0.86);
}

.wiki-table-scroll:focus-visible {
  outline: 2px solid var(--gold);
}

.wiki-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.wiki-table th,
.wiki-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
  vertical-align: top;
}

.wiki-table th {
  position: sticky;
  top: 0;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  background: var(--bg-dark);
}

.wiki-table th a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
}

.wiki-table th[aria-sort] a {
  color: var(--gold-bright);
}

.wiki-table th[aria-sort="ascending"] a::after {
  content: " \2191";
}

.wiki-table th[aria-sort="descending"] a::after {
  content: " \2193";
}

.wiki-table td a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--gold);
}

.wiki-table td:first-child {
  min-width: 10rem;
}

.wiki-table .wiki-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.wiki-table-scroll--fit {
  width: fit-content;
}

/* A table of numbers only (class levels) is as wide as its numbers, not the whole column:
   the eye does not travel across the page to read a row. */
.wiki-prose .wiki-table--numbers {
  display: table;
  width: auto;
  margin: 0;
  border: 0;
}

.wiki-table--numbers th,
.wiki-table--numbers td {
  padding: 8px;
}

/* Its headers wrap instead of pushing the table wider than its column (.wiki-num keeps the numbers on one line). */
.wiki-table--numbers th.wiki-num {
  white-space: normal;
  line-height: 1.25;
  vertical-align: bottom;
  hyphens: auto;
}

.wiki-table--numbers td:first-child {
  min-width: 0;
}

/* On a phone six columns do not fit: every row becomes a card of «name: value» lines,
   so nothing scrolls sideways. */
@media (max-width: 640px) {
  .wiki-table-scroll--fit {
    width: auto;
    border: 0;
    background: none;
  }

  .wiki-prose .wiki-table--numbers,
  .wiki-table--numbers tbody,
  .wiki-table--numbers tr,
  .wiki-table--numbers td {
    display: block;
    width: 100%;
  }

  .wiki-table--numbers thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .wiki-table--numbers tr {
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(10, 14, 21, 0.86);
  }

  .wiki-table--numbers td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 12px;
  }

  .wiki-table--numbers td::before {
    content: attr(data-label);
    color: var(--text-muted);
    text-align: left;
    white-space: normal;
  }

  .wiki-table--numbers td:first-child {
    color: var(--gold-bright);
    font-weight: 600;
  }
}

.wiki-table tbody tr:hover {
  background: rgba(212, 165, 116, 0.05);
}

/* Search results */
.wiki-hits {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wiki-hits a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(16, 22, 31, 0.72);
}

.wiki-hits strong {
  color: var(--gold-bright);
}

.wiki-hits span {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 600px) {
  .wiki {
    padding-top: 8px;
  }

  .wiki-search-compact {
    max-width: none;
  }

  .wiki-filter-actions {
    width: 100%;
  }

  .wiki-filter-actions .button {
    flex: 1 1 0;
  }
}

/* Reading comfort: the site backdrop (castle reel or its still) sits right behind long
   article text, and its detail and motion tire the eyes. On wiki pages it is blurred
   and dimmed so it stays a mood, not a picture. Other pages keep it as it is. */
body:has(main.wiki) .background-video,
html.bg-anim-off body:has(main.wiki) .background-video-shell {
  filter: saturate(0.8) brightness(0.26) blur(8px);
  transform: scale(1.08);
}
