/* ============================================================
   LOE WIKI — Items module CSS
   Dark fantasy / blood-and-gold + cyan phoenix sub-brand
   Source: docs/BRAND.md + LOE Wiki design v2
   ============================================================ */

:root {
  /* Foundations — cool dark fantasy (reference palette) */
  --bg-base:        #05070b;
  --bg-surface-1:   #141822;
  --bg-surface-2:   #0b0e14;
  --bg-surface-3:   #07090d;
  --border-default: #262b36;
  --border-strong:  #39414f;

  /* Panels + gold borders (reference) */
  --panel:            rgba(12, 14, 19, 0.74);
  --border-gold:      rgba(196, 132, 45, 0.45);
  --border-gold-soft: rgba(196, 132, 45, 0.30);

  /* Brand — gold (reference) */
  --gold-primary:   #d89b36;
  --gold-bright:    #ffd76a;
  --gold-warm:      #b8792e;
  --gold-glow:      #f2ca7d;

  /* Phoenix cyan (wiki sub-brand) */
  --phoenix-cyan:        #4fc3f7;
  --phoenix-cyan-bright: #80deea;

  /* Fire */
  --red-cta:        #c90300;
  --red-deep:       #b30808;

  /* Avalon */
  --avalon-green:   #6e9a28;

  /* Text (reference) */
  --text-primary:   #f2eee7;
  --text-body:      #c9c3bd;
  --text-muted:     #aaa39d;
  --text-hint:      #7e8794;

  /* Display font: Cyrillic-supporting fantasy serif (Cinzel doesn't have Cyrillic) */
  --font-display:   "Marcellus", "Cormorant Garamond", "Cinzel", "Times New Roman", serif;
  --font-body:      "Manrope", system-ui, sans-serif;

  --fs-h1:          44px;
  --fs-h2:          28px;
  --fs-body:        16px;
  --fs-small:       13px;

  --space-2: 8px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  --radius:         8px;
  --transition:     all 0.18s ease-in-out;
  --container:      1600px;
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-base);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold-primary); text-decoration: none; }
a:hover { color: var(--gold-bright); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--gold-primary);
  letter-spacing: 0.03em;
  font-weight: 600;
  margin: 0 0 var(--space-4);
  line-height: 1.2;
}
h1 { font-size: var(--fs-h1); text-transform: uppercase; letter-spacing: 0.04em; }
h2 { font-size: var(--fs-h2); }
.eyebrow {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-primary);
  margin: 0 0 var(--space-2);
}
.muted { color: var(--text-hint); }
img { max-width: 100%; display: block; }

/* ---- header ---- */
.wiki-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, rgba(7,9,13,0.96), rgba(5,7,11,0.94));
  border-bottom: 1px solid var(--border-gold);
  backdrop-filter: blur(8px);
}
.wiki-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px var(--space-6);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-6);
  align-items: center;
}
.wiki-header__brand { display: flex; align-items: center; gap: 12px; }
.wiki-header__phoenix {
  width: 36px; height: 36px;
  background: url('/wiki/assets/phoenix.png') center/contain no-repeat;
  filter: drop-shadow(0 0 8px rgba(79,195,247,0.5));
}
.wiki-header__lockup {
  display: flex; flex-direction: column; gap: 1px; line-height: 1;
}
.wiki-header__name {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 16px;
}
.wiki-header__sub {
  font-family: var(--font-display);
  color: var(--gold-primary);
  font-weight: 500;
  letter-spacing: 0.22em;
  font-size: 11px;
}

.wiki-header__search {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}
.wiki-header__search input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 18px;
  background: var(--bg-surface-3);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: var(--transition);
}
.wiki-header__search input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(255,178,50,0.16);
}
.wiki-header__search kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: ui-monospace, monospace; font-size: 11px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--text-hint);
}

.wiki-header__nav { display: flex; gap: var(--space-4); }
.wiki-header__nav a {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}
.wiki-header__nav a:hover { color: var(--gold-primary); text-decoration: none; }
.wiki-header__nav a.is-gold { color: var(--gold-primary); }
.wiki-header__nav a.is-gold:hover { color: var(--gold-bright); }
.wiki-header__search input { border-color: var(--border-gold-soft); }

/* ---- breadcrumbs ---- */
.breadcrumbs {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-4) var(--space-6) 0;
}
.breadcrumbs ol {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: 13px;
  color: var(--text-hint);
}
.breadcrumbs .sep { color: var(--gold-primary); opacity: 0.6; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--gold-primary); text-decoration: none; }
.breadcrumbs [aria-current] { color: var(--text-primary); }

/* ---- main ---- */
.wiki-main {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6) var(--space-16);
}

/* ============================================================
   ITEM PAGE
   ============================================================ */
.item-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--space-8);
}
.item-page__head {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-8);
  align-items: start;
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-default);
}
.item-page__icon img,
.item-page__icon .icon-placeholder {
  width: 240px; height: 240px;
  display: block;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  filter: drop-shadow(0 0 14px rgba(242,202,125,0.18));
  image-rendering: pixelated;
}
.item-page__icon .icon-placeholder {
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 80px;
  color: var(--text-hint);
}
.item-page__alt {
  color: var(--text-muted);
  font-style: italic;
  margin: 6px 0 0;
}
.item-page__additional {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-warm);
  padding: 4px 10px;
  border: 1px solid var(--gold-warm);
  border-radius: 999px;
}
.item-page__desc { margin-top: var(--space-6); }
.item-page__desc h2 { font-size: 20px; }
.item-page__desc p { color: var(--text-body); }
.item-page__desc--en p { color: var(--text-muted); }

.item-page__infobox {
  background: var(--bg-surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-6);
  position: sticky; top: 92px;
  height: fit-content;
}
.item-page__infobox h2 { font-size: 18px; margin-bottom: var(--space-4); }
.item-page__infobox dl {
  display: grid; grid-template-columns: max-content 1fr;
  column-gap: var(--space-4); row-gap: 10px;
  margin: 0;
}
.item-page__infobox dt { color: var(--text-hint); font-size: 13px; }
.item-page__infobox dd { color: var(--text-primary); margin: 0; font-size: 14px; font-weight: 500; }
.item-page__flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-4); }
.flag {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.flag--yes { background: rgba(110,154,40,0.12); color: var(--avalon-green); border: 1px solid rgba(110,154,40,0.4); }
.flag--no  { background: rgba(201,3,0,0.08); color: var(--red-cta); border: 1px solid rgba(201,3,0,0.4); }

/* ---- Related grid ---- */
.related { grid-column: 1 / -1; margin-top: var(--space-12); }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
}
.related-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  color: var(--text-primary);
  transition: var(--transition);
  text-decoration: none;
}
.related-card:hover {
  border-color: var(--gold-primary);
  background: var(--bg-surface-1);
  text-decoration: none;
}
.related-card img,
.related-card .ico-ph {
  width: 48px; height: 48px;
  background: var(--bg-surface-3);
  border-radius: 4px; flex-shrink: 0;
}
.related-card .ico-ph { display: grid; place-items: center; color: var(--text-hint); }
.related-card strong { display: block; font-weight: 600; }
.related-card small {
  display: block; color: var(--text-hint); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
}

/* ============================================================
   CATEGORY PAGE
   ============================================================ */
.category-page__header {
  text-align: center; margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-default);
}
.category-page__meta {
  color: var(--text-hint);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
}
/* ============================================================
   CATEGORY GRID — cards with grade-coloured glow on hover
   ============================================================ */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 20px;
}
.category-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 18px 14px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-top-width: 3px;
  border-radius: var(--radius);
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  min-height: 168px;
}
.category-card:hover {
  background: var(--bg-surface-1);
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(0,0,0,0.6);
}

/* Grade-coloured top border so cards visually stratify */
.category-card.card-grade-d    { border-top-color: #6e9a28; }
.category-card.card-grade-c    { border-top-color: #29b6f6; }
.category-card.card-grade-b    { border-top-color: #c060ff; }
.category-card.card-grade-a    { border-top-color: #ffd700; }
.category-card.card-grade-s    { border-top-color: #ffb232; box-shadow: 0 0 14px rgba(255,178,50,0.18); }
.category-card.card-grade-s:hover { box-shadow: 0 12px 24px rgba(0,0,0,0.6), 0 0 18px rgba(255,178,50,0.3); }
.category-card.card-grade-r    { border-top-color: #c90300; box-shadow: 0 0 14px rgba(201,3,0,0.2); }
.category-card.card-grade-r:hover { box-shadow: 0 12px 24px rgba(0,0,0,0.6), 0 0 20px rgba(201,3,0,0.35); }
.category-card.card-grade-none { border-top-color: var(--border-strong); }

.category-card__icon { margin-bottom: 10px; }
.category-card__icon img,
.category-card__icon .ico-fallback {
  width: 64px; height: 64px;
  background: var(--bg-surface-3);
  border-radius: 6px;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}
.category-card__title {
  font-size: 13px; line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-weight: 500;
}
.category-card__sub {
  font-size: 10px; color: var(--text-hint);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.category-card__meta {
  margin-top: auto;
  font-size: 11px;
  color: var(--text-hint);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Favorite button on card */
.card-fav {
  position: absolute; top: 6px; right: 6px;
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-hint);
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 50%;
  line-height: 1;
  transition: var(--transition);
  z-index: 2;
}
.card-fav:hover { color: var(--red-cta); transform: scale(1.2); }
.card-fav.is-fav { color: var(--red-cta); }
.card-fav.is-fav::before { content: '♥'; }
.card-fav.is-fav { font-size: 0; }
.card-fav.is-fav::before { font-size: 18px; }

/* Tooltip on hover */
.card-tooltip {
  position: absolute; left: 50%; bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: var(--bg-surface-3);
  border: 1px solid var(--gold-primary);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-primary);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity 0.15s ease-out;
  z-index: 10;
  box-shadow: 0 8px 20px rgba(0,0,0,0.6);
}
.category-card:hover .card-tooltip {
  opacity: 1; visibility: visible;
}

/* ============================================================
   LIST VIEW (alternate layout for items)
   ============================================================ */
.category-list { display: flex; flex-direction: column; gap: 6px; }
.list-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr 140px 60px 80px 28px;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-left-width: 3px;
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}
.list-card:hover {
  background: var(--bg-surface-1);
  border-color: var(--gold-primary);
  text-decoration: none;
}
.list-card.card-grade-d    { border-left-color: #6e9a28; }
.list-card.card-grade-c    { border-left-color: #29b6f6; }
.list-card.card-grade-b    { border-left-color: #c060ff; }
.list-card.card-grade-a    { border-left-color: #ffd700; }
.list-card.card-grade-s    { border-left-color: #ffb232; }
.list-card.card-grade-r    { border-left-color: #c90300; }
.list-card.card-grade-none { border-left-color: var(--border-strong); }
.list-card__icon img,
.list-card__icon .ico-fallback {
  width: 40px; height: 40px;
  background: var(--bg-surface-3);
  border-radius: 4px;
  image-rendering: pixelated;
}
.list-card__name { font-size: 14px; }
.list-card__alt { color: var(--text-hint); font-size: 11px; display: block; }
.list-card__sub { color: var(--text-muted); font-size: 12px; }
.list-card__weight { color: var(--text-hint); font-size: 12px; text-align: right; }
.list-card__compare {
  appearance: none;
  width: 18px; height: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  cursor: pointer;
  background: var(--bg-surface-3);
  transition: var(--transition);
}
.list-card__compare:hover { border-color: var(--gold-primary); }
.list-card__compare:checked {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
}

@media (max-width: 700px) {
  .list-card {
    grid-template-columns: 40px 1fr 70px 24px;
  }
  .list-card__sub, .list-card__weight { display: none; }
}

/* ============================================================
   COMPARE BAR (floating)
   ============================================================ */
.compare-bar {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-surface-1);
  border: 1px solid var(--gold-primary);
  border-radius: 999px;
  padding: 12px 20px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.65), 0 0 18px rgba(255,178,50,0.2);
  z-index: 100;
  max-width: 90vw;
}
.compare-bar[hidden] { display: none; }
.compare-bar__label {
  font-family: var(--font-display);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-primary);
}
.compare-bar__items { display: flex; gap: 8px; flex-wrap: wrap; max-width: 50vw; overflow: hidden; }
.compare-bar__items .chip {
  background: var(--bg-surface-3);
  border: 1px solid var(--border-default);
  padding: 4px 12px 4px 8px;
  font-size: 12px;
  display: inline-flex; align-items: center; gap: 6px;
}
.compare-bar__items .chip button {
  background: none; border: none; color: var(--text-hint);
  font-size: 14px; cursor: pointer; padding: 0;
}
.compare-bar__items .chip button:hover { color: var(--red-cta); }
.compare-bar__clear {
  background: transparent; border: none;
  color: var(--text-hint); font-size: 18px; cursor: pointer;
}
.compare-bar__clear:hover { color: var(--red-cta); }

/* ============================================================
   CLASSES / SKILLS / NPCs
   ============================================================ */
.class-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px; margin-bottom: 32px;
}
.class-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--gold-primary);
  border-radius: 8px;
  padding: 14px 18px;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}
.class-card:hover { background: var(--bg-surface-1); border-color: var(--gold-primary); text-decoration: none; }
.class-card strong { font-family: var(--font-display); font-size: 15px; display: block; margin-bottom: 6px; }
.class-card p { font-size: 12px; color: var(--text-muted); margin: 0; line-height: 1.4; }

.skill-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}
.skill-card {
  display: grid; grid-template-columns: 36px 1fr auto;
  gap: 10px; align-items: center;
  padding: 8px 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}
.skill-card:hover { background: var(--bg-surface-1); border-color: var(--gold-primary); text-decoration: none; }
.skill-card__icon { width: 32px; height: 32px; }
.skill-card__icon img { width: 32px; height: 32px; border-radius: 4px; image-rendering: pixelated; }
.skill-card__body strong { font-size: 13px; display: block; }
.skill-card__body small { display: block; color: var(--text-hint); font-size: 11px; line-height: 1.3; }
.skill-card__type {
  background: var(--phoenix-cyan); color: #0a1a2c;
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
}

.skill-page__head { display: grid; grid-template-columns: 64px 1fr; gap: 24px; align-items: center; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border-default); }
.skill-page__icon img { width: 64px; height: 64px; border-radius: 6px; image-rendering: pixelated; }
.skill-page__info { background: var(--bg-surface-2); border: 1px solid var(--border-default); border-radius: 8px; padding: 18px; margin-top: 24px; max-width: 400px; }
.skill-page__info dl { display: grid; grid-template-columns: max-content 1fr; column-gap: 16px; row-gap: 8px; margin: 0; }
.skill-page__info dt { color: var(--text-hint); font-size: 13px; }
.skill-page__info dd { color: var(--text-primary); margin: 0; font-size: 14px; font-weight: 500; }

.npc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.npc-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--avalon-green);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}
.npc-card:hover { background: var(--bg-surface-1); border-color: var(--gold-primary); text-decoration: none; }
.npc-card strong { font-size: 14px; display: block; }
.npc-card small { display: block; color: var(--text-muted); font-size: 12px; font-style: italic; }
.npc-card__meta { display: block; font-size: 11px; color: var(--text-hint); margin-top: 6px; letter-spacing: 0.04em; }

.npc-page__head, .class-page__head { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border-default); }
.npc-page__info { background: var(--bg-surface-2); border: 1px solid var(--border-default); border-radius: 8px; padding: 18px; max-width: 400px; }
.npc-page__info dl { display: grid; grid-template-columns: max-content 1fr; column-gap: 16px; row-gap: 8px; margin: 0; }
.npc-page__info dt { color: var(--text-hint); font-size: 13px; }
.npc-page__info dd { color: var(--text-primary); margin: 0; font-size: 14px; font-weight: 500; }

.chain-list { list-style: none; padding: 0; margin: 0; display: flex; gap: 12px; flex-wrap: wrap; }
.chain-item {
  flex: 1; min-width: 180px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 14px;
}
.chain-item--active { border-color: var(--gold-primary); background: var(--bg-surface-1); box-shadow: 0 0 14px rgba(255,178,50,0.2); }
.chain-tier { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-hint); display: block; margin-bottom: 6px; }
.chain-item a { color: var(--text-primary); }
.chain-item--active a { color: var(--gold-primary); }

/* ============================================================
   COMPARE PAGE
   ============================================================ */
.compare-page { padding: 32px 0; }
.compare-table-wrap { overflow-x: auto; margin-top: 32px; }
.compare-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  overflow: hidden;
}
.compare-table th, .compare-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-default);
  vertical-align: top;
  text-align: left;
}
.compare-table thead th {
  background: var(--bg-surface-2);
  padding: 18px;
  width: 25%;
}
.compare-table .compare-spec {
  color: var(--gold-primary);
  font-family: var(--font-display);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--bg-surface-2);
  width: 180px;
}
.compare-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}
.compare-card:hover { text-decoration: none; color: var(--gold-primary); }
.compare-card img, .compare-card .ico-fallback {
  width: 80px; height: 80px;
  border-radius: 6px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  padding: 80px 20px;
  text-align: center;
  color: var(--text-hint);
}
.empty-state p { margin-bottom: 24px; font-size: 16px; }

.pagination {
  margin-top: var(--space-8);
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.pagination a, .pagination .current {
  padding: 8px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
}
.pagination .current { background: var(--gold-primary); color: var(--bg-base); border-color: var(--gold-primary); }
.pagination a:hover { border-color: var(--gold-primary); }

/* ============================================================
   SEARCH PAGE
   ============================================================ */
.search-page__form {
  display: flex; gap: 12px;
  max-width: 600px; margin: var(--space-6) 0;
}
.search-page__form input {
  flex: 1;
  height: 52px;
  padding: 0 18px;
  background: var(--bg-surface-3);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 16px;
  font-family: var(--font-body);
}
.search-page__form input:focus { border-color: var(--gold-primary); outline: none; }
.search-page__form button {
  padding: 0 24px;
  background: var(--red-cta);
  color: var(--text-primary);
  border: none;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: var(--transition);
}
.search-page__form button:hover { background: var(--red-deep); filter: brightness(1.15); }
.search-page__meta { color: var(--text-hint); margin-bottom: var(--space-4); }
.search-page__empty { padding: var(--space-8); text-align: center; color: var(--text-hint); }

.search-results { list-style: none; padding: 0; margin: 0; }
.search-results li { margin-bottom: var(--space-2); }
.search-result {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}
.search-result:hover {
  border-color: var(--gold-primary);
  background: var(--bg-surface-1);
  text-decoration: none;
}
.search-result__icon img,
.search-result__icon .ico-ph {
  width: 40px; height: 40px;
  background: var(--bg-surface-3);
  border-radius: 4px;
}
.search-result__body strong { font-size: 15px; }
.search-result__body small { display: block; margin-top: 2px; color: var(--text-hint); font-size: 12px; }

/* ===== Faceted search (v2) ===== */
.search-page { max-width: 1080px; }
.search-hint { color: var(--text-hint); margin: 6px 0 10px; font-size: 14px; }
.search-suggest { display: flex; flex-wrap: wrap; gap: 10px; }
.search-suggest__chip {
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--border-default);
  background: var(--bg-surface-2); color: var(--text-body); text-decoration: none;
  font-family: var(--font-display); font-size: 14px; transition: var(--transition);
}
.search-suggest__chip:hover { border-color: var(--gold-primary); color: var(--gold-bright); background: var(--bg-surface-3); }

/* facet bar */
.search-facets {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin: 18px 0 30px; padding-bottom: 20px;
  border-bottom: 1px solid var(--border-default);
}
.facet {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 17px; border-radius: 999px;
  border: 1px solid var(--border-default); background: var(--bg-surface-2);
  color: var(--text-body); font-family: var(--font-display); font-size: 14px;
  letter-spacing: 0.02em; cursor: pointer; transition: var(--transition); line-height: 1;
}
.facet:hover { border-color: var(--gold-primary); color: var(--text-primary); }
.facet.is-active {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-primary));
  border-color: var(--gold-bright); color: #1c1305; font-weight: 600;
  box-shadow: 0 4px 16px rgba(216,155,54,0.32);
}
.facet em { font-style: normal; opacity: 0.62; font-size: 0.86em; }
.facet.is-active em { opacity: 0.8; }
.facet__dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.facet.is-active .facet__dot { box-shadow: 0 0 0 2px rgba(28,19,5,0.25); }
.facet__dot--monster { background: #d2553f; }
.facet__dot--item     { background: var(--gold-bright); }
.facet__dot--location { background: #4f9e84; }
.facet__dot--quest    { background: #a487d0; }
.facet__dot--class    { background: #5b8fc9; }

/* result group */
.sr-group { margin-bottom: 34px; }
.sr-group.is-hidden { display: none; }
.sr-group__head {
  display: flex; align-items: center; gap: 12px; margin: 0 0 14px;
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
  color: var(--gold-bright); letter-spacing: 0.04em; text-transform: uppercase;
}
.sr-group__count {
  font-size: 12px; color: var(--text-muted); font-family: var(--font-body);
  background: var(--bg-surface-2); border: 1px solid var(--border-default);
  border-radius: 999px; padding: 2px 11px; letter-spacing: 0;
}
.sr-list { display: flex; flex-direction: column; gap: 8px; }

/* result row */
.sr {
  display: flex; align-items: center; gap: 16px; padding: 11px 16px;
  border-radius: 12px; background: var(--bg-surface-1);
  border: 1px solid var(--border-default); text-decoration: none;
  transition: var(--transition); position: relative; overflow: hidden;
}
.sr::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; transition: var(--transition); }
.sr:hover { border-color: var(--border-gold); background: var(--bg-surface-2); transform: translateX(3px); text-decoration: none; }
.sr:hover::before { background: var(--gold-primary); }
.sr--extra { display: none; }
.sr-group.is-expanded .sr--extra,
.sr-group.is-solo .sr--extra { display: flex; }
.sr-group.is-solo .sr-more { display: none; }

.sr__ico {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 10px;
  display: grid; place-items: center; background: var(--bg-surface-3);
  border: 1px solid var(--border-default); overflow: hidden;
}
.sr__ico img { width: 42px; height: 42px; object-fit: contain; }
.sr__ico svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sr__ico--monster  { color: #e8745c; }
.sr__ico--location { color: #5cb89a; }
.sr__ico--quest    { color: #b89ae0; }
.sr__ico--class    { color: #6ea0d8; }
.sr__ico--item     { color: var(--gold-bright); }

.sr-badge { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--text-body); }
.sr-badge--boss { color: var(--gold-bright); text-shadow: 0 0 10px rgba(255,215,106,0.45); }

.sr__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sr__name { font-size: 16px; color: var(--text-primary); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr__en { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr__meta { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-hint); white-space: nowrap; }
.sr__chev { flex: 0 0 auto; color: var(--text-muted); font-size: 22px; line-height: 1; opacity: 0; transform: translateX(-4px); transition: var(--transition); }
.sr:hover .sr__chev { opacity: 1; transform: translateX(0); color: var(--gold-primary); }

.sr-tag { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border-default); background: var(--bg-surface-2); font-size: 12px; color: var(--text-body); }
.sr-tag--boss { border-color: var(--border-gold); color: var(--gold-bright); background: rgba(216,155,54,0.08); }

.sr mark, .search-page mark { background: rgba(255,215,106,0.2); color: var(--gold-bright); border-radius: 3px; padding: 0 2px; }

.sr-more {
  margin-top: 12px; background: none; border: 1px solid var(--border-default);
  color: var(--gold-primary); font-family: var(--font-display); font-size: 14px;
  padding: 9px 20px; border-radius: 999px; cursor: pointer; transition: var(--transition);
}
.sr-more:hover { border-color: var(--gold-primary); background: var(--bg-surface-2); }
.sr-more.is-hidden { display: none; }

.search-page__empty { padding: 56px 24px; text-align: center; color: var(--text-body); }
.search-page__empty-ico { font-size: 40px; color: var(--gold-primary); opacity: 0.5; margin-bottom: 12px; }
.search-page__empty .muted { color: var(--text-hint); font-size: 14px; margin-top: 4px; }

@media (max-width: 640px) {
  .sr__en { display: none; }
  .sr__meta { font-size: 12px; }
  .sr__ico { width: 40px; height: 40px; }
  .sr__ico img { width: 36px; height: 36px; }
}

/* ===== Collections ===== */
.coll-index__head { margin-bottom: 22px; }
.coll-index__lead { color: var(--text-hint); max-width: 620px; margin-top: 6px; }
.coll-index__count { color: var(--text-muted); font-size: 13px; margin-top: 22px; text-align: center; }

.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.coll-card {
  display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 14px;
  background: var(--bg-surface-1); border: 1px solid var(--border-default);
  border-left: 3px solid var(--accent, var(--gold-primary)); border-radius: 12px;
  text-decoration: none; transition: var(--transition); position: relative;
}
.coll-card:hover { border-color: var(--border-gold); background: var(--bg-surface-2); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.35); text-decoration: none; }
.coll-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.coll-card__cat { font-family: var(--font-display); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.coll-card__tier { font-size: 11px; color: var(--text-muted); border: 1px solid var(--border-default); border-radius: 999px; padding: 1px 9px; }
.coll-card__name { font-family: var(--font-display); font-size: 17px; color: var(--text-primary); margin: 0; line-height: 1.25; }
.coll-card__bonus { font-size: 13px; color: var(--gold-bright); margin: 0; line-height: 1.4; }
.coll-card__meta { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; }

/* single collection page */
.coll-page { max-width: 920px; }
.coll-hero { padding: 22px 24px; border: 1px solid var(--border-default); border-left: 4px solid var(--accent); border-radius: 14px; background: var(--bg-surface-1); margin-bottom: 26px; }
.coll-hero h1 { margin: 6px 0 0; font-size: 30px; }
.coll-hero .eyebrow a { color: var(--text-hint); text-decoration: none; }
.coll-hero .eyebrow a:hover { color: var(--gold-primary); }
.coll-cat { font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.coll-bonus { display: flex; flex-direction: column; gap: 3px; margin: 16px 0 4px; padding: 12px 16px; background: rgba(216,155,54,.08); border: 1px solid var(--border-gold); border-radius: 10px; }
.coll-bonus__label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.coll-bonus__val { font-size: 16px; color: var(--gold-bright); font-weight: 600; }
.coll-hero__meta { color: var(--text-hint); font-size: 14px; margin: 10px 0 0; }

.coll-slots h2 { margin-bottom: 14px; }
.coll-slot { display: flex; align-items: flex-start; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border-default); }
.coll-slot:last-child { border-bottom: none; }
.coll-slot__no { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-surface-3); border: 1px solid var(--border-gold); color: var(--gold-bright); font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.coll-slot__alts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex: 1; }
.coll-slot__or { color: var(--text-muted); font-size: 12px; font-style: italic; padding: 0 2px; }
.coll-item { display: inline-flex; align-items: center; gap: 9px; padding: 6px 12px 6px 6px; background: var(--bg-surface-2); border: 1px solid var(--border-default); border-radius: 999px; text-decoration: none; transition: var(--transition); }
.coll-item:hover { border-color: var(--gold-primary); background: var(--bg-surface-3); text-decoration: none; }
.coll-item__ico { width: 30px; height: 30px; border-radius: 6px; overflow: hidden; display: grid; place-items: center; background: var(--bg-surface-3); }
.coll-item__ico img { width: 28px; height: 28px; object-fit: contain; }
.coll-item__name { font-size: 14px; color: var(--text-primary); }
.coll-ench { color: var(--gold-bright); font-style: normal; font-weight: 600; }
.coll-cnt { color: var(--text-hint); font-style: normal; }
.coll-subst { margin-top: 18px; color: var(--text-muted); font-size: 13px; }

/* item-page: used in collections */
.item-colls { margin-top: 36px; }
.item-colls h2 { display: flex; align-items: center; gap: 10px; }
.item-colls__n { font-size: 13px; color: var(--text-muted); background: var(--bg-surface-2); border: 1px solid var(--border-default); border-radius: 999px; padding: 2px 10px; font-family: var(--font-body); }
.item-colls__more { color: var(--text-muted); font-size: 13px; margin-top: 12px; }

/* item-page: box contents / opened-from (extract) */
.item-extract { margin-top: 32px; }
.item-extract h2 { display: flex; align-items: baseline; gap: 10px; }
.item-extract__n { font-size: 13px; color: var(--text-muted); background: var(--bg-surface-2); border: 1px solid var(--border-default); border-radius: 999px; padding: 2px 10px; }
.item-extract__hint { font-size: 13px; color: var(--text-muted); font-weight: 400; font-family: var(--font-body); }
.extract-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.extract-row { display: flex; align-items: center; gap: 11px; padding: 8px 12px; background: var(--bg-surface-1); border: 1px solid var(--border-default); border-radius: 10px; text-decoration: none; transition: var(--transition); }
.extract-row:hover { border-color: var(--border-gold); background: var(--bg-surface-2); transform: translateX(2px); text-decoration: none; }
.extract-row__ico { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 7px; overflow: hidden; display: grid; place-items: center; background: var(--bg-surface-3); }
.extract-row__ico img { width: 34px; height: 34px; object-fit: contain; }
.extract-row__name { flex: 1 1 auto; min-width: 0; font-size: 14px; color: var(--text-primary); line-height: 1.3; }
.extract-row__name .grade-badge, .extract-row__name [class*="grade"] { margin-left: 4px; }
.extract-row__cnt { color: var(--gold-bright); font-style: normal; font-weight: 600; font-size: 13px; }
.extract-row__chance { flex: 0 0 auto; font-size: 12px; color: var(--text-hint); }
.extract-row__chance.is-guaranteed { color: #7fdc7f; }

/* item-page: combat stats */
.item-stats { margin-top: 28px; }
.istat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.istat { display: flex; flex-direction: column; gap: 3px; padding: 13px 16px; background: var(--bg-surface-1); border: 1px solid var(--border-default); border-radius: 10px; }
.istat__v { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--gold-bright); line-height: 1; }
.istat__l { font-size: 12px; color: var(--text-hint); text-transform: uppercase; letter-spacing: 0.04em; }

/* quest page extras */
.npc-quests, .npc-sells { margin-top: 28px; }
.quest-goal { color: var(--text-hint); margin: 6px 0 0; font-size: 15px; }
.quest-goal strong { color: var(--gold-bright); }
.quest-classes { font-size: 13px; line-height: 1.4; }
.quest-cur { margin: 4px 0 14px; padding: 8px 12px; background: rgba(216,155,54,0.08); border: 1px solid var(--border-gold); border-radius: 8px; color: var(--gold-bright); font-size: 14px; font-weight: 600; }

/* crafting */
.craft-list { display: flex; flex-direction: column; gap: 10px; }
.craft-recipe { padding: 12px 14px; background: var(--bg-surface-1); border: 1px solid var(--border-default); border-radius: 10px; }
.craft-recipe__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.craft-kind { font-family: var(--font-display); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border-default); }
.craft-kind--recipe { color: #5cb89a; border-color: rgba(92,184,154,0.4); }
.craft-kind--combine { color: #b89ae0; border-color: rgba(184,154,224,0.4); }
.craft-kind--transmute { color: var(--gold-bright); border-color: var(--border-gold); }
.craft-recipe__label { color: var(--text-body); font-size: 13px; text-transform: capitalize; }
.craft-recipe__chance { color: var(--text-hint); font-size: 12px; }
.craft-recipe__out { color: var(--gold-bright); font-size: 13px; font-weight: 600; }
.craft-recipe__mats { display: flex; flex-wrap: wrap; gap: 8px; }
.craft-mat { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 5px; background: var(--bg-surface-2); border: 1px solid var(--border-default); border-radius: 999px; text-decoration: none; font-size: 13px; color: var(--text-primary); transition: var(--transition); }
.craft-mat:hover { border-color: var(--gold-primary); background: var(--bg-surface-3); text-decoration: none; }
.craft-mat img { width: 26px; height: 26px; object-fit: contain; border-radius: 5px; }
.craft-mat em { color: var(--gold-bright); font-style: normal; font-weight: 600; }

/* SEO lede — data-driven summary paragraph */
.seo-lede { margin: 4px 0 22px; padding: 14px 18px; background: var(--bg-surface-1); border-left: 3px solid var(--gold-primary); border-radius: 0 10px 10px 0; color: var(--text-body); font-size: 15px; line-height: 1.6; }
.seo-lede strong { color: var(--gold-bright); }

/* Server conversion CTA */
.loe-cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 32px 0 8px; padding: 20px 24px; border-radius: 14px; border: 1px solid var(--border-gold); background: linear-gradient(135deg, rgba(216,155,54,0.1), rgba(12,14,19,0.6)); position: relative; overflow: hidden; }
.loe-cta::after { content: ''; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; background: radial-gradient(circle, rgba(255,215,106,0.12), transparent 70%); pointer-events: none; }
.loe-cta__eyebrow { font-family: var(--font-display); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold-primary); margin: 0 0 4px; }
.loe-cta__title { font-family: var(--font-display); font-size: 21px; color: var(--text-primary); margin: 0 0 10px; }
.loe-cta__usp { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 0; }
.loe-cta__usp li { position: relative; padding-left: 18px; font-size: 13px; color: var(--text-body); }
.loe-cta__usp li::before { content: '✦'; position: absolute; left: 0; color: var(--gold-primary); font-size: 11px; }
.loe-cta__btn { flex: 0 0 auto; padding: 13px 28px; border-radius: 999px; background: linear-gradient(180deg, var(--gold-bright), var(--gold-primary)); color: #1c1305; font-family: var(--font-display); font-weight: 700; font-size: 15px; text-decoration: none; letter-spacing: 0.02em; transition: var(--transition); box-shadow: 0 4px 18px rgba(216,155,54,0.35); }
.loe-cta__btn:hover { filter: brightness(1.08); transform: translateY(-1px); text-decoration: none; }
@media (max-width: 600px) { .loe-cta__btn { width: 100%; text-align: center; } }

/* live online badge (header) */
.hdr-online { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-gold-soft); background: rgba(92,184,154,0.08); color: var(--text-primary); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: var(--transition); }
.hdr-online:hover { border-color: #5cb89a; text-decoration: none; }
.hdr-online__dot { width: 8px; height: 8px; border-radius: 50%; background: #3fd17a; animation: loePulse 2s infinite; }
.hdr-online__lbl { color: var(--text-hint); font-weight: 400; }
@keyframes loePulse { 0% { box-shadow: 0 0 0 0 rgba(63,209,122,0.5); } 70% { box-shadow: 0 0 0 6px rgba(63,209,122,0); } 100% { box-shadow: 0 0 0 0 rgba(63,209,122,0); } }

/* CTA proof line + actions + discord */
.loe-cta__proof { margin: 10px 0 0; font-size: 13px; color: var(--text-hint); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.loe-cta__live { display: inline-flex; align-items: center; gap: 6px; color: #7fdc7f; font-weight: 600; }
.loe-cta__dot { width: 8px; height: 8px; border-radius: 50%; background: #3fd17a; animation: loePulse 2s infinite; }
.loe-cta__actions { display: flex; flex-direction: column; gap: 8px; flex: 0 0 auto; }
.loe-cta__discord { text-align: center; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--border-default); color: #9aa6e0; font-size: 13px; font-weight: 600; text-decoration: none; background: rgba(88,101,242,0.1); transition: var(--transition); }
.loe-cta__discord:hover { border-color: #5865f2; color: #c5ccff; text-decoration: none; }

/* sticky play bar (mobile) */
.playbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: none; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(8,10,15,0.96); border-top: 1px solid var(--border-gold); box-shadow: 0 -4px 20px rgba(0,0,0,0.45); }
.playbar__txt { flex: 1; min-width: 0; font-size: 13px; color: var(--text-body); display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.playbar__txt strong { color: #7fdc7f; }
.playbar__txt em { color: var(--gold-bright); font-style: normal; }
.playbar__dot { width: 8px; height: 8px; border-radius: 50%; background: #3fd17a; flex: 0 0 auto; animation: loePulse 2s infinite; }
.playbar__btn { flex: 0 0 auto; padding: 9px 22px; border-radius: 999px; background: linear-gradient(180deg, var(--gold-bright), var(--gold-primary)); color: #1c1305; font-family: var(--font-display); font-weight: 700; font-size: 14px; text-decoration: none; }
.playbar__x { flex: 0 0 auto; background: none; border: none; color: var(--text-muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }
@media (max-width: 760px) { .playbar { display: flex; } .wiki-main { padding-bottom: 64px; } .hdr-online__lbl { display: none; } }

/* ============================================================
   ITEMS HOME
   ============================================================ */
.items-home__hero {
  text-align: center;
  padding: var(--space-12) 0 var(--space-8);
  border-bottom: 1px solid var(--border-default);
  margin-bottom: var(--space-8);
}
.items-home__lead { max-width: 640px; margin: 0 auto var(--space-8); color: var(--text-body); }
.items-home__search {
  display: flex; gap: 8px; max-width: 600px; margin: 0 auto;
}
.items-home__search input {
  flex: 1; height: 56px; padding: 0 18px;
  background: var(--bg-surface-3);
  border: 1px solid var(--gold-primary);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 17px;
}
.items-home__search input:focus { outline: none; box-shadow: 0 0 0 3px rgba(255,178,50,0.18); }
.items-home__search button {
  padding: 0 24px;
  background: var(--red-cta);
  color: var(--text-primary);
  border: none; border-radius: 999px; cursor: pointer;
  font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
}
.items-home__cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-4);
}
.cat-tile {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-6);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}
.cat-tile:hover {
  border-color: var(--gold-primary);
  background: var(--bg-surface-1);
  text-decoration: none;
}
.cat-tile__name { font-family: var(--font-display); letter-spacing: 0.05em; }
.cat-tile__count {
  background: var(--bg-surface-3);
  color: var(--gold-primary);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

/* ============================================================
   FOOTER
   ============================================================ */
.wiki-footer {
  border-top: 1px solid var(--border-gold);
  background: var(--bg-surface-2);
  margin-top: var(--space-16);
}
.wiki-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 44px var(--space-8) 40px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.wiki-footer__logo { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.wiki-footer__logo .wiki-header__phoenix { width: 34px; height: 34px; }
.wiki-footer__logo .wiki-header__lockup { gap: 1px; }
.wiki-footer__brand p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.6; max-width: 34ch; }
.wiki-footer__col h4 {
  margin: 0 0 14px; font-family: var(--font-display);
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-primary);
}
.wiki-footer__links { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.wiki-footer__links a { color: var(--text-muted); font-size: 13px; text-decoration: none; }
.wiki-footer__links a:hover { color: var(--gold-primary); }
.wiki-footer__social { display: flex; gap: 10px; flex-wrap: wrap; }
.wiki-footer__social a {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-surface-1); border: 1px solid var(--border-default);
  color: var(--text-muted); transition: var(--transition);
}
.wiki-footer__social a:hover { border-color: var(--gold-primary); color: var(--gold-bright); transform: translateY(-2px); }
.wiki-footer__social svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wiki-footer__copy p { margin: 0 0 4px; font-size: 13px; color: var(--text-muted); }
.wiki-footer__copy p:first-child { color: var(--gold-primary); font-family: var(--font-display); letter-spacing: 0.06em; }
.wiki-footer__copy .muted { color: var(--text-hint); font-size: 12px; }
@media (max-width: 900px) {
  .wiki-footer__inner { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  .wiki-footer__inner { grid-template-columns: 1fr; }
}
.wiki-footer a { color: var(--text-muted); }
.wiki-footer a:hover { color: var(--gold-primary); }

/* ============================================================
   ERROR PAGE
   ============================================================ */
.error { text-align: center; padding: var(--space-16) 0; }
.error h1 { color: var(--red-cta); font-size: 64px; }
.red-btn {
  display: inline-block;
  margin-top: var(--space-6);
  padding: 14px 32px;
  background: var(--red-cta);
  color: var(--text-primary);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: var(--transition);
}
.red-btn:hover { background: var(--red-deep); text-decoration: none; }

/* ============================================================
   ICON FALLBACK — category SVG when PNG missing
   ============================================================ */
.ico-fallback {
  display: inline-grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, #3a2e28, #1a1314);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  color: var(--gold-warm);
  opacity: 0.7;
}
.icon-fallback-svg {
  width: 60%; height: 60%;
  fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
/* Large icon for item page hero */
.item-page__icon .ico-fallback { width: 240px; height: 240px; border-radius: var(--radius); }
.item-page__icon .ico-fallback .icon-fallback-svg { width: 50%; height: 50%; }

/* ============================================================
   BREADCRUMBS (visible above category title)
   ============================================================ */
.breadcrumbs-vis {
  font-size: 13px;
  color: var(--text-hint);
  margin-bottom: 16px;
}
.breadcrumbs-vis a { color: var(--text-muted); }
.breadcrumbs-vis a:hover { color: var(--gold-primary); text-decoration: none; }
.breadcrumbs-vis span { color: var(--gold-primary); opacity: 0.5; margin: 0 6px; }
.breadcrumbs-vis strong { color: var(--text-primary); font-weight: 600; }

/* ============================================================
   FILTER BAR (category page)
   ============================================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 14px 18px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  margin-bottom: 24px;
  align-items: center;
}
.filter-bar--sticky {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
  background: rgba(38,31,33,0.95);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

/* In-category search */
.filter-search {
  display: flex; align-items: center;
  gap: 4px;
  background: var(--bg-surface-3);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  padding: 4px 4px 4px 14px;
  flex: 1; min-width: 220px; max-width: 360px;
}
.filter-search:focus-within { border-color: var(--gold-primary); }
.filter-search input {
  background: transparent; border: none; outline: none;
  color: var(--text-primary); font-family: var(--font-body); font-size: 13px;
  flex: 1; padding: 4px 0;
}
.filter-search input::placeholder { color: var(--text-hint); }
.filter-search button {
  background: transparent; border: none; color: var(--gold-primary);
  cursor: pointer; padding: 4px 10px; font-size: 16px;
}
.filter-search button:hover { color: var(--gold-bright); }
.filter-search__clear {
  color: var(--text-hint); padding: 0 6px;
  font-size: 16px; line-height: 1;
}
.filter-search__clear:hover { color: var(--red-cta); text-decoration: none; }
.filter-group {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.filter-group--right { margin-left: auto; }
.filter-group__label {
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-hint);
  margin-right: 2px;
}
.filter-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-body);
  background: var(--bg-surface-3);
  text-decoration: none;
  transition: var(--transition);
}
.filter-pill:hover { border-color: var(--gold-primary); color: var(--gold-primary); text-decoration: none; }
.filter-pill.active {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  background: rgba(255, 178, 50, 0.08);
}
.filter-pill em { color: var(--text-hint); font-style: normal; font-size: 10px; }
.filter-pill.active em { color: var(--gold-warm); }
.filter-reset {
  font-size: 11px;
  color: var(--red-cta);
  margin-left: 8px;
  letter-spacing: 0.04em;
}
.filter-reset:hover { color: var(--gold-primary); }

/* ============================================================
   GRADE BADGES — L2-style colored chips per grade tier
   ============================================================ */
.grade-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.4;
  border: 1px solid;
  white-space: nowrap;
}
.grade-none { color: #b4aaa6; border-color: #4b3a38; background: rgba(180,170,166,0.06); }
.grade-d    { color: #b8e986; border-color: #6e9a28; background: rgba(110,154,40,0.10); }
.grade-c    { color: #6ec1ff; border-color: #29b6f6; background: rgba(41,182,246,0.10); }
.grade-b    { color: #ff9eff; border-color: #c060ff; background: rgba(192,96,255,0.10); }
.grade-a    { color: #ffe78a; border-color: #ffd700; background: rgba(255,215,0,0.10); }
.grade-s    { color: #ffb232; border-color: #ffb232; background: rgba(255,178,50,0.12); box-shadow: 0 0 6px rgba(255,178,50,0.2); }
.grade-r    { color: #ff5d5d; border-color: #c90300; background: rgba(201,3,0,0.14); box-shadow: 0 0 6px rgba(201,3,0,0.25); }

/* ============================================================
   CLASSES — LAYOUT SWITCH (Атлас vs Список)
   ============================================================ */
.layout-switch {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 12px;
  padding: 4px;
  background: var(--bg-surface-3);
  border: 1px solid var(--border-default);
  border-radius: 999px;
}
.layout-switch__hint {
  padding: 0 8px 0 10px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-hint);
}
.layout-switch__pill {
  padding: 6px 14px;
  font-size: 12px;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: var(--transition);
}
.layout-switch__pill:hover {
  color: var(--text-primary);
  background: var(--bg-surface-1);
  text-decoration: none;
}
.layout-switch__pill--active {
  background: linear-gradient(135deg, rgba(255,178,50,0.22), rgba(255,178,50,0.06));
  border-color: var(--gold-primary);
  color: var(--gold-bright);
  box-shadow: 0 0 0 1px rgba(255,178,50,0.25);
}

/* ============================================================
   CLASSES — VARIANT A: RACE CARDS (Атлас)
   ============================================================ */
.race-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.race-card {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  min-height: 96px;
  background: linear-gradient(135deg, var(--bg-surface-2), var(--bg-surface-3));
  border: 1px solid var(--border-default);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
  overflow: hidden;
}
.race-card::before {
  /* subtle gold ribbon along the top edge */
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
  opacity: 0.35;
}
.race-card::after {
  /* corner radial glow on hover */
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 85% 0%, rgba(79,195,247,0.12), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}
.race-card:hover {
  border-color: var(--phoenix-cyan);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -12px rgba(79,195,247,0.4), 0 0 0 1px rgba(79,195,247,0.2);
  text-decoration: none;
}
.race-card:hover::after { opacity: 1; }
.race-card:hover .race-card__crest {
  color: var(--phoenix-cyan-bright);
  filter: drop-shadow(0 0 12px rgba(79,195,247,0.55));
}
.race-card--active {
  background: linear-gradient(135deg, rgba(255,178,50,0.18), rgba(255,178,50,0.03));
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 1px rgba(255,178,50,0.35), 0 12px 32px -12px rgba(255,178,50,0.4);
}
.race-card--active::before {
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  opacity: 1;
}
.race-card--active .race-card__crest {
  color: var(--gold-bright);
  filter: drop-shadow(0 0 12px rgba(255,215,0,0.55));
}
.race-card__crest {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  color: var(--phoenix-cyan);
  background: radial-gradient(circle, rgba(0,0,0,0.4), transparent);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  filter: drop-shadow(0 0 6px rgba(79,195,247,0.3));
  transition: var(--transition);
}
.race-card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.race-card__name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}
.race-card--active .race-card__name { color: var(--gold-bright); }
.race-card__sub {
  font-size: 12px;
  color: var(--text-hint);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.race-card__count {
  display: flex; flex-direction: column; align-items: flex-end;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-bright);
  line-height: 1;
}
.race-card__count em {
  font-style: normal;
  font-family: var(--font-body);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-hint);
  font-weight: 500;
  margin-top: 4px;
}

@media (max-width: 1100px) {
  .race-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .race-cards { grid-template-columns: 1fr; gap: 10px; }
  .race-card { min-height: 80px; padding: 14px 16px; gap: 12px; grid-template-columns: 44px 1fr auto; }
  .race-card__crest { width: 44px; height: 44px; font-size: 24px; }
  .race-card__name { font-size: 16px; }
}

/* ============================================================
   CLASSES — VARIANT B: RACE SIDEBAR (Список)
   ============================================================ */
.classes-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  margin-top: 24px;
}
.classes-shell__content { min-width: 0; }
.race-rail {
  position: sticky;
  top: 80px;
  align-self: start;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface-3);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  overflow: hidden;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.race-rail__head {
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--border-default);
  background: linear-gradient(180deg, rgba(255,178,50,0.06), transparent);
}
.race-rail__head .eyebrow {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-bright);
}
.race-rail__item {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  text-decoration: none;
  color: var(--text-body);
  border-bottom: 1px solid var(--border-default);
  transition: var(--transition);
}
.race-rail__item:last-child { border-bottom: none; }
.race-rail__item:hover {
  background: var(--bg-surface-1);
  text-decoration: none;
  color: var(--text-primary);
}
.race-rail__item:hover .race-rail__glyph {
  color: var(--phoenix-cyan-bright);
  filter: drop-shadow(0 0 6px rgba(79,195,247,0.45));
}
.race-rail__item--active {
  background: linear-gradient(90deg, rgba(255,178,50,0.18), rgba(255,178,50,0.03) 70%);
  color: var(--gold-bright);
}
.race-rail__item--active::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--gold-bright), transparent);
}
.race-rail__item--active .race-rail__glyph {
  color: var(--gold-bright);
  filter: drop-shadow(0 0 8px rgba(255,215,0,0.5));
}
.race-rail__item--active .race-rail__count {
  background: rgba(255,178,50,0.18);
  color: var(--gold-bright);
  border-color: rgba(255,178,50,0.5);
}
.race-rail__glyph {
  font-size: 22px;
  color: var(--phoenix-cyan);
  filter: drop-shadow(0 0 5px rgba(79,195,247,0.35));
  display: flex; align-items: center; justify-content: center;
  width: 36px;
  transition: var(--transition);
}
.race-rail__text {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.race-rail__text strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.race-rail__text small {
  font-size: 11px;
  color: var(--text-hint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.race-rail__count {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  color: var(--text-muted);
  min-width: 36px;
  text-align: center;
}

@media (max-width: 900px) {
  .classes-shell { grid-template-columns: 1fr; }
  .race-rail { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; overflow-x: auto; }
  .race-rail__head { display: none; }
  .race-rail__item { flex: 1 1 calc(50% - 1px); border-bottom: 1px solid var(--border-default); }
}

/* ============================================================
   CLASSES — TABS + TREE
   ============================================================ */
.classes-page { margin-top: 8px; }

/* Race tabs ---------------------------------------------------- */
.race-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 14px; margin-bottom: 24px;
  background: var(--bg-surface-3);
  border: 1px solid var(--border-default);
  border-radius: 12px;
}
.race-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  color: var(--text-body);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
}
.race-tab:hover {
  background: var(--bg-surface-1);
  border-color: var(--phoenix-cyan);
  color: var(--text-primary);
  text-decoration: none;
}
.race-tab--active {
  background: linear-gradient(135deg, rgba(79,195,247,0.18), rgba(79,195,247,0.04));
  border-color: var(--phoenix-cyan);
  color: var(--phoenix-cyan-bright);
  box-shadow: 0 0 0 1px rgba(79,195,247,0.25), 0 6px 18px rgba(79,195,247,0.15);
}
.race-tab__glyph {
  font-size: 16px; line-height: 1;
  color: var(--phoenix-cyan);
  filter: drop-shadow(0 0 6px rgba(79,195,247,0.4));
}
.race-tab--active .race-tab__glyph { color: var(--gold-bright); filter: drop-shadow(0 0 6px rgba(255,215,0,0.5)); }
.race-tab__count {
  font-size: 11px; padding: 2px 7px; border-radius: 999px;
  background: rgba(0,0,0,0.35); color: var(--text-hint);
  border: 1px solid var(--border-default);
}

/* Tree panel --------------------------------------------------- */
.tree-panel {
  background: var(--bg-surface-3);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 32px;
}
.tree-panel__header { margin-bottom: 22px; }
.tree-panel__header h2 {
  margin: 0 0 6px; font-size: 26px;
  font-family: var(--font-display); color: var(--text-primary);
  display: inline-flex; align-items: center; gap: 12px;
}
.tree-panel__glyph { color: var(--gold-bright); filter: drop-shadow(0 0 8px rgba(255,215,0,0.4)); }
.tree-panel__header p { margin: 0; color: var(--text-muted); font-size: 14px; }

.tree-tier-pill {
  display: inline-block; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px;
  background: rgba(255,255,255,0.04); color: var(--text-hint);
  border: 1px solid var(--border-default);
}
.tree-tier-pill--awakened {
  color: #ff8e8e; border-color: rgba(201,3,0,0.5);
  background: rgba(201,3,0,0.12);
  box-shadow: 0 0 6px rgba(201,3,0,0.25);
}

/* Branch (Воин / Маг) ----------------------------------------- */
.tree-branch { margin-bottom: 32px; }
.tree-branch:last-child { margin-bottom: 0; }
.tree-branch__header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-default);
}
.tree-branch__title {
  margin: 0; font-family: var(--font-display);
  font-size: 22px; color: var(--gold-bright);
  letter-spacing: 0.04em;
}
.tree-branch--mage .tree-branch__title { color: var(--phoenix-cyan-bright); }
.tree-branch__legend { display: flex; gap: 6px; flex-wrap: wrap; }

/* Tree grid (4 columns: tiers 0..3) ---------------------------- */
.tree-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  position: relative;
}
.tree-col {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 14px 12px;
  position: relative;
}
.tree-col--tier-3 {
  background: linear-gradient(180deg, rgba(255,178,50,0.08), rgba(255,178,50,0.02));
  border-color: rgba(255,178,50,0.4);
}
.tree-col__header {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-hint);
  text-align: center;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--border-default);
}
.tree-col--tier-3 .tree-col__header { color: var(--gold-bright); border-bottom-color: rgba(255,178,50,0.3); }
.tree-col__items { display: flex; flex-direction: column; gap: 6px; }
.tree-col__empty { text-align: center; color: var(--text-hint); padding: 12px 0; font-size: 14px; }

/* Class chip in tree ------------------------------------------ */
.tree-class {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--gold-primary);
  border-radius: 6px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.3;
  transition: var(--transition);
}
.tree-class:hover {
  background: rgba(79,195,247,0.08);
  border-color: var(--phoenix-cyan);
  border-left-color: var(--phoenix-cyan);
  text-decoration: none;
  transform: translateX(2px);
}
/* class emblem (signature skill icon) */
.tree-class__icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.tree-class__icon img {
  width: 28px; height: 28px; max-width: none;
  object-fit: contain; image-rendering: auto;
  border-radius: 5px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface-3);
}
.tree-class:hover .tree-class__icon img {
  border-color: var(--phoenix-cyan);
}
/* fallback dot when class has no emblem */
.tree-class__icon--dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 0 6px var(--gold-glow);
  margin: 9px;
}
.tree-class__name {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}
.tree-class--final {
  border-left-color: var(--gold-bright);
  background: linear-gradient(90deg, rgba(255,178,50,0.10), var(--bg-surface-1) 60%);
  color: var(--text-primary);
}
.tree-class--final .tree-class__name {
  color: var(--gold-bright);
}
.tree-class--final .tree-class__icon img {
  border-color: rgba(255,178,50,0.5);
  box-shadow: 0 0 8px rgba(255,215,0,0.25);
}
.tree-class--final .tree-class__icon--dot {
  background: var(--gold-bright);
  box-shadow: 0 0 8px rgba(255,215,0,0.7);
}
.tree-class--final:hover {
  background: linear-gradient(90deg, rgba(255,178,50,0.22), rgba(255,178,50,0.04) 60%);
  border-color: var(--gold-bright);
  border-left-color: var(--gold-bright);
}

/* "Where awakening leads" chip strip --------------------------- */
.tree-branch__awake {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(0,0,0,0.25);
  border: 1px dashed rgba(201,3,0,0.35);
  border-radius: 8px;
}
.tree-branch__awake-label {
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-hint);
  margin-right: 4px;
}
.tree-branch__awake-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: var(--bg-surface-1);
  border: 1px solid rgba(201,3,0,0.4);
  border-radius: 6px;
  color: #ffd0d0;
  text-decoration: none;
  font-size: 12px;
  font-family: var(--font-display);
}
.tree-branch__awake-chip em {
  font-style: normal; color: var(--text-hint); font-size: 11px;
}
.tree-branch__awake-chip:hover {
  background: rgba(201,3,0,0.18);
  border-color: var(--red-cta);
  text-decoration: none;
}

/* Awakening overview grid ------------------------------------- */
.awakening-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.awakening-card {
  background: var(--bg-surface-2);
  border: 1px solid rgba(201,3,0,0.4);
  border-top: 3px solid var(--red-cta);
  border-radius: 10px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.awakening-card::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 80% -20%, rgba(201,3,0,0.18), transparent 60%);
  pointer-events: none;
}
.awakening-card__glyph {
  font-size: 30px; color: var(--red-cta);
  filter: drop-shadow(0 0 10px rgba(201,3,0,0.6));
  margin-bottom: 8px;
}
.awakening-card h3 {
  margin: 0 0 4px; font-family: var(--font-display);
  font-size: 19px; color: #ffd0d0;
}
.awakening-card__role {
  margin: 0 0 10px; color: var(--gold-bright);
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
}
.awakening-card__list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.awakening-card__list li { font-size: 12px; }
.awakening-card__list a {
  color: var(--text-body); text-decoration: none;
}
.awakening-card__list a:hover { color: var(--phoenix-cyan-bright); }
.awakening-card__more { color: var(--text-hint); font-style: italic; }

/* Footer explainer -------------------------------------------- */
.classes-footer {
  margin-top: 24px;
  padding: 20px 24px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: 10px;
}
.classes-footer h2 {
  margin: 0 0 12px; font-size: 18px;
  font-family: var(--font-display); color: var(--gold-bright);
}
.classes-footer__list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}
.classes-footer__list li {
  padding: 10px 14px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-body);
}
.classes-footer__list strong { color: var(--text-primary); }
.classes-footer__list em { color: var(--phoenix-cyan-bright); font-style: normal; }

@media (max-width: 900px) {
  .tree-grid { grid-template-columns: 1fr; gap: 12px; }
  .tree-col__header { text-align: left; }
  .race-tabs { padding: 10px; }
  .race-tab { font-size: 13px; padding: 6px 10px; }
  .tree-panel { padding: 18px; }
}

/* ============================================================
   CLASS DETAIL PAGE (/class/{slug})
   ============================================================ */
.class-page__head {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  padding: 28px 32px;
  background: linear-gradient(135deg, var(--bg-surface-2), var(--bg-surface-3));
  border: 1px solid var(--border-default);
  border-left: 4px solid var(--gold-primary);
  border-bottom: 1px solid var(--border-default);   /* override generic head rule */
  border-radius: 12px;
  margin-bottom: 24px;
}
.class-page__head--mage { border-left-color: var(--phoenix-cyan); }
.class-page__headtext { flex: 1; min-width: 0; }
.class-page__emblem {
  flex-shrink: 0;
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(0,0,0,0.4), transparent);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  margin-top: 4px;
}
.class-page__head--mage .class-page__emblem { border-color: rgba(79,195,247,0.4); }
.class-page__emblem img {
  width: 56px; height: 56px; max-width: none;
  object-fit: contain; image-rendering: auto;
  border-radius: 8px;
  filter: drop-shadow(0 0 8px rgba(255,178,50,0.35));
}
.class-page__head--mage .class-page__emblem img {
  filter: drop-shadow(0 0 8px rgba(79,195,247,0.4));
}
.class-page__head h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 38px;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
}
.class-page__head--mage h1 { color: var(--phoenix-cyan-bright); }
.class-page__head .eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-hint);
}
.class-page__desc {
  margin: 0 0 16px;
  color: var(--text-body);
  font-size: 15px;
  line-height: 1.55;
  max-width: 720px;
}
.class-page__stats {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 6px;
}
.class-stat {
  padding: 6px 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.class-stat strong {
  color: var(--gold-bright);
  font-family: var(--font-display);
  margin-right: 4px;
}

/* Skill section */
.class-skills {
  background: var(--bg-surface-3);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.class-skills__head { margin-bottom: 16px; }
.class-skills__head h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  color: var(--gold-bright);
  font-size: 22px;
}
.class-skills__sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* Tabs */
.skill-tabs {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin: 16px 0;
  padding: 6px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: 8px;
}
.skill-tab {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.02em;
}
.skill-tab:hover {
  background: var(--bg-surface-1);
  border-color: var(--border-default);
  color: var(--text-primary);
}
.skill-tab--active {
  background: linear-gradient(180deg, rgba(255,178,50,0.18), rgba(255,178,50,0.05));
  border-color: var(--gold-primary);
  color: var(--gold-bright);
  box-shadow: 0 0 0 1px rgba(255,178,50,0.25), 0 4px 12px rgba(255,178,50,0.12);
}
.skill-tab__count {
  font-style: normal;
  font-size: 10px;
  font-family: var(--font-body);
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(0,0,0,0.4);
  color: var(--text-hint);
  min-width: 18px; text-align: center;
}
.skill-tab--active .skill-tab__count {
  background: rgba(255,178,50,0.25);
  color: var(--gold-bright);
}

/* Skill table */
.skill-panel { animation: fadeIn 0.2s ease; }
.skill-panel[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.skill-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-surface-2);
}
.skill-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: var(--text-body);
}
.skill-table thead th {
  text-align: left;
  padding: 12px 14px;
  background: var(--bg-surface-3);
  color: var(--text-hint);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}
.skill-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-default);
  vertical-align: middle;
}
.skill-table tbody tr:last-child td { border-bottom: none; }
.skill-table tbody tr:hover { background: rgba(79,195,247,0.05); }

.skill-table__col-icon { width: 56px; }
.skill-table__col-name { width: 210px; }
.skill-table__col-desc { width: auto; min-width: 260px; }
.skill-table__col-type { width: 170px; white-space: nowrap; }
.skill-table__col-mp,
.skill-table__col-hp,
.skill-table__col-sp { width: 66px; text-align: right; }

/* icon cell: tighter padding so the 36px square never gets clipped/squished */
.skill-table__icon { padding-left: 12px !important; padding-right: 6px !important; }
.skill-table__icon img {
  width: 36px; height: 36px;
  max-width: none;            /* override global img{max-width:100%} that squished it */
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--border-default);
  image-rendering: auto;      /* smooth 64→36 downscale (pixelated only helps upscaling) */
  display: block;
  background: var(--bg-surface-3);
}
.skill-icon-stub {
  display: block;
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--bg-surface-3), var(--bg-surface-1));
  border: 1px solid var(--border-default);
  border-radius: 6px;
}

/* Skill detail: hero icon + per-level value progression */
.skill-page__icon img {
  width: 64px; height: 64px; max-width: none;
  object-fit: contain; image-rendering: auto;
  border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--bg-surface-3);
}
.skill-levels { margin: 24px 0; }
.skill-levels h2 {
  font-family: var(--font-display);
  font-size: 18px; color: var(--gold-bright);
  margin: 0 0 12px;
}
.skill-levels__grid {
  display: grid; gap: 2px;
  border: 1px solid var(--border-default);
  border-radius: 8px; overflow: hidden;
}
.skill-level-row {
  display: grid; grid-template-columns: 72px 1fr; gap: 14px;
  padding: 10px 14px; align-items: start;
  background: var(--bg-surface-2);
}
.skill-level-row:nth-child(even) { background: var(--bg-surface-3); }
.skill-level-row__lv {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700;
  color: var(--gold-bright);
  white-space: nowrap;
}
.skill-level-row__desc {
  font-size: 13px; line-height: 1.5; color: var(--text-body);
}

.skill-link {
  display: block;
  color: var(--phoenix-cyan-bright);
  text-decoration: none;
  font-family: var(--font-display);
  line-height: 1.25;
}
.skill-link:hover { color: var(--gold-bright); text-decoration: none; }
.skill-link strong { display: block; font-size: 13px; font-weight: 600; }
.skill-link small { display: block; color: var(--text-hint); font-size: 11px; margin-top: 2px; }
.skill-table__lvl {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-family: var(--font-body);
  background: rgba(0,0,0,0.35);
  color: var(--text-hint);
  border-radius: 999px;
  vertical-align: 1px;
}
.skill-table__desc {
  color: var(--text-muted);
  line-height: 1.45;
  font-size: 12px;
}
.skill-param {
  color: var(--gold-bright);
  font-style: normal;
  padding: 0 2px;
  letter-spacing: 0.05em;
}
.skill-table__type {
  color: var(--text-body);
  font-size: 12px;
}
.skill-table__mp { color: var(--phoenix-cyan); font-weight: 500; }
.skill-table__hp { color: var(--red-cta); font-weight: 500; }
.skill-table__sp { color: var(--gold-bright); font-weight: 500; }

/* Sibling cards */
.class-siblings {
  margin-bottom: 24px;
}
.class-siblings h2 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-primary);
}
.class-siblings__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.class-sibling-card {
  display: block;
  padding: 12px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--gold-primary);
  border-radius: 6px;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}
.class-sibling-card:hover {
  background: var(--bg-surface-1);
  border-color: var(--phoenix-cyan);
  border-left-color: var(--phoenix-cyan);
  text-decoration: none;
}
.class-sibling-card__tier {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-hint);
  margin-bottom: 4px;
}
.class-sibling-card strong {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--gold-bright);
}

@media (max-width: 900px) {
  .class-page__head { padding: 20px; }
  .class-page__head h1 { font-size: 28px; }
  .skill-table { font-size: 12px; }
  .skill-table thead th,
  .skill-table tbody td { padding: 8px 10px; }
  .skill-table__col-desc { min-width: 200px; }
}

/* ============================================================
   LOCATIONS
   ============================================================ */
.loc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.loc-card {
  display: flex;
  align-items: stretch;
  min-height: 168px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  overflow: hidden;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}
.loc-card:hover {
  border-color: var(--phoenix-cyan);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 26px -12px rgba(79,195,247,0.5);
}

/* map thumbnail column (left) — portrait 2:3 = same aspect as worldmap.jpg → no crop */
.loc-map {
  position: relative;
  width: 112px;
  flex-shrink: 0;
  align-self: stretch;
  border-right: 1px solid var(--border-default);
  /* real game map (worldmap.jpg) layered over a tactical-grid fallback */
  background-image:
    url('/wiki/assets/worldmap.jpg?v=1'),
    linear-gradient(rgba(79,195,247,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,195,247,0.06) 1px, transparent 1px),
    linear-gradient(160deg, #0d1722, #070b12);
  background-size: cover, 18px 18px, 18px 18px, cover;
  background-position: center, center, center, center;
  background-repeat: no-repeat, repeat, repeat, no-repeat;
}
.loc-map--town { filter: grayscale(0.5) brightness(0.8); }
.loc-card:hover .loc-map { filter: brightness(1.08); }
.loc-card:hover .loc-map--town { filter: grayscale(0.4) brightness(0.9); }

/* glowing position marker (gold teardrop) */
.loc-pin {
  position: absolute; width: 16px; height: 16px;
  transform: translate(-50%, -100%);
  border-radius: 50% 50% 50% 0;
  rotate: -45deg;
  background: radial-gradient(circle at 50% 38%, #fff2cf, var(--gold-bright) 45%, var(--gold-primary));
  border: 1.5px solid #2a1c08;
  box-shadow: 0 0 12px 2px rgba(255,178,50,0.75), 0 2px 4px rgba(0,0,0,0.6);
}
.loc-pin::after {
  content: ""; position: absolute; left: 50%; top: 42%;
  width: 5px; height: 5px; transform: translate(-50%,-50%);
  background: #2a1c08; border-radius: 50%;
}
.loc-card:hover .loc-pin {
  box-shadow: 0 0 18px 5px rgba(255,215,106,0.9), 0 2px 4px rgba(0,0,0,0.6);
}

.loc-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 14px 16px; }
.loc-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.loc-card__name { font-family: var(--font-display); font-size: 16px; color: var(--text-primary); line-height: 1.25; }
.loc-card:hover .loc-card__name { color: var(--gold-bright); }
.loc-card__lvl {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 12px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(110,154,40,0.18);
  color: #aacb6b;
  border: 1px solid rgba(110,154,40,0.5);
  white-space: nowrap;
}
.loc-card__lvl--town { background: rgba(0,0,0,0.3); color: var(--text-hint); border-color: var(--border-default); }
.loc-card__desc { margin: 0 0 6px; font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.loc-card__en { font-size: 11px; color: var(--text-hint); margin-top: auto; }

/* location detail */
.location-page__head { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--border-default); }
.location-page__head h1 { margin: 0 0 4px; font-family: var(--font-display); font-size: 34px; color: var(--gold-bright); }
.location-page__body { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
.location-page__main { min-width: 0; }
.location-lore { margin-bottom: 24px; }
.location-lore h2, .location-related h2 { font-family: var(--font-display); font-size: 20px; color: var(--gold-bright); margin: 0 0 12px; }
.location-lore p { font-size: 15px; line-height: 1.65; color: var(--text-body); }
.loc-related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.loc-related-card {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; background: var(--bg-surface-2);
  border: 1px solid var(--border-default); border-radius: 6px;
  color: var(--text-primary); text-decoration: none; transition: var(--transition);
}
.loc-related-card:hover { border-color: var(--phoenix-cyan); background: var(--bg-surface-1); text-decoration: none; }
.loc-related-card strong { font-family: var(--font-display); font-size: 13px; }
.loc-related-card span { font-size: 11px; color: #aacb6b; }
.location-page__info, .quest-page__info {
  align-self: start; position: sticky; top: 80px;
  background: var(--bg-surface-2); border: 1px solid var(--border-default);
  border-radius: 10px; padding: 18px;
}
.location-page__info h3, .quest-page__info h3 {
  margin: 0 0 12px; font-family: var(--font-display); font-size: 16px; color: var(--gold-bright);
}
.location-map {
  position: relative;
  aspect-ratio: 2 / 3;            /* = worldmap.jpg aspect → cover shows full map, pin exact */
  margin: -18px -18px 16px;
  border-bottom: 1px solid var(--border-gold-soft);
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  background-image:
    url('/wiki/assets/worldmap.jpg?v=1'),
    linear-gradient(rgba(79,195,247,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,195,247,0.06) 1px, transparent 1px),
    linear-gradient(160deg, #0d1722, #070b12);
  background-size: cover, 26px 26px, 26px 26px, cover;
  background-position: center;
  background-repeat: no-repeat, repeat, repeat, no-repeat;
}
.location-map__label {
  position: absolute; left: 12px; bottom: 10px;
  font-size: 11px; letter-spacing: 0.06em;
  color: var(--text-muted);
  background: rgba(5,7,11,0.72); padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border-gold-soft);
  backdrop-filter: blur(3px);
}
.location-map .loc-pin { width: 22px; height: 22px; }
.location-page__info dl, .quest-page__info dl {
  display: grid; grid-template-columns: max-content 1fr; column-gap: 14px; row-gap: 10px; margin: 0 0 16px;
}
.location-page__info dt, .quest-page__info dt { color: var(--text-hint); font-size: 13px; }
.location-page__info dd, .quest-page__info dd { margin: 0; font-size: 14px; color: var(--text-primary); }
.location-page__info dd a, .quest-page__info dd a { color: var(--phoenix-cyan-bright); text-decoration: none; }
.loc-lvl-strong { font-family: var(--font-display); font-weight: 700; color: #aacb6b !important; font-size: 16px !important; }
.loc-coords { font-family: monospace; font-size: 12px !important; color: var(--text-muted) !important; }
.location-cta { display: block; text-align: center; margin-top: 4px; }

/* ============================================================
   QUESTS
   ============================================================ */
.quest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.quest-card {
  display: block; padding: 16px 18px;
  background: var(--bg-surface-2); border: 1px solid var(--border-default);
  border-left: 3px solid var(--gold-primary); border-radius: 10px;
  color: var(--text-primary); text-decoration: none; transition: var(--transition);
}
.quest-card:hover {
  background: var(--bg-surface-1); border-color: var(--gold-bright); border-left-color: var(--gold-bright);
  text-decoration: none; transform: translateY(-2px);
  box-shadow: 0 8px 22px -12px rgba(255,178,50,0.4);
}
.quest-card__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.quest-card__lvl {
  flex-shrink: 0; font-family: var(--font-display); font-size: 12px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(255,178,50,0.16); color: var(--gold-bright); border: 1px solid rgba(255,178,50,0.45);
}
.quest-card__head strong { font-family: var(--font-display); font-size: 16px; line-height: 1.25; }
.quest-card__intro { margin: 0 0 8px; font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.quest-card__npc { font-size: 11px; color: var(--phoenix-cyan); }

/* quest detail */
.quest-page__head { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--border-default); }
.quest-page__head h1 { margin: 0 0 4px; font-family: var(--font-display); font-size: 32px; color: var(--gold-bright); }
.quest-page__body { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
.quest-page__main { min-width: 0; }
.quest-intro { margin-bottom: 24px; }
.quest-intro h2, .quest-steps h2 { font-family: var(--font-display); font-size: 20px; color: var(--gold-bright); margin: 0 0 12px; }
.quest-intro p { font-size: 15px; line-height: 1.65; color: var(--text-body); font-style: italic; }
.quest-steps__list { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.quest-step {
  display: grid; grid-template-columns: 36px 1fr; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--border-default);
}
.quest-step:last-child { border-bottom: none; }
.quest-step__num {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(255,178,50,0.2), rgba(255,178,50,0.05));
  border: 1px solid var(--gold-primary);
  font-family: var(--font-display); font-weight: 700; color: var(--gold-bright);
}
.quest-step__goal { display: block; font-size: 15px; color: var(--text-primary); margin-bottom: 4px; }
.quest-step__body p { margin: 0 0 6px; font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.quest-step__entity { font-size: 12px; color: var(--phoenix-cyan); }
.quest-rewards__title { margin-top: 4px !important; }
.quest-rewards { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.quest-reward {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; background: var(--bg-surface-1);
  border: 1px solid var(--border-default); border-radius: 6px;
  color: var(--text-primary); text-decoration: none; transition: var(--transition);
}
.quest-reward:hover { border-color: var(--gold-primary); text-decoration: none; }
.quest-reward__icon img, .quest-reward__icon .icon-placeholder { width: 36px; height: 36px; border-radius: 5px; }
.quest-reward__name { font-size: 13px; line-height: 1.3; }
.quest-reward__name em { color: var(--gold-bright); font-style: normal; font-weight: 600; }
.quest-reward--unknown { opacity: 0.7; }

@media (max-width: 900px) {
  .location-page__body, .quest-page__body { grid-template-columns: 1fr; }
  .location-page__info, .quest-page__info { position: static; }
}

/* ============================================================
   EDITORIAL ARTICLES (/ru/{slug}) — doc layout + typography
   ============================================================ */
.doc-page { margin-top: 4px; }
.doc-page__head {
  margin-bottom: 28px;
  padding: 30px 34px;
  background:
    radial-gradient(circle at 90% -30%, rgba(79,195,247,0.10), transparent 55%),
    linear-gradient(135deg, var(--bg-surface-2), var(--bg-surface-3));
  border: 1px solid var(--border-default);
  border-left: 4px solid var(--gold-primary);
  border-radius: 14px;
}
.doc-page__head h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 38px;
  line-height: 1.15;
  color: var(--gold-bright);
  letter-spacing: 0.01em;
}
.doc-page__lede {
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-body);
  max-width: 760px;
}
.doc-page__meta {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-hint);
}

.doc-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 32px;
  align-items: start;
}

/* TOC sidebar */
.doc-toc { position: sticky; top: 80px; }
.doc-toc__inner {
  background: var(--bg-surface-3);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 16px 14px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
.doc-toc__label {
  margin: 0 0 10px; padding: 0 6px;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold-bright);
}
.doc-toc__nav { display: flex; flex-direction: column; gap: 1px; }
.doc-toc__link {
  display: block;
  padding: 8px 12px;
  border-radius: 7px;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.35;
  transition: var(--transition);
}
.doc-toc__link:hover {
  background: var(--bg-surface-1);
  color: var(--phoenix-cyan-bright);
  border-left-color: var(--phoenix-cyan);
  text-decoration: none;
}
.doc-toc__link--sub { padding-left: 24px; font-size: 12px; color: var(--text-hint); }

/* Article body typography */
.doc-body {
  min-width: 0;
  max-width: 900px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-body);
}
.doc-body > *:first-child { margin-top: 0; }
.doc-body h2 {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--gold-bright);
  margin: 38px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-default);
  letter-spacing: 0.01em;
  scroll-margin-top: 90px;
}
.doc-body h3 {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--phoenix-cyan-bright);
  margin: 28px 0 10px;
  scroll-margin-top: 90px;
}
.doc-body h4 { font-size: 16px; color: var(--text-primary); margin: 22px 0 8px; font-weight: 700; }
.doc-body p { margin: 0 0 16px; }
.doc-body a {
  color: var(--phoenix-cyan-bright);
  text-decoration: none;
  border-bottom: 1px solid rgba(128,222,234,0.3);
  transition: var(--transition);
}
.doc-body a:hover { color: var(--gold-bright); border-bottom-color: var(--gold-bright); }
.doc-body strong { color: var(--text-primary); font-weight: 700; }
.doc-body em { color: var(--text-body); }
.doc-body ul, .doc-body ol { margin: 0 0 18px; padding-left: 4px; list-style: none; }
.doc-body ul > li, .doc-body ol > li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 9px;
}
.doc-body ul > li::before {
  content: "";
  position: absolute; left: 4px; top: 11px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 0 6px var(--gold-glow);
}
.doc-body ol { counter-reset: docol; }
.doc-body ol > li { counter-increment: docol; }
.doc-body ol > li::before {
  content: counter(docol);
  position: absolute; left: 0; top: 2px;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  color: var(--gold-bright);
  background: rgba(255,178,50,0.14);
  border: 1px solid rgba(255,178,50,0.4);
  border-radius: 50%;
}
.doc-body li > ul, .doc-body li > ol { margin: 9px 0 0; }
.doc-body blockquote {
  margin: 0 0 18px;
  padding: 14px 20px;
  background: rgba(79,195,247,0.06);
  border-left: 3px solid var(--phoenix-cyan);
  border-radius: 0 8px 8px 0;
  color: var(--text-body);
}
.doc-body blockquote p:last-child { margin-bottom: 0; }
.doc-body code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
  padding: 2px 6px;
  background: var(--bg-surface-3);
  border: 1px solid var(--border-default);
  border-radius: 5px;
  color: var(--gold-warm);
}
.doc-body pre {
  margin: 0 0 18px; padding: 16px;
  background: var(--bg-surface-3);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  overflow-x: auto;
}
.doc-body pre code { padding: 0; background: none; border: none; color: var(--text-body); }
.doc-body hr { border: none; border-top: 1px solid var(--border-default); margin: 32px 0; }
.doc-body table {
  width: 100%; border-collapse: collapse; margin: 0 0 20px;
  border: 1px solid var(--border-default); border-radius: 8px; overflow: hidden;
}
.doc-body th { background: var(--bg-surface-3); color: var(--gold-bright); text-align: left; padding: 10px 14px; font-family: var(--font-display); font-size: 14px; }
.doc-body td { padding: 10px 14px; border-top: 1px solid var(--border-default); font-size: 14px; }
.doc-body img { border-radius: 10px; border: 1px solid var(--border-default); margin: 0 0 18px; }
/* hide Wiki.js heading pilcrow anchors (¶) until hover */
.doc-body .toc-anchor { opacity: 0; margin-left: -0.7em; padding-right: 0.2em; color: var(--text-hint); text-decoration: none; border: none; font-weight: 400; }
.doc-body h2:hover .toc-anchor, .doc-body h3:hover .toc-anchor { opacity: 0.5; }

/* article footer: edit + CTA */
.doc-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 36px; padding-top: 22px;
  border-top: 1px solid var(--border-default);
}
.doc-foot__edit {
  font-size: 13px; color: var(--text-hint) !important;
  text-decoration: none !important; border: none !important;
}
.doc-foot__edit:hover { color: var(--phoenix-cyan-bright) !important; }
.doc-foot__cta { text-decoration: none !important; border: none !important; }

@media (max-width: 900px) {
  .doc-shell { grid-template-columns: 1fr; gap: 18px; }
  .doc-toc { position: static; order: -1; }
  .doc-toc__inner { max-height: none; }
  .doc-page__head { padding: 22px; }
  .doc-page__head h1 { font-size: 28px; }
  .doc-body { font-size: 15px; }
}

/* ============================================================
   NPC / MOB PAGE v2 — drops + spawns (server data)
   ============================================================ */
.npc-page2__head {
  margin-bottom: 22px; padding: 24px 28px;
  background: linear-gradient(135deg, var(--bg-surface-2), var(--bg-surface-3));
  border: 1px solid var(--border-default); border-left: 4px solid var(--avalon-green);
  border-radius: 12px;
}
.npc-page2__head--boss { border-left-color: var(--red-cta); background: linear-gradient(135deg, rgba(201,3,0,0.12), var(--bg-surface-3)); }
.npc-page2__head h1 { margin: 0 0 4px; font-family: var(--font-display); font-size: 32px; color: var(--gold-bright); }
.npc-page2__head--boss h1 { color: #ff8e8e; }
.npc-page2__nick { margin: 0 0 4px; color: var(--phoenix-cyan-bright); font-size: 14px; }
.npc-page2__body { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.npc-page2__main { min-width: 0; }
.npc-page2__info {
  position: sticky; top: 80px; align-self: start;
  background: var(--bg-surface-2); border: 1px solid var(--border-default); border-radius: 10px; padding: 18px;
}
.npc-page2__info h3 { margin: 0 0 12px; font-family: var(--font-display); font-size: 16px; color: var(--gold-bright); }
.npc-page2__info dl { display: grid; grid-template-columns: max-content 1fr; column-gap: 14px; row-gap: 9px; margin: 0 0 16px; }
.npc-page2__info dt { color: var(--text-hint); font-size: 13px; }
.npc-page2__info dd { margin: 0; font-size: 14px; color: var(--text-primary); }
.npc-lvl { font-family: var(--font-display); font-weight: 700; color: #aacb6b !important; font-size: 16px !important; }

/* combat stats */
.npc-stats { margin-bottom: 24px; }
.npc-stats h2 { font-family: var(--font-display); font-size: 22px; color: var(--gold-bright); margin: 0 0 14px; }
.npc-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; margin-bottom: 12px; }
.npc-stat {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px;
  background: var(--bg-surface-2); border: 1px solid var(--border-default); border-radius: 8px;
}
.npc-stat b { font-family: var(--font-display); font-size: 20px; color: var(--gold-bright); line-height: 1; }
.npc-stat i { font-style: normal; font-size: 11px; letter-spacing: 0.05em; color: var(--text-hint); }
.npc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.npc-chip {
  font-size: 12px; padding: 5px 11px; border-radius: 999px;
  background: var(--bg-surface-2); border: 1px solid var(--border-default); color: var(--text-body);
}
.npc-chip i { font-style: normal; color: var(--text-hint); margin-right: 2px; }
.npc-chip--elem { border-color: rgba(79,195,247,0.45); color: var(--phoenix-cyan-bright); }
.npc-chip--rw { border-color: rgba(255,178,50,0.45); color: var(--gold-bright); }

/* drops */
.npc-drops { margin-bottom: 26px; }
.npc-drops h2, .npc-where h2 { font-family: var(--font-display); font-size: 22px; color: var(--gold-bright); margin: 0 0 14px; }
.npc-drops__grp { font-family: var(--font-display); font-size: 14px; color: var(--phoenix-cyan-bright); margin: 16px 0 8px; letter-spacing: 0.04em; }
.drop-list { display: flex; flex-direction: column; gap: 4px; }
.drop-row {
  display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: 12px;
  padding: 7px 12px; background: var(--bg-surface-2);
  border: 1px solid var(--border-default); border-radius: 8px;
  color: var(--text-primary); text-decoration: none; transition: var(--transition);
}
.drop-row:hover { background: var(--bg-surface-1); border-color: var(--gold-primary); text-decoration: none; }
.drop-row__icon img, .drop-row__icon .icon-placeholder { width: 34px; height: 34px; border-radius: 5px; }
.drop-row__name { font-size: 13px; line-height: 1.3; }
.drop-row__lr { font-style: normal; font-size: 11px; color: var(--text-hint); }
.drop-row__count { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.drop-row__chance {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  color: var(--gold-bright); min-width: 56px; text-align: right; white-space: nowrap;
}

/* where found */
.npc-where { margin-bottom: 24px; }
.npc-map {
  position: relative; aspect-ratio: 2 / 3;   /* = worldmap aspect → pins exact */
  width: 300px; max-width: 100%; margin: 0 0 16px;
  border: 1px solid var(--border-gold-soft); border-radius: 12px; overflow: hidden;
  background-image:
    url('/wiki/assets/worldmap.jpg?v=1'),
    linear-gradient(160deg, #0d1722, #070b12);
  background-size: cover, cover; background-position: center; background-repeat: no-repeat;
}
.npc-map__pin {
  position: absolute; width: 12px; height: 12px; transform: translate(-50%, -100%);
  border-radius: 50% 50% 50% 0; rotate: -45deg;
  background: radial-gradient(circle at 50% 38%, #fff2cf, var(--gold-bright) 45%, var(--gold-primary));
  border: 1.5px solid #2a1c08;
  box-shadow: 0 0 8px 1px rgba(255,178,50,0.7);
}
.npc-zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.npc-zone {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
  background: var(--bg-surface-2); border: 1px solid var(--border-default);
  border-left: 3px solid var(--avalon-green); border-radius: 6px;
  color: var(--text-primary); text-decoration: none; transition: var(--transition);
}
.npc-zone:hover { border-color: var(--phoenix-cyan); border-left-color: var(--phoenix-cyan); background: var(--bg-surface-1); text-decoration: none; }
.npc-zone strong { font-family: var(--font-display); font-size: 13px; }
.npc-zone span { font-size: 11px; color: #aacb6b; }

/* item page: "dropped by" */
.item-droppedby { margin-top: 28px; }
.item-droppedby h2 { font-family: var(--font-display); font-size: 20px; color: var(--gold-bright); margin: 0 0 12px; }
.dropby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.dropby-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 13px; background: var(--bg-surface-2);
  border: 1px solid var(--border-default); border-radius: 8px;
  color: var(--text-primary); text-decoration: none; transition: var(--transition);
}
.dropby-row:hover { border-color: var(--gold-primary); background: var(--bg-surface-1); text-decoration: none; }
.dropby-row__name { font-size: 13px; line-height: 1.25; }
.dropby-row__name small { display: block; color: var(--text-hint); font-size: 11px; }
.dropby-row__chance { font-family: var(--font-display); font-weight: 700; font-size: 12px; color: var(--gold-bright); white-space: nowrap; }

/* location inhabitants */
.location-mobs { margin-bottom: 24px; }
.location-mobs h2 { font-family: var(--font-display); font-size: 20px; color: var(--gold-bright); margin: 0 0 12px; }
.locmob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.locmob-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 13px; background: var(--bg-surface-2);
  border: 1px solid var(--border-default); border-radius: 8px;
  color: var(--text-primary); text-decoration: none; transition: var(--transition);
}
.locmob-row:hover { border-color: var(--phoenix-cyan); background: var(--bg-surface-1); text-decoration: none; }
.locmob-row--boss { border-left: 3px solid var(--red-cta); }
.locmob-row__name { font-size: 13px; line-height: 1.25; }
.locmob-row__lvl { font-family: var(--font-display); font-weight: 700; font-size: 12px; color: #aacb6b; white-space: nowrap; }

@media (max-width: 900px) {
  .npc-page2__body { grid-template-columns: 1fr; }
  .npc-page2__info { position: static; }
}

/* ============================================================
   BESTIARY — /monsters (monsters + raid bosses)
   ============================================================ */
.bestiary-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 20px; }
.bestiary-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--bg-surface-2); border: 1px solid var(--border-default);
  color: var(--text-muted); font-family: var(--font-display); font-size: 14px;
  letter-spacing: 0.03em; text-decoration: none; transition: var(--transition);
}
.bestiary-tab em { font-style: normal; font-size: 11px; font-family: var(--font-body); padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,0.35); color: var(--text-hint); border: 1px solid var(--border-default); }
.bestiary-tab:hover { color: var(--text-primary); border-color: var(--phoenix-cyan); text-decoration: none; }
.bestiary-tab--active { background: linear-gradient(135deg, rgba(79,195,247,0.16), rgba(79,195,247,0.04)); border-color: var(--phoenix-cyan); color: var(--phoenix-cyan-bright); }
.bestiary-tab--boss.bestiary-tab--active { background: linear-gradient(135deg, rgba(201,3,0,0.22), rgba(201,3,0,0.05)); border-color: var(--red-cta); color: #ffd0d0; }
.bestiary-tab--boss .bestiary-tab__x, .bestiary-tab--boss:hover { border-color: rgba(201,3,0,0.55); }

/* monster grid */
.mon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.mon-card {
  position: relative; display: flex; flex-direction: column; gap: 3px;
  padding: 14px 16px; min-height: 96px;
  background: var(--bg-surface-2); border: 1px solid var(--border-default);
  border-left: 3px solid var(--border-strong); border-radius: 10px;
  color: var(--text-primary); text-decoration: none; transition: var(--transition);
}
.mon-card:hover { border-color: var(--phoenix-cyan); border-left-color: var(--phoenix-cyan); background: var(--bg-surface-1); transform: translateY(-2px); text-decoration: none; box-shadow: 0 8px 20px -12px rgba(79,195,247,0.5); }
.mon-card__lvl {
  position: absolute; top: 12px; right: 12px;
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.mon-card__lvl--lo  { background: rgba(110,154,40,0.18); color: #aacb6b; border: 1px solid rgba(110,154,40,0.5); }
.mon-card__lvl--mid { background: rgba(79,195,247,0.16); color: var(--phoenix-cyan-bright); border: 1px solid rgba(79,195,247,0.45); }
.mon-card__lvl--hi  { background: rgba(255,178,50,0.16); color: var(--gold-bright); border: 1px solid rgba(255,178,50,0.5); }
.mon-card__name { font-family: var(--font-display); font-size: 15px; line-height: 1.25; padding-right: 56px; }
.mon-card:hover .mon-card__name { color: var(--gold-bright); }
.mon-card__en { font-size: 11px; color: var(--text-hint); }
.mon-card__meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.mon-card__zone { font-size: 11px; color: var(--phoenix-cyan); margin-top: auto; padding-top: 4px; }

/* premium boss cards */
.boss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.boss-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 22px 22px 18px; overflow: hidden;
  background: linear-gradient(150deg, rgba(201,3,0,0.14), var(--bg-surface-3) 60%);
  border: 1px solid rgba(201,3,0,0.45); border-radius: 14px;
  color: var(--text-primary); text-decoration: none; transition: var(--transition);
}
.boss-card--grand { background: linear-gradient(150deg, rgba(168,85,247,0.16), var(--bg-surface-3) 60%); border-color: rgba(168,85,247,0.5); }
.boss-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 88% -10%, rgba(201,3,0,0.25), transparent 55%); }
.boss-card--grand::after { background: radial-gradient(circle at 88% -10%, rgba(168,85,247,0.28), transparent 55%); }
.boss-card:hover { transform: translateY(-3px); border-color: var(--red-cta); box-shadow: 0 16px 36px -16px rgba(201,3,0,0.6); text-decoration: none; }
.boss-card--grand:hover { border-color: #a855f7; box-shadow: 0 16px 36px -16px rgba(168,85,247,0.6); }
.boss-card__crest { position: absolute; top: 14px; right: 18px; font-size: 30px; color: var(--red-cta); filter: drop-shadow(0 0 10px rgba(201,3,0,0.6)); z-index: 1; }
.boss-card--grand .boss-card__crest { color: #c084fc; filter: drop-shadow(0 0 10px rgba(168,85,247,0.6)); }
.boss-card__badge { position: relative; z-index: 1; align-self: flex-start; font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; padding: 3px 10px; border-radius: 4px; background: rgba(201,3,0,0.2); color: #ff9e9e; border: 1px solid rgba(201,3,0,0.5); }
.boss-card--grand .boss-card__badge { background: rgba(168,85,247,0.2); color: #d8b4fe; border-color: rgba(168,85,247,0.5); }
.boss-card__name { position: relative; z-index: 1; font-family: var(--font-display); font-size: 21px; line-height: 1.15; color: #ffd6d6; padding-right: 36px; }
.boss-card--grand .boss-card__name { color: #ecd5ff; }
.boss-card:hover .boss-card__name { color: #fff; }
.boss-card__stats { position: relative; z-index: 1; display: flex; gap: 22px; }
.boss-stat { display: flex; flex-direction: column; line-height: 1; }
.boss-stat b { font-family: var(--font-display); font-size: 22px; color: var(--gold-bright); }
.boss-stat i { font-style: normal; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-hint); margin-top: 4px; }
.boss-card__meta { position: relative; z-index: 1; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border-default); padding-top: 10px; margin-top: 2px; }

@media (max-width: 600px) { .boss-grid { grid-template-columns: 1fr; } }

/* search: grouped sections + simple (no-icon) rows */
.search-group {
  font-family: var(--font-display); font-size: 16px; color: var(--gold-bright);
  margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border-default);
  letter-spacing: 0.04em;
}
.search-result--simple { grid-template-columns: 1fr !important; }
.search-result--simple .search-result__body { padding-left: 2px; }

/* broken/missing item icon → clean placeholder box (no browser broken-image glyph) */
.ico-fallback--broken {
  display: inline-grid !important; place-items: center;
  background: linear-gradient(135deg, var(--bg-surface-1), var(--bg-surface-3));
  border: 1px solid var(--border-default); border-radius: 6px;
  vertical-align: middle;
}
.ico-fallback--broken::after {
  content: "?"; font-family: var(--font-display); font-size: 0.7em;
  color: var(--text-hint); opacity: 0.6;
}

/* ============================================================
   CATEGORY FILTER BAR v2 (labeled rows + type icons)
   ============================================================ */
.cat-filters {
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 20px; margin-bottom: 22px;
  background: var(--panel); border: 1px solid var(--border-gold);
  border-radius: 14px;
}
.cat-filters.filter-bar--sticky { position: sticky; top: 70px; z-index: 20; backdrop-filter: blur(6px); }
.catf-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.catf-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-display); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold-primary); margin-right: 6px; white-space: nowrap;
}
.catf-help {
  width: 15px; height: 15px; border-radius: 50%; font-style: normal; font-size: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); color: var(--text-hint); cursor: help;
}
/* search */
.catf-search {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 12px; min-width: 240px;
  background: rgba(4,6,10,0.7); border: 1px solid var(--border-default); border-radius: 999px;
}
.catf-search__ico { color: var(--text-hint); font-size: 15px; }
.catf-search input { flex: 1; height: 100%; border: none; background: transparent; outline: none; color: var(--text-primary); font-family: var(--font-body); font-size: 14px; min-width: 120px; }
.catf-search input::placeholder { color: var(--text-hint); }
.catf-search__clear { color: var(--text-hint); text-decoration: none; font-size: 16px; padding: 0 2px; }
.catf-search__clear:hover { color: var(--red-cta); }
/* pills */
.catf-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--bg-surface-2); border: 1px solid var(--border-default);
  color: var(--text-muted); font-size: 13px; text-decoration: none; white-space: nowrap;
  transition: var(--transition);
}
.catf-pill:hover { border-color: var(--gold-primary); color: var(--text-primary); text-decoration: none; }
.catf-pill.is-active { background: linear-gradient(135deg, rgba(216,155,54,0.22), rgba(216,155,54,0.05)); border-color: var(--gold-primary); color: var(--gold-bright); }
.catf-pill em { font-style: normal; font-size: 11px; color: var(--text-hint); }
.catf-pill.is-active em { color: var(--gold-primary); }
.catf-ico { width: 17px; height: 17px; fill: none; stroke: var(--gold-primary); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.catf-pill:hover .catf-ico, .catf-pill.is-active .catf-ico { stroke: var(--gold-bright); }
/* real game item icon inside type pill */
.catf-pill--type { padding: 5px 13px 5px 6px; }
.catf-gameico {
  width: 30px; height: 30px; flex-shrink: 0; display: inline-grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,0.06), transparent 70%), var(--bg-surface-3);
  border: 1px solid var(--border-default); border-radius: 7px;
}
.catf-gameico img { width: 26px; height: 26px; image-rendering: auto; border-radius: 4px; display: block; }
.catf-pill--type.is-active .catf-gameico { border-color: var(--gold-primary); box-shadow: 0 0 8px rgba(216,155,54,0.35); }
.catf-pill__txt { font-family: var(--font-display); letter-spacing: 0.02em; }
.catf-pill--grade .grade-badge, .catf-pill--grade [class*="grade-"] { transform: none; }
/* reset */
.catf-reset {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted); text-decoration: none; padding: 7px 4px;
}
.catf-reset:hover { color: var(--gold-bright); text-decoration: none; }
/* view toggle */
.catf-view { margin-left: auto; display: inline-flex; gap: 4px; }
.catf-vbtn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--bg-surface-2); border: 1px solid var(--border-default);
  color: var(--text-muted); text-decoration: none; font-size: 16px; transition: var(--transition);
}
.catf-vbtn:hover { border-color: var(--gold-primary); color: var(--text-primary); text-decoration: none; }
.catf-vbtn.is-active { background: linear-gradient(135deg, rgba(216,155,54,0.22), rgba(216,155,54,0.05)); border-color: var(--gold-primary); color: var(--gold-bright); }
@media (max-width: 700px) { .catf-reset, .catf-view { margin-left: 0; } .catf-search { width: 100%; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .wiki-header__inner { grid-template-columns: 1fr auto; gap: 12px; }
  .wiki-header__search { grid-column: 1 / -1; order: 3; max-width: none; }
  .wiki-header__nav { display: none; }
  .item-page { grid-template-columns: 1fr; }
  .item-page__head { grid-template-columns: 1fr; text-align: center; }
  .item-page__icon { justify-self: center; }
  .item-page__infobox { position: static; }
  h1 { font-size: 32px; }
  h2 { font-size: 22px; }
}
@media (max-width: 600px) {
  .wiki-main { padding: var(--space-6) var(--space-4) var(--space-12); }
  .item-page__icon img, .item-page__icon .icon-placeholder { width: 180px; height: 180px; }
}

/* ============================================================
   LOE HOVER TOOLTIPS — Wowhead-class hover cards + grade system
   (grade tokens · icon frames · gilded tooltip · mobile sheet)
   ============================================================ */
:root{
  /* grade text colours (match existing badge text) */
  --g-none:#b4aaa6; --g-d:#b8e986; --g-c:#6ec1ff; --g-b:#ff9eff;
  --g-a:#ffe78a;    --g-s:#ffb232; --g-r:#ff5d5d; --g-skill:#ffd76a;
  /* grade border/accent colours (deeper) */
  --gb-none:#4b3a38; --gb-d:#6e9a28; --gb-c:#29b6f6; --gb-b:#c060ff;
  --gb-a:#ffd700;    --gb-s:#ffb232; --gb-r:#c90300; --gb-skill:#b8792e;
}

/* --- Icon frame (rarity-coloured) --- */
.icon-frame{position:relative;display:inline-flex;align-items:center;justify-content:center;
  border-radius:7px;border:1px solid var(--fr,#4b3a38);overflow:hidden;
  background:radial-gradient(120% 120% at 50% 0,rgba(255,255,255,.06),rgba(0,0,0,.28));
  box-shadow:inset 0 0 8px rgba(0,0,0,.5),0 0 0 1px rgba(0,0,0,.4)}
.icon-frame img{display:block;border-radius:5px}
.icon-frame--lg{width:48px;height:48px;flex:0 0 48px}
.icon-frame[data-grade="none"]{--fr:var(--gb-none)}
.icon-frame[data-grade="d"]{--fr:var(--gb-d)}
.icon-frame[data-grade="c"]{--fr:var(--gb-c)}
.icon-frame[data-grade="b"]{--fr:var(--gb-b)}
.icon-frame[data-grade="a"]{--fr:var(--gb-a)}
.icon-frame[data-grade="s"]{--fr:var(--gb-s);box-shadow:inset 0 0 11px rgba(255,178,50,.28),0 0 0 1px rgba(0,0,0,.4)}
.icon-frame[data-grade="r"]{--fr:var(--gb-r);animation:ltEmber 2.6s ease-in-out infinite}
.icon-frame[data-grade="skill"]{--fr:var(--gb-skill)}
@keyframes ltEmber{0%,100%{box-shadow:inset 0 0 11px rgba(201,3,0,.3),0 0 0 1px rgba(0,0,0,.4)}
  50%{box-shadow:inset 0 0 17px rgba(201,3,0,.52),0 0 0 1px rgba(0,0,0,.4)}}

/* --- Floating tooltip container --- */
#loe-tip{position:fixed;top:0;left:0;z-index:9999;max-width:340px;pointer-events:none;
  opacity:0;transform:translateY(6px) scale(.985);
  transition:opacity .14s cubic-bezier(.2,.8,.2,1),transform .14s cubic-bezier(.2,.8,.2,1);
  will-change:transform,opacity}
#loe-tip.is-on{opacity:1;transform:none}
#loe-tip-scrim{position:fixed;inset:0;z-index:9998;background:rgba(4,3,6,.55);
  opacity:0;pointer-events:none;transition:opacity .2s}
#loe-tip-scrim.is-on{opacity:1;pointer-events:auto}

/* --- The hover card --- */
.lt-card{position:relative;display:block;text-decoration:none!important;min-width:212px;
  padding:11px 13px 12px;border-radius:8px;color:var(--text-body);
  border:1px solid var(--fr,#4b3a38);
  background:linear-gradient(180deg,rgba(21,13,12,.985),rgba(10,7,9,.985));
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  box-shadow:0 0 0 1px rgba(0,0,0,.6),0 14px 42px rgba(0,0,0,.72),0 0 22px var(--gl,transparent)}
.lt-card::before{content:"";position:absolute;top:0;left:11px;right:11px;height:1px;opacity:.6;
  background:linear-gradient(90deg,transparent,var(--fr,#d89b36),transparent)}
.lt-g-none{--fr:var(--gb-none);--nm:var(--g-none);--gl:transparent}
.lt-g-d{--fr:var(--gb-d);--nm:var(--g-d);--gl:rgba(110,154,40,.13)}
.lt-g-c{--fr:var(--gb-c);--nm:var(--g-c);--gl:rgba(41,182,246,.13)}
.lt-g-b{--fr:var(--gb-b);--nm:var(--g-b);--gl:rgba(192,96,255,.13)}
.lt-g-a{--fr:var(--gb-a);--nm:var(--g-a);--gl:rgba(255,215,0,.13)}
.lt-g-s{--fr:var(--gb-s);--nm:var(--g-s);--gl:rgba(255,178,50,.17)}
.lt-g-r{--fr:var(--gb-r);--nm:var(--g-r);--gl:rgba(201,3,0,.18)}
.lt-card--skill{--fr:var(--gb-skill);--nm:var(--g-skill);--gl:rgba(184,121,46,.16)}

.lt-head{display:flex;gap:11px;align-items:center}
.lt-head__txt{display:flex;flex-direction:column;gap:3px;min-width:0}
.lt-name{font-family:'Marcellus',serif;font-size:15px;line-height:1.15;font-weight:600;
  letter-spacing:.2px;color:var(--nm,#f2eee7)}
.lt-type{font-size:10.5px;text-transform:uppercase;letter-spacing:.6px;color:var(--text-hint)}
.lt-ico-stub{width:44px;height:44px;display:block;background:rgba(255,255,255,.04)}

.lt-div{position:relative;height:1px;margin:10px 0 9px;
  background:linear-gradient(90deg,transparent,rgba(216,155,54,.5),transparent)}
.lt-div::after{content:"";position:absolute;left:50%;top:50%;width:5px;height:5px;
  transform:translate(-50%,-50%) rotate(45deg);background:var(--gold-primary,#d89b36);
  box-shadow:0 0 6px rgba(216,155,54,.6)}

.lt-stats{display:flex;flex-direction:column;gap:3px;font-variant-numeric:tabular-nums}
.lt-stat{display:flex;justify-content:space-between;align-items:center;gap:14px;font-size:12.5px}
.lt-stat__l{color:var(--text-hint);text-transform:uppercase;font-size:10.5px;letter-spacing:.4px}
.lt-stat__v{color:var(--text-primary);font-weight:700}

.lt-desc{margin:9px 0 0;font-size:12px;line-height:1.45;color:var(--text-muted);font-style:italic}
.lt-desc--skill{font-style:normal;color:var(--text-body)}

.lt-flags{display:flex;flex-wrap:wrap;gap:5px;margin-top:9px}
.lt-flag{font-size:10px;text-transform:uppercase;letter-spacing:.4px;padding:2px 7px;border-radius:99px;
  background:rgba(255,255,255,.05);color:var(--text-hint);border:1px solid rgba(255,255,255,.07)}
.lt-flag--bind{color:#e58a8a;border-color:rgba(201,3,0,.3);background:rgba(201,3,0,.08)}
.lt-card--err{min-width:0;padding:9px 12px;font-size:12px;color:var(--text-hint)}

/* hint that any tip target is interactive */
[data-loe-tip]{cursor:help}
a[data-loe-tip],[data-loe-tip] a{cursor:pointer}

/* --- Mobile: bottom sheet instead of follow-cursor --- */
@media (hover:none),(pointer:coarse){
  #loe-tip.is-sheet{left:0;right:0;bottom:0;top:auto;max-width:none;width:100%;
    pointer-events:auto;transform:translateY(101%);
    transition:transform .24s cubic-bezier(.2,.8,.2,1)}
  #loe-tip.is-sheet.is-on{transform:none}
  #loe-tip.is-sheet .lt-card{min-width:0;max-width:none;border-radius:15px 15px 0 0;
    padding:17px 18px calc(20px + env(safe-area-inset-bottom))}
  #loe-tip.is-sheet .lt-name{font-size:18px}
  #loe-tip.is-sheet .lt-stat{font-size:14px}
}

@media (prefers-reduced-motion:reduce){
  #loe-tip{transition:opacity .12s linear!important;transform:none!important}
  #loe-tip.is-sheet{transition:none!important}
  .icon-frame[data-grade="r"]{animation:none!important}
}

/* ============================================================
   LOE Wiki — global instant-search autocomplete dropdown
   ============================================================ */
.wiki-header__search{position:relative}
.ac-drop{position:absolute;top:calc(100% + 8px);left:0;right:0;z-index:6000;max-height:72vh;overflow:auto;
  padding:6px;border-radius:10px;border:1px solid var(--border-gold,rgba(196,132,45,.45));
  background:linear-gradient(180deg,rgba(18,12,11,.99),rgba(9,6,8,.99));
  -webkit-backdrop-filter:blur(9px);backdrop-filter:blur(9px);
  box-shadow:0 18px 52px rgba(0,0,0,.62),0 0 0 1px rgba(0,0,0,.5)}
.ac-group{padding:2px 0}
.ac-group__h{font-size:10px;text-transform:uppercase;letter-spacing:1px;font-weight:700;
  color:var(--gold-warm,#b8792e);padding:7px 10px 4px}
.ac-row{display:flex;align-items:center;gap:10px;padding:6px 10px;border-radius:7px;
  text-decoration:none!important;color:var(--text-body)}
.ac-row:hover,.ac-row.is-active{background:rgba(216,155,54,.10)}
.ac-row__main{min-width:0;display:flex;flex-direction:column;gap:1px}
.ac-row__name{font-size:13.5px;line-height:1.25;color:var(--text-primary);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ac-row__name mark{background:transparent;color:var(--gold-bright,#ffd76a);font-weight:700}
.ac-row__sub{font-size:10.5px;color:var(--text-hint);text-transform:uppercase;letter-spacing:.4px}
.icon-frame--sm{width:34px;height:34px;flex:0 0 34px;border-radius:6px}
.icon-frame--sm img{width:34px;height:34px}
.ac-glyph{width:34px;height:34px;flex:0 0 34px;display:flex;align-items:center;justify-content:center;
  border-radius:6px;font-size:16px;color:var(--gold-primary,#d89b36);
  background:radial-gradient(120% 120% at 50% 0,rgba(255,255,255,.05),rgba(0,0,0,.25));
  border:1px solid rgba(196,132,45,.3)}
.ac-glyph--boss{color:#ff6b6b;border-color:rgba(201,3,0,.4)}
.ac-glyph--location{color:#7fb2ff}
.ac-glyph--quest{color:#ffd76a}
.ac-glyph--class{color:#c79bff}
.ac-empty{padding:15px;text-align:center;color:var(--text-hint);font-size:12.5px}
@media (max-width:760px){ .ac-drop{position:fixed;left:8px;right:8px;top:62px} }

.lt-lvl{font-family:'Marcellus',serif;font-size:18px;font-weight:700;color:var(--nm,#f2eee7)}

/* ============================================================
   LOE Wiki — interactive world maps (Leaflet drop/spawn)
   ============================================================ */
.loe-map{position:relative;height:440px;border-radius:10px;overflow:hidden;
  border:1px solid var(--border-gold,rgba(196,132,45,.4));background:#0a0d12}
.loe-map__static{position:absolute;inset:0;background:url('/wiki/assets/worldmap.jpg') center/cover no-repeat}
.loe-map__pin{position:absolute;width:9px;height:9px;margin:-4.5px 0 0 -4.5px;border-radius:50%;
  background:#ffb232;box-shadow:0 0 8px rgba(255,178,50,.8);border:1px solid rgba(255,255,255,.2)}
.loe-map__badge{position:absolute;left:10px;bottom:10px;z-index:600;pointer-events:none;
  background:rgba(8,5,9,.82);color:var(--gold-bright,#ffd76a);font-size:11px;padding:4px 10px;
  border-radius:99px;border:1px solid var(--border-gold,rgba(196,132,45,.4))}
.loe-map .leaflet-container{background:#0a0d12;font-family:inherit}
.loe-map .leaflet-popup-content-wrapper,.loe-map .leaflet-popup-tip{
  background:rgba(20,13,12,.97);color:#f2eee7;border:1px solid var(--border-gold,rgba(196,132,45,.5));
  box-shadow:0 8px 24px rgba(0,0,0,.6)}
.loe-map .leaflet-popup-content{margin:8px 12px;font-size:13px}
.loe-map .leaflet-control-zoom a{background:rgba(20,13,12,.95);color:var(--gold-bright,#ffd76a);
  border-color:rgba(196,132,45,.4)}
.loe-map .leaflet-control-zoom a:hover{background:rgba(40,26,20,.96)}
@media (max-width:600px){.loe-map{height:330px}}

/* ============================================================
   LOE Wiki — item enchant chance slider (real SEASON6 odds)
   ============================================================ */
.item-enchant{margin:20px 0}
.ench-tool{display:flex;flex-direction:column;gap:14px;max-width:540px;padding:17px 19px;border-radius:12px;
  border:1px solid var(--border-gold,rgba(196,132,45,.35));background:linear-gradient(180deg,rgba(18,12,11,.6),rgba(9,6,8,.5))}
.ench-slider{-webkit-appearance:none;appearance:none;width:100%;height:6px;border-radius:99px;outline:none;
  background:linear-gradient(90deg,var(--gold-primary,#d89b36) var(--ench-fill,20%),rgba(255,255,255,.08) var(--ench-fill,20%))}
.ench-slider::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;border-radius:50%;cursor:pointer;
  background:radial-gradient(circle at 35% 30%,#ffe9b0,#d89b36);border:2px solid #1a1209;
  box-shadow:0 2px 8px rgba(0,0,0,.5),0 0 10px rgba(255,178,50,.5)}
.ench-slider::-moz-range-thumb{width:18px;height:18px;border-radius:50%;cursor:pointer;
  background:radial-gradient(circle at 35% 30%,#ffe9b0,#d89b36);border:2px solid #1a1209}
.ench-read{display:flex;align-items:baseline;gap:16px}
.ench-lv{font-family:'Marcellus',serif;font-size:30px;line-height:1;color:var(--gold-bright,#ffd76a);min-width:62px}
.ench-ch{font-size:22px;font-weight:700;font-variant-numeric:tabular-nums}
.ench-ch.is-safe,.ench-ch.is-hi{color:#7fdc7f}.ench-ch.is-mid{color:#ffd76a}.ench-ch.is-lo{color:#ff6b6b}
.ench-safe{font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--text-hint);margin-left:auto;align-self:center}

/* dedup: centralized .breadcrumbs (render_page) is canonical; hide legacy inline */
.breadcrumbs-vis{display:none!important}

.hdr-servers{display:inline-flex;align-items:center;gap:8px}.hdr-soon{font-size:12px;font-weight:600;color:#b9ab8f;background:rgba(255,178,50,.07);border:1px solid rgba(255,178,50,.22);border-radius:99px;padding:4px 10px;white-space:nowrap}.hdr-soon b{color:#ffd76a;font-weight:700}

/* hdr-mobile-fix: hide status badges on narrow screens to stop header horizontal overflow */
@media (max-width:620px){.hdr-online,.hdr-servers,.hdr-soon{display:none!important}}

/* ---- Language switcher (header) ---- */
.langsw{position:relative;justify-self:end}
.langsw__btn{display:inline-flex;align-items:center;gap:7px;height:36px;padding:0 12px;background:var(--bg-surface-3);
  border:1px solid var(--border-default);border-radius:999px;color:var(--text-body);font-family:var(--font-body);
  font-size:13px;font-weight:600;cursor:pointer;transition:border-color .15s,color .15s}
.langsw__btn:hover{border-color:var(--border-gold);color:var(--text-primary)}
.langsw__btn svg{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.5}
.langsw__btn b{font-weight:700;letter-spacing:.04em}
.langsw__car{width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;
  border-top:5px solid currentColor;opacity:.65;transition:transform .15s}
.langsw.is-open .langsw__car{transform:rotate(180deg)}
.langsw__menu{position:absolute;top:calc(100% + 8px);left:0;right:auto;min-width:186px;z-index:120;
  background:var(--bg-surface-1);border:1px solid var(--border-gold-soft);border-radius:12px;padding:6px;
  box-shadow:0 18px 44px rgba(0,0,0,.55);opacity:0;visibility:hidden;transform:translateY(-6px);
  transition:opacity .15s,transform .15s,visibility .15s}
.langsw.is-open .langsw__menu{opacity:1;visibility:visible;transform:none}
.langsw__item{display:flex;align-items:center;gap:10px;padding:9px 11px;border-radius:8px;
  color:var(--text-body);text-decoration:none;font-size:13.5px;transition:background .13s,color .13s}
.langsw__item:hover{background:rgba(216,155,54,.10);color:var(--text-primary)}
.langsw__item b{min-width:26px;font-size:11px;font-weight:700;letter-spacing:.08em;color:var(--gold-primary)}
.langsw__item.is-on{background:rgba(216,155,54,.14);color:var(--text-primary)}
.langsw__item.is-on b{color:var(--gold-bright)}
.langsw__tick{margin-left:auto;width:12px;height:7px;border-left:2px solid var(--gold-bright);
  border-bottom:2px solid var(--gold-bright);transform:rotate(-45deg)}
@media (max-width:900px){.langsw{grid-column:auto}.langsw__menu{right:auto;left:0}}
@media (max-width:620px){.langsw__btn{height:32px;padding:0 10px;font-size:12px}}

/* ================= Light theme ================= */
:root[data-theme="light"]{
  --bg-base:        #f6f1e8;
  --bg-surface-1:   #fffdf8;
  --bg-surface-2:   #f1eadd;
  --bg-surface-3:   #ffffff;
  --border-default: #e2d7c3;
  --border-strong:  #cbbb9e;
  --panel:            rgba(255, 253, 248, 0.92);
  --border-gold:      rgba(176, 116, 32, 0.45);
  --border-gold-soft: rgba(176, 116, 32, 0.26);
  --gold-primary:   #a8761f;
  --gold-bright:    #8a5f14;
  --gold-warm:      #8a5f14;
  --gold-glow:      #b9873a;
  --phoenix-cyan:        #1c7ea8;
  --phoenix-cyan-bright: #14607f;
  --text-primary:   #241a12;
  --text-body:      #40372c;
  --text-muted:     #6b6055;
  --text-hint:      #7d7568;
}
:root[data-theme="light"] body{background:var(--bg-base);color:var(--text-body)}
:root[data-theme="light"] .wiki-header{background:rgba(255,253,248,.92);border-bottom-color:var(--border-gold-soft)}
:root[data-theme="light"] .wiki-footer{background:var(--bg-surface-1);border-top-color:var(--border-default)}
:root[data-theme="light"] .wiki-header__search input{background:#fff;border-color:var(--border-default);color:var(--text-primary)}
:root[data-theme="light"] .langsw__btn,
:root[data-theme="light"] .themesw{background:#fff;border-color:var(--border-default);color:var(--text-body)}
:root[data-theme="light"] .langsw__menu{background:#fff;border-color:var(--border-gold-soft);box-shadow:0 18px 40px rgba(60,40,10,.16)}
:root[data-theme="light"] .langsw__item{color:var(--text-body)}
:root[data-theme="light"] .langsw__item:hover,
:root[data-theme="light"] .langsw__item.is-on{background:rgba(168,118,31,.12);color:var(--text-primary)}
/* page-local dark palettes need re-pointing too */
:root[data-theme="light"] .talents{--ink:#241a12;--body:#40372c;--muted:#6b6055;
  --panel:rgba(255,253,248,.95);--line:rgba(176,116,32,.20);--lineh:rgba(176,116,32,.42);
  --gold:#a8761f;--goldb:#8a5f14;--goldg:#b9873a}
:root[data-theme="light"] .talents .tal-node{background:linear-gradient(180deg,#fffdf8,#f4ece0);color:var(--body)}
:root[data-theme="light"] .talents .tal-node__name,
:root[data-theme="light"] .talents .tal-col__ttl{color:#241a12}
:root[data-theme="light"] .talents .tal-u b,
:root[data-theme="light"] .talents .tal-node__rank{color:#241a12}
:root[data-theme="light"] .clanhub{--cream:#241a12;--muted:#6b6055;--panel:#fffdf8;--panel2:#f7f1e6;
  --line:rgba(176,116,32,.20);--line-hi:rgba(176,116,32,.42);--gold:#a8761f;--gold-soft:#8a5f14}
:root[data-theme="light"] .clanhub td{color:var(--cream)}
:root[data-theme="light"] .clanhub .kbd{background:#fff;color:#241a12}
:root[data-theme="light"] .cbpage{--bg:#f6f1e8;--panel:#fffdf8;--panel2:#f7f1e6;--text:#241a12;
  --muted:#6b6055;--faint:#8b8073;--line:rgba(176,116,32,.20);--line2:rgba(176,116,32,.42);
  --gold:#a8761f;--gold-b:#8a5f14;background:var(--bg-base);color:#40372c}
:root[data-theme="light"] .cbpage .card,
:root[data-theme="light"] .cbpage .cb-ov,
:root[data-theme="light"] .cbpage .lb-timer{background:#fffdf8}
:root[data-theme="light"] .cbpage .row .nm-ru{color:#241a12}

/* ---- Theme toggle button ---- */
.themesw{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;flex:none;
  background:var(--bg-surface-3);border:1px solid var(--border-default);border-radius:999px;
  color:var(--text-body);cursor:pointer;transition:border-color .15s,color .15s}
.themesw:hover{border-color:var(--border-gold);color:var(--text-primary)}
.themesw svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round}
.themesw__sun{display:none}
.themesw__moon{display:block}
:root[data-theme="light"] .themesw__sun{display:block}
:root[data-theme="light"] .themesw__moon{display:none}
@media (max-width:620px){.themesw{width:32px;height:32px}}

/* ---- light theme: pass 2 (hard-coded dark spots) ---- */
/* theme-light-pass2 */
:root[data-theme="light"] .cbpage .lb-u{background:#fffdf8;border-color:var(--border-gold-soft)}
:root[data-theme="light"] .cbpage .lb-u b{color:#241a12}
:root[data-theme="light"] .cbpage .lb-timer{background:linear-gradient(180deg,#fffdf8,#f7f1e6);border-color:var(--border-gold-soft)}
:root[data-theme="light"] .cbpage .server-note{color:#5b4a33}
:root[data-theme="light"] .cbpage .server-note b{color:#8a5f14}
:root[data-theme="light"] .cbpage .ch-ico,
:root[data-theme="light"] .cbpage .cb-ov-chip .ci,
:root[data-theme="light"] .cbpage .row .ic{background:#f4ece0;border-color:var(--border-default)}
:root[data-theme="light"] .cbpage .cb-ov-chip{background:#fffdf8}
:root[data-theme="light"] .cbpage .cb-ov-chip:hover{background:#f7f1e6}
:root[data-theme="light"] .cbpage .cb-ov-chip .cnn{color:#241a12}
:root[data-theme="light"] .cbpage .card,
:root[data-theme="light"] .cbpage .cb-chip,
:root[data-theme="light"] .cbpage .bar,
:root[data-theme="light"] .cbpage .pill,
:root[data-theme="light"] .cbpage .search input{background:#fffdf8;border-color:var(--border-default);color:#40372c}
:root[data-theme="light"] .cbpage .card-h{background:linear-gradient(180deg,rgba(168,118,31,.07),transparent)}
:root[data-theme="light"] .cbpage .nm-ru,
:root[data-theme="light"] .cbpage .role-h h2,
:root[data-theme="light"] .cbpage h1,
:root[data-theme="light"] .cbpage h2,
:root[data-theme="light"] .cbpage h3{color:#241a12}
:root[data-theme="light"] .cbpage .nm-en,
:root[data-theme="light"] .cbpage .role-n,
:root[data-theme="light"] .cbpage .ch{color:#5b5245}
:root[data-theme="light"] .cbpage .totop{background:#fffdf8;color:#40372c;border-color:var(--border-default)}
/* talents / clans leftovers */
:root[data-theme="light"] .talents .tal-col,
:root[data-theme="light"] .talents .tal-card,
:root[data-theme="light"] .talents .tal-sum,
:root[data-theme="light"] .talents .tal-build,
:root[data-theme="light"] .talents .tal-oc{background:#fffdf8}
:root[data-theme="light"] .talents .tal-u,
:root[data-theme="light"] .talents .tal-tip{background:#fffdf8;color:#40372c}
:root[data-theme="light"] .talents .tal-btn{color:#8a5f14}
:root[data-theme="light"] .clanhub section,
:root[data-theme="light"] .clanhub .card,
:root[data-theme="light"] .clanhub .band .b,
:root[data-theme="light"] .clanhub .step,
:root[data-theme="light"] .clanhub .adv .a,
:root[data-theme="light"] .clanhub .access,
:root[data-theme="light"] .clanhub .tabs{background:#fffdf8}
:root[data-theme="light"] .clanhub .tblwrap{background:#fff}
:root[data-theme="light"] .clanhub h1,
:root[data-theme="light"] .clanhub h2,
:root[data-theme="light"] .clanhub h3.sec{color:#241a12}

/* theme-light-pass3 — contrast + white logos */
:root[data-theme="light"] .clanhub .stage{background:linear-gradient(180deg,rgba(196,30,30,.10),rgba(196,30,30,.04));border-color:rgba(180,60,45,.35);color:#6d2f26}
:root[data-theme="light"] .clanhub .stage b{color:#a5301f}
:root[data-theme="light"] .clanhub .stage span b{color:#a5301f}
:root[data-theme="light"] .clanhub .warn{color:#6d2f26}
:root[data-theme="light"] .clanhub .warn b{color:#a5301f}
:root[data-theme="light"] .clanhub .hl{color:#25503f}
:root[data-theme="light"] .clanhub .brandlogo,
:root[data-theme="light"] .clanhub .cfoot .flogo{filter:brightness(.28) saturate(.6)}
:root[data-theme="light"] .clanhub .ssub,
:root[data-theme="light"] .clanhub .sub,
:root[data-theme="light"] .clanhub .card .cnote,
:root[data-theme="light"] .clanhub .crumb{color:#5f5648}
:root[data-theme="light"] .clanhub .tab{color:#5f5648}
:root[data-theme="light"] .talents .tal-node__eff,
:root[data-theme="light"] .talents .tal-col__role{color:#5f5648}

/* ---- "See also" cross-links ---- */
.rel{max-width:1040px;margin:46px auto 8px;padding:0 16px}
.rel__h{font-family:var(--font-display);font-size:22px;color:var(--gold-glow);margin:0 0 14px;font-weight:400;letter-spacing:.02em}
.rel__grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(232px,1fr));gap:10px}
.rel__card{display:flex;align-items:center;gap:12px;padding:14px 15px;border:1px solid var(--border-default);
  border-radius:12px;background:var(--bg-surface-1);text-decoration:none;color:var(--text-body);
  transition:border-color .15s,transform .15s,background .15s}
.rel__card:hover{border-color:var(--border-gold);background:var(--bg-surface-3);transform:translateY(-1px)}
.rel__ic{flex:none;width:36px;height:36px;border-radius:9px;display:grid;place-items:center;
  background:rgba(216,155,54,.10);border:1px solid var(--border-gold-soft)}
.rel__ic svg{width:19px;height:19px;fill:none;stroke:var(--gold-primary);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.rel__tx{min-width:0;display:flex;flex-direction:column;line-height:1.25}
.rel__tx b{font-size:14.5px;color:var(--text-primary);font-weight:600}
.rel__tx small{font-size:12px;color:var(--text-muted);margin-top:2px}
.rel__arw{margin-left:auto;color:var(--gold-primary);opacity:.55;font-size:15px}
.rel__card:hover .rel__arw{opacity:1}
:root[data-theme="light"] .rel__card{background:#fffdf8}
:root[data-theme="light"] .rel__card:hover{background:#f7f1e6}
@media(max-width:560px){.rel__grid{grid-template-columns:1fr}}

/* theme-light-pass4 — readability audit fixes (contrast >= 4.5 for body text) */
/* darker gold for text on light backgrounds */
:root[data-theme="light"]{--gold-glow:#7a5310;--gold-bright:#7a5310;--gold-primary:#8a5f14}
:root[data-theme="light"] .rel__h,
:root[data-theme="light"] .talents .tal-card h4,
:root[data-theme="light"] .talents .tal-ttab th,
:root[data-theme="light"] .talents .tal-tier__hd .rn,
:root[data-theme="light"] .clanhub .tag,
:root[data-theme="light"] .clanhub th,
:root[data-theme="light"] .cbpage .role-h h2{color:#6f4a0e}
/* rank pill: light plate, dark digits */
:root[data-theme="light"] .talents .tal-node__rank{background:#f1e7d8;border-color:rgba(176,116,32,.35);color:#241a12}
:root[data-theme="light"] .talents .tal-node__pips i{background:#e4d8c6}
/* branch accent colours readable on cream */
:root[data-theme="light"] .talents{--s:#1c6f96;--b:#b3372a;--h:#4f7a12}
:root[data-theme="light"] .clanhub{--pve:#1c6f96;--pvp:#b3372a;--str:#6b46b8;--ok:#1f6a53}
:root[data-theme="light"] .talents .tal-oc .role,
:root[data-theme="light"] .talents .tal-col__role{color:var(--ac)}
/* header "soon" badge */
:root[data-theme="light"] .hdr-soon{color:#5f5648;border-color:rgba(176,116,32,.35);background:rgba(176,116,32,.08)}
:root[data-theme="light"] .hdr-soon b{color:#a5301f}
:root[data-theme="light"] .hdr-online{color:#2f5f4b;border-color:rgba(31,106,83,.35);background:rgba(31,106,83,.08)}
/* muted text a touch darker */
:root[data-theme="light"]{--text-muted:#5f5648;--text-hint:#6b6156}
:root[data-theme="light"] .talents .tal-note,
:root[data-theme="light"] .talents .tal-legend,
:root[data-theme="light"] .rel__tx small{color:#5f5648}

/* theme-light-pass5 — last contrast offenders */
:root[data-theme="light"] .talents .tal-note b,
:root[data-theme="light"] .talents .tal-build h3,
:root[data-theme="light"] .talents .tal-kicker,
:root[data-theme="light"] .clanhub .crumb,
:root[data-theme="light"] .cbpage .kick{color:#6f4a0e}
:root[data-theme="light"] .hdr-soon b{color:#93291a!important}
:root[data-theme="light"] .hdr-soon{color:#4f463a!important}

/* theme-light-pass6 — link + accent contrast on cream backgrounds */
:root[data-theme="light"] .clanhub{--gold:#8a5f14;--gold-soft:#6f4a0e}
:root[data-theme="light"] .clanhub a{color:#7a5310}
:root[data-theme="light"] .clanhub a:hover{color:#5c3d0b}
:root[data-theme="light"] .clanhub .stage b{color:#93291a}
:root[data-theme="light"] .cbpage a{color:#7a5310}
:root[data-theme="light"] .cbpage a:hover{color:#5c3d0b}
:root[data-theme="light"] .doc-body a,
:root[data-theme="light"] .wiki-footer a{color:#7a5310}

/* theme-light-pass7 — small caption labels */
:root[data-theme="light"] .cbpage{--faint:#5f5648;--muted:#5b5245}
:root[data-theme="light"] .cbpage .cb-chip span,
:root[data-theme="light"] .cbpage .lb-u span,
:root[data-theme="light"] .cbpage .role-n,
:root[data-theme="light"] .cbpage .cb-ov-chip .cn small,
:root[data-theme="light"] .cbpage .cb-ov-race h4 span{color:#5b5245}
:root[data-theme="light"] .cbpage .lb-timer .lbl b{color:#5b5245}
