/* D2 Survivors wiki: the landing page's look (tokens, frames, Cinzel). */
:root {
  --bg: #0b0907; --panel: #15110d; --panel2: #1c1712; --line: #3a2f22; --line2: #5a4630;
  --text: #ddd2bd; --dim: #9a8d78; --gold: #d4ad62; --gold2: #f0d79a; --red: #8f1d14;
  --fire: #e8743a; --cold: #6fb6e8; --ltng: #f2dc5d; --pois: #6fcf5a; --magic: #c9a6ff; --phys: #cfc4ad;
  --normal: #e8e0d0; --magicq: #7f7fff; --rare: #ffff64; --unique: #c7b377; --set: #2fd02f;
  --side: 248px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15.5px/1.6 Inter, system-ui, sans-serif; }
a { color: var(--gold); }
a:hover { color: var(--gold2); }
img { max-width: 100%; display: block; }
code { background: #261e16; border: 1px solid var(--line); padding: 0 5px; border-radius: 3px;
  font-size: 13px; color: var(--gold2); }
kbd { display: inline-block; min-width: 22px; padding: 0 6px; text-align: center; font: 600 12.5px Inter, sans-serif;
  border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 3px; background: #261e16; color: var(--gold2); }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: rgba(11,9,7,.92);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.top .in { display: flex; align-items: center; gap: 14px; height: 54px; padding: 0 16px; }
.top .brand { font: 800 18px Cinzel, serif; color: var(--gold); letter-spacing: 1px; text-decoration: none; white-space: nowrap; }
.top .brand span { color: var(--dim); font-size: 13px; letter-spacing: 2px; margin-left: 6px; }
.top .links { margin-left: auto; display: flex; gap: 16px; }
.top .links a { color: var(--dim); text-decoration: none; font-size: 14px; white-space: nowrap; }
.top .links a:hover { color: var(--gold2); }
.menu-btn { display: none; background: none; border: 1px solid var(--line2); color: var(--gold2);
  border-radius: 3px; padding: 5px 9px; font: 600 13px Inter, sans-serif; cursor: pointer; }

/* search */
.search { position: relative; flex: 0 1 320px; min-width: 0; }
.search input { width: 100%; background: #120e0a; border: 1px solid var(--line2); color: var(--text);
  border-radius: 3px; padding: 7px 10px; font: 14px Inter, sans-serif; }
.search input:focus { outline: none; border-color: var(--gold); }
.results { position: absolute; top: 40px; left: 0; right: 0; max-height: 70vh; overflow: auto;
  background: var(--panel2); border: 1px solid var(--line2); border-radius: 4px; box-shadow: 0 10px 30px #000c;
  display: none; z-index: 30; min-width: 280px; }
.results.on { display: block; }
.results a { display: block; padding: 7px 12px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.results a:hover, .results a.sel { background: #2a2118; }
.results a small { display: block; color: var(--dim); font-size: 12px; }
.results .none { padding: 10px 12px; color: var(--dim); font-size: 14px; }

/* layout */
.layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
.side { position: sticky; top: 54px; height: calc(100vh - 54px); overflow: auto; padding: 18px 12px 30px 16px;
  border-right: 1px solid var(--line); background: linear-gradient(var(--panel), var(--bg)); }
.side h4 { font: 700 12px Cinzel, serif; letter-spacing: 2px; color: var(--dim); margin: 16px 0 6px 8px; text-transform: uppercase; }
.side h4:first-child { margin-top: 0; }
.side a { display: block; padding: 4px 8px; border-radius: 3px; color: var(--text); text-decoration: none; font-size: 14px; }
.side a:hover { background: #221a13; color: var(--gold2); }
.side a.cur { background: #2a2118; color: var(--gold2); border-left: 2px solid var(--gold); padding-left: 6px; }
main { padding: 26px 32px 60px; max-width: 1180px; min-width: 0; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .menu-btn { display: inline-block; }
  .side { display: none; position: fixed; top: 54px; left: 0; bottom: 0; width: min(300px, 86vw); height: auto; z-index: 25;
    box-shadow: 8px 0 30px #000c; background: var(--panel); }
  body.menu .side { display: block; }
  main { padding: 20px 16px 50px; }
  .top .links { display: none; }
  .search { flex: 1 1 auto; }
  .top .brand span { display: none; }
}

/* text */
h1 { font: 800 clamp(30px, 5vw, 44px)/1.1 Cinzel, serif; color: var(--gold); margin: 0 0 8px; letter-spacing: 1px; }
h2 { font: 700 clamp(21px, 3vw, 26px) Cinzel, serif; color: var(--gold); margin: 34px 0 10px;
  display: flex; align-items: center; gap: 14px; }
h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line2), transparent); }
h3 { font: 700 18px Cinzel, serif; color: var(--gold2); margin: 0 0 6px; }
.lead { color: var(--dim); margin: 0 0 18px; max-width: 760px; }
.dim { color: var(--dim); }
p { margin: 0 0 12px; }
ul.plain { margin: 0 0 12px; padding-left: 20px; }
ul.plain li { margin-bottom: 4px; }

/* frames */
.frame { background: linear-gradient(var(--panel2), var(--panel)); border: 1px solid var(--line);
  border-radius: 4px; position: relative; box-shadow: inset 0 0 0 1px #0006, 0 6px 20px #0007; }
.frame::before { content: ""; position: absolute; inset: 3px; border: 1px solid rgba(212,173,98,.08);
  border-radius: 2px; pointer-events: none; }
.box { padding: 16px 18px; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font-size: 12px; padding: 1px 8px; border-radius: 10px; background: #2a2118;
  border: 1px solid var(--line); color: var(--text); white-space: nowrap; text-decoration: none; }
a.chip:hover { border-color: var(--gold); }
.chip.k { color: var(--dim); }
.chip.start { border-color: var(--gold); color: var(--gold2); }
.el-Fire { color: var(--fire); } .el-Cold { color: var(--cold); } .el-Lightning { color: var(--ltng); }
.el-Poison { color: var(--pois); } .el-Magic { color: var(--magic); } .el-Physical { color: var(--phys); }
.q-Normal { color: var(--normal); } .q-Magic { color: var(--magicq); } .q-Rare { color: var(--rare); }
.q-Unique { color: var(--unique); } .q-Set { color: var(--set); }

/* tables */
.tw { overflow-x: auto; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 700 12px Inter, sans-serif; letter-spacing: .5px; text-transform: uppercase; color: var(--dim);
  background: #1a140f; position: sticky; top: 0; white-space: nowrap; }
th.sort { cursor: pointer; user-select: none; }
th.sort:hover { color: var(--gold2); }
th.sort.up::after { content: " ▲"; } th.sort.down::after { content: " ▼"; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #1c1610; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
td.nw { white-space: nowrap; }

/* class page */
.hero { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 8px; }
.hero .pic { display: block; width: 100%; aspect-ratio: 420/507; object-fit: contain; background: radial-gradient(ellipse at 50% 60%, #2a1a10, #070605 70%); border-radius: 4px; border: 1px solid var(--line); }
.cpic { display: block; width: 100%; aspect-ratio: 420/507; object-fit: contain; background: radial-gradient(ellipse at 50% 60%, #2a1a10, #070605 70%); border-bottom: 1px solid var(--line); }
@media (max-width: 700px) { .hero { grid-template-columns: 1fr; } .hero .pic { max-height: 420px; } }
.stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 10px 0; }
.stats div { font-size: 14px; } .stats b { color: var(--gold2); font: 700 18px Cinzel, serif; margin-right: 4px; }
.build h3 { margin-bottom: 4px; }
.build p { color: var(--dim); font-size: 14px; }
.build .row { font-size: 13px; color: var(--dim); margin-top: 8px; }

.skill { padding: 16px 18px; margin-bottom: 14px; }
.skill header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 6px; }
.skill header h3 { margin: 0; }
.skill .desc { font-style: italic; color: var(--dim); font-size: 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 18px; font-size: 14px; margin: 8px 0; }
.facts span { color: var(--dim); }
.lv { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 18px; font-size: 14px; margin: 8px 0; }
.lv div span { color: var(--dim); }
details { margin-top: 8px; }
details summary { cursor: pointer; color: var(--gold); font-size: 14px; }
details .tw { margin-top: 8px; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.filters input, .filters select { background: #120e0a; border: 1px solid var(--line2); color: var(--text);
  border-radius: 3px; padding: 6px 9px; font: 14px Inter, sans-serif; }
.filters input { flex: 1 1 200px; min-width: 0; }
.filters .count { color: var(--dim); font-size: 13px; margin-left: auto; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tabs button { background: #1a140f; border: 1px solid var(--line); color: var(--text); padding: 5px 12px;
  border-radius: 3px; cursor: pointer; font: 600 13px Inter, sans-serif; }
.tabs button.on { border-color: var(--gold); color: var(--gold2); background: #2a2118; }

.act { padding: 16px 18px; margin-bottom: 18px; }
.boss { font: 700 22px Cinzel, serif; color: #e05a3a; text-shadow: 0 0 12px rgba(224,90,58,.35); }
.note { padding: 12px 16px; font-size: 14px; color: var(--dim); margin-bottom: 14px; }
.note b { color: var(--text); }
.loading { color: var(--dim); padding: 30px 0; }
.hit { animation: hit 1.6s ease-out; }
@keyframes hit { from { box-shadow: 0 0 0 2px var(--gold), 0 0 24px rgba(212,173,98,.5); } }
footer { color: var(--dim); font-size: 13px; padding: 30px 0 0; margin-top: 40px; border-top: 1px solid var(--line); }

/* gameplay clip on class pages */
.clip { margin: 0 0 8px; overflow: hidden; }
.clip video { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; background: #000; }
.clip figcaption { padding: 8px 12px 10px; font-size: 14px; color: var(--dim); }
.clip figcaption b { margin-right: 6px; color: var(--gold2, #e8c070); }
