:root {
  --bg: #0a0714;
  --bg-2: #110b20;
  --bg-card: #1a1130;
  --bg-card-2: #221740;
  --border: #2a1e4a;
  --border-glow: #3d2a6b;
  --text: #f5f2ff;
  --muted: #a99cc9;
  --dim: #6f6490;
  --accent: #a78bfa;
  --accent-dim: #8b5cf6;
  --cyan: #38bdf8;
  --green: #34d399;
  --gold: #fbbf24;
  --max-w: 72rem;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(60rem 30rem at 85% -5%, rgba(167,139,250,0.10), transparent 60%),
    radial-gradient(50rem 28rem at 0% 10%, rgba(56,189,248,0.07), transparent 55%),
    radial-gradient(45rem 30rem at 50% 110%, rgba(52,211,153,0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,7,20,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(167,139,250,0.08);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; gap: 1rem;
}
.nav-logo {
  font-weight: 800; color: var(--text); text-decoration: none; font-size: 1.1rem;
  background: linear-gradient(90deg, #c4b5fd, #38bdf8);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.nav-links { display: none; list-style: none; gap: 0.25rem; }
@media (min-width: 900px) { .nav-links { display: flex; } }
.nav-links a {
  color: var(--muted); padding: 0.5rem 0.6rem; border-radius: 0.5rem;
  font-size: 0.85rem; text-decoration: none; white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); background: var(--bg-card); text-decoration: none; }
.nav-mobile { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0 1rem 0.5rem; }
@media (min-width: 900px) { .nav-mobile { display: none; } }
.nav-mobile a {
  white-space: nowrap; font-size: 0.75rem; color: var(--muted);
  border: 1px solid var(--border); padding: 0.25rem 0.75rem; border-radius: 999px;
  text-decoration: none; background: rgba(26,17,48,0.6);
}
.btn {
  display: inline-block; background: linear-gradient(135deg, #a78bfa, #8b5cf6); color: #120a24;
  font-weight: 700; padding: 0.5rem 1rem; border-radius: 0.5rem;
  text-decoration: none; border: none; cursor: pointer; font-size: 0.875rem;
  box-shadow: 0 0 18px rgba(167,139,250,0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 0 26px rgba(167,139,250,0.4); color: #120a24; text-decoration: none; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border-glow); box-shadow: none; }
.btn-outline:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 18px rgba(56,189,248,0.2); }

main { flex: 1; padding: 2rem 0; }
.page-narrow { max-width: 48rem; margin: 0 auto; padding: 0 1rem; }
.page-wide { max-width: var(--max-w); margin: 0 auto; padding: 0 1rem; }
h1 { font-size: 2rem; font-weight: 800; margin-bottom: 0.75rem; line-height: 1.2; }
@media (min-width: 768px) { h1 { font-size: 2.5rem; } }
h2 { font-size: 1.5rem; font-weight: 700; margin: 2rem 0 1rem; color: var(--text); }
h3 { font-size: 1.15rem; font-weight: 700; margin: 1.5rem 0 0.75rem; color: var(--text); }
p { color: var(--muted); margin-bottom: 1rem; }
ul, ol { color: var(--muted); margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.5rem; }
.breadcrumb { font-size: 0.875rem; color: var(--muted); margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--muted); }
.last-updated { font-size: 0.875rem; color: var(--dim); margin-bottom: 1.5rem; }

.quick-answer {
  border: 1px solid rgba(167,139,250,0.35);
  border-left: 4px solid var(--accent);
  background: linear-gradient(135deg, rgba(167,139,250,0.12), rgba(56,189,248,0.06));
  padding: 1.25rem; border-radius: 0 0.75rem 0.75rem 0; margin-bottom: 2rem;
}
.quick-answer-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--accent); margin-bottom: 0.25rem; letter-spacing: 0.08em; }
.quick-answer p { color: #e9e4f8; margin: 0; font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 2.5rem 0 3rem; position: relative; }
.hero h1 {
  background: linear-gradient(90deg, #c4b5fd 0%, #38bdf8 55%, #34d399 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-badge {
  display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--cyan); margin-bottom: 0.9rem; padding: 0.3rem 0.9rem;
  border: 1px solid rgba(56,189,248,0.35); border-radius: 999px; background: rgba(56,189,248,0.08);
}
.hero-btns { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 1.5rem; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 2rem; }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stats-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.5rem 0; }
.stat {
  background: linear-gradient(160deg, var(--bg-card), var(--bg-2));
  border: 1px solid var(--border); border-radius: 0.75rem; padding: 1rem; text-align: center;
}
.stat-label { font-size: 0.7rem; text-transform: uppercase; color: var(--dim); letter-spacing: 0.08em; }
.stat-value { font-size: 1.25rem; font-weight: 700; color: var(--accent); margin-top: 0.25rem; }

.card-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 2rem; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: linear-gradient(160deg, rgba(26,17,48,0.85), rgba(17,11,32,0.85));
  border: 1px solid var(--border);
  border-radius: 0.75rem; padding: 1.25rem; text-decoration: none; color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  display: block;
}
.card:hover {
  border-color: rgba(167,139,250,0.5); text-decoration: none;
  transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.35), 0 0 20px rgba(167,139,250,0.08);
}
.card-icon { font-size: 1.5rem; }
.card h3, .card .card-title { color: var(--text); margin: 0.75rem 0 0.5rem; font-size: 1.1rem; font-weight: 700; }
.card p { font-size: 0.875rem; margin: 0; }
.card-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.6rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 0.75rem; margin-bottom: 1.5rem; background: rgba(17,11,32,0.5); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead { background: var(--bg-card); }
th { padding: 0.75rem 1rem; text-align: left; color: #d6cdec; font-weight: 600; }
td { padding: 0.75rem 1rem; border-top: 1px solid var(--border); color: var(--muted); }
td code, .code-text { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 700; color: var(--cyan); background: rgba(56,189,248,0.08); padding: 0.1rem 0.4rem; border-radius: 0.3rem; }
.badge-active { font-size: 0.65rem; background: rgba(52,211,153,0.18); color: var(--green); padding: 0.15rem 0.5rem; border-radius: 999px; margin-left: 0.5rem; border: 1px solid rgba(52,211,153,0.3); white-space: nowrap; }
.badge-new { font-size: 0.65rem; background: rgba(251,191,36,0.15); color: var(--gold); padding: 0.15rem 0.5rem; border-radius: 999px; margin-left: 0.5rem; border: 1px solid rgba(251,191,36,0.35); white-space: nowrap; }
.badge-expired { font-size: 0.65rem; background: rgba(148,163,184,0.12); color: var(--dim); padding: 0.15rem 0.5rem; border-radius: 999px; margin-left: 0.5rem; border: 1px solid rgba(148,163,184,0.25); text-decoration: line-through; white-space: nowrap; }
.copy-btn {
  background: linear-gradient(135deg, #a78bfa, #8b5cf6); color: #120a24; border: none;
  padding: 0.35rem 0.75rem; border-radius: 0.5rem; font-size: 0.8rem; font-weight: 700; cursor: pointer;
}
.copy-btn:hover { box-shadow: 0 0 14px rgba(167,139,250,0.4); }
.copy-btn.copied { background: #4c1d95; color: #fff; }

.faq { margin-top: 2rem; }
.faq-item { border: 1px solid var(--border); border-radius: 0.75rem; margin-bottom: 0.75rem; overflow: hidden; }
.faq-q { width: 100%; text-align: left; background: rgba(26,17,48,0.6); border: none; color: var(--text); padding: 1rem 1.25rem; font-weight: 600; cursor: pointer; font-size: 1rem; }
.faq-a { padding: 0 1.25rem 1rem; color: var(--muted); display: none; }
.faq-item.open .faq-a { display: block; }

.related { margin-top: 2rem; border: 1px solid var(--border); border-radius: 0.75rem; padding: 1.5rem; background: rgba(26,17,48,0.4); }
.related-grid { display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .related-grid { grid-template-columns: 1fr 1fr; } }
.related-link { border: 1px solid var(--border); border-radius: 0.5rem; padding: 1rem; text-decoration: none; display: block; }
.related-link:hover { border-color: var(--accent); text-decoration: none; }
.related-link strong { color: var(--accent); display: block; }
.related-link span { font-size: 0.875rem; color: var(--muted); }

/* ---------- Tier system ---------- */
.tier-block { border-radius: 0.75rem; padding: 1.5rem; margin-bottom: 1.5rem; border: 1px solid; }
.tier-s { border-color: rgba(239,68,68,0.35); background: linear-gradient(160deg, rgba(239,68,68,0.08), rgba(17,11,32,0.6)); }
.tier-a { border-color: rgba(249,115,22,0.35); background: linear-gradient(160deg, rgba(249,115,22,0.08), rgba(17,11,32,0.6)); }
.tier-b { border-color: rgba(234,179,8,0.35); background: linear-gradient(160deg, rgba(234,179,8,0.07), rgba(17,11,32,0.6)); }
.tier-c { border-color: rgba(20,184,166,0.35); background: linear-gradient(160deg, rgba(20,184,166,0.08), rgba(17,11,32,0.6)); }
.tier-letter {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.6rem; height: 2.6rem; border-radius: 0.6rem; font-size: 1.4rem; font-weight: 900;
  margin-right: 0.75rem; vertical-align: middle; color: #fff;
}
.tier-letter-s { background: linear-gradient(135deg, #ef4444, #b91c1c); box-shadow: 0 0 16px rgba(239,68,68,0.4); }
.tier-letter-a { background: linear-gradient(135deg, #f97316, #c2410c); box-shadow: 0 0 16px rgba(249,115,22,0.4); }
.tier-letter-b { background: linear-gradient(135deg, #eab308, #a16207); box-shadow: 0 0 16px rgba(234,179,8,0.35); }
.tier-letter-c { background: linear-gradient(135deg, #14b8a6, #0f766e); box-shadow: 0 0 16px rgba(20,184,166,0.35); }
.tier-block h2 { display: flex; align-items: center; margin-top: 0; }
.tier-mons { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.mon-chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  border: 1px solid var(--border-glow); background: rgba(26,17,48,0.8);
  padding: 0.35rem 0.75rem; border-radius: 999px; font-size: 0.85rem; color: var(--text);
  text-decoration: none;
}
a.mon-chip:hover { border-color: var(--cyan); text-decoration: none; }
.tier-notes { border-top: 1px dashed var(--border-glow); padding-top: 0.9rem; margin-top: 0.25rem; }
.tier-notes ul { margin-bottom: 0; font-size: 0.875rem; }

/* ---------- Element badges ---------- */
.type-badge {
  display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 0.12rem 0.55rem;
  border-radius: 999px; letter-spacing: 0.03em; text-transform: uppercase; color: #fff; white-space: nowrap;
}
.type-fire { background: #dc2626; }
.type-water { background: #2563eb; }
.type-grass { background: #16a34a; }
.type-electric { background: #ca8a04; }
.type-ice { background: #0891b2; }
.type-ground { background: #b45309; }
.type-none { background: #64748b; }
.rarity-badge {
  display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 0.12rem 0.55rem;
  border-radius: 999px; letter-spacing: 0.03em; white-space: nowrap; border: 1px solid;
}
.rarity-secret { color: #f472b6; border-color: rgba(244,114,182,0.4); background: rgba(244,114,182,0.1); }
.rarity-mythic, .rarity-mythical { color: #c4b5fd; border-color: rgba(196,181,253,0.4); background: rgba(196,181,253,0.1); }
.rarity-legendary { color: #fbbf24; border-color: rgba(251,191,36,0.4); background: rgba(251,191,36,0.1); }
.rarity-epic { color: #a78bfa; border-color: rgba(167,139,250,0.4); background: rgba(167,139,250,0.08); }
.rarity-rare { color: #38bdf8; border-color: rgba(56,189,248,0.4); background: rgba(56,189,248,0.08); }

.footer { border-top: 1px solid var(--border); background: rgba(10,7,20,0.8); padding: 2rem 0 1rem; margin-top: auto; }
.footer-grid { max-width: var(--max-w); margin: 0 auto; padding: 0 1rem; display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer .footer-title { margin-bottom: 0.75rem; font-size: 1rem; font-weight: 700; color: var(--text); }
.footer a { display: block; color: var(--muted); font-size: 0.875rem; margin-bottom: 0.5rem; text-decoration: none; }
.footer a:hover { color: var(--accent); }
.footer p { font-size: 0.85rem; }
.footer-bottom { text-align: center; padding: 1rem; font-size: 0.75rem; color: var(--dim); border-top: 1px solid var(--border); margin-top: 2rem; }

.steps { list-style: none; padding: 0; }
.steps li { display: flex; gap: 1rem; margin-bottom: 1rem; align-items: baseline; }
.step-num {
  width: 2rem; height: 2rem; border-radius: 999px; background: linear-gradient(135deg, #a78bfa, #8b5cf6);
  color: #120a24; font-weight: 700; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 0.875rem;
}

.callout {
  border: 1px solid var(--border); border-radius: 0.75rem;
  padding: 1.25rem; margin-bottom: 1.5rem; background: rgba(26,17,48,0.6);
}
.callout-tip { border-left: 4px solid var(--green); }
.callout-warn { border-left: 4px solid #f59e0b; }
.content-block { margin-bottom: 2.5rem; }
.content-block h2 { margin-top: 0; }
.toc { background: var(--bg-card); border: 1px solid var(--border); border-radius: 0.75rem; padding: 1.25rem; margin-bottom: 2rem; }
.toc ol { margin: 0.5rem 0 0; }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--accent); }
.two-col { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .two-col { grid-template-columns: 1fr 1fr; } }
.tag { display: inline-block; font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--bg-card); border: 1px solid var(--border-glow); margin-right: 0.25rem; }

/* ---------- Info table (monster/item detail) ---------- */
.info-table { width: 100%; margin-bottom: 1.5rem; }
.info-table th { width: 32%; vertical-align: top; color: var(--dim); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.info-table td { color: var(--text); }

/* ---------- Tools ---------- */
.tool-panel {
  border: 1px solid var(--border); border-radius: 0.75rem; padding: 1.5rem;
  background: linear-gradient(160deg, rgba(26,17,48,0.85), rgba(17,11,32,0.85)); margin-bottom: 1.5rem;
}
.tool-panel label { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dim); margin: 1rem 0 0.35rem; }
.tool-panel select, .tool-panel input[type="number"] {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border-glow); color: var(--text);
  padding: 0.6rem 0.75rem; border-radius: 0.5rem; font-size: 0.95rem;
}
.tool-panel select:focus, .tool-panel input:focus { outline: none; border-color: var(--accent); }
.tool-result {
  border: 1px solid rgba(52,211,153,0.35); border-radius: 0.75rem; padding: 1.25rem;
  background: rgba(52,211,153,0.06); margin-top: 1.25rem;
}
.tool-result h3 { margin-top: 0; color: var(--green); }
.tool-result ul { margin-bottom: 0; }
.team-slots { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
@media (min-width: 640px) { .team-slots { grid-template-columns: repeat(3, 1fr); } }
.team-slot { border: 1px solid var(--border-glow); border-radius: 0.75rem; padding: 1rem; background: rgba(17,11,32,0.6); }
.team-slot .slot-label { margin: 0 0 0.5rem; font-size: 0.9rem; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: 0.05em; }
.share-row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.share-url { flex: 1; min-width: 200px; background: var(--bg-2); border: 1px solid var(--border-glow); color: var(--muted); padding: 0.5rem 0.75rem; border-radius: 0.5rem; font-size: 0.8rem; font-family: ui-monospace, Menlo, monospace; }
