@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700;800;900&family=Marcellus+SC&family=EB+Garamond:ital,wght@0,500;0,600;1,500&family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --void-1000: #05030a;
  --void-900: #0a0714;
  --void-800: #110a22;
  --void-700: #1a1130;
  --void-600: #241a44;
  --arcane-700: #3d1a85;
  --arcane-600: #5c2bb5;
  --arcane-500: #7a3fd6;
  --arcane-400: #9a64eb;
  --arcane-300: #b78fff;
  --glacial-400: #5cb0ff;
  --glacial-300: #8fd0ff;
  --gold-600: #c89530;
  --gold-500: #e8b850;
  --gold-400: #f3cf78;
  --silver-700: #5a6371;
  --silver-600: #8590a0;
  --silver-500: #b3bcc8;
  --silver-400: #d4dae3;
  --silver-300: #e8ecf2;
  --silver-200: #f4f6fa;
  --crimson-400: #e54a5e;
  --bg-page: radial-gradient(120% 80% at 50% -10%, #241a44 0%, #110a22 45%, #05030a 100%);
  --border-subtle: rgba(180, 145, 255, 0.12);
  --border-default: rgba(180, 145, 255, 0.22);
  --border-strong: rgba(180, 145, 255, 0.42);
  --border-gold: rgba(232, 184, 80, 0.55);
  --inset-arcane: inset 0 0 0 1px rgba(122, 63, 214, 0.25), inset 0 1px 0 rgba(212, 184, 255, 0.06);
  --inset-gold: inset 0 0 0 1px rgba(232, 184, 80, 0.45), inset 0 1px 0 rgba(247, 224, 166, 0.20);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(180, 145, 255, 0.06) inset;
  --shadow-3: 0 12px 32px rgba(0, 0, 0, 0.70), 0 1px 0 rgba(180, 145, 255, 0.08) inset;
  --glow-arcane: 0 0 24px rgba(122, 63, 214, 0.45);
  --glow-gold: 0 0 18px rgba(232, 184, 80, 0.48);
  --font-display: "Cinzel", "Times New Roman", serif;
  --font-smallcaps: "Marcellus SC", "Cinzel", serif;
  --font-serif: "EB Garamond", Georgia, serif;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg-page);
  color: var(--silver-200);
  font-family: var(--font-ui);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.wiki-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.wiki-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 24px;
  overflow: auto;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(122, 63, 214, 0.22), transparent 64%),
    rgba(10, 7, 20, 0.92);
  border-right: 1px solid var(--border-default);
}

.wiki-sidebar::after {
  content: "";
  display: block;
  width: 160px;
  height: 160px;
  margin: 28px auto 0;
  background: url("/assets/brand/marks/rune-circle.svg") center / contain no-repeat;
  opacity: 0.08;
}

.wiki-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
  color: var(--silver-200);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-decoration: none;
  text-transform: uppercase;
}

.wiki-brand::before {
  content: "";
  width: 34px;
  height: 34px;
  background: url("/assets/brand/marks/mark-sigil.svg") center / contain no-repeat;
  filter: drop-shadow(0 0 14px rgba(92, 176, 255, 0.34));
}

.wiki-nav {
  display: grid;
  gap: 7px;
}

.wiki-nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 11px 13px;
  border-radius: 4px;
  color: var(--silver-500);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.18s, background 0.18s, box-shadow 0.18s;
}

.wiki-nav a:hover,
.wiki-nav a.active {
  color: var(--silver-200);
  background: rgba(36, 26, 68, 0.76);
  box-shadow: inset 0 0 0 1px var(--border-default);
}

.wiki-nav a.active {
  color: var(--gold-400);
  box-shadow: inset 0 0 0 1px var(--border-gold), var(--glow-gold);
}

.nav-section {
  display: block;
  margin-top: 8px;
  padding: 7px 13px 2px;
  color: var(--arcane-300);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}

.wiki-content {
  width: min(1160px, 100%);
  padding: 58px clamp(22px, 6vw, 78px) 80px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--arcane-300);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: clamp(42px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h2 {
  margin: 52px 0 18px;
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h2::after {
  content: "";
  display: block;
  width: min(420px, 70vw);
  height: 18px;
  margin-top: 16px;
  background: url("/assets/brand/marks/divider-diamond.svg") left center / contain no-repeat;
  opacity: 0.8;
}

p,
li {
  color: var(--silver-500);
}

p {
  font-family: var(--font-serif);
  font-size: 17px;
}

.summary {
  max-width: 800px;
  color: var(--silver-400);
  font-family: var(--font-serif);
  font-size: 22px;
  font-style: italic;
}

.lead-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 10px;
}

.pill-link,
.tag {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--glacial-300);
  background: rgba(17, 10, 34, 0.78);
  box-shadow: inset 0 0 0 1px var(--border-default);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
}

.pill-link:hover {
  color: var(--silver-200);
  box-shadow: inset 0 0 0 1px var(--glacial-400), 0 0 18px rgba(92, 176, 255, 0.24);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 32px 0;
}

.info-card,
.callout,
table,
.content-card,
.npc-card,
.route-card {
  border-radius: 6px;
  background: rgba(17, 10, 34, 0.92);
  box-shadow: var(--inset-arcane), var(--shadow-2);
}

.info-card {
  padding: 22px;
}

.info-card strong {
  display: block;
  color: var(--gold-400);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.info-card span {
  color: var(--silver-500);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.callout {
  padding: 20px 22px;
  border-left: 3px solid var(--gold-500);
  color: var(--silver-400);
  font-family: var(--font-serif);
  font-size: 18px;
}

.content-grid,
.npc-grid,
.route-grid,
.media-grid,
.set-grid {
  display: grid;
  gap: 16px;
  margin: 22px 0;
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.npc-grid,
.route-grid,
.media-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.set-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-card,
.npc-card,
.route-card,
.media-card,
.set-card {
  padding: 22px;
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.2s;
}

.content-card:hover,
.npc-card:hover,
.route-card:hover,
.media-card:hover,
.set-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--inset-arcane), var(--shadow-3), var(--glow-arcane);
}

.content-card h3,
.npc-card h3,
.route-card h3,
.media-card h3,
.set-card h3 {
  margin: 0 0 8px;
  color: var(--silver-200);
  font-family: var(--font-smallcaps);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.subsection-title {
  margin: 30px 0 12px;
  color: var(--gold-400);
  font-family: var(--font-smallcaps);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.content-card p,
.npc-card p,
.route-card p,
.media-card p,
.set-card p {
  margin: 0;
}

.media-card,
.set-card {
  border-radius: 6px;
  background: rgba(17, 10, 34, 0.92);
  box-shadow: var(--inset-arcane), var(--shadow-2);
}

.set-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 0;
}

.set-preview-grid .asset-slot {
  width: 100%;
  height: 92px;
}

.set-preview-grid .asset-slot::before {
  content: "SET";
}

.class-art {
  width: 100%;
  height: 210px;
  margin-bottom: 16px;
}

.class-art::before {
  content: "CLASE";
}

.meta {
  display: block;
  margin-bottom: 12px;
  color: var(--gold-400);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.item-list,
.compact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.item-list li,
.compact-list li {
  padding: 7px 10px;
  border-radius: 4px;
  background: rgba(36, 26, 68, 0.82);
  box-shadow: inset 0 0 0 1px var(--border-subtle);
  color: var(--silver-400);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
}

.loot-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.loot-item {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px 7px 7px;
  border-radius: 4px;
  background: rgba(5, 3, 10, 0.46);
  box-shadow: inset 0 0 0 1px var(--border-subtle);
  color: var(--silver-400);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.loot-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 4px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.38);
  box-shadow: inset 0 0 0 1px rgba(232, 184, 80, 0.18);
}

.asset-slot {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(232, 184, 80, 0.12), transparent 42%),
    rgba(5, 3, 10, 0.72);
  box-shadow: inset 0 0 0 1px rgba(232, 184, 80, 0.24), 0 0 16px rgba(122, 63, 214, 0.16);
  color: var(--gold-400);
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.asset-slot::before {
  content: "IMG";
}

.asset-slot[data-type="jewel"]::before {
  content: "JWL";
}

.asset-slot[data-type="entry"]::before {
  content: "ENT";
}

.asset-slot[data-type="weapon"]::before {
  content: "WPN";
}

.asset-slot[data-type="set"]::before {
  content: "SET";
}

.asset-slot[data-type="wing"]::before {
  content: "ALA";
}

.asset-slot[data-type="pet"]::before {
  content: "PET";
}

.asset-slot[data-type="skill"]::before {
  content: "SKL";
}

.asset-slot[data-type="class"]::before {
  content: "CLS";
}

.asset-slot[data-type="npc"] {
  width: 100%;
  height: 150px;
  margin-bottom: 16px;
}

.asset-slot[data-type="npc"]::before {
  content: "NPC";
}

.asset-slot[data-type="map"] {
  width: 100%;
  height: 180px;
  margin: 14px 0;
  aspect-ratio: 16 / 9;
}

.asset-slot[data-type="map"]::before {
  content: "MAP";
}

.asset-slot[data-type="spot"] {
  width: 100%;
  height: 132px;
  margin-bottom: 14px;
  aspect-ratio: 16 / 9;
}

.asset-slot[data-type="spot"]::before {
  content: "SPOT";
}

.asset-note {
  display: block;
  margin-top: 8px;
  color: var(--silver-600);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.npc-card .loot-strip {
  margin-top: 14px;
}

.map-route {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.map-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 18px;
  border-radius: 6px;
  background: rgba(17, 10, 34, 0.92);
  box-shadow: var(--inset-arcane), var(--shadow-2);
}

.map-row strong {
  color: var(--gold-400);
  font-family: var(--font-smallcaps);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.map-row span {
  color: var(--silver-500);
  font-family: var(--font-serif);
  font-size: 17px;
}

.reward-table td:first-child,
.reward-table th:first-child {
  width: 28%;
}

.reward-table td:nth-child(2),
.reward-table th:nth-child(2) {
  width: 30%;
}

.reward-table .tier {
  color: var(--gold-400);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reference-table {
  min-width: 900px;
}

.item-reference-table td:first-child,
.item-reference-table th:first-child {
  width: 34%;
}

.item-cell {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.item-cell strong {
  display: block;
  color: var(--silver-200);
  font-family: var(--font-smallcaps);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.item-cell small {
  display: block;
  margin-top: 3px;
  color: var(--silver-600);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.item-thumb {
  width: 64px;
  height: 64px;
}

.path-steps {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.path-step {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  border-radius: 6px;
  background: rgba(17, 10, 34, 0.88);
  box-shadow: var(--inset-arcane), var(--shadow-2);
}

.path-step strong {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--gold-400);
  background: rgba(36, 26, 68, 0.92);
  box-shadow: inset 0 0 0 1px var(--border-gold);
  font-family: var(--font-display);
  font-size: 16px;
}

.path-step span {
  color: var(--silver-500);
  font-family: var(--font-serif);
  font-size: 17px;
}

.note {
  color: var(--silver-600);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
}

table {
  width: 100%;
  overflow: hidden;
  border-collapse: collapse;
}

.table-scroll {
  overflow-x: auto;
}

.spot-table {
  min-width: 760px;
}

.skill-table,
.schedule-table {
  min-width: 820px;
}

.skill-table {
  min-width: 980px;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.skill-item .asset-slot {
  width: 38px;
  height: 38px;
}

th,
td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

th {
  color: var(--gold-400);
  background: rgba(36, 26, 68, 0.78);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

td {
  color: var(--silver-500);
  font-family: var(--font-serif);
  font-size: 17px;
}

tr:last-child td {
  border-bottom: 0;
}

code {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(36, 26, 68, 0.86);
  color: var(--glacial-300);
  font-family: var(--font-ui);
  font-size: 0.9em;
}

/* Item catalog */
.item-catalog {
  display: grid;
  gap: 16px;
  margin: 24px 0;
}

.item-entry {
  display: flex;
  gap: 22px;
  padding: 22px;
  border-radius: 6px;
  background: rgba(17, 10, 34, 0.92);
  box-shadow: var(--inset-arcane), var(--shadow-2);
}

.item-portrait {
  flex: 0 0 130px;
  height: 180px;
  border-radius: 4px;
  background: rgba(5, 3, 10, 0.65);
  box-shadow: inset 0 0 0 1px var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.ph-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(36, 26, 68, 0.72);
  box-shadow: inset 0 0 0 1px var(--border-subtle);
}

.ph-label {
  color: var(--silver-700);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.55;
  padding: 0 10px;
}

.item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-body h3 {
  margin: 0;
  color: var(--silver-200);
  font-family: var(--font-smallcaps);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.item-body p {
  margin: 0;
}

.req-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.req-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(36, 26, 68, 0.72);
  color: var(--silver-400);
  font-size: 11px;
  font-weight: 700;
}

.req-tag.cls {
  color: var(--glacial-300);
}

.req-tag.craft {
  color: var(--arcane-300);
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.stat-chip {
  padding: 7px 12px;
  border-radius: 4px;
  background: rgba(36, 26, 68, 0.72);
  color: var(--gold-400);
  font-size: 12px;
  font-weight: 800;
}

.stat-chip em {
  display: block;
  color: var(--silver-700);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-style: normal;
  margin-bottom: 2px;
}

/* =========================================================
   Hero (index.html)
   ========================================================= */
.hero {
  position: relative;
  text-align: center;
  padding: 24px 0 60px;
  overflow: hidden;
  margin-bottom: 8px;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Glowing orbs — animated via CSS custom properties */
.hero-orb {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: var(--s, 200px);
  height: var(--s, 200px);
  border-radius: 50%;
  background: radial-gradient(circle, var(--c, var(--arcane-700)) 0%, transparent 68%);
  transform: translate(-50%, -50%);
  animation: orb-pulse var(--t, 10s) ease-in-out infinite var(--d, 0s);
  opacity: 0;
}

@keyframes orb-pulse {
  0%, 100% { opacity: 0;    transform: translate(-50%, -50%) scale(0.75); }
  50%       { opacity: var(--op, 0.18); transform: translate(-50%, -50%) scale(1.1); }
}

/* Logo area — PNG goes here when ready */
.hero-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 90px;
  margin-bottom: 28px;
}

.hero-logo {
  max-width: 320px;
  max-height: 110px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 22px rgba(122, 63, 214, 0.45));
}

/* Shown when the PNG file doesn't exist yet */
.hero-logo-wrap.logo-missing {
  border: 1px dashed var(--border-subtle);
  border-radius: 4px;
  padding: 16px 48px;
  color: var(--silver-700);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-logo-wrap.logo-missing::after {
  content: "Logo · pendiente PNG";
}

.hero h1 {
  margin-bottom: 14px;
}

.hero-lead {
  max-width: 500px;
  margin: 0 auto 32px;
  color: var(--silver-500);
  font-size: 17px;
  line-height: 1.62;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  padding: 13px 32px;
  background: linear-gradient(135deg, var(--arcane-600), var(--arcane-700));
  color: var(--silver-200);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  box-shadow: var(--inset-arcane), var(--shadow-2);
  transition: background 0.2s, box-shadow 0.2s;
}

.hero-cta:hover {
  background: linear-gradient(135deg, var(--arcane-500), var(--arcane-600));
  box-shadow: var(--inset-arcane), var(--glow-arcane), var(--shadow-3);
}

/* =========================================================
   Wiki section navigation map (index.html)
   ========================================================= */
.wiki-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0 0;
}

.wiki-map-card {
  display: block;
  padding: 20px 18px;
  border-radius: 6px;
  background: rgba(17, 10, 34, 0.92);
  box-shadow: var(--inset-arcane), var(--shadow-2);
  text-decoration: none;
  transition: background 0.18s, box-shadow 0.18s;
}

.wiki-map-card:hover {
  background: rgba(36, 26, 68, 0.88);
  box-shadow: var(--inset-arcane), 0 0 20px rgba(122, 63, 214, 0.24), var(--shadow-3);
}

.wiki-map-card .meta {
  color: var(--arcane-300);
  margin-bottom: 5px;
}

.wiki-map-card h3 {
  margin: 0 0 5px;
  font-family: var(--font-smallcaps);
  font-size: 16px;
  font-weight: 400;
  color: var(--silver-200);
  letter-spacing: 0.04em;
}

.wiki-map-card p {
  margin: 0;
  font-size: 12px;
  color: var(--silver-600);
  line-height: 1.55;
}

/* Hamburger toggle — hidden on desktop, shown via media query */
.nav-toggle {
  display: none;
}

.nav-overlay {
  display: none;
}

@media (max-width: 900px) {
  .wiki-shell {
    display: block;
  }

  /* Sidebar becomes a fixed thin top bar */
  .wiki-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 100;
    overflow: hidden;
    padding: 0 16px;
    display: flex;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border-default);
  }

  .wiki-sidebar::after {
    display: none;
  }

  .wiki-brand {
    flex: 1;
    margin-bottom: 0;
  }

  /* Nav hidden by default on mobile */
  .wiki-nav {
    display: none;
  }

  /* Push content below the fixed top bar */
  .wiki-content {
    margin-top: 56px;
  }

  /* ---- Open state: sidebar becomes a left drawer ---- */
  .wiki-shell.nav-open .wiki-sidebar {
    width: 280px;
    right: auto;
    height: 100vh;
    overflow-y: auto;
    padding: 20px 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .wiki-shell.nav-open .wiki-brand {
    flex: none;
    width: 100%;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .wiki-shell.nav-open .wiki-nav {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  /* Semi-transparent overlay behind the drawer */
  .wiki-shell.nav-open .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    z-index: 99;
    cursor: pointer;
  }

  /* ---- Hamburger button ---- */
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 9px 8px;
    width: 40px;
    height: 40px;
    background: rgba(36, 26, 68, 0.72);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.18s;
  }

  .nav-toggle:hover {
    background: rgba(60, 40, 100, 0.88);
  }

  .nav-toggle span {
    display: block;
    height: 2px;
    background: var(--silver-400);
    border-radius: 2px;
    transition: transform 0.22s ease, opacity 0.18s;
  }

  /* Hamburger → X animation when open */
  .wiki-shell.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .wiki-shell.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  .wiki-shell.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .wiki-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    padding: 16px 0 44px;
  }

  /* ---- Content layout — collapse grids to single column ---- */
  .info-grid,
  .content-grid,
  .npc-grid,
  .route-grid,
  .media-grid,
  .set-grid,
  .map-row,
  .path-step {
    grid-template-columns: 1fr;
  }

  .item-entry {
    flex-direction: column;
  }

  .item-portrait {
    flex: 0 0 auto;
    width: 100%;
    height: 110px;
  }

  .set-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .wiki-content {
    padding-inline: 18px;
  }

  .summary {
    font-size: 20px;
  }

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

  .hero-lead {
    font-size: 15px;
  }
}
