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

:root {
  --bg: #0d0b09;
  --bg2: #131019;
  --panel: #181421;
  --panel2: #1f1a2b;
  --panel3: #251f33;
  --line: #2c2540;
  --line2: #3a3157;
  --text: #ece8f3;
  --muted: #a89fc0;
  --dim: #756e90;
  --gold: #f5c45a;
  --gold-soft: #ffd98a;
  --amber: #e89a3c;
  --green: #74e08a;
  --red: #ff7a6b;
  --blue: #6fc0ff;
  --purple: #c79bff;
  --pink: #ff7ad0;
  --grad: linear-gradient(135deg, #f5c45a, #e8863c);
  --shadow: 0 10px 40px rgba(0,0,0,0.55);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -200px, rgba(232,134,60,0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(124,92,255,0.10), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px; line-height: 1.65;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-soft); }
img { image-rendering: pixelated; }
::selection { background: rgba(245,196,90,0.3); }

h1, h2, h3, .brand .t, .hero h1 { font-family: 'Rajdhani', sans-serif; letter-spacing: 0.4px; }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- top bar ---------- */
header.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 16px;
  padding: 11px 22px;
  background: rgba(13,11,9,0.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand-logo { height: 38px; width: auto; image-rendering: pixelated; display: block;
  filter: drop-shadow(0 2px 6px rgba(41,198,255,0.25)); }
.brand .s { font-size: 10px; color: var(--dim); letter-spacing: 2.5px; text-transform: uppercase;
  border-left: 1px solid var(--line2); padding-left: 12px; }
.gsearch { position: relative; flex: 1; max-width: 440px; }
.gsearch input { width: 100%; background: var(--panel); border: 1px solid var(--line2); color: var(--text);
  padding: 10px 14px 10px 38px; border-radius: 10px; font-size: 14px; outline: none; font-family: inherit; }
.gsearch input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,196,90,0.12); }
.gsearch .gi { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); opacity: 0.5; }
.gresults { position: absolute; top: 46px; left: 0; right: 0; background: var(--panel2); border: 1px solid var(--line2);
  border-radius: 12px; box-shadow: var(--shadow); max-height: 60vh; overflow-y: auto; display: none; z-index: 70; padding: 6px; }
.gresults.show { display: block; }
.gresults .gr { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.gresults .gr:hover { background: var(--panel3); }
.gresults .gr .t2 { color: var(--dim); font-size: 11px; margin-left: auto; text-transform: uppercase; }
.topbar .spacer { flex: 0; }
.play { background: var(--grad); color: #1a1206; padding: 9px 18px; border-radius: 10px; font-weight: 700;
  font-size: 14px; white-space: nowrap; box-shadow: 0 4px 16px rgba(232,134,60,0.35); }
.play:hover { filter: brightness(1.08); color: #1a1206; }
.menu-toggle { display: none; background: var(--panel); border: 1px solid var(--line2); color: var(--gold);
  font-size: 19px; border-radius: 8px; padding: 4px 11px; cursor: pointer; }

/* ---------- layout ---------- */
.layout { display: flex; max-width: 1500px; margin: 0 auto; }
nav.side { width: 244px; flex-shrink: 0; padding: 16px 10px 80px;
  position: sticky; top: 57px; height: calc(100vh - 57px); overflow-y: auto; }
nav.side .group { font-size: 10px; text-transform: uppercase; letter-spacing: 1.8px;
  color: var(--dim); margin: 18px 14px 6px; }
nav.side a { display: flex; align-items: center; gap: 11px; padding: 8px 13px; margin: 1px 4px;
  border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 500; }
nav.side a:hover { background: var(--panel); color: var(--text); }
nav.side a.active { background: linear-gradient(90deg, rgba(245,196,90,0.16), rgba(245,196,90,0.02));
  color: var(--gold-soft); box-shadow: inset 2px 0 0 var(--gold); }
nav.side a .ic { width: 20px; text-align: center; font-size: 15px; }

main { flex: 1; min-width: 0; padding: 30px 40px 120px; }
section.page { display: none; }
section.page.active { display: block; animation: fade 0.3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- typography ---------- */
h1.title { font-size: 38px; font-weight: 700; margin: 0 0 6px; color: var(--text); }
h1.title .accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 17px; margin: 0 0 26px; max-width: 75ch; }
h2 { font-size: 25px; font-weight: 600; margin: 38px 0 14px; color: var(--text);
  display: flex; align-items: center; gap: 10px; }
h2::before { content: ''; width: 4px; height: 22px; background: var(--grad); border-radius: 3px; }
h3 { font-size: 17px; margin: 22px 0 8px; color: var(--gold-soft); font-weight: 600; }
p { max-width: 80ch; } ul, ol { max-width: 80ch; } li { margin: 5px 0; }
code { background: var(--panel2); padding: 2px 7px; border-radius: 6px; font-size: 13px; color: var(--gold); border: 1px solid var(--line); }
strong { color: #fff; }
.muted, .mut { color: var(--muted); }

/* ---------- hero ---------- */
.hero { position: relative; border-radius: 20px; overflow: hidden; margin-bottom: 30px;
  border: 1px solid var(--line2);
  background: linear-gradient(120deg, rgba(232,134,60,0.14), rgba(124,92,255,0.12) 60%, transparent), var(--panel); }
.hero-inner { padding: 46px 44px; position: relative; z-index: 2; }
.hero-logo { height: 92px; width: auto; image-rendering: pixelated; margin-bottom: 14px;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,0.5)); }
.hero .eyebrow { color: var(--gold); font-weight: 700; letter-spacing: 3px; text-transform: uppercase; font-size: 12px; }
.hero h1 { font-size: 52px; line-height: 1.02; margin: 10px 0 14px; max-width: 18ch; font-weight: 700; }
.hero h1 .accent { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 17px; color: var(--muted); max-width: 56ch; }
.hero-cta { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.btn { padding: 11px 20px; border-radius: 11px; font-weight: 700; font-size: 14px; cursor: pointer; border: 1px solid transparent; }
.btn.primary { background: var(--grad); color: #1a1206; box-shadow: 0 6px 20px rgba(232,134,60,0.3); }
.btn.ghost { background: var(--panel2); border-color: var(--line2); color: var(--text); }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.hero-mobs { position: absolute; right: 20px; bottom: 0; top: 0; display: flex; align-items: center; gap: 6px; z-index: 1; opacity: 0.92; }
@media (max-width: 1100px) { .hero-mobs { display: none; } }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin: 20px 0; }
.qcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  transition: 0.18s; cursor: pointer; position: relative; overflow: hidden; }
.qcard:hover { border-color: var(--line2); transform: translateY(-3px); box-shadow: var(--shadow); }
.qcard .ico { font-size: 26px; margin-bottom: 8px; }
.qcard h3 { margin: 0 0 4px; color: var(--text); }
.qcard p { margin: 0; color: var(--muted); font-size: 14px; }
.qcard::after { content: '→'; position: absolute; right: 18px; top: 18px; color: var(--gold); opacity: 0; transition: 0.18s; }
.qcard:hover::after { opacity: 1; right: 14px; }

.statband { display: flex; flex-wrap: wrap; gap: 14px; margin: 22px 0; }
.statband .sb { flex: 1; min-width: 150px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.statband .sb .n { font-family: 'Rajdhani'; font-size: 30px; font-weight: 700; color: var(--gold); line-height: 1; }
.statband .sb .l { color: var(--muted); font-size: 13px; margin-top: 4px; }

.callout { background: linear-gradient(90deg, rgba(245,196,90,0.08), transparent); border: 1px solid var(--line);
  border-left: 3px solid var(--gold); border-radius: 10px; padding: 14px 18px; margin: 18px 0; color: var(--muted); }
.callout.warn { border-left-color: var(--red); background: linear-gradient(90deg, rgba(255,122,107,0.08), transparent); }
.callout.good { border-left-color: var(--green); background: linear-gradient(90deg, rgba(116,224,138,0.08), transparent); }
.callout b { color: var(--text); }
.lore { font-size: 16.5px; line-height: 1.85; color: #d8d2e6; max-width: 74ch; }
.lore p::first-letter { }
.dropcap::first-letter { float: left; font-family: 'Rajdhani'; font-size: 58px; line-height: 0.8; padding: 4px 10px 0 0; color: var(--gold); font-weight: 700; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px;
  font-weight: 600; border: 1px solid var(--line2); color: var(--muted); background: var(--panel2); }
.pill.boss { background: rgba(255,122,107,0.14); border-color: rgba(255,122,107,0.4); color: #ff9686; }
.pill.aggro { background: rgba(232,154,60,0.14); border-color: rgba(232,154,60,0.4); color: #f5b66a; }
.pill.poison { background: rgba(116,224,138,0.12); border-color: rgba(116,224,138,0.35); color: #92e6a4; }
.pill.gold { background: rgba(245,196,90,0.12); border-color: rgba(245,196,90,0.4); color: var(--gold); }
.pill.lv { background: var(--panel3); color: var(--gold-soft); font-family: 'Rajdhani'; font-weight: 700; }

/* ---------- mob portrait (animated sprite) ---------- */
@keyframes mobIdle { to { background-position-x: var(--end); } }
.mob-portrait { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mob-sheet { display: block; image-rendering: pixelated; background-repeat: no-repeat; }
.mob-fallback { max-width: 80%; max-height: 80%; object-fit: contain; }

/* ---------- bestiary grid ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 20px; }
.toolbar input[type=search], .toolbar select { background: var(--panel); border: 1px solid var(--line2); color: var(--text);
  padding: 10px 14px; border-radius: 10px; font-size: 14px; outline: none; font-family: inherit; }
.toolbar input[type=search] { min-width: 240px; }
.toolbar input[type=search]:focus, .toolbar select:focus { border-color: var(--gold); }
.toolbar .count { color: var(--dim); font-size: 13px; margin-left: auto; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line2); background: var(--panel);
  color: var(--muted); font-size: 13px; cursor: pointer; font-weight: 600; }
.chip.on { background: var(--grad); color: #1a1206; border-color: transparent; }

.mob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.mob-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 14px 14px;
  text-align: center; cursor: pointer; transition: 0.16s; position: relative; overflow: hidden; }
.mob-card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(120px 80px at 50% 0%, rgba(245,196,90,0.08), transparent 70%); opacity: 0; transition: 0.16s; }
.mob-card:hover { border-color: var(--line2); transform: translateY(-4px); box-shadow: var(--shadow); }
.mob-card:hover::before { opacity: 1; }
.mob-card.is-boss { border-color: rgba(255,122,107,0.35); }
.mob-card .pic { height: 90px; display: flex; align-items: flex-end; justify-content: center; margin-bottom: 6px; }
.mob-card .nm { font-weight: 600; font-size: 15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mob-card .meta { display: flex; justify-content: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.mob-card .meta b { color: var(--gold-soft); font-family: 'Rajdhani'; }
.mob-card .tagrow { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; margin-top: 8px; min-height: 20px; }
.mob-card .tagrow .pill { font-size: 10px; padding: 1px 7px; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(5,4,8,0.78); backdrop-filter: blur(4px); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-bg.show { display: flex; animation: fade 0.2s; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 18px; box-shadow: var(--shadow);
  max-width: 760px; width: 100%; max-height: 88vh; overflow-y: auto; }
.modal-head { display: flex; gap: 18px; align-items: center; padding: 24px 26px; position: relative;
  background: linear-gradient(120deg, rgba(232,134,60,0.12), transparent); border-bottom: 1px solid var(--line); }
.modal-head .big { width: 110px; height: 110px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 14px; }
.modal-head h2 { margin: 0; border: none; font-size: 30px; }
.modal-head h2::before { display: none; }
.modal-head .sub { color: var(--muted); margin-top: 4px; }
.modal-close { position: absolute; right: 16px; top: 14px; background: var(--panel2); border: 1px solid var(--line2);
  color: var(--muted); width: 34px; height: 34px; border-radius: 9px; font-size: 18px; cursor: pointer; }
.modal-close:hover { color: var(--text); border-color: var(--line2); }
.modal-body { padding: 22px 26px 28px; }
.modal-body .flavor { font-style: italic; color: var(--muted); border-left: 2px solid var(--line2); padding-left: 14px; margin: 0 0 18px; }

.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 8px 20px; margin: 6px 0 4px; }
.statgrid .s { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 5px 0; font-size: 13.5px; }
.statgrid .s span:first-child { color: var(--muted); }
.statgrid .s span:last-child { color: var(--gold-soft); font-family: 'Rajdhani'; font-weight: 700; }

/* ---------- drop list ---------- */
.droplist { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 8px 0 4px; }
.drow { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.drow:last-child { border-bottom: none; }
.drow:hover { background: var(--panel2); }
.drow .di { width: 34px; height: 34px; display: grid; place-items: center; flex-shrink: 0; }
.drow .di img { width: 30px; height: 30px; object-fit: contain; }
.drow .dn { flex: 1; min-width: 0; }
.drow .dn .nm2 { font-weight: 600; }
.drow .dn .src { color: var(--dim); font-size: 11px; }
.drow .dbar { width: 130px; flex-shrink: 0; }
.bar { height: 7px; border-radius: 4px; background: var(--panel3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--grad); }
.drow .dp { width: 64px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; flex-shrink: 0; }
.rar { font-size: 11px; padding: 2px 9px; border-radius: 999px; font-weight: 700; width: 78px; text-align: center; flex-shrink: 0; }
.rar.common { background: rgba(116,224,138,0.14); color: #92e6a4; }
.rar.uncommon { background: rgba(111,192,255,0.14); color: #8fccff; }
.rar.rare { background: rgba(199,155,255,0.16); color: #d3b3ff; }
.rar.veryrare { background: rgba(255,154,108,0.16); color: #ffb088; }
.rar.legendary { background: linear-gradient(90deg, rgba(245,196,90,0.25), rgba(232,134,60,0.18)); color: var(--gold-soft); box-shadow: inset 0 0 0 1px rgba(245,196,90,0.4); }

/* ---------- generic table ---------- */
table.data { width: 100%; border-collapse: collapse; margin: 8px 0 26px; font-size: 14px; }
table.data th { text-align: left; color: var(--gold-soft); font-weight: 700; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.6px; padding: 9px 12px; border-bottom: 1px solid var(--line2); cursor: pointer; user-select: none;
  white-space: nowrap; position: sticky; top: 57px; background: var(--bg); }
table.data th.no-sort { cursor: default; }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:hover { background: var(--panel); }
.icon { width: 30px; height: 30px; object-fit: contain; vertical-align: middle; }
.namecell { display: flex; align-items: center; gap: 11px; }
.namecell .nm { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.gold-t { color: var(--gold); }
.itemrow { cursor: pointer; }

/* item type colors */
.t-weapon { color: #ff9e88; } .t-armour, .t-chestplate, .t-platebody { color: #8fccff; }
.t-pet { color: var(--purple); } .t-helmet, .t-boots, .t-legplates, .t-shield { color: #8fccff; }
.t-pendant, .t-ring { color: var(--gold-soft); }

footer.foot { border-top: 1px solid var(--line); margin-top: 50px; padding: 22px 0; color: var(--dim); font-size: 13px; }
.backtop { position: fixed; right: 24px; bottom: 24px; background: var(--panel2); border: 1px solid var(--line2);
  color: var(--gold); width: 44px; height: 44px; border-radius: 50%; font-size: 18px; cursor: pointer; display: none; z-index: 50; }
.loading { color: var(--dim); padding: 60px 0; text-align: center; }

@media (max-width: 980px) {
  .menu-toggle { display: block; }
  nav.side { position: fixed; left: 0; top: 57px; background: var(--bg2); z-index: 55;
    transform: translateX(-100%); transition: 0.22s; box-shadow: 8px 0 30px rgba(0,0,0,0.7); border-right: 1px solid var(--line2); }
  nav.side.open { transform: none; }
  main { padding: 22px 16px 90px; }
  .brand .s { display: none; }
  table.data th { position: static; }
  .hero h1 { font-size: 38px; }
  .hero-inner { padding: 32px 24px; }
  h1.title { font-size: 30px; }
}
