:root {
  --bg: #0f1117;
  --panel: #171a23;
  --panel-2: #1f2330;
  --border: #2a2f3d;
  --text: #e6e8ee;
  --muted: #9aa1b2;
  --accent: #e0b354;
  --accent-2: #7aa7ff;
  --good: #5fd39a;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

img { display: block; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(15, 17, 23, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 24px; height: 60px;
}
.brand { font-weight: 700; font-size: 18px; color: var(--accent); letter-spacing: .3px; }
.brand:hover { text-decoration: none; }
nav { display: flex; gap: 4px; }
nav a {
  color: var(--muted); padding: 8px 14px; border-radius: 8px; font-weight: 500;
}
nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
nav a.active { color: var(--text); background: var(--panel-2); }

main { max-width: 1200px; margin: 0 auto; padding: 28px 20px 60px; }

footer {
  border-top: 1px solid var(--border); color: var(--muted);
  font-size: 13px; text-align: center; padding: 20px;
}

h1 { font-size: 30px; margin: 0 0 8px; }
h2 { font-size: 21px; margin: 36px 0 14px; }
h3 { font-size: 16px; margin: 0 0 10px; }
.lead { color: var(--muted); margin: 0 0 24px; max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Panels ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }

/* ---------- Hero banner on home ---------- */
.hero-banner {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center;
  background: linear-gradient(135deg, #1d2130, #141720);
  border: 1px solid var(--border); border-radius: 14px; padding: 28px; overflow: hidden;
}
.hero-banner .portraits { display: flex; gap: 8px; justify-content: flex-end; }
.hero-banner .portraits img {
  width: 92px; height: 130px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border);
}
.cta { display: flex; gap: 10px; margin-top: 18px; }
.btn {
  display: inline-block; padding: 9px 18px; border-radius: 8px; font-weight: 600;
  background: var(--accent); color: #1a1405;
}
.btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn:hover { text-decoration: none; filter: brightness(1.08); }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 24px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .value { font-size: 26px; font-weight: 700; }
.stat .label { color: var(--muted); font-size: 13px; }

/* ---------- Icon list rows ---------- */
.icon-row { display: flex; align-items: center; gap: 12px; }
.icon-row img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.icon-row .count { margin-left: auto; color: var(--muted); font-size: 13px; }

.set-card { display: flex; gap: 12px; }
.set-card img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.set-card p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px; padding: 2px 9px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
}
.tag.gold { color: var(--accent); border-color: #5a4a25; }

/* ---------- Filters ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; margin-bottom: 18px;
}
.filters input, .filters select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px;
}
.filters input { flex: 1; min-width: 200px; }
.filters .result-count { margin-left: auto; color: var(--muted); font-size: 13px; }

/* ---------- Hero cards ---------- */
.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.hero-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; color: var(--text); transition: transform .12s, border-color .12s;
  display: flex; flex-direction: column;
}
.hero-card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.hero-card .img-wrap { position: relative; aspect-ratio: 3 / 4; background: #0b0d12; }
.hero-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.hero-card .badges { position: absolute; top: 6px; left: 6px; display: flex; flex-direction: column; gap: 4px; }
.hero-card .badges img { width: 26px; height: 26px; background: rgba(0,0,0,.55); border-radius: 50%; padding: 2px; }
.hero-card .stars { position: absolute; bottom: 6px; right: 8px; color: var(--accent); font-size: 13px; text-shadow: 0 1px 2px #000; }
.hero-card .body { padding: 8px 10px 10px; }
.hero-card .name { font-weight: 600; font-size: 14px; }
.hero-card .sub { color: var(--muted); font-size: 12px; }

/* ---------- Hero detail ---------- */
.hero-detail { display: grid; grid-template-columns: 300px 1fr; gap: 28px; }
.hero-detail .portrait img { width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.meta-line { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 10px 0 16px; color: var(--muted); }
.meta-line .pill { display: flex; align-items: center; gap: 6px; }
.meta-line .pill img { width: 22px; height: 22px; object-fit: contain; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab-btn {
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 14px; cursor: pointer; font: inherit; font-size: 14px;
}
.tab-btn.active { color: #1a1405; background: var(--accent); border-color: var(--accent); }

.slot { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.slot-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-weight: 600; }
.slot-head img { width: 26px; height: 26px; }
.choice { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.choice img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.choice .nm { flex: 1; font-size: 14px; }
.rate { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; font-size: 13px; }
.attrs { margin-top: 10px; font-size: 13px; color: var(--muted); }
.attrs b { color: var(--text); font-weight: 500; }

.bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.bar > span { display: block; height: 100%; background: var(--accent); }

.usage-row { display: grid; grid-template-columns: 40px 1fr 60px; align-items: center; gap: 10px; padding: 6px 0; }
.usage-row img { width: 36px; height: 36px; object-fit: contain; }

.lineup { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.lineup a { width: 70px; text-align: center; font-size: 11px; color: var(--muted); }
.lineup img { width: 70px; height: 92px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.lineup .lord img { border-color: var(--accent); }

/* ---------- Arena ---------- */
.arena-head { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: flex-start; }
.arena-member { display: grid; grid-template-columns: 120px 1fr; gap: 16px; }
.arena-member .portrait img { width: 120px; height: 160px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; margin: 10px 0; }
.kv div { background: var(--panel-2); border-radius: 6px; padding: 5px 8px; }
.kv .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.kv .v { font-weight: 600; font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
td .note { color: var(--muted); font-size: 12px; margin-top: 3px; }
.unknown { color: #6b7284; font-style: italic; }

.timeline { display: flex; flex-direction: column; gap: 10px; }
.wave { display: grid; grid-template-columns: 80px 1fr; gap: 12px; align-items: start; }
.wave .wlabel { font-weight: 700; color: var(--accent); padding-top: 6px; }
.casts { display: flex; flex-wrap: wrap; gap: 8px; }
.cast {
  display: flex; align-items: center; gap: 8px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px 5px 5px; font-size: 13px;
}
.cast img { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; }
.cast .t { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; }
.cast.deploy { border-style: dashed; }

.loading, .error { padding: 40px; text-align: center; color: var(--muted); }
.error { color: #ff8a8a; }


/* ---------- Meta teams (sidebar layout) ---------- */
main.with-sidebar { max-width: 1400px; display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }
.sidebar {
  position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px;
}
.sidebar input {
  width: 100%; background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; margin-bottom: 8px;
}
.menu-group { margin-top: 10px; }
.menu-title { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--accent); padding: 4px 8px; font-weight: 600; }
.menu-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; color: var(--muted); font-size: 13.5px; }
.menu-item img, .menu-icon-ph { width: 44px; height: 26px; object-fit: cover; flex: none; border-radius: 4px; }
.menu-icon-ph { background: var(--panel-2); }
.menu-item .nm { flex: 1; line-height: 1.25; }
.menu-item .cnt { font-size: 11px; background: var(--panel-2); border-radius: 999px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.menu-item:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.menu-item.active { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.menu-item.active .cnt { background: var(--accent); color: #1a1405; }

.mode-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.mode-head img { width: 120px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.mode-head h1 { margin: 0; }

.usage-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.usage-chip {
  display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 10px 4px 4px; color: var(--text); font-size: 13px;
}
.usage-chip img { width: 30px; height: 40px; object-fit: cover; border-radius: 5px; }
.usage-chip:hover { border-color: var(--accent); text-decoration: none; }

.team-list { display: grid; gap: 12px; }
.team-card.top { border-color: #5a4a25; }
.team-head { display: flex; align-items: center; gap: 10px; }
.team-no { font-weight: 700; color: var(--accent); }
.team-card .lineup a { width: 84px; }
.team-card .lineup img { width: 84px; height: 110px; }
.lord-tag { color: var(--accent); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }

@media (max-width: 800px) {
  main.with-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: 45vh; }
  .hero-banner, .hero-detail { grid-template-columns: 1fr; }
  .hero-banner .portraits { justify-content: flex-start; overflow-x: auto; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .arena-member { grid-template-columns: 1fr; }
  nav a { padding: 8px 10px; }
}

/* Guild War teams from video: notes, unidentified heroes, placement maps */
.lineup .unidentified { width: 84px; text-align: center; font-size: 11px; color: var(--muted); }
.lineup .unidentified img { width: 84px; height: 110px; object-fit: cover; border-radius: 6px; border: 1px dashed var(--border); }
.lineup .guess img { border-style: dashed; }
.hero-note { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; opacity: .8; }
.placements { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 12px; }
.placement { margin: 0; }
.placement img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); display: block; }
.placement figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- Home: PvP / GvG / PvE meta ---------- */
.meta-banner { grid-template-columns: 1fr; }
.pillar-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; max-width: 720px; }
.pillar-nav a {
  display: flex; flex-direction: column; padding: 14px 16px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
}
.pillar-nav a b { font-size: 22px; color: var(--accent); }
.pillar-nav a span { color: var(--muted); font-size: 13px; }
.pillar-nav a:hover { border-color: var(--accent); text-decoration: none; }

.pillar { margin-top: 44px; scroll-margin-top: 76px; }
.pillar-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.pillar-head h2 { margin: 0; }
.pillar-head p { margin: 2px 0 0; }
.pillar-badge {
  flex: none; width: 58px; height: 58px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; font-size: 17px; color: #1a1405; background: var(--accent);
}
.pillar-body { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 14px; align-items: start; }
.stack { display: grid; gap: 12px; }

.tier-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.tier-row {
  display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 8px; color: var(--text);
}
a.tier-row:hover { background: var(--panel-2); text-decoration: none; }
.tier-row img { width: 34px; height: 44px; object-fit: cover; border-radius: 5px; flex: none; }
.tier-row .rank { width: 22px; text-align: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.tier-row .rank.top { color: var(--accent); }
.tier-row .who { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tier-row .nm { font-weight: 600; font-size: 14px; }

.mode-card.top { border-color: #5a4a25; }
.mode-card-head { display: flex; align-items: center; gap: 12px; color: var(--text); }
.mode-card-head:hover { text-decoration: none; }
.mode-card-head:hover strong { color: var(--accent); }
.mode-card-head img { width: 84px; height: 46px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.lineup.mini { margin-top: 12px; }
.lineup.mini a, .lineup.mini .unidentified { width: 64px; }
.lineup.mini img { width: 64px; height: 84px; }
.lineup.mini span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.featured { display: flex; flex-direction: column; gap: 4px; color: var(--text); align-items: flex-start; }
.featured:hover { border-color: var(--accent); text-decoration: none; }

.pve-row { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.pve-row:last-child { border-bottom: 0; }
.pve-name { flex: 1; min-width: 0; color: var(--text); font-size: 14px; }
.pve-row .faces { display: flex; align-items: center; gap: 4px; flex: none; }
.pve-row .faces img { width: 32px; height: 42px; object-fit: cover; border-radius: 5px; border: 1px solid var(--border); }
.pve-row .faces .unidentified img { border-style: dashed; }

@media (max-width: 900px) {
  .pillar-body { grid-template-columns: 1fr; }
  .pillar-nav { grid-template-columns: 1fr; }
  .pve-row { flex-wrap: wrap; }
}

/* Static content for crawlers without JavaScript; the page script replaces it. */
.prerender { grid-column: 1 / -1; max-width: 900px; margin: 0 auto; padding: 24px 16px; line-height: 1.6; }
.prerender h1 { margin-top: 0; }
.prerender ol, .prerender ul { padding-left: 1.4em; }
