﻿/* ═══════════════════════════════════════════════════════
   BARD'S QUEST WIKI - Design System v2
   Dark forest green + gold accents, modern glassmorphism
   Font: Cinzel serif (same as game UI)
   ═══════════════════════════════════════════════════════ */

/* ── Imports ── */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&display=swap');

/* ── Token Architecture ── */
:root {
  /* Surfaces - dark green elevation scale */
  --bg-deepest:    #0a0f0d;
  --bg-base:       #0f1c19;
  --bg-panel:      #141f1b;
  --bg-elevated:   #1a2a24;
  --bg-hover:      #1f332b;
  --bg-input:      rgba(10, 15, 13, 0.55);

  /* Brand - forest green + gold */
  --green-deep:    #01371A;
  --green-accent:  #025026;
  --green-bright:  #036b33;
  --gold:          #ffcc00;
  --gold-hover:    #ffd633;
  --gold-dim:      rgb(255 204 0 / 0.18);
  --gold-subtle:   rgb(255 204 0 / 0.08);
  --gold-border:   rgb(255 204 0 / 0.18);
  --gold-focus:    rgb(255 204 0 / 0.45);

  /* Text hierarchy */
  --text-primary:  #f2f4f1;
  --text-secondary:#c8cfc9;
  --text-muted:    #a6b3ad;
  --text-dim:      #6b7d74;
  --text-dark:     #1b1407;

  /* Semantic */
  --danger:        #e25a4f;
  --warning:       #f0a64b;
  --success:       #4ad67b;
  --mmp-purple:    #9b59b6;
  --funk-magenta:  #ff00ff;

  /* Rarity */
  --rarity-common:    #9e9e9e;
  --rarity-uncommon:  #4CAF50;
  --rarity-rare:      #2196F3;
  --rarity-epic:      #9C27B0;
  --rarity-legendary: #FF9800;
  --rarity-mythic:    #E91E63;

  /* Note colors */
  --note-c:  #4CAF50;  --note-cs: #388E3C;
  --note-d:  #2196F3;  --note-ds: #1976D2;
  --note-e:  #FFEB3B;  --note-f:  #F44336;
  --note-fs: #E91E63;  --note-g:  #9C27B0;
  --note-gs: #7B1FA2;  --note-a:  #FF9800;
  --note-as: #FF5722;  --note-b:  #00BCD4;

  /* Spacing - 8px base */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);
  --shadow-gold: 0 0 20px rgb(255 204 0 / 0.15);

  /* Layout */
  --wiki-max-width: 1200px;
  --sidebar-width: 260px;
  --header-height: 64px;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scrollbar-color: var(--bg-elevated) var(--bg-base);
}

body {
  font-family: 'Cinzel', serif;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-deepest);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Wiki SPA shell aligns with the main site visual treatment */
body.wiki-spa-page {
  background:
    linear-gradient(135deg, rgb(6 10 8 / 0.88) 0%, rgb(0 0 0 / 0.94) 100%),
    url('../src/backg.png');
  background-repeat: repeat;
  background-size: 500px;
  background-blend-mode: overlay;
}

.wiki-spa-page #vanta-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.58;
  filter: saturate(0.9) brightness(0.75);
}

.wiki-spa-page > *:not(script):not(#vanta-bg) {
  position: relative;
  z-index: 1;
}

.wiki-spa-page .nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-6);
  z-index: 1100;
  background: rgb(6 10 8 / 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgb(226 183 20 / 0.2);
}

.wiki-spa-page .nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
}

.wiki-spa-page .nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.wiki-spa-page .nav-links a {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
  text-decoration: none;
}

.wiki-spa-page .nav-links a:hover,
.wiki-spa-page .nav-links a.active {
  color: var(--gold);
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--bg-hover); }

/* ── Background atmosphere - vanta fog + deep forest ── */
.wiki-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 20% 0%, rgb(2 80 38 / 0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgb(1 55 26 / 0.14) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 30%, rgb(0 40 20 / 0.1) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, var(--bg-base) 0%, var(--bg-deepest) 100%);
  overflow: hidden;
}
.wiki-bg::before,
.wiki-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* Fog layer 1 - slow drift */
.wiki-bg::before {
  background:
    radial-gradient(ellipse 600px 200px at 15% 20%, rgb(2 80 38 / 0.09) 0%, transparent 100%),
    radial-gradient(ellipse 500px 180px at 75% 60%, rgb(1 55 26 / 0.07) 0%, transparent 100%),
    radial-gradient(ellipse 700px 250px at 50% 80%, rgb(3 107 51 / 0.06) 0%, transparent 100%);
  animation: fogDrift1 30s ease-in-out infinite alternate;
}
/* Fog layer 2 - counter drift */
.wiki-bg::after {
  background:
    radial-gradient(ellipse 550px 220px at 80% 15%, rgb(2 80 38 / 0.07) 0%, transparent 100%),
    radial-gradient(ellipse 450px 160px at 25% 70%, rgb(1 55 26 / 0.06) 0%, transparent 100%),
    radial-gradient(ellipse 600px 200px at 55% 40%, rgb(3 107 51 / 0.05) 0%, transparent 100%);
  animation: fogDrift2 25s ease-in-out infinite alternate;
}
@keyframes fogDrift1 {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.8; }
  50%  { transform: translate(30px, -15px) scale(1.05); opacity: 1; }
  100% { transform: translate(-20px, 10px) scale(0.98); opacity: 0.7; }
}
@keyframes fogDrift2 {
  0%   { transform: translate(0, 0) scale(1.02); opacity: 0.6; }
  50%  { transform: translate(-25px, 12px) scale(0.97); opacity: 0.9; }
  100% { transform: translate(18px, -8px) scale(1.04); opacity: 0.7; }
}
/* Vignette overlay on main content */
.wiki-main::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgb(10 15 13 / 0.4) 100%);
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Cinzel', serif;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: 0.02em;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 30px rgb(255 204 0 / 0.2);
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gold);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--gold-dim);
  margin-bottom: var(--sp-5);
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

h4 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

p {
  color: var(--text-secondary);
  margin-bottom: var(--sp-4);
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--gold-hover);
  text-decoration: underline;
}

/* ── Layout ── */
.wiki-layout {
  display: flex;
  min-height: 100vh;
}

.wiki-spa-page .wiki-layout {
  padding-top: 76px;
}

.wiki-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-panel);
  border-right: 1px solid var(--gold-dim);
  overflow-y: auto;
  z-index: 100;
  padding: var(--sp-5) 0;
  display: flex;
  flex-direction: column;
}

.wiki-spa-page .wiki-sidebar {
  top: 0;
  bottom: 0;
  height: 100vh;
  min-height: 100vh;
  padding-top: calc(76px + var(--sp-4));
}

.wiki-sidebar-logo {
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
  text-align: center;
}

.wiki-sidebar-logo h2 {
  font-size: 1.1rem;
  color: var(--gold);
  border: none;
  padding: 0;
  margin: 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wiki-sidebar-logo .subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: var(--sp-1);
}

.wiki-sidebar nav {
  flex: 1;
  padding: 0 var(--sp-3);
}

.sidebar-section {
  margin-bottom: var(--sp-5);
}

.sidebar-section-title {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-1);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
}

.sidebar-link:hover {
  background: var(--gold-subtle);
  color: var(--gold);
  text-decoration: none;
}

.sidebar-link.active {
  background: rgb(255 204 0 / 0.12);
  color: var(--gold);
  border: 1px solid var(--gold-focus);
}

.sidebar-link .icon {
  width: 20px;
  text-align: center;
  font-size: 0.9rem;
}

.wiki-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: var(--sp-7) var(--sp-7) var(--sp-8);
  max-width: calc(var(--wiki-max-width) + var(--sidebar-width));
}

/* ── Header bar ── */
.wiki-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-7);
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--gold-dim);
}

.wiki-header .breadcrumb {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.wiki-header .breadcrumb a {
  color: var(--text-muted);
}

/* ── Search ── */
.wiki-search {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.wiki-search input {
  width: 100%;
  padding: var(--sp-2) var(--sp-4);
  padding-left: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--gold-dim);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  outline: none;
}

.wiki-search input:focus {
  border-color: var(--gold-focus);
  box-shadow: 0 0 0 3px rgb(255 204 0 / 0.12);
}

.wiki-search input::placeholder {
  color: var(--text-dim);
}

.wiki-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.85rem;
  pointer-events: none;
}

/* ── Cards ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--sp-3);
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-xl);
  padding: var(--sp-5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
}

.card:hover {
  border-color: var(--gold-focus);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), var(--shadow-gold);
  text-decoration: none;
  color: inherit;
}

.card-icon {
  font-size: 1.8rem;
  margin-bottom: var(--sp-3);
  display: block;
}

.card h3 {
  margin-bottom: var(--sp-2);
}

.card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.card .card-count {
  display: inline-block;
  margin-top: var(--sp-3);
  font-size: 0.7rem;
  color: var(--text-dim);
  background: var(--bg-elevated);
  padding: 2px var(--sp-2);
  border-radius: var(--radius-pill);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Panels / Content Boxes ── */
.panel {
  background: linear-gradient(180deg, rgb(20 31 27 / 0.85) 0%, rgb(15 28 25 / 0.95) 100%);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-xl);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(255 204 0 / 0.3), transparent);
}

.panel-glass {
  background: rgb(20 31 27 / 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-xl);
  padding: var(--sp-5);
}

/* ── Tables ── */
.wiki-table-wrap {
  overflow-x: auto;
  margin-bottom: var(--sp-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gold-dim);
  background: rgb(10 15 13 / 0.5);
  backdrop-filter: blur(4px);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead {
  background: linear-gradient(180deg, var(--bg-elevated), rgb(26 42 36 / 0.8));
}

th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--gold-dim);
  white-space: nowrap;
}

td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid rgb(255 204 0 / 0.06);
  color: var(--text-secondary);
  vertical-align: top;
}

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

tbody tr {
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: rgb(255 204 0 / 0.06);
}

/* ── Rarity badges ── */
.rarity {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.rarity-common    { color: var(--rarity-common);    background: rgb(158 158 158 / 0.12); border: 1px solid rgb(158 158 158 / 0.25); }
.rarity-uncommon  { color: var(--rarity-uncommon);  background: rgb(76 175 80 / 0.12);   border: 1px solid rgb(76 175 80 / 0.25); }
.rarity-rare      { color: var(--rarity-rare);      background: rgb(33 150 243 / 0.12);  border: 1px solid rgb(33 150 243 / 0.25); }
.rarity-epic      { color: var(--rarity-epic);      background: rgb(156 39 176 / 0.12);  border: 1px solid rgb(156 39 176 / 0.25); }
.rarity-legendary { color: var(--rarity-legendary); background: rgb(255 152 0 / 0.12);   border: 1px solid rgb(255 152 0 / 0.25); }
.rarity-mythic    { color: var(--rarity-mythic);    background: rgb(233 30 99 / 0.12);   border: 1px solid rgb(233 30 99 / 0.25); }

/* ── Tier badges ── */
.tier {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 1px solid var(--gold-dim);
  color: var(--text-muted);
  background: var(--bg-elevated);
}

/* ── Stat pills ── */
.stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid rgb(255 204 0 / 0.08);
}

.stat-hp      { color: var(--danger); }
.stat-atk     { color: var(--warning); }
.stat-def     { color: var(--rarity-rare); }
.stat-spd     { color: var(--success); }
.stat-gold    { color: var(--gold); }
.stat-mmp     { color: var(--mmp-purple); }

/* ── Tabs / Filters ── */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid rgb(255 204 0 / 0.08);
}

.tab {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-pill);
  background: rgb(20 31 27 / 0.7);
  color: var(--text-muted);
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.tab:hover {
  background: var(--gold-subtle);
  color: var(--gold);
  text-decoration: none;
}

.tab.active {
  color: var(--gold);
  border-color: var(--gold-focus);
  background: rgb(255 204 0 / 0.12);
}

/* ── Infobox (sidebar-style detail card) ── */
.infobox {
  background: var(--bg-panel);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-5);
  max-width: 340px;
  float: right;
  margin-left: var(--sp-5);
}

.infobox h4 {
  text-align: center;
  color: var(--gold);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--gold-dim);
}

.infobox-row {
  display: flex;
  justify-content: space-between;
  padding: var(--sp-1) 0;
  font-size: 0.82rem;
  border-bottom: 1px solid rgb(255 204 0 / 0.06);
}

.infobox-row:last-child { border-bottom: none; }

.infobox-label {
  color: var(--text-muted);
  font-weight: 500;
}

.infobox-value {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
}

/* ── Boss phase bars ── */
.phase-bar {
  display: flex;
  gap: 2px;
  height: 6px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: var(--sp-2) 0;
}

.phase-bar .phase {
  flex: 1;
  border-radius: var(--radius-pill);
}

.phase-bar .phase-1 { background: var(--success); }
.phase-bar .phase-2 { background: var(--warning); }
.phase-bar .phase-3 { background: var(--danger); }
.phase-bar .phase-4 { background: var(--mmp-purple); }

/* ── Interval / Note display ── */
.interval-display {
  display: inline-flex;
  gap: 3px;
  flex-wrap: wrap;
}

.interval-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid rgb(255 204 0 / 0.15);
  color: var(--text-secondary);
}

/* ── Drop chance bar ── */
.drop-chance {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8rem;
}

.drop-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius-pill);
  overflow: hidden;
  max-width: 80px;
}

.drop-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--gold);
}

/* ── Section anchors ── */
.section-anchor {
  display: block;
  position: relative;
  top: -80px;
  visibility: hidden;
}

/* ── Utility ── */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.fw-600 { font-weight: 600; }
.text-center { text-align: center; }
.clearfix::after { content: ''; display: table; clear: both; }

/* ═══════════════════════════════════════════════════════
   STAGGER REVEAL ANIMATION
   ═══════════════════════════════════════════════════════ */

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmerGold {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 8px rgb(255 204 0 / 0.08); }
  50% { box-shadow: 0 0 20px rgb(255 204 0 / 0.2); }
}

@keyframes borderTrace {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.wiki-main h1 {
  animation: fadeSlideUp 0.5s ease-out both;
}

.wiki-main h2 {
  animation: fadeSlideUp 0.4s ease-out both;
}

/* ── Hero section (index page) ── */
.wiki-hero {
  text-align: center;
  padding: var(--sp-7) 0 var(--sp-6);
  position: relative;
}

.wiki-hero h1 {
  font-size: 2.6rem;
  margin-bottom: var(--sp-3);
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--gold) 0%, #fff8dc 40%, var(--gold) 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerGold 4s linear infinite, fadeSlideUp 0.6s ease-out both;
}

.wiki-hero .hero-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: var(--sp-3) auto 0;
  animation: fadeSlideUp 0.6s ease-out 0.1s both;
}

.wiki-hero .tagline {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto var(--sp-5);
}

.wiki-hero .hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--sp-6);
  margin-top: var(--sp-5);
}

.hero-stat {
  text-align: center;
}

.hero-stat .number {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
}

.hero-stat .label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Home Grid ── */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-6);
}
.home-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-5) var(--sp-4);
  background: linear-gradient(180deg, rgb(20 31 27 / 0.7) 0%, rgb(10 15 13 / 0.8) 100%);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-xl);
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  animation: fadeSlideUp 0.4s ease-out both;
}
.home-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgb(255 204 0 / 0.04) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.home-card:hover::before {
  opacity: 1;
}
.home-card:hover {
  border-color: var(--gold-focus);
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    0 12px 40px rgb(0 0 0 / 0.4),
    0 0 30px rgb(255 204 0 / 0.1),
    inset 0 1px 0 rgb(255 204 0 / 0.15);
  color: var(--text-primary);
  text-decoration: none;
}
/* Stagger children */
.home-card:nth-child(1)  { animation-delay: 0.05s; }
.home-card:nth-child(2)  { animation-delay: 0.1s; }
.home-card:nth-child(3)  { animation-delay: 0.15s; }
.home-card:nth-child(4)  { animation-delay: 0.2s; }
.home-card:nth-child(5)  { animation-delay: 0.25s; }
.home-card:nth-child(6)  { animation-delay: 0.3s; }
.home-card:nth-child(7)  { animation-delay: 0.35s; }
.home-card:nth-child(8)  { animation-delay: 0.4s; }
.home-card:nth-child(9)  { animation-delay: 0.45s; }
.home-card:nth-child(10) { animation-delay: 0.5s; }
.home-card:nth-child(11) { animation-delay: 0.55s; }

.home-icon {
  font-size: 2rem;
  transition: transform 0.35s ease;
  filter: drop-shadow(0 0 6px rgb(255 204 0 / 0.15));
}
.home-card:hover .home-icon {
  transform: scale(1.2);
}
.home-label { font-weight: 600; font-size: 0.95rem; color: var(--gold); }
.home-count { font-size: 0.72rem; color: var(--text-dim); }

/* ── Item detail cards ── */
.item-card {
  background: var(--bg-panel);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  transition: all 0.2s ease;
}

.item-card:hover {
  border-color: var(--gold-focus);
  box-shadow: var(--shadow-gold);
}

.item-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
}

.item-card-header h4 {
  color: var(--text-primary);
  font-weight: 600;
}

.item-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.item-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: var(--sp-2);
}

/* ── Boss detail sections ── */
.boss-section {
  background: var(--bg-panel);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  margin-bottom: var(--sp-6);
}

.boss-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--sp-5);
  gap: var(--sp-5);
}

.boss-title h3 {
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: var(--sp-1);
}

.boss-title .boss-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.boss-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--sp-3);
}

.boss-stat-item {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  text-align: center;
}

.boss-stat-item .value {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.boss-stat-item .label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Quest timeline ── */
.quest-act {
  margin-bottom: var(--sp-6);
}

.quest-act-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.quest-act-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgb(255 204 0 / 0.12);
  border: 1px solid var(--gold-focus);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.quest-list {
  list-style: none;
  padding-left: 18px;
  border-left: 2px solid var(--gold-dim);
}

.quest-list li {
  position: relative;
  padding: var(--sp-2) 0 var(--sp-2) var(--sp-5);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.quest-list li::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--gold-dim);
}

/* ── Map region cards ── */
.region-card {
  background: var(--bg-panel);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
}

.region-card h4 {
  color: var(--gold);
  margin-bottom: var(--sp-2);
}

.region-maps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.region-map-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid rgb(255 204 0 / 0.08);
}

/* ── Back to top ── */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  left: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 200;
  text-decoration: none;
}

.wiki-spa-page .back-to-top {
  right: 24px;
  left: auto;
}

.back-to-top:hover {
  background: rgb(255 204 0 / 0.12);
  border-color: var(--gold-focus);
  transform: translateY(-2px);
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════
   SPA ADDITIONS - Tooltips, Search, Entity Cards, Details
   ═══════════════════════════════════════════════════════ */

/* ── Wiki Link styling ── */
.wiki-link {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px dotted var(--gold-dim);
  transition: all 0.2s ease;
}
.wiki-link:hover {
  color: var(--gold-hover);
  border-bottom-color: var(--gold);
  text-decoration: none;
  text-shadow: 0 0 8px rgb(255 204 0 / 0.3);
}

/* ── Rarity Badge (SPA version) ── */
.rarity-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.rarity-badge.rarity-common    { color: var(--rarity-common);    background: rgb(158 158 158 / 0.12); border: 1px solid rgb(158 158 158 / 0.25); }
.rarity-badge.rarity-uncommon  { color: var(--rarity-uncommon);  background: rgb(76 175 80 / 0.12);   border: 1px solid rgb(76 175 80 / 0.25); }
.rarity-badge.rarity-rare      { color: var(--rarity-rare);      background: rgb(33 150 243 / 0.12);  border: 1px solid rgb(33 150 243 / 0.25); }
.rarity-badge.rarity-epic      { color: var(--rarity-epic);      background: rgb(156 39 176 / 0.12);  border: 1px solid rgb(156 39 176 / 0.25); }
.rarity-badge.rarity-legendary { color: var(--rarity-legendary); background: rgb(255 152 0 / 0.12);   border: 1px solid rgb(255 152 0 / 0.25); }
.rarity-badge.rarity-mythic    { color: var(--rarity-mythic);    background: rgb(233 30 99 / 0.12);   border: 1px solid rgb(233 30 99 / 0.25); }

/* ── Tooltip / Hover Card ── */
.wiki-tooltip {
  position: fixed;
  z-index: 10000;
  max-width: 320px;
  padding: var(--sp-4);
  background: rgb(14 22 19 / 0.95);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  backdrop-filter: blur(16px);
  pointer-events: none;
  font-size: 0.82rem;
  line-height: 1.5;
  animation: fadeSlideUp 0.15s ease-out;
}
.tt-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}
.tt-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  image-rendering: pixelated;
}
.tt-header .lpc-sprite-frame.lpc-sprite-sm,
.tt-header .strip-sprite-frame.strip-sprite-sm {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
}
.tt-header .lpc-sprite-frame.lpc-sprite-sm .lpc-sprite-window {
  transform: scale(0.75);
  transform-origin: 0 0;
}
.tt-name {
  font-weight: 700;
  color: var(--gold);
  font-size: 0.9rem;
}
.tt-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.tt-stats {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: var(--sp-2) 0;
  padding: var(--sp-1) var(--sp-2);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}
.tt-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: var(--sp-2);
}

/* ── Search (SPA) ── */
.search-container {
  position: relative;
  max-width: 480px;
  margin: var(--sp-5) auto 0;
  animation: fadeSlideUp 0.5s ease-out 0.2s both;
}
.search-input {
  width: 100%;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-pill);
  border: 1px solid var(--gold-dim);
  background: rgb(10 15 13 / 0.55);
  color: var(--text-primary);
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  outline: none;
  backdrop-filter: blur(8px);
}
.search-input:focus {
  border-color: var(--gold-focus);
  box-shadow: 0 0 0 3px rgb(255 204 0 / 0.12), 0 0 20px rgb(255 204 0 / 0.08);
}
.search-input::placeholder { color: var(--text-dim); }

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgb(14 22 19 / 0.95);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  margin-top: var(--sp-2);
  max-height: 400px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  display: none;
  backdrop-filter: blur(16px);
}
.search-result {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
  border-bottom: 1px solid rgb(255 204 0 / 0.04);
}
.search-result:hover {
  background: rgb(255 204 0 / 0.08);
  color: var(--text-primary);
  text-decoration: none;
  padding-left: calc(var(--sp-4) + 4px);
}
.search-result .search-icon { font-size: 1rem; width: 24px; text-align: center; }
.search-result .search-name { flex: 1; font-weight: 500; }
.search-result .search-type {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.search-no-results {
  padding: var(--sp-4);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ── Entity Card Grid ── */
.entity-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgb(20 31 27 / 0.8) 0%, rgb(10 15 13 / 0.9) 100%);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  animation: fadeSlideUp 0.4s ease-out both;
}
.entity-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 0%, rgb(255 204 0 / 0.03) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.entity-card:hover {
  border-color: var(--gold-focus);
  transform: translateY(-5px);
  box-shadow:
    0 16px 48px rgb(0 0 0 / 0.5),
    0 0 24px rgb(255 204 0 / 0.1);
  text-decoration: none;
  color: inherit;
}
.entity-card:hover::after {
  opacity: 1;
}

/* Stagger entity cards */
.card-grid .entity-card:nth-child(1)  { animation-delay: 0.03s; }
.card-grid .entity-card:nth-child(2)  { animation-delay: 0.06s; }
.card-grid .entity-card:nth-child(3)  { animation-delay: 0.09s; }
.card-grid .entity-card:nth-child(4)  { animation-delay: 0.12s; }
.card-grid .entity-card:nth-child(5)  { animation-delay: 0.15s; }
.card-grid .entity-card:nth-child(6)  { animation-delay: 0.18s; }
.card-grid .entity-card:nth-child(7)  { animation-delay: 0.21s; }
.card-grid .entity-card:nth-child(8)  { animation-delay: 0.24s; }
.card-grid .entity-card:nth-child(9)  { animation-delay: 0.27s; }
.card-grid .entity-card:nth-child(10) { animation-delay: 0.3s; }
.card-grid .entity-card:nth-child(11) { animation-delay: 0.33s; }
.card-grid .entity-card:nth-child(12) { animation-delay: 0.36s; }

.card-img {
  width: 100%;
  height: 64px;
  object-fit: contain;
  background: var(--bg-elevated);
  padding: var(--sp-3);
  image-rendering: pixelated;
}
.card-img-placeholder {
  width: 100%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, rgb(10 15 13 / 0.8) 100%);
  color: var(--text-dim);
}
.card-body {
  padding: var(--sp-2) var(--sp-3);
}
.card-name {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--gold);
}
.card-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.card-stats {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: var(--sp-1);
}

/* ── Detail Pages ── */
.detail-header {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.detail-sprite {
  width: 96px;
  height: 96px;
  object-fit: contain;
  image-rendering: pixelated;
  background: var(--bg-elevated);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  padding: var(--sp-2);
}
.boss-sprite {
  width: 128px;
  height: 128px;
}
.detail-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: var(--sp-4);
}
.detail-grid {
  display: grid;
  gap: var(--sp-5);
}
.detail-main { max-width: 100%; }

/* ── Stat Block ── */
.stat-block {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.stat-block .stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-2) var(--sp-4);
  background: linear-gradient(180deg, var(--bg-elevated), rgb(20 31 27 / 0.6));
  border: 1px solid rgb(255 204 0 / 0.1);
  border-radius: var(--radius-md);
  min-width: 80px;
  transition: all 0.2s ease;
}
.stat-block .stat:hover {
  border-color: rgb(255 204 0 / 0.25);
  background: linear-gradient(180deg, var(--bg-hover), var(--bg-elevated));
}
.stat-block .stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-block .stat-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: var(--sp-5);
}
.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--gold); }

/* ── Back Link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-5);
}
.back-link:hover { color: var(--gold); }

/* ── Quest Type Badges ── */
.quest-main {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
}
.quest-side {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid rgb(255 204 0 / 0.08);
}

/* ── Phase Entries (Boss Detail) ── */
.phase-entry {
  margin-bottom: var(--sp-4);
  padding: var(--sp-3);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--gold-dim);
}
.phase-entry h4 {
  margin-bottom: var(--sp-2);
  color: var(--gold);
}

/* ═══════════════════════════════════════════════════════
   SYSTEM PAGES - Modern Accordion + Visual Hierarchy
   ═══════════════════════════════════════════════════════ */

/* ── System Detail Page ── */
.system-detail-header {
  text-align: center;
  padding: var(--sp-6) var(--sp-5);
  margin-bottom: var(--sp-6);
  background: linear-gradient(180deg, rgb(20 31 27 / 0.6) 0%, transparent 100%);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}
.system-detail-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgb(255 204 0 / 0.06) 0%, transparent 60%);
  pointer-events: none;
}
.system-detail-header h1 {
  font-size: 2.2rem;
  margin-bottom: var(--sp-3);
  position: relative;
}
.system-detail-header .system-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  line-height: 1.7;
}

/* ── System Tabbed Layout ── */
.sys-tabs {
  animation: fadeSlideUp 0.4s ease-out both;
}

.sys-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-5);
  background: linear-gradient(180deg, rgb(20 31 27 / 0.5) 0%, rgb(15 24 20 / 0.4) 100%);
  border: 1px solid rgb(255 204 0 / 0.1);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(8px);
  overflow-x: auto;
  scrollbar-width: none;
}
.sys-tab-bar::-webkit-scrollbar { display: none; }

.sys-tab-btn {
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: var(--sp-2) var(--sp-4);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  letter-spacing: 0.02em;
}
.sys-tab-btn:hover {
  color: var(--text-primary);
  background: rgb(255 204 0 / 0.06);
  border-color: rgb(255 204 0 / 0.12);
}
.sys-tab-btn.active {
  color: var(--text-dark);
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-hover) 100%);
  border-color: transparent;
  box-shadow: 0 2px 12px rgb(255 204 0 / 0.25), 0 0 20px rgb(255 204 0 / 0.1);
}

/* ── Tab Panels ── */
.sys-tab-panels {
  position: relative;
  min-height: 120px;
}
.sys-tab-panel {
  display: none;
  animation: sysTabFadeIn 0.35s ease-out;
}
.sys-tab-panel.active {
  display: block;
}

@keyframes sysTabFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── System Items Grid (inside tab panels) ── */
.sys-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
}

.sys-item-card {
  padding: var(--sp-4) var(--sp-5);
  background: linear-gradient(145deg, rgb(20 31 27 / 0.65) 0%, rgb(14 22 18 / 0.8) 100%);
  border: 1px solid rgb(255 204 0 / 0.08);
  border-radius: var(--radius-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: fadeSlideUp 0.4s ease-out both;
}
.sys-item-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 0%, rgb(255 204 0 / 0.04) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.sys-item-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold), rgb(255 204 0 / 0.15));
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 3px 0 0 3px;
}
.sys-item-card:hover {
  border-color: rgb(255 204 0 / 0.2);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.35), 0 0 16px rgb(255 204 0 / 0.06);
}
.sys-item-card:hover::before,
.sys-item-card:hover::after {
  opacity: 1;
}
.sys-item-name {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: var(--sp-2);
  letter-spacing: 0.02em;
}
.sys-item-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Stagger item cards within grid */
.sys-items-grid .sys-item-card:nth-child(1)  { animation-delay: 0.03s; }
.sys-items-grid .sys-item-card:nth-child(2)  { animation-delay: 0.06s; }
.sys-items-grid .sys-item-card:nth-child(3)  { animation-delay: 0.09s; }
.sys-items-grid .sys-item-card:nth-child(4)  { animation-delay: 0.12s; }
.sys-items-grid .sys-item-card:nth-child(5)  { animation-delay: 0.15s; }
.sys-items-grid .sys-item-card:nth-child(6)  { animation-delay: 0.18s; }
.sys-items-grid .sys-item-card:nth-child(7)  { animation-delay: 0.21s; }
.sys-items-grid .sys-item-card:nth-child(8)  { animation-delay: 0.24s; }
.sys-items-grid .sys-item-card:nth-child(9)  { animation-delay: 0.27s; }
.sys-items-grid .sys-item-card:nth-child(10) { animation-delay: 0.3s; }

/* ── System Card Grid (list view) ── */
.system-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-5);
}

.system-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgb(20 31 27 / 0.8) 0%, rgb(10 15 13 / 0.9) 100%);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-xl);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  animation: fadeSlideUp 0.5s ease-out both;
}
.system-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgb(255 204 0 / 0.05) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.system-card:hover {
  border-color: var(--gold-focus);
  transform: translateY(-6px);
  box-shadow:
    0 16px 48px rgb(0 0 0 / 0.5),
    0 0 28px rgb(255 204 0 / 0.12);
  text-decoration: none;
  color: inherit;
}
.system-card:hover::before {
  opacity: 1;
}

.system-card-icon {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, rgb(10 15 13 / 0.6) 100%);
  color: var(--gold);
  position: relative;
}
.system-card-icon::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

.system-card-body {
  padding: var(--sp-4) var(--sp-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.system-card-name {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: var(--sp-2);
}
.system-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}
.system-card-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  font-size: 0.72rem;
  color: var(--text-dim);
}
.system-card-sections {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid rgb(255 204 0 / 0.08);
}

/* Stagger system cards */
.system-card-grid .system-card:nth-child(1) { animation-delay: 0.05s; }
.system-card-grid .system-card:nth-child(2) { animation-delay: 0.1s; }
.system-card-grid .system-card:nth-child(3) { animation-delay: 0.15s; }
.system-card-grid .system-card:nth-child(4) { animation-delay: 0.2s; }
.system-card-grid .system-card:nth-child(5) { animation-delay: 0.25s; }
.system-card-grid .system-card:nth-child(6) { animation-delay: 0.3s; }
.system-card-grid .system-card:nth-child(7) { animation-delay: 0.35s; }
.system-card-grid .system-card:nth-child(8) { animation-delay: 0.4s; }
.system-card-grid .system-card:nth-child(9) { animation-delay: 0.45s; }

/* Stagger tab buttons */
.sys-tab-bar .sys-tab-btn:nth-child(1)  { animation-delay: 0.03s; }
.sys-tab-bar .sys-tab-btn:nth-child(2)  { animation-delay: 0.06s; }
.sys-tab-bar .sys-tab-btn:nth-child(3)  { animation-delay: 0.09s; }
.sys-tab-bar .sys-tab-btn:nth-child(4)  { animation-delay: 0.12s; }
.sys-tab-bar .sys-tab-btn:nth-child(5)  { animation-delay: 0.15s; }
.sys-tab-bar .sys-tab-btn:nth-child(6)  { animation-delay: 0.18s; }
.sys-tab-bar .sys-tab-btn:nth-child(7)  { animation-delay: 0.21s; }
.sys-tab-bar .sys-tab-btn:nth-child(8)  { animation-delay: 0.24s; }
.sys-tab-bar .sys-tab-btn:nth-child(9)  { animation-delay: 0.27s; }
.sys-tab-bar .sys-tab-btn:nth-child(10) { animation-delay: 0.3s; }

/* ═══════════════════════════════════════════════════════
   SPRITE DISPLAY SYSTEM - LPC idle frames & strip sprites
   ═══════════════════════════════════════════════════════ */

/* ── LPC Sprite Frame (shows idle-down from LPC spritesheet) ── */
.lpc-sprite-frame {
  overflow: hidden;
  image-rendering: pixelated;
  background: var(--bg-elevated);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-md);
  position: relative;
  flex-shrink: 0;
}
.lpc-sprite-window {
  width: 64px;
  height: 64px;
  overflow: hidden;
  transform-origin: 0 0;
}
.lpc-sprite-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  image-rendering: pixelated;
  pointer-events: none;
  margin-top: -1536px; /* row 24 (idle-down) * 64px */
}

/* Card preview - 64px display from 64px source */
.lpc-sprite-sm {
  width: 64px;
  height: 64px;
}
.lpc-sprite-sm .lpc-sprite-window {
  transform: scale(1);
}

/* Detail page - 128px display (2x scale of 64px source) */
.lpc-sprite-lg {
  width: 128px;
  height: 128px;
}
.lpc-sprite-lg .lpc-sprite-window {
  transform: scale(2);
}

/* Boss detail - 160px display */
.lpc-sprite-xl {
  width: 160px;
  height: 160px;
  border: 2px solid var(--gold-border);
  box-shadow: 0 0 24px rgb(255 204 0 / 0.12), var(--shadow-md);
}
.lpc-sprite-xl .lpc-sprite-window {
  transform: scale(2.5);
}

/* ── Strip Sprite Frame (horizontal frame strip - first frame) ── */
.strip-sprite-frame {
  overflow: hidden;
  image-rendering: pixelated;
  background: var(--bg-elevated);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-md);
  position: relative;
  flex-shrink: 0;
}
.strip-sprite-frame img {
  display: block;
  image-rendering: pixelated;
  height: 100%;
  width: auto;
  pointer-events: none;
}

.strip-sprite-sm {
  width: 64px;
  height: 64px;
}
.strip-sprite-lg {
  width: 128px;
  height: 128px;
}
.strip-sprite-xl {
  width: 160px;
  height: 160px;
  border: 2px solid var(--gold-border);
  box-shadow: 0 0 24px rgb(255 204 0 / 0.12), var(--shadow-md);
}

/* ── Sprite Showcase (detail page hero area) ── */
.sprite-showcase {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  margin-bottom: var(--sp-5);
  padding: var(--sp-5);
  background: linear-gradient(135deg, rgb(20 31 27 / 0.7) 0%, rgb(26 42 36 / 0.5) 100%);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  animation: fadeSlideUp 0.5s ease-out both;
}
.sprite-showcase::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgb(2 80 38 / 0.12) 0%, transparent 60%);
  pointer-events: none;
}
.sprite-showcase .lpc-sprite-frame,
.sprite-showcase .strip-sprite-frame {
  z-index: 1;
}
.sprite-showcase-info {
  position: relative;
  z-index: 1;
  flex: 1;
}
.sprite-showcase-info h1 {
  margin-bottom: var(--sp-1);
}
.sprite-showcase-info .detail-subtitle {
  margin-bottom: var(--sp-3);
}

/* ── Sprite glow border for bosses ── */
.sprite-glow {
  border-color: var(--gold-focus);
  box-shadow:
    0 0 20px rgb(255 204 0 / 0.15),
    0 0 40px rgb(255 204 0 / 0.08),
    inset 0 0 12px rgb(255 204 0 / 0.05);
  animation: pulseGlow 3s ease-in-out infinite;
}

/* ── Enhanced Card Grid for entities with sprites ── */
.entity-card .card-img-sprite {
  width: 100%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, rgb(10 15 13 / 0.9) 100%);
  padding: var(--sp-2);
  position: relative;
  overflow: hidden;
}
.entity-card .card-img-sprite::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgb(2 80 38 / 0.1) 0%, transparent 70%);
  pointer-events: none;
}
.entity-card .card-img-sprite .lpc-sprite-frame,
.entity-card .card-img-sprite .strip-sprite-frame {
  border: none;
  background: transparent;
  z-index: 1;
}
.entity-card .card-img-item {
  height: 56px;
}
.entity-card .card-img-item > div {
  z-index: 1;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.3));
}

/* ── Table sprite thumbnails ── */
.table-sprite {
  width: 32px;
  height: 32px;
  overflow: hidden;
  image-rendering: pixelated;
  display: inline-block;
  vertical-align: middle;
  margin-right: var(--sp-2);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  flex-shrink: 0;
}
.table-sprite img {
  display: block;
  image-rendering: pixelated;
  pointer-events: none;
}
.table-sprite.lpc img {
  transform: scale(0.5);
  transform-origin: 0 0;
  margin-top: -1536px;
}
.table-sprite.strip img {
  height: 32px;
  width: auto;
}

.td-with-sprite {
  display: flex;
  align-items: center;
}

/* ═══════════════════════════════════════════════════════
   ENHANCED PANELS & CONTRAST
   ═══════════════════════════════════════════════════════ */

/* ── Boss tier indicators ── */
.guardian-tier-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.guardian-tier-1 {
  color: var(--rarity-rare);
  background: rgb(33 150 243 / 0.12);
  border: 1px solid rgb(33 150 243 / 0.25);
}
.guardian-tier-2 {
  color: var(--rarity-epic);
  background: rgb(156 39 176 / 0.12);
  border: 1px solid rgb(156 39 176 / 0.25);
}

/* ── Dialogue display ── */
.dialogue-line {
  padding: var(--sp-2) var(--sp-3);
  border-left: 2px solid var(--gold-dim);
  margin-bottom: var(--sp-2);
  font-style: italic;
  color: var(--text-secondary);
}
.dialogue-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-left: var(--sp-3);
}
.dialogue-objective {
  margin-bottom: var(--sp-3);
}
.dialogue-objective h4 {
  color: var(--gold);
  font-size: 0.85rem;
  margin-bottom: var(--sp-1);
}

/* ── Note Color Display ── */
.note-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-3);
}
.note-color-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: linear-gradient(135deg, rgb(26 42 36 / 0.5) 0%, rgb(20 31 27 / 0.4) 100%);
  border: 1px solid rgb(255 204 0 / 0.08);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
}
.note-color-card:hover {
  border-color: rgb(255 204 0 / 0.2);
  transform: translateX(2px);
}
.note-color-swatch {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  box-shadow: 0 0 12px currentColor;
  opacity: 0.9;
}
.note-color-info {
  flex: 1;
}
.note-color-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.note-color-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.note-color-key {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid rgb(255 204 0 / 0.1);
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════════════════
   WIKI DETAIL LAYOUTS - Modern two-column wiki pages
   ═══════════════════════════════════════════════════════ */

/* ── Section Hero (page header with icon) ── */
.wiki-section-hero {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  margin-bottom: var(--sp-6);
  padding: var(--sp-5) var(--sp-6);
  background: linear-gradient(135deg, rgb(20 31 27 / 0.6) 0%, rgb(10 15 13 / 0.7) 100%);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  animation: fadeSlideUp 0.4s ease-out both;
}
.wiki-section-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 10% 50%, rgb(255 204 0 / 0.04) 0%, transparent 60%);
  pointer-events: none;
}
.wiki-section-hero .wiki-section-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 8px rgb(255 204 0 / 0.2));
  flex-shrink: 0;
  position: relative;
}
.wiki-section-hero h1 {
  margin: 0;
  position: relative;
}
.wiki-section-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: var(--sp-1);
  position: relative;
}

/* ── Detail Hero (entity header) ── */
.wiki-detail-hero {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-5);
  background: linear-gradient(135deg, rgb(20 31 27 / 0.7) 0%, rgb(26 42 36 / 0.5) 100%);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  animation: fadeSlideUp 0.4s ease-out both;
}
.wiki-detail-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 15% 50%, rgb(2 80 38 / 0.1) 0%, transparent 60%);
  pointer-events: none;
}
.wiki-detail-hero-boss {
  border-color: rgb(255 204 0 / 0.25);
  background: linear-gradient(135deg, rgb(20 31 27 / 0.7) 0%, rgb(30 20 10 / 0.4) 100%);
}
.wiki-detail-hero-sprite {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.wiki-detail-hero-info {
  position: relative;
  z-index: 1;
  flex: 1;
}
.wiki-detail-hero-info h1 {
  margin-bottom: var(--sp-1);
}
.wiki-detail-title {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}
.wiki-detail-badges {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--sp-2);
}

/* ── Two-column detail layout ── */
.wiki-detail-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--sp-5);
  animation: fadeSlideUp 0.5s ease-out 0.1s both;
}

/* ── Info Panel (sidebar key-value card) ── */
.wiki-info-panel {
  background: linear-gradient(180deg, rgb(20 31 27 / 0.8) 0%, rgb(15 24 20 / 0.9) 100%);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--sp-4);
  backdrop-filter: blur(6px);
}
.wiki-info-title {
  padding: var(--sp-3) var(--sp-4);
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, rgb(26 42 36 / 0.6) 100%);
  border-bottom: 1px solid var(--gold-dim);
}
.wiki-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--sp-2) var(--sp-4);
  border-bottom: 1px solid rgb(255 204 0 / 0.05);
  transition: background 0.15s ease;
}
.wiki-info-row:last-child {
  border-bottom: none;
}
.wiki-info-row:hover {
  background: rgb(255 204 0 / 0.03);
}
.wiki-info-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}
.wiki-info-value {
  font-size: 0.8rem;
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  max-width: 60%;
}

/* ── Content blocks (right column) ── */
.wiki-detail-content {
  min-width: 0;
}

.wiki-detail-sidebar {
  min-width: 0;
}

.wiki-content-block {
  background: linear-gradient(180deg, rgb(20 31 27 / 0.6) 0%, rgb(15 24 20 / 0.7) 100%);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(4px);
}
.wiki-content-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(255 204 0 / 0.2), transparent);
}
.wiki-content-block h3 {
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid rgb(255 204 0 / 0.1);
}
.wiki-content-block p {
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 0;
}

.wiki-highlight-block {
  border-color: rgb(255 204 0 / 0.25);
  background: linear-gradient(135deg, rgb(30 25 15 / 0.5) 0%, rgb(20 31 27 / 0.6) 100%);
}
.wiki-highlight-block::before {
  background: linear-gradient(90deg, transparent, rgb(255 204 0 / 0.35), transparent);
}

/* ── Feature Grid ── */
.wiki-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-3);
}
.wiki-feature-card {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: linear-gradient(135deg, rgb(26 42 36 / 0.4) 0%, rgb(20 31 27 / 0.3) 100%);
  border: 1px solid rgb(255 204 0 / 0.06);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}
.wiki-feature-card:hover {
  border-color: rgb(255 204 0 / 0.15);
  background: linear-gradient(135deg, rgb(31 51 43 / 0.5) 0%, rgb(26 42 36 / 0.4) 100%);
}
.wiki-feature-icon {
  font-size: 1.1rem;
  color: var(--gold);
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(255 204 0 / 0.08);
  border-radius: var(--radius-sm);
}
.wiki-feature-body { flex: 1; min-width: 0; }
.wiki-feature-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.wiki-feature-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.wiki-slot-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.8rem;
}

/* ── Interval tags ── */
.wiki-interval-display {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.wiki-interval-tag {
  display: inline-block;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  background: linear-gradient(135deg, rgb(255 204 0 / 0.1), rgb(255 204 0 / 0.04));
  border: 1px solid rgb(255 204 0 / 0.2);
  color: var(--gold);
}

/* ── Boss Phases ── */
.wiki-phases {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.wiki-phase-card {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-4);
  background: linear-gradient(135deg, rgb(26 42 36 / 0.4) 0%, rgb(20 31 27 / 0.3) 100%);
  border: 1px solid rgb(255 204 0 / 0.08);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease;
}
.wiki-phase-card:hover {
  border-color: rgb(255 204 0 / 0.2);
}
.wiki-phase-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgb(255 204 0 / 0.15), rgb(255 204 0 / 0.05));
  border: 1px solid rgb(255 204 0 / 0.3);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wiki-phase-body { flex: 1; }
.wiki-phase-name {
  font-weight: 600;
  color: var(--gold);
  font-size: 0.9rem;
  margin-bottom: var(--sp-1);
}
.wiki-phase-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.wiki-phase-pattern {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* ── Drops Section ── */
.wiki-drops-section {
  margin-bottom: var(--sp-4);
}
.wiki-drops-section h3 {
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: var(--sp-3);
}
.wiki-drops-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.wiki-drop-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-2) var(--sp-4);
  background: linear-gradient(135deg, rgb(26 42 36 / 0.3) 0%, rgb(20 31 27 / 0.2) 100%);
  border: 1px solid rgb(255 204 0 / 0.06);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}
.wiki-drop-item:hover {
  border-color: rgb(255 204 0 / 0.15);
  background: linear-gradient(135deg, rgb(31 51 43 / 0.4) 0%, rgb(26 42 36 / 0.3) 100%);
}
.wiki-drop-name {
  font-size: 0.85rem;
  color: var(--text-primary);
}
.wiki-drop-chance {
  font-size: 0.78rem;
  color: var(--text-dim);
  padding: 1px 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-pill);
  border: 1px solid rgb(255 204 0 / 0.06);
}

/* ── Abilities Section ── */
.wiki-abilities-section {
  margin-bottom: var(--sp-4);
}
.wiki-abilities-section h3 {
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: var(--sp-3);
}
.wiki-ability-card {
  padding: var(--sp-3) var(--sp-4);
  background: linear-gradient(135deg, rgb(26 42 36 / 0.3) 0%, rgb(20 31 27 / 0.2) 100%);
  border: 1px solid rgb(255 204 0 / 0.06);
  border-left: 3px solid var(--gold-dim);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-2);
  transition: all 0.15s ease;
}
.wiki-ability-card:hover {
  border-left-color: var(--gold);
  border-color: rgb(255 204 0 / 0.12);
  border-left-color: var(--gold);
}
.wiki-ability-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--gold);
  margin-bottom: var(--sp-1);
}
.wiki-ability-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── World Map Grid ── */
.wiki-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding: var(--sp-3);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.wiki-map-legend-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.wiki-map-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}
.wiki-world-map {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
  padding: var(--sp-3);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: var(--sp-6);
  min-height: 420px;
}
.wiki-world-cell {
  border-radius: var(--radius-sm);
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--sp-2);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}
.wiki-world-cell-filled {
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  overflow: hidden;
}
.wiki-world-cell-filled::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--region-color);
  opacity: 0.12;
  pointer-events: none;
  transition: opacity 0.2s;
}
.wiki-world-cell-filled:hover {
  border-color: var(--region-color);
  transform: scale(1.05);
  z-index: 2;
  box-shadow: 0 0 12px rgba(0,0,0,0.3);
}
.wiki-world-cell-filled:hover::before {
  opacity: 0.25;
}
.wiki-world-cell-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 2px;
}
.wiki-world-cell-info {
  font-size: 0.62rem;
  color: var(--text-secondary);
  opacity: 0.8;
}

/* ── Sub-maps Grid ── */
.wiki-submaps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-2);
}
.wiki-submap-card {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.wiki-submap-icon {
  font-size: 1.1rem;
  color: var(--gold);
  flex-shrink: 0;
}
.wiki-submap-name {
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* ── Connections List ── */
.wiki-connections-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.wiki-connection-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.wiki-connection-arrow {
  font-size: 1.1rem;
  color: var(--gold);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.wiki-connection-name {
  flex: 1;
  font-size: 0.85rem;
}
.wiki-connection-dir {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: capitalize;
}

/* ── Entity Chips (NPCs, Enemies lists) ── */
.wiki-entity-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.wiki-entity-chips .wiki-link {
  padding: var(--sp-1) var(--sp-2);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  transition: border-color 0.2s;
}
.wiki-entity-chips .wiki-link:hover {
  border-color: var(--gold);
}

/* ── Shop Block ── */
.wiki-shop-block {
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: var(--sp-2);
}
.wiki-shop-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--gold);
}

/* ── Unlock Requirement Badge ── */
.wiki-unlock-req {
  margin-top: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: #f59e0b;
}

/* ── Quest Detail Styles ── */
.quest-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-3) 0;
}
.quest-nav-link {
  padding: var(--sp-2) var(--sp-4);
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-md);
  color: var(--gold);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
.quest-nav-link:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-focus);
}
.quest-nav-prev { margin-right: auto; }
.quest-nav-next { margin-left: auto; }

.quest-chain-badge,
.quest-chain-badge-sm {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  color: #818cf8;
  text-transform: capitalize;
}
.quest-chain-badge { margin-left: var(--sp-2); }
.quest-chain-badge-sm { font-size: 0.65rem; padding: 1px 5px; }

/* Quest dialogue */
.quest-dialogue-phases {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.quest-dialogue-phase {
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.quest-dialogue-phase-header {
  padding: var(--sp-2) var(--sp-3);
  background: rgba(212, 175, 55, 0.06);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gold);
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
}
.quest-dialogue-phase-icon {
  margin-right: var(--sp-2);
}
.quest-dialogue-phase-body {
  padding: var(--sp-3);
}
.quest-dialogue-line {
  margin: 0 0 var(--sp-2);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-body);
  font-style: italic;
  padding-left: var(--sp-3);
  border-left: 2px solid rgba(212, 175, 55, 0.15);
}
.quest-dialogue-line:last-child { margin-bottom: 0; }
.quest-dialogue-item {
  color: var(--gold);
  font-style: normal;
  font-weight: 600;
  font-size: 0.8rem;
}
.quest-dialogue-progress-entry {
  margin-bottom: var(--sp-2);
  font-size: 0.85rem;
  color: var(--text-body);
  font-style: italic;
  padding-left: var(--sp-3);
  border-left: 2px solid rgba(99, 102, 241, 0.25);
}
.quest-dialogue-obj-label {
  font-style: normal;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: capitalize;
}

/* Quest objectives */
.quest-objectives-list {
  list-style: none;
  padding: 0;
  counter-reset: obj;
}
.quest-objective {
  position: relative;
  padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-6);
  margin-bottom: var(--sp-2);
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: var(--radius-sm);
  counter-increment: obj;
}
.quest-objective::before {
  content: counter(obj);
  position: absolute;
  left: var(--sp-2);
  top: var(--sp-2);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quest-objective-desc {
  font-size: 0.88rem;
  color: var(--text-body);
}
.quest-objective-type {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 6px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  color: #818cf8;
  text-transform: uppercase;
}
.quest-objective-count {
  display: inline-block;
  margin-top: 4px;
  margin-left: var(--sp-1);
  padding: 1px 6px;
  background: rgba(212, 175, 55, 0.1);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  color: var(--gold);
}
.quest-objective-hint {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
}

/* Quest act navigation tabs */
.quest-act-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
  padding: var(--sp-3);
  background: rgba(10, 15, 13, 0.5);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-md);
}
.quest-act-tab {
  padding: var(--sp-1) var(--sp-3);
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.78rem;
  text-decoration: none;
  transition: all 0.2s ease;
}
.quest-act-tab:hover {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold);
  border-color: var(--gold-dim);
}
.quest-act-tab-count {
  background: rgba(212, 175, 55, 0.15);
  padding: 1px 5px;
  border-radius: 8px;
  font-size: 0.68rem;
  margin-left: 4px;
}

.quest-type-header {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: var(--sp-3) 0 var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quest-card-main {
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold);
}
.quest-card-side {
  background: rgba(99, 102, 241, 0.08);
  color: #818cf8;
}

/* ── Fish Habitat Sections ── */
.fish-habitat-section {
  margin-bottom: var(--sp-5);
}
.fish-habitat-section > h3 {
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}
.fish-habitat-count {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ── Mobile not targeted (desktop-only per AGENTS.md) ── */

