/* Wiki minimal skin — layers over /Interlude_files/lk-header.css.
   Goal: clean, readable catalog in the Interlude PW dark theme. */

/* ---- Scrollbar (matches main site) ---- */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #251a35; }
::-webkit-scrollbar-thumb {
  background-color: #542774;
  border: 3px solid #251a35;
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background-color: #6b2fa0; }
html { scrollbar-color: #542774 #251a35; }

/* ---- Preloader (mirrors main site .preloader behaviour) ---- */
@keyframes wiki-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

.preloader {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  background-color: #181224;
  opacity: 1;
  z-index: 9999;
  user-select: none;
  transition: opacity 0.5s cubic-bezier(.4,0,.2,1);
}
.preloader.--hide { opacity: 0; pointer-events: none; }
.preloader__Wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.preloader .loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.preloader .loading-logo {
  position: relative;
  transition: transform 0.7s cubic-bezier(.4,0,.2,1);
}
.preloader.--hide .loading-logo { transform: scale(1.25); }
.preloader .loading-logo > div {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preloader .loading-logo .logo {
  position: relative;
  z-index: 10;
  max-width: 180px;
  height: auto;
}
.preloader .loading-logo .lightning {
  position: absolute;
  z-index: 0;
  transform: scale(1.1);
  animation: wiki-pulse 2s cubic-bezier(.4,0,.6,1) infinite;
  max-width: 220px;
  height: auto;
}
.preloader .loading-text {
  color: #c5b3e6;
  font-family: 'Beaufort for LoL', Cinzel, Georgia, serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.9;
  animation: wiki-pulse 2s cubic-bezier(.4,0,.6,1) infinite;
}

:root {
  --wiki-bg: #0a0712;
  --wiki-bg-2: #150b25;
  --wiki-panel: #1a1130;
  --wiki-border: #2a1d4a;
  --wiki-text: #e6dffa;
  --wiki-text-dim: #9189b0;
  --wiki-accent: #b78fff;
  --wiki-accent-hot: #ffd166;
  /* PW canon name colors based on ☆ count in the stored Name field.
     0 stars = regular white; ☆…☆☆☆☆☆ ladder = green → blue → purple → gold → red. */
  --wiki-q0: #ffffff;     /* 0 stars — regular  (white) */
  --wiki-q1: #6fdc6f;     /* ☆       — improved (green) */
  --wiki-q2: #6fa3ff;     /* ☆☆      — rare     (blue)  */
  --wiki-q3: #c46fff;     /* ☆☆☆     — epic     (purple)*/
  --wiki-q4: #ffb84d;     /* ☆☆☆☆    — legend   (gold)  */
  --wiki-q5: #ff5050;     /* ☆☆☆☆☆   — mythic   (red)   */

  /* Server-side colour palette (rae's defaults; sourced from
     ADDITIONAL_PARAMS.cs). Drives the .c0..c8 classes when an item has a
     color_id from element/configs/item_color.txt. */
  --wiki-c0: #ffffff;     /* white  (default) */
  --wiki-c1: #8c8cef;     /* light blue */
  --wiki-c2: #ffd700;     /* gold */
  --wiki-c3: #aa32ff;     /* purple */
  --wiki-c4: #ff6000;     /* orange (OrangeColorPW) */
  --wiki-c5: #ffffff;     /* white */
  --wiki-c6: #a9a9a9;     /* dark gray */
  --wiki-c7: #00fa9a;     /* medium spring green */
  --wiki-c8: #ff0000;     /* red */
}

body.wiki-page {
  margin: 0;
  background: var(--wiki-bg);
  background-image: linear-gradient(180deg, #0a0712 0%, #1a0d2e 60%, #0a0712 100%);
  color: var(--wiki-text);
  font-family: 'Beaufort for LoL', Cinzel, 'Trajan Pro', Georgia, serif;
  min-height: 100vh;
}

/* View Transitions intentionally not used — even scoped to .wiki-results
   they took a full-viewport snapshot which made the header flicker on
   every chip click. spa.js (v5+) does instant in-place DOM swaps instead.
   Trade-off accepted: rows appear hard-cut, but the rest of the page is
   visually rock-solid. */

/* Kill the JS-driven sliding indicator entirely on wiki pages — it
   re-initialises on every navigation (snapshot races with JS, opacity
   transitions, etc.) and there's no clean way to make it not blink.
   Replace with a CSS-only static underline that's painted as part of the
   initial style pass. No JS = no re-init = no blink, ever. */
.lk-tnav-indicator { display: none !important; }

.lk-tnav-link {
  position: relative;
}
/* Underline drawn under the link text. Opacity transitions on hover so the
   indicator still "follows" the cursor — just per-link instead of one shared
   sliding bar. Pseudo-element is paint-only so no layout cost. */
.lk-tnav-link::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 5px;
  height: 1px;
  background: #fff;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}
.lk-tnav-link--active::after { opacity: 1; }
.lk-tnav-link:hover::after   { opacity: 0.75; }

/* Header still gets a view-transition-name so it doesn't crossfade with the
   page content — it should look fully static during navigation. */
.lk-tnav { view-transition-name: wiki-vt-header; }
::view-transition-old(wiki-vt-header),
::view-transition-new(wiki-vt-header) {
  animation: none;
}

/* ---- Shell layout: sidebar + main ---- */
.wiki-shell {
  display: flex;
  gap: 28px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 140px 24px 80px;
  align-items: flex-start;
}
.wiki-sidebar {
  flex: 0 0 240px;
  position: sticky;
  top: 110px;
  background: var(--wiki-panel);
  border: 1px solid var(--wiki-border);
  border-radius: 8px;
  overflow: hidden;
}
.wiki-sidebar-h {
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.18), transparent);
  border-bottom: 1px solid var(--wiki-border);
}
.wiki-sidebar-logo {
  text-decoration: none;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wiki-sidebar-logo .brand { color: var(--wiki-text); }
.wiki-sidebar-logo .brand-accent { color: var(--wiki-accent-hot); }
.wiki-sidebar-nav { display: flex; flex-direction: column; }
.wiki-side-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 18px;
  color: var(--wiki-text);
  text-decoration: none;
  border-left: 3px solid transparent;
  border-bottom: 1px solid rgba(42, 29, 74, 0.4);
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: background .12s, border-color .12s, color .12s;
}
.wiki-side-item:hover {
  background: rgba(183, 143, 255, 0.08);
  color: var(--wiki-accent-hot);
}
.wiki-side-item.is-active {
  background: rgba(124, 58, 237, 0.16);
  border-left-color: var(--wiki-accent-hot);
  color: var(--wiki-accent-hot);
  font-weight: 600;
}
.wiki-side-item .side-count {
  color: var(--wiki-text-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.wiki-side-item.is-active .side-count { color: var(--wiki-accent-hot); }
.wiki-side-item.side-everything {
  color: var(--wiki-text-dim);
  font-style: italic;
  border-bottom: 0;
}

.wiki-main {
  flex: 1;
  min-width: 0;
}

/* Stack the sidebar above content on narrow screens */
@media (max-width: 900px) {
  .wiki-shell { flex-direction: column; padding-top: 110px; }
  .wiki-sidebar { position: static; width: 100%; flex: none; }
}

/* ---- Breadcrumbs ---- */
.wiki-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--wiki-text-dim);
  flex-wrap: wrap;
}
.wiki-crumbs a {
  color: var(--wiki-text-dim);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--wiki-border);
  border-radius: 4px;
  transition: color .15s, border-color .15s, background .15s;
}
.wiki-crumbs a:hover {
  color: var(--wiki-accent);
  border-color: var(--wiki-accent);
  background: rgba(183, 143, 255, 0.08);
}
.wiki-crumbs a.home::before { content: '← '; }
.wiki-crumbs .sep { opacity: .5; }
.wiki-crumbs .here { color: var(--wiki-text); padding: 4px 0; }

/* ---- Home (centered search) ---- */
.wiki-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 16px;
}
.wiki-home-title {
  font-size: clamp(36px, 6vw, 64px);
  margin: 0 0 12px;
  color: var(--wiki-text);
  letter-spacing: 0.02em;
}
.wiki-home-title span {
  color: var(--wiki-accent-hot);
  text-shadow: 0 0 18px rgba(255, 209, 102, 0.35);
}
.wiki-home-sub {
  color: var(--wiki-text-dim);
  margin: 0 0 32px;
  font-size: 16px;
  max-width: 560px;
}
.wiki-home-search { width: 100%; max-width: 560px; }
.wiki-home-search .wiki-search { width: 100%; }
.wiki-home-search .wiki-search input[type=text] { width: 100%; min-width: 0; }

.wiki-home-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 48px 0 0;
  padding: 0;
}
.wiki-home-stats > div {
  background: var(--wiki-panel);
  border: 1px solid var(--wiki-border);
  border-radius: 6px;
  padding: 12px 22px;
  min-width: 120px;
}
.wiki-home-stats dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--wiki-text-dim);
  margin-bottom: 4px;
}
.wiki-home-stats dd {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--wiki-accent-hot);
  font-variant-numeric: tabular-nums;
}

/* legacy .wiki-hero kept for back-compat */
.wiki-hero {
  text-align: center;
  padding: 48px 16px 32px;
}
.wiki-hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  margin: 0 0 8px;
  color: var(--wiki-accent-hot);
  text-shadow: 0 0 18px rgba(255, 209, 102, 0.35);
}
.wiki-sub { color: var(--wiki-text-dim); margin-bottom: 28px; }

.wiki-search-wrap { position: relative; display: inline-block; }
.wiki-search-wrap.inline { display: inline-block; }
[x-cloak] { display: none !important; }

.wiki-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--wiki-panel);
  border: 1px solid var(--wiki-border);
  border-radius: 6px;
  z-index: 50;
  max-height: 420px;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  text-align: left;
  min-width: 320px;
}
.wiki-suggest-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--wiki-text);
  border-bottom: 1px solid var(--wiki-border);
}
.wiki-suggest-row:last-child { border-bottom: 0; }
.wiki-suggest-row.is-active,
.wiki-suggest-row:hover {
  background: rgba(183, 143, 255, 0.14);
}
.wiki-suggest-row img {
  width: 28px; height: 28px;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.wiki-suggest-row .name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiki-suggest-row .type { color: var(--wiki-text-dim); font-size: 12px; flex-shrink: 0; }
.wiki-suggest-row.q0 .name { color: var(--wiki-q0); }
.wiki-suggest-row.q1 .name { color: var(--wiki-q1); }
.wiki-suggest-row.q2 .name { color: var(--wiki-q2); }
.wiki-suggest-row.q3 .name { color: var(--wiki-q3); }
.wiki-suggest-row.q4 .name { color: var(--wiki-q4); }
.wiki-suggest-row.q5 .name { color: var(--wiki-q5); }

.wiki-search {
  display: inline-flex;
  gap: 8px;
  background: var(--wiki-panel);
  padding: 6px;
  border: 1px solid var(--wiki-border);
  border-radius: 8px;
}
.wiki-search input[type=text] {
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--wiki-text);
  font: inherit;
  padding: 10px 14px;
  min-width: 320px;
}
.wiki-search button {
  background: var(--wiki-accent);
  border: 0;
  color: #14082c;
  font: inherit; font-weight: 700;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
}

/* ---- Category grid ---- */
.wiki-cats h2 {
  margin: 56px 0 16px;
  font-size: 22px;
  color: var(--wiki-text);
  border-bottom: 1px solid var(--wiki-border);
  padding-bottom: 8px;
}
.wiki-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.wiki-cat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--wiki-panel);
  border: 1px solid var(--wiki-border);
  border-radius: 6px;
  color: var(--wiki-text);
  text-decoration: none;
  transition: border-color .15s, transform .15s, background .15s;
}
.wiki-cat:hover {
  border-color: var(--wiki-accent);
  transform: translateY(-1px);
  background: rgba(183, 143, 255, 0.06);
}
.wiki-cat-icon {
  width: 36px; height: 36px;
  image-rendering: pixelated;
  flex-shrink: 0;
  background: var(--wiki-bg-2);
  border-radius: 4px;
  padding: 2px;
}
.wiki-cat-label {
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wiki-cat-count {
  color: var(--wiki-text-dim);
  font-size: 12px;
  flex-shrink: 0;
}

/* ---- No-icon mode: any essence whose items don't have real icons gets
       these affordances suppressed so the UI doesn't show '?' everywhere.
       Driven by body[data-no-icons="1"] (computed per-page in PHP) and
       per-chip via .wiki-cat-chip.no-icon. ---- */
body[data-no-icons="1"] .wiki-table th.ic,
body[data-no-icons="1"] .wiki-table td.ic,
body[data-no-icons="1"] .wiki-item-icon { display: none !important; }
body[data-no-icons="1"] .wiki-item-head { padding-left: 24px; }
.wiki-cat-chip.no-icon .cc-icon { display: none; }
.wiki-cat-chip.no-icon { padding-left: 12px; }

/* ---- Catalog toolbar (search + chips) ---- */
.wiki-toolbar { margin-bottom: 18px; }
.wiki-toolbar-search {
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  padding: 0;
  border: 0;
}
.wiki-toolbar-search .wiki-search-wrap { width: 360px; }
.wiki-toolbar-search input[name=q] {
  width: 100%;
  background: var(--wiki-panel);
  color: var(--wiki-text);
  border: 1px solid var(--wiki-border);
  font: inherit;
  padding: 9px 14px;
  border-radius: 6px;
}
.wiki-toolbar-search input[name=q]:focus {
  outline: none;
  border-color: var(--wiki-accent);
}
.wiki-counter {
  color: var(--wiki-text-dim);
  font-size: 13px;
  white-space: nowrap;
}

/* Subcategory chips row */
.wiki-cat-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.wiki-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: var(--wiki-panel);
  border: 1px solid var(--wiki-border);
  border-radius: 6px;
  color: var(--wiki-text);
  text-decoration: none;
  font-size: 13px;
  transition: border-color .12s, background .12s, color .12s;
}
.wiki-cat-chip:hover {
  border-color: var(--wiki-accent);
  background: rgba(183, 143, 255, 0.08);
}
.wiki-cat-chip.is-active {
  border-color: var(--wiki-accent-hot);
  background: rgba(255, 209, 102, 0.10);
  color: var(--wiki-accent-hot);
}
.wiki-cat-chip .cc-icon {
  width: 32px;
  height: 32px;
  background: var(--wiki-bg-2);
  border-radius: 3px;
  padding: 2px;
  flex-shrink: 0;
}
.wiki-cat-chip .cc-label { display: inline-flex; align-items: baseline; gap: 6px; }
.wiki-cat-chip .cc-count {
  color: var(--wiki-text-dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.wiki-cat-chip.is-active .cc-count { color: rgba(255, 209, 102, 0.7); }

/* ---- Sortable column headers ---- */
.wiki-table thead th .wiki-sort,
.wiki-table thead th a.wiki-sort {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}
.wiki-table thead th a.wiki-sort:hover { color: var(--wiki-accent); }
.wiki-table thead th a.wiki-sort.is-active { color: var(--wiki-accent-hot); }
.wiki-table thead th .arrow {
  font-size: 9px;
  opacity: 0.85;
}
.wiki-table thead th a.wiki-sort:not(.is-active) .arrow::before {
  content: '⇅';
  opacity: 0.3;
  font-size: 11px;
}

/* ---- Results table ---- */
.wiki-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--wiki-panel);
  border: 1px solid var(--wiki-border);
  border-radius: 6px;
  overflow: hidden;
}
.wiki-table th, .wiki-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--wiki-border);
  text-align: left;
}
.wiki-table thead th {
  background: var(--wiki-bg-2);
  color: var(--wiki-text-dim);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.wiki-table tbody tr:hover { background: rgba(183, 143, 255, 0.06); }
.wiki-table td.ic, .wiki-table th.ic { width: 40px; }
.wiki-table td.ic img { width: 28px; height: 28px; image-rendering: pixelated; }
/* Alignment helpers — apply to both th AND td so headers don't fall back to left. */
.wiki-table th.t-r, .wiki-table td.t-r { text-align: right; }
.wiki-table th.t-c, .wiki-table td.t-c { text-align: center; }
.wiki-table td.dim { color: var(--wiki-text-dim); font-size: 12px; }
.wiki-table td.num, .wiki-table th.num { font-variant-numeric: tabular-nums; }

.wiki-table a { color: inherit; text-decoration: none; border-bottom: 1px dotted transparent; }
.wiki-table a:hover { border-bottom-color: currentColor; }

/* Quality colours */
.wiki-row.q0 a { color: var(--wiki-q0); }
.wiki-row.q1 a { color: var(--wiki-q1); }
.wiki-row.q2 a { color: var(--wiki-q2); }
.wiki-row.q3 a { color: var(--wiki-q3); }
.wiki-row.q4 a { color: var(--wiki-q4); }
.wiki-row.q5 a { color: var(--wiki-q5); }

/* Server colour-id classes (from item_color.txt) — applied wherever a row
   / list item / chip carries .c0..c8. Override quality colours so the table
   shows the in-game colour exactly. */
.c0, .c0 a, tr.c0 td.name a { color: var(--wiki-c0); }
.c1, .c1 a, tr.c1 td.name a { color: var(--wiki-c1); }
.c2, .c2 a, tr.c2 td.name a { color: var(--wiki-c2); }
.c3, .c3 a, tr.c3 td.name a { color: var(--wiki-c3); }
.c4, .c4 a, tr.c4 td.name a { color: var(--wiki-c4); }
.c5, .c5 a, tr.c5 td.name a { color: var(--wiki-c5); }
.c6, .c6 a, tr.c6 td.name a { color: var(--wiki-c6); }
.c7, .c7 a, tr.c7 td.name a { color: var(--wiki-c7); }
.c8, .c8 a, tr.c8 td.name a { color: var(--wiki-c8); }

.wiki-empty { color: var(--wiki-text-dim); padding: 24px; text-align: center; }

/* ---- Pager ---- */
.wiki-pager {
  display: flex; align-items: center; gap: 4px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.wiki-pager a {
  padding: 6px 10px;
  background: var(--wiki-panel);
  border: 1px solid var(--wiki-border);
  border-radius: 4px;
  color: var(--wiki-text);
  text-decoration: none;
}
.wiki-pager a.active { background: var(--wiki-accent); color: #14082c; border-color: var(--wiki-accent); }
.wiki-pager-info { color: var(--wiki-text-dim); margin-left: 8px; }
.wiki-pager-gap  { color: var(--wiki-text-dim); padding: 0 4px; user-select: none; }

/* Jump-to-page input: typed number + Go button, sits on the right side of
   the pager so it doesn't interfere with the click-through page list. */
.wiki-pager-jump {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 12px;
  color: var(--wiki-text-dim);
  font-size: 0.92em;
}
.wiki-pager-jump label { display: inline-flex; align-items: center; gap: 6px; }
.wiki-pager-jump input[type="number"] {
  width: 64px;
  padding: 5px 8px;
  background: var(--wiki-bg);
  border: 1px solid var(--wiki-border);
  border-radius: 4px;
  color: var(--wiki-text);
  font: inherit;
  text-align: center;
  /* Hide spinner buttons — keeps the field tidy, keyboard arrows still work. */
  -moz-appearance: textfield;
}
.wiki-pager-jump input[type="number"]::-webkit-outer-spin-button,
.wiki-pager-jump input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.wiki-pager-jump button {
  padding: 6px 12px;
  background: var(--wiki-panel);
  border: 1px solid var(--wiki-border);
  border-radius: 4px;
  color: var(--wiki-text);
  cursor: pointer;
  font: inherit;
}
.wiki-pager-jump button:hover { background: var(--wiki-accent); color: #14082c; border-color: var(--wiki-accent); }
.wiki-pager-of { color: var(--wiki-text-dim); }

/* ---- Item card ---- */
.wiki-item-head { display: flex; gap: 20px; align-items: center; padding: 20px 24px; background: var(--wiki-panel); border: 1px solid var(--wiki-border); border-radius: 8px; }
/* Icons are native 32x32 — show at native size so they don't blur up. The
   subtle frame keeps the head visually balanced next to the large title. */
.wiki-item-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  padding: 4px;
  background: var(--wiki-bg-2);
  border: 1px solid var(--wiki-border);
  border-radius: 4px;
}
.wiki-item-name { margin: 0; font-size: 28px; }
.wiki-item-name.q0 { color: var(--wiki-q0); }
.wiki-item-name.q1 { color: var(--wiki-q1); }
.wiki-item-name.q2 { color: var(--wiki-q2); }
.wiki-item-name.q3 { color: var(--wiki-q3); }
.wiki-item-name.q4 { color: var(--wiki-q4); }
.wiki-item-name.q5 { color: var(--wiki-q5); }
.wiki-item-meta { color: var(--wiki-text-dim); margin-top: 6px; }
.wiki-item-meta span { margin-right: 14px; }

.wiki-item-summary { margin-top: 24px; }
.wiki-item-summary table { width: 100%; border-collapse: collapse; }
.wiki-item-summary th, .wiki-item-summary td { padding: 8px 12px; border-bottom: 1px solid var(--wiki-border); text-align: left; }
.wiki-item-summary th { color: var(--wiki-text-dim); font-weight: 600; width: 30%; }

.wiki-item-raw { margin-top: 32px; }
.wiki-item-raw summary { cursor: pointer; color: var(--wiki-text-dim); padding: 8px 0; }
.wiki-item-raw table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wiki-item-raw th, .wiki-item-raw td { padding: 4px 8px; border-bottom: 1px solid var(--wiki-border); text-align: left; }
.wiki-item-raw th { color: var(--wiki-text-dim); font-family: monospace; }
.wiki-item-raw td { font-family: monospace; word-break: break-all; }

.wiki-item-back { margin-top: 32px; }
.wiki-item-back a { color: var(--wiki-accent); text-decoration: none; }

/* ---- Recipe sections on item card ---- */
.wiki-section-h {
  font-size: 18px;
  color: var(--wiki-accent-hot);
  margin: 28px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--wiki-border);
}
.wiki-item-recipes ul { list-style: none; padding: 0; margin: 0; }

/* ---- Expanded recipe card on item page ---- */
.wiki-recipe-card {
  background: var(--wiki-panel);
  border: 1px solid var(--wiki-border);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.wiki-recipe-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.wiki-recipe-name {
  color: var(--wiki-accent-hot);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
}
.wiki-recipe-name:hover { color: var(--wiki-accent); }
.wiki-recipe-name .ico { color: var(--wiki-accent); margin-right: 4px; }
.wiki-recipe-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12px;
  color: var(--wiki-text-dim);
}
.wiki-recipe-stats span {
  padding: 2px 8px;
  background: var(--wiki-bg-2);
  border: 1px solid var(--wiki-border);
  border-radius: 3px;
}
.wiki-recipe-stats .wiki-fail {
  color: #ff8a8a;
  border-color: rgba(255, 138, 138, 0.3);
}

.wiki-mat-chips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wiki-mat-chips li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  background: var(--wiki-bg-2);
  border: 1px solid var(--wiki-border);
  border-radius: 4px;
  font-size: 13px;
}
.wiki-mat-chips li img {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
}
.wiki-mat-chips li a {
  color: var(--wiki-text);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
}
.wiki-mat-chips li a:hover { border-bottom-color: currentColor; color: var(--wiki-accent); }
.wiki-mat-chips li.q1 a { color: var(--wiki-q1); }
.wiki-mat-chips li.q2 a { color: var(--wiki-q2); }
.wiki-mat-chips li.q3 a { color: var(--wiki-q3); }
.wiki-mat-chips li.q4 a { color: var(--wiki-q4); }
.wiki-mat-chips li.q5 a { color: var(--wiki-q5); }
.wiki-mat-chips li .qty {
  color: var(--wiki-text-dim);
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.wiki-mat-empty { padding: 8px; margin: 0; }

.wiki-recipe-list li {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 8px 12px;
  background: var(--wiki-panel);
  border: 1px solid var(--wiki-border);
  border-radius: 4px;
  margin-bottom: 6px;
}
.wiki-recipe-list li a {
  color: var(--wiki-text);
  text-decoration: none;
}
.wiki-recipe-list li a:hover { color: var(--wiki-accent); }
.wiki-recipe-list li.q1 a { color: var(--wiki-q1); }
.wiki-recipe-list li.q2 a { color: var(--wiki-q2); }
.wiki-recipe-list li.q3 a { color: var(--wiki-q3); }
.wiki-recipe-list li.q4 a { color: var(--wiki-q4); }
.wiki-recipe-list li.q5 a { color: var(--wiki-q5); }
.wiki-recipe-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: var(--wiki-bg-2);
  border-radius: 3px;
  padding: 2px;
}

/* ---- "Used as material in N recipes" — multi-line per-entry cards ---- */
.wiki-usedin-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}
.wiki-usedin-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: var(--wiki-panel);
  border: 1px solid var(--wiki-border);
  border-radius: 4px;
}
.wiki-usedin-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: var(--wiki-bg-2);
  border-radius: 3px;
  padding: 2px;
}
.wiki-usedin-body {
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
}
.wiki-usedin-title {
  font-weight: 700;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wiki-usedin-title a { color: var(--wiki-text); text-decoration: none; }
.wiki-usedin-title a:hover { text-decoration: underline; }
.wiki-usedin-list li.q1 .wiki-usedin-title a { color: var(--wiki-q1); }
.wiki-usedin-list li.q2 .wiki-usedin-title a { color: var(--wiki-q2); }
.wiki-usedin-list li.q3 .wiki-usedin-title a { color: var(--wiki-q3); }
.wiki-usedin-list li.q4 .wiki-usedin-title a { color: var(--wiki-q4); }
.wiki-usedin-list li.q5 .wiki-usedin-title a { color: var(--wiki-q5); }
.wiki-usedin-id { color: var(--wiki-text-dim); font-weight: 400; font-size: 12px; }
.wiki-usedin-row { color: var(--wiki-text-dim); }
.wiki-usedin-label { font-weight: 600; margin-right: 4px; }
.wiki-usedin-row a { color: var(--wiki-text); text-decoration: none; }
.wiki-usedin-row a:hover { color: var(--wiki-accent); }
.wiki-usedin-qty { color: var(--wiki-text); font-variant-numeric: tabular-nums; }
.wiki-recipe-prob {
  color: var(--wiki-text-dim);
  font-size: 13px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* ---- Recipe page tables (materials / produces) ---- */
.wiki-mat-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--wiki-panel);
  border: 1px solid var(--wiki-border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}
.wiki-mat-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--wiki-border);
}
.wiki-mat-table tr:last-child td { border-bottom: 0; }
.wiki-mat-table tr:hover { background: rgba(183, 143, 255, 0.06); }
.wiki-mat-table td.ic  { width: 40px; }
.wiki-mat-table td.ic img { width: 32px; height: 32px; image-rendering: pixelated; }
/* Name column shrinks to its content so qty stays right beside the name,
   not stranded at the row's right edge. The remaining row width is absorbed
   by td.spacer. */
.wiki-mat-table td.name {
  width: 1%;
  white-space: nowrap;
  padding-right: 16px;
}
.wiki-mat-table td.qty {
  width: 1%;
  white-space: nowrap;
  color: var(--wiki-text-dim);
  font-variant-numeric: tabular-nums;
}
.wiki-mat-table td.spacer { width: auto; padding: 0; }

/* Pack/loot table — borrows mat-table styling but uses a header row and a
   right-aligned probability column instead of qty / spacer. */
.wiki-pack-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 0.85em;
  color: var(--wiki-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--wiki-border);
  background: rgba(0, 0, 0, 0.15);
}
.wiki-pack-table th.t-r { text-align: right; }
.wiki-pack-table td.t-r { text-align: right; font-variant-numeric: tabular-nums; color: var(--wiki-text); }
.wiki-pack-table td.name { width: auto; white-space: normal; }
.wiki-section-sub { color: var(--wiki-text-dim); font-weight: normal; font-size: 0.7em; margin-left: 6px; }
.wiki-mat-table td.name a { color: inherit; text-decoration: none; border-bottom: 1px dotted transparent; }
.wiki-mat-table td.name a:hover { border-bottom-color: currentColor; }
.wiki-mat-table tr.q1 td.name a { color: var(--wiki-q1); }
.wiki-mat-table tr.q2 td.name a { color: var(--wiki-q2); }
.wiki-mat-table tr.q3 td.name a { color: var(--wiki-q3); }
.wiki-mat-table tr.q4 td.name a { color: var(--wiki-q4); }
.wiki-mat-table tr.q5 td.name a { color: var(--wiki-q5); }

.wiki-footer { text-align: center; color: var(--wiki-text-dim); padding: 24px; }

/* ---- Quest card layout ---- */
.wiki-quest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  background: var(--wiki-panel);
  border: 1px solid var(--wiki-border);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  padding: 18px 24px;
}
.wiki-quest-col { min-width: 0; }
.wiki-quest-h {
  font-size: 14px;
  margin: 14px 0 6px;
  color: var(--wiki-accent-hot);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.wiki-quest-h:first-child { margin-top: 0; }
.wiki-quest-desc { color: var(--wiki-text); line-height: 1.5; margin: 0 0 4px; }
.wiki-quest-task, .wiki-quest-award { list-style: none; padding: 0; margin: 0; }
.wiki-quest-task li, .wiki-quest-award li {
  padding: 4px 0;
  color: var(--wiki-text);
}
/* Clickable refs across the wiki — items, mobs, NPCs, recipes, quests,
   drops, materials — all get the same subtle "highlight" so you can tell
   at a glance they're tappable. Accent tint + soft glow + dotted underline. */
/* Glow on CROSS-LINK references inside detail pages — NPC names, mobs in
   "Required to do", items in "Items Group", "Crafted by"/"Used as material"
   lists, recipe-card headers. NOT applied to catalog tables — there names
   should look uniform with the rest of items (white / quality color). */
.wiki-quest-task li a,
.wiki-quest-award li a,
.wiki-quest-col p > a,
.wiki-drop-table td.name a,
.wiki-usedin-list .wiki-usedin-title a,
.wiki-usedin-list .wiki-usedin-row a,
.wiki-recipe-list li a,
.wiki-recipe-name,
.wiki-mon-col td a,
.wiki-item-back a {
  color: var(--wiki-accent);
  text-decoration: none;
  border-bottom: 1px dotted rgba(183, 143, 255, 0.55);
  text-shadow: 0 0 6px rgba(183, 143, 255, 0.45);
  transition: color .12s, text-shadow .12s, border-color .12s;
}
.wiki-quest-task li a:hover,
.wiki-quest-award li a:hover,
.wiki-quest-col p > a:hover,
.wiki-drop-table td.name a:hover,
.wiki-usedin-list .wiki-usedin-title a:hover,
.wiki-usedin-list .wiki-usedin-row a:hover,
.wiki-recipe-list li a:hover,
.wiki-recipe-name:hover,
.wiki-mon-col td a:hover,
.wiki-item-back a:hover {
  color: var(--wiki-accent-hot);
  border-bottom-color: var(--wiki-accent-hot);
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.75);
}
/* Recipe material/target tables: keep the original quality-tinted look (no
   purple override) so weapon/armor in a recipe show their q-color cleanly. */
.wiki-mat-table td.name a { color: inherit; text-decoration: none; border-bottom: 1px dotted transparent; text-shadow: none; }
.wiki-mat-table td.name a:hover { border-bottom-color: currentColor; }

/* Quality-tinted links keep their color but get a matching glow. Applies
   anywhere a row/li/td carries a .q1..q5 class. */
tr.q1 td.name a, tr.q1 td.name a:hover,
li.q1 .wiki-usedin-title a, li.q1 a, .wiki-quest-task li a.q1 {
  color: var(--wiki-q1); border-bottom-color: var(--wiki-q1);
  text-shadow: 0 0 6px rgba(230, 224, 255, 0.5);
}
tr.q2 td.name a, tr.q2 td.name a:hover,
li.q2 .wiki-usedin-title a, li.q2 a, .wiki-quest-task li a.q2 {
  color: var(--wiki-q2); border-bottom-color: var(--wiki-q2);
  text-shadow: 0 0 6px rgba(111, 220, 111, 0.55);
}
tr.q3 td.name a, tr.q3 td.name a:hover,
li.q3 .wiki-usedin-title a, li.q3 a, .wiki-quest-task li a.q3 {
  color: var(--wiki-q3); border-bottom-color: var(--wiki-q3);
  text-shadow: 0 0 6px rgba(111, 163, 255, 0.55);
}
tr.q4 td.name a, tr.q4 td.name a:hover,
li.q4 .wiki-usedin-title a, li.q4 a, .wiki-quest-task li a.q4 {
  color: var(--wiki-q4); border-bottom-color: var(--wiki-q4);
  text-shadow: 0 0 6px rgba(196, 111, 255, 0.55);
}
tr.q5 td.name a, tr.q5 td.name a:hover,
li.q5 .wiki-usedin-title a, li.q5 a, .wiki-quest-task li a.q5 {
  color: var(--wiki-q5); border-bottom-color: var(--wiki-q5);
  text-shadow: 0 0 6px rgba(255, 184, 77, 0.6);
}
/* Quality-tinted links keep their color but inherit the glow/underline */
.wiki-quest-task li a.q1, .wiki-quest-task li a.q1:hover { color: var(--wiki-q1); border-bottom-color: var(--wiki-q1); text-shadow: 0 0 6px rgba(230, 224, 255, 0.5); }
.wiki-quest-task li a.q2, .wiki-quest-task li a.q2:hover { color: var(--wiki-q2); border-bottom-color: var(--wiki-q2); text-shadow: 0 0 6px rgba(111, 220, 111, 0.55); }
.wiki-quest-task li a.q3, .wiki-quest-task li a.q3:hover { color: var(--wiki-q3); border-bottom-color: var(--wiki-q3); text-shadow: 0 0 6px rgba(111, 163, 255, 0.55); }
.wiki-quest-task li a.q4, .wiki-quest-task li a.q4:hover { color: var(--wiki-q4); border-bottom-color: var(--wiki-q4); text-shadow: 0 0 6px rgba(196, 111, 255, 0.55); }
.wiki-quest-task li a.q5, .wiki-quest-task li a.q5:hover { color: var(--wiki-q5); border-bottom-color: var(--wiki-q5); text-shadow: 0 0 6px rgba(255, 184, 77, 0.6); }
.wiki-quest-coord { font-variant-numeric: tabular-nums; }

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

/* ---- Monster page ---- */
.wiki-mon-head {
  padding: 18px 24px;
  background: var(--wiki-panel);
  border: 1px solid var(--wiki-border);
  border-radius: 8px 8px 0 0;
}
.wiki-mon-name {
  margin: 0;
  font-size: 26px;
  color: var(--wiki-accent-hot);
}
.wiki-mon-meta {
  margin-top: 4px;
  color: var(--wiki-text-dim);
  font-size: 13px;
}
.wiki-mon-meta span { margin-right: 14px; }

.wiki-mon-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--wiki-panel);
  border: 1px solid var(--wiki-border);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}
.wiki-mon-col {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.wiki-mon-col + .wiki-mon-col { border-left: 1px solid var(--wiki-border); }
.wiki-mon-col th, .wiki-mon-col td {
  padding: 7px 14px;
  border-bottom: 1px solid rgba(42, 29, 74, 0.5);
  text-align: left;
  vertical-align: top;
}
.wiki-mon-col th {
  color: var(--wiki-text-dim);
  font-weight: 600;
  width: 45%;
}
.wiki-mon-col td { color: var(--wiki-text); font-variant-numeric: tabular-nums; }
.wiki-mon-col td a { color: var(--wiki-accent); text-decoration: none; }
.wiki-mon-col td a:hover { text-decoration: underline; }
.wiki-mon-drophead th,
.wiki-mon-magdef th {
  background: rgba(124, 58, 237, 0.10);
  color: var(--wiki-accent-hot) !important;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding-top: 10px;
  padding-bottom: 10px;
}

/* Element color hints — applied wherever .el-XYZ appears */
.el-metal { color: #c9ccd9; }
.el-wood  { color: #6fdc6f; }
.el-water { color: #6fa3ff; }
.el-fire  { color: #ff7a7a; }
.el-earth { color: #d4a55a; }

.wiki-mon-section { margin-top: 28px; }

/* ---- Default Drop table (monster page) ---- */
.wiki-drop-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--wiki-panel);
  border: 1px solid var(--wiki-border);
  border-radius: 6px;
  overflow: hidden;
}
.wiki-drop-table thead th {
  background: var(--wiki-bg-2);
  color: var(--wiki-text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 12px;
}
.wiki-drop-table td {
  padding: 6px 12px;
  border-bottom: 1px solid rgba(42, 29, 74, 0.5);
}
.wiki-drop-table tr:last-child td { border-bottom: 0; }
.wiki-drop-table tr:hover { background: rgba(183, 143, 255, 0.06); }
.wiki-drop-table td.ic { width: 40px; }
.wiki-drop-table td.ic img { width: 32px; height: 32px; }
.wiki-drop-table td.name a { color: var(--wiki-text); text-decoration: none; }
.wiki-drop-table td.name a:hover { color: var(--wiki-accent); }
.wiki-drop-table tr.q1 td.name a { color: var(--wiki-q1); }
.wiki-drop-table tr.q2 td.name a { color: var(--wiki-q2); }
.wiki-drop-table tr.q3 td.name a { color: var(--wiki-q3); }
.wiki-drop-table tr.q4 td.name a { color: var(--wiki-q4); }
.wiki-drop-table tr.q5 td.name a { color: var(--wiki-q5); }

/* ---- World map with spawn markers (mine page) ---- */
.wiki-worldmap {
  position: relative;
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  background: #000;
  border: 1px solid var(--wiki-border);
  border-radius: 6px;
  overflow: hidden;
}
.wiki-worldmap .wm-bg {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  pointer-events: none;
}
.wiki-worldmap .wm-marker {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #ffff23;
  border: 1px solid #000;        /* pure black for crisp edge */
  border-radius: 0;              /* sharp corners — no rounding */
  transform: translate(-50%, -50%);
  box-shadow: none;              /* no glow — keeps markers crisp */
  image-rendering: pixelated;
  z-index: 2;
  cursor: help;
  transition: transform 0.1s, box-shadow 0.1s;
}
.wiki-worldmap .wm-marker:hover {
  transform: translate(-50%, -50%) scale(2);
  box-shadow: 0 0 8px rgba(255, 255, 35, 1);
  z-index: 3;
}
.wiki-worldmap .wm-marker:active {
  transform: translate(-50%, -50%) scale(1.5);
  background: #ffff90;
}

/* ---- Floating toast for "copied to clipboard" feedback ---- */
.wiki-toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 20px);
  background: rgba(20, 8, 44, 0.92);
  color: var(--wiki-accent-hot);
  border: 1px solid var(--wiki-accent);
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
}
.wiki-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
