:root {
  color-scheme: dark;
  --bg: #090b0f;
  --bg-soft: #10141b;
  --panel: #121820;
  --panel-raised: #171e28;
  --line: rgba(192, 157, 83, 0.22);
  --line-bright: rgba(225, 184, 91, 0.5);
  --gold: #d8aa51;
  --gold-soft: #f0cd78;
  --text: #e9e6df;
  --muted: #929ba8;
  --faint: #68717d;
  --blue: #76b8ff;
  --green: #74d2a1;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.3);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
*[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 72% -12%, rgba(114, 154, 208, 0.1), transparent 32rem),
    radial-gradient(circle at 20% 20%, rgba(201, 144, 52, 0.06), transparent 28rem),
    var(--bg);
  color: var(--text);
  line-height: 1.65;
}

a { color: var(--gold-soft); text-decoration: none; }
a:hover { color: #fff1ba; }
button, input { font: inherit; }
code, kbd, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.app-shell { min-height: 100vh; }
.topbar {
  align-items: center;
  background: rgba(9, 11, 15, 0.88);
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 76px;
  justify-content: space-between;
  padding: 0 34px;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
}
.brand { align-items: center; display: flex; gap: 12px; }
.brand-mark {
  align-items: center;
  border: 1px solid var(--gold);
  color: var(--gold-soft);
  display: flex;
  font-size: 16px;
  height: 34px;
  justify-content: center;
  transform: rotate(45deg);
  width: 34px;
}
.brand-mark::first-letter { transform: rotate(-45deg); }
.brand-copy { display: grid; gap: 1px; line-height: 1; }
.brand-name { color: #f5f0e4; font-size: 12px; font-weight: 750; letter-spacing: 0.2em; }
.brand-subtitle { color: var(--gold); font-size: 10px; letter-spacing: 0.24em; }
.topbar-actions { align-items: center; display: flex; gap: 18px; }
.live-pill {
  align-items: center;
  border: 1px solid rgba(116, 210, 161, 0.3);
  border-radius: 999px;
  color: var(--green);
  display: inline-flex;
  font-size: 10px;
  font-weight: 700;
  gap: 7px;
  letter-spacing: 0.13em;
  padding: 7px 11px;
}
.live-dot, .status-dot { background: var(--green); border-radius: 50%; display: inline-block; height: 6px; width: 6px; box-shadow: 0 0 12px var(--green); }
.icon-button { background: transparent; border: 0; color: var(--muted); cursor: pointer; display: none; font-size: 22px; padding: 4px; }

.page-layout { display: grid; grid-template-columns: 252px minmax(0, 1fr) 236px; margin: 0 auto; max-width: 1540px; }
.sidebar { border-right: 1px solid var(--line); min-height: calc(100vh - 76px); }
.sidebar-inner {
  max-height: calc(100vh - 76px);
  overflow-y: auto;
  padding: 34px 20px 30px 26px;
  position: sticky;
  scrollbar-color: rgba(216, 170, 81, 0.45) transparent;
  scrollbar-width: thin;
  top: 76px;
}
.sidebar-inner::-webkit-scrollbar { width: 5px; }
.sidebar-inner::-webkit-scrollbar-thumb { background: rgba(216, 170, 81, 0.45); border-radius: 999px; }
.sidebar-inner::-webkit-scrollbar-track { background: transparent; }
.sidebar-label, .rail-card-label, .section-kicker { color: var(--gold); font-size: 10px; font-weight: 750; letter-spacing: 0.18em; text-transform: uppercase; }
.wiki-nav { display: grid; gap: 3px; margin-top: 17px; }
.wiki-nav a { border-left: 2px solid transparent; color: var(--muted); display: block; font-size: 13px; line-height: 1.35; padding: 8px 12px; transition: background .18s ease, color .18s ease; }
.wiki-nav a:hover, .wiki-nav a.active { background: rgba(216, 170, 81, 0.09); border-left-color: var(--gold); color: var(--gold-soft); }
.wiki-nav a.nav-h3 { font-size: 12px; padding-left: 24px; }
.sidebar-footer { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 18px; }
.source-chip { align-items: center; color: var(--muted); display: flex; font-size: 11px; gap: 9px; line-height: 1.35; }
.source-chip strong { color: var(--text); font-weight: 600; }
.source-icon { color: var(--gold); font-size: 22px; }
.text-link { display: inline-block; font-size: 11px; margin-top: 13px; }

.main-content { min-width: 0; padding: 52px clamp(28px, 5vw, 84px) 92px; }
.wiki-content { margin: 0 auto; max-width: 850px; }
.wiki-hero { border-bottom: 1px solid var(--line); margin-bottom: 46px; padding-bottom: 35px; position: relative; }
.wiki-hero::before { background: linear-gradient(90deg, var(--gold), transparent); content: ""; height: 1px; left: 0; opacity: .8; position: absolute; top: -18px; width: 180px; }
.wiki-hero h1 { color: #fbf7ec; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 5vw, 64px); font-weight: 500; letter-spacing: -0.045em; line-height: 1.04; margin: 0 0 20px; max-width: 700px; }
.wiki-hero h1::first-line { color: var(--gold-soft); }
.hero-note, .callout { background: linear-gradient(110deg, rgba(216, 170, 81, 0.1), rgba(18, 24, 32, .45)); border-left: 2px solid var(--gold); color: #c8c9c4; font-size: 14px; margin: 18px 0 0; padding: 12px 17px; }
.hero-note p, .callout p { margin: 0; }
.wiki-section { border-bottom: 1px solid rgba(192, 157, 83, 0.13); padding: 5px 0 42px; scroll-margin-top: 104px; }
.wiki-section + .wiki-section { padding-top: 46px; }
.wiki-section h2 { color: #f5efe2; font-family: Georgia, "Times New Roman", serif; font-size: clamp(27px, 3vw, 37px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.15; margin: 0 0 24px; }
.wiki-section h3 { color: var(--gold-soft); font-family: Georgia, "Times New Roman", serif; font-size: 21px; font-weight: 500; margin: 32px 0 12px; }
.wiki-section h4 { color: var(--text); font-size: 15px; margin: 24px 0 8px; }
.wiki-section p { color: #bdc1c4; font-size: 15px; margin: 0 0 17px; }
.wiki-section strong { color: #f0eadc; font-weight: 650; }
.wiki-section ul, .wiki-section ol { color: #c4c7c8; font-size: 15px; margin: 10px 0 21px; padding-left: 23px; }
.wiki-section li { margin: 6px 0; padding-left: 4px; }
.wiki-section li::marker { color: var(--gold); }
.wiki-section code { background: rgba(118, 184, 255, .1); border: 1px solid rgba(118, 184, 255, .16); border-radius: 4px; color: #a9d3ff; font-size: .86em; padding: 2px 5px; }
.wiki-section pre { background: #0b1016; border: 1px solid rgba(118, 184, 255, .16); border-radius: 8px; color: #aab8c8; font-size: 12px; line-height: 1.6; margin: 19px 0 24px; overflow: auto; padding: 18px; }
.wiki-section pre.diagram { border-color: rgba(216, 170, 81, .27); color: #d7bf88; }
.wiki-section hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }
.wiki-section table { border-collapse: collapse; display: block; font-size: 13px; margin: 18px 0 25px; max-width: 100%; overflow-x: auto; width: max-content; }
.wiki-section th { background: rgba(216, 170, 81, .12); color: var(--gold-soft); font-size: 11px; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.wiki-section th, .wiki-section td { border: 1px solid rgba(192, 157, 83, .2); padding: 9px 12px; vertical-align: top; }
.wiki-section td { color: #c1c5c8; }
.wiki-section blockquote { margin: 18px 0; }
.wiki-section a { border-bottom: 1px solid rgba(216, 170, 81, .35); }
.wiki-section a:hover { border-color: var(--gold-soft); }
.wiki-section mark { background: rgba(216, 170, 81, .4); color: #fff4c9; }

/* Player-facing content galleries. These cards keep the wiki visual and useful on
   both a desktop monitor and a narrow phone screen without changing the source
   markdown: the build injects the current game data into the hooks. */
.wiki-gallery-hook { margin: 24px 0 6px; }
.gallery-summary { align-items: center; color: var(--muted); display: flex; flex-wrap: wrap; font-size: 11px; gap: 8px 18px; letter-spacing: .04em; margin: 0 0 18px; text-transform: uppercase; }
.gallery-summary span { align-items: center; display: inline-flex; gap: 6px; }
.gallery-summary span + span::before { color: var(--gold); content: "·"; margin-right: 10px; }
.gallery-summary strong { color: var(--gold-soft); font-size: 18px; font-weight: 650; letter-spacing: 0; }
.gallery-eyebrow { color: var(--gold); font-size: 9px; font-weight: 750; letter-spacing: .16em; line-height: 1.35; text-transform: uppercase; }
.gallery-empty, .image-missing, .drop-empty { color: var(--faint); font-size: 12px; }

.app-guide-grid { display: grid; gap: 10px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.app-guide-card { background: linear-gradient(150deg, rgba(29,38,50,.95), rgba(14,19,25,.95)); border: 1px solid rgba(192,157,83,.25); border-radius: 9px; min-width: 0; padding: 13px 10px 12px; position: relative; }
.app-guide-number { color: rgba(216,170,81,.65); font-family: Georgia, serif; font-size: 16px; position: absolute; right: 10px; top: 8px; }
.app-guide-icon { align-items: center; background: radial-gradient(circle, rgba(216,170,81,.22), transparent 68%); display: flex; height: 47px; justify-content: center; margin-bottom: 7px; }
.app-guide-icon img { height: 38px; object-fit: contain; width: 38px; }
.app-guide-body h3 { color: #f1e6c8; font-size: 16px; margin: 3px 0 6px; }
.app-guide-body p { font-size: 11px; line-height: 1.45; margin-bottom: 8px; }
.app-guide-action { color: var(--blue); display: block; font-size: 10px; line-height: 1.35; }

.class-grid, .region-grid, .skill-grid { display: grid; gap: 14px; }
.class-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.class-card, .skill-card { background: linear-gradient(135deg, rgba(29, 38, 50, .95), rgba(16, 21, 28, .95)); border: 1px solid rgba(192, 157, 83, .25); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.16); display: flex; min-width: 0; overflow: hidden; }
.class-card { padding: 17px; }
.class-card-icon { align-items: center; background: radial-gradient(circle, rgba(216,170,81,.22), transparent 68%); display: flex; flex: 0 0 54px; height: 54px; justify-content: center; margin-right: 14px; }
.class-card-icon img, .class-resource img { height: 38px; object-fit: contain; width: 38px; }
.class-card-body { min-width: 0; }
.class-card h3, .region-card h3, .monster-card h3, .skill-card h3 { margin: 3px 0 7px; }
.class-card h3 { color: #f3e8c8; font-size: 20px; }
.class-card p { font-size: 13px; margin-bottom: 10px; }
.class-resource { align-items: center; color: var(--blue); display: flex; font-size: 11px; gap: 7px; margin: 5px 0 10px; }
.class-resource img { height: 20px; width: 20px; }
.specialization-list { display: flex; flex-wrap: wrap; gap: 5px; }
.specialization-list span, .monster-tags span, .skill-meta span { background: rgba(216,170,81,.1); border: 1px solid rgba(216,170,81,.22); border-radius: 999px; color: var(--gold-soft); font-size: 10px; line-height: 1; padding: 5px 7px; }

.region-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.region-card { background-color: #141a22; background-position: center; background-size: cover; border: 1px solid rgba(192,157,83,.3); border-radius: 10px; min-height: 420px; overflow: hidden; position: relative; }
.region-card-overlay { background: linear-gradient(180deg, rgba(10,14,20,.18) 0 25%, rgba(10,14,20,.9) 53%, rgba(10,14,20,.98)); height: 100%; padding: 22px 17px 14px; }
.region-card h3 { color: #fff1c2; font-size: 24px; }
.region-card p { font-size: 13px; margin-bottom: 13px; }
.region-unlock { border-left: 2px solid var(--green); display: grid; gap: 2px; margin-bottom: 14px; padding-left: 9px; }
.region-unlock strong { color: var(--green); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.region-unlock span { color: #c9d1ce; font-size: 12px; }
.region-stage-list { border-top: 1px solid rgba(255,255,255,.12); }
.region-stage { border-bottom: 1px solid rgba(255,255,255,.1); display: grid; gap: 6px; padding: 9px 0; }
.region-stage > div:first-child { align-items: baseline; display: flex; justify-content: space-between; }
.region-stage strong { color: var(--gold-soft); font-size: 12px; }
.region-stage > div:first-child span, .region-stage small { color: var(--muted); font-size: 10px; }
.stage-portraits { display: flex; gap: 5px; min-height: 28px; }
.stage-portraits img { background: rgba(0,0,0,.35); border: 1px solid rgba(216,170,81,.24); border-radius: 5px; height: 32px; object-fit: contain; width: 32px; }
.region-boss-row { display: flex; flex-wrap: wrap; gap: 7px 16px; padding-top: 11px; }
.region-boss-row span { color: #c9c7bf; font-size: 11px; }
.region-boss-row b { color: #f0cd78; font-weight: 600; }

.monster-grid { display: grid; gap: 17px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.monster-card { background: linear-gradient(145deg, rgba(24,31,41,.98), rgba(12,16,21,.98)); border: 1px solid rgba(192,157,83,.25); border-radius: 11px; box-shadow: 0 12px 32px rgba(0,0,0,.2); min-width: 0; overflow: hidden; }
.monster-card.monster-miniboss { border-color: rgba(145, 125, 227, .48); }
.monster-card.monster-boss { border-color: rgba(221, 104, 83, .55); }
.monster-card-head { align-items: center; border-bottom: 1px solid rgba(255,255,255,.09); display: flex; justify-content: space-between; min-height: 76px; padding: 13px 15px 10px; }
.monster-card h3 { color: #f4ecd9; font-size: 19px; }
.monster-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.monster-tags span { color: var(--muted); font-size: 9px; padding: 4px 6px; }
.monster-tags span:first-child { color: var(--gold-soft); }
.monster-mini { background: rgba(216,170,81,.08); border: 1px solid rgba(216,170,81,.2); border-radius: 50%; height: 48px; object-fit: contain; width: 48px; }
.monster-visual { display: grid; grid-template-columns: minmax(112px, .78fr) minmax(0, 1.22fr); min-height: 155px; }
.portrait-stage { align-items: center; background: radial-gradient(circle, rgba(216,170,81,.24), rgba(12,17,23,.1) 72%); display: flex; justify-content: center; min-height: 155px; padding: 10px; }
.monster-portrait { height: 136px; image-rendering: auto; object-fit: contain; width: 136px; }
.attack-stage { align-content: center; background: rgba(5,8,12,.36); border-left: 1px solid rgba(255,255,255,.08); display: grid; gap: 8px; min-width: 0; padding: 11px 10px; }
.frame-strip { align-items: center; display: flex; gap: 4px; min-height: 72px; overflow: hidden; }
.monster-frame { background-image: var(--sheet-url); background-position: calc(var(--frame-x) * -.44) calc(var(--frame-y) * -.44); background-repeat: no-repeat; background-size: calc(var(--sheet-w) * .44) calc(var(--sheet-h) * .44); flex: 0 0 auto; height: calc(var(--frame-h) * .44); max-height: 72px; max-width: 72px; width: calc(var(--frame-w) * .44); }
.sheet-link { border-bottom: 0 !important; color: var(--blue); font-size: 10px; justify-self: start; }
.monster-feature { background: rgba(216,170,81,.06); border-left: 2px solid var(--gold); color: #d0c8b5 !important; font-size: 12px !important; margin: 0 !important; padding: 9px 13px; }
.monster-facts { border-bottom: 1px solid rgba(255,255,255,.09); display: grid; gap: 7px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 11px 14px; }
.monster-facts span { color: #c5ccd0; display: grid; font-size: 11px; gap: 2px; line-height: 1.35; min-width: 0; }
.monster-facts b { color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.ability-block, .drop-block { padding: 12px 14px 0; }
.ability-block ul { list-style: none; margin: 7px 0 0; padding: 0; }
.ability-block li { align-items: flex-start; display: flex; gap: 8px; margin: 9px 0; padding: 0; }
.ability-block li::marker { content: ""; }
.ability-block li > span { display: grid; gap: 2px; min-width: 0; }
.ability-block li strong { color: #e5d8b9; font-size: 12px; }
.ability-block li small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.ability-block li em { color: var(--gold-soft); display: block; font-style: normal; margin-top: 2px; }
.ability-icon { flex: 0 0 25px; height: 25px; object-fit: contain; width: 25px; }
.drop-block { border-top: 1px solid rgba(255,255,255,.09); margin-top: 8px; padding-bottom: 14px; }
.drop-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.drop-chip { align-items: center; background: rgba(118,184,255,.07); border: 1px solid rgba(118,184,255,.15); border-radius: 6px; display: grid; gap: 0 6px; grid-template-columns: 24px minmax(0,1fr); padding: 5px 7px; }
.drop-chip > span { color: #c8d4df; font-size: 10px; line-height: 1.1; }
.drop-chip small { color: var(--muted); font-size: 9px; grid-column: 2; }
.drop-icon { grid-row: span 2; height: 23px; object-fit: contain; width: 23px; }

.skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.skill-card { align-items: flex-start; padding: 12px; }
.skill-icon { align-items: center; background: radial-gradient(circle, rgba(216,170,81,.18), transparent 70%); display: flex; flex: 0 0 46px; height: 46px; justify-content: center; margin-right: 11px; }
.skill-icon img { height: 42px; object-fit: contain; width: 42px; }
.skill-card-body { min-width: 0; }
.skill-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.skill-meta span { color: var(--muted); font-size: 9px; padding: 4px 6px; }
.skill-card h3 { color: #f1e7cc; font-size: 16px; }
.skill-card p { font-size: 12px; margin-bottom: 8px; }
.skill-stats { color: var(--blue); display: flex; flex-wrap: wrap; font-size: 10px; gap: 7px 12px; }
.skill-stats span + span::before { color: var(--faint); content: "·"; margin-right: 8px; }
.skill-specialization { color: var(--gold); display: block; font-size: 10px; margin-top: 6px; }

.right-rail { border-left: 1px solid var(--line); min-height: calc(100vh - 76px); padding: 34px 24px; }
.search-box { align-items: center; background: rgba(18, 24, 32, .84); border: 1px solid rgba(192, 157, 83, .25); border-radius: 7px; color: var(--gold); display: flex; gap: 9px; padding: 8px 10px; }
.search-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216, 170, 81, .08); }
.search-box input { background: transparent; border: 0; color: var(--text); min-width: 0; outline: 0; width: 100%; }
.search-box input::placeholder { color: var(--faint); }
.search-box kbd { border: 1px solid rgba(255,255,255,.14); border-radius: 3px; color: var(--faint); font-size: 10px; padding: 1px 4px; }
.rail-card { border-top: 1px solid var(--line); margin-top: 30px; padding-top: 18px; }
.status-row { align-items: center; display: flex; font-size: 12px; gap: 8px; margin-top: 13px; }
.rail-card p { color: var(--muted); font-size: 12px; line-height: 1.55; }
.rail-card-accent { display: grid; gap: 8px; }
.rail-card-accent a { color: var(--muted); display: flex; font-size: 12px; justify-content: space-between; }
.rail-card-accent a:hover { color: var(--gold-soft); }
.mobile-search { display: none; }
.no-results { margin: 80px auto; max-width: 380px; text-align: center; }
.no-results-icon { color: var(--gold); font-size: 36px; }
.no-results h2 { font-family: Georgia, serif; font-weight: 500; }
.no-results p { color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); color: var(--faint); display: flex; font-size: 10px; justify-content: space-between; letter-spacing: .1em; padding: 18px 34px; text-transform: uppercase; }

@media (max-width: 1120px) {
  .page-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .right-rail { display: none; }
  .app-guide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar { height: 64px; padding: 0 18px; }
  .brand-name { font-size: 11px; }
  .live-pill { display: none; }
  .icon-button { display: block; }
  .page-layout { display: block; }
  .sidebar { background: rgba(9, 11, 15, .98); border-right: 1px solid var(--line); bottom: 0; left: 0; max-width: 290px; position: fixed; top: 64px; transform: translateX(-102%); transition: transform .2s ease; width: 82%; z-index: 15; }
  .sidebar.open { box-shadow: 20px 0 55px rgba(0,0,0,.45); transform: translateX(0); }
  .sidebar-inner { max-height: calc(100vh - 64px); position: static; }
  .main-content { padding: 28px 19px 58px; }
  .mobile-search { display: block; margin-bottom: 39px; }
  .wiki-hero { margin-bottom: 35px; }
  .wiki-hero h1 { font-size: 42px; }
  .wiki-section h2 { font-size: 29px; }
  .wiki-section p, .wiki-section ul, .wiki-section ol { font-size: 14px; }
  .class-grid, .region-grid, .monster-grid, .skill-grid { grid-template-columns: minmax(0, 1fr); }
  .app-guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-summary { align-items: flex-start; display: grid; gap: 6px; }
  .gallery-summary span + span::before { display: none; }
  .region-card { min-height: 0; }
  .monster-visual { grid-template-columns: 40% 60%; }
  .monster-portrait { height: 112px; width: 112px; }
  .portrait-stage { min-height: 130px; }
  .monster-frame { transform: scale(.9); transform-origin: left center; }
  .site-footer { display: grid; gap: 7px; padding: 16px 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
