@font-face {
  font-family: "Cinzel";
  src: url("cinzel.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}
:root {
  --bg: #000;
  --bg2: #0c0c0c;
  --card: #121212;
  --card2: #1a1a1a;
  --line: #4a3b2e;
  --ink: #f3e6d4;
  --muted: #cbb8a2;
  --dim: #9a8774;
  --amber: #e2a15a;
  --moss: #8eae78;
  --ember: #d4653a;
  --good: #d7e7c4;
  --bad: #f0b4a4;
  --lock: #6d6258;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  font-size: 17px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: "Cinzel", Palatino, "Palatino Linotype", Georgia, serif;
  line-height: 1.45;
  background: #000 url("watermark.jpg") center / cover fixed no-repeat;
}
.front-art { width: 100%; max-height: 360px; object-fit: cover; border-radius: 16px; display: block; margin: 0 0 18px; border: 1px solid #3a3328; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--amber); }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: 0.01em; margin: 0 0 0.4rem; }
p { margin: 0 0 0.7rem; }
.wrap { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 22px 0 64px; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 16px; }
.brand { font-size: 2rem; line-height: 1; }
.brand small { display: block; margin-top: 6px; color: var(--muted); font-size: 0.95rem; }
.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 8px 14px;
}
.ghost:hover, .choice.on, .slot.on, .tree-tab.on { border-color: var(--amber); color: var(--amber); }
.columns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin: 14px 0 22px; }
.col, .card, .panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 14px 12px;
  box-shadow: var(--shadow);
}
.col h2 { font-size: 1.15rem; }
.kicker { color: var(--amber); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; }
.col a, .src a { display: block; margin: 8px 0 2px; }
.note { color: var(--muted); font-size: 0.92rem; }
.pts { background: #2a221c; border-style: dashed; }
.class-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.class-card { text-align: left; width: 100%; min-height: 150px; }
.class-card h3 { display: flex; justify-content: space-between; align-items: center; }
.mark {
  width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center;
  background: #3c2e22; border: 1px solid var(--line); font-family: Georgia, serif;
}
.filled { color: var(--moss); font-size: 0.85rem; }
.empty-tag { color: var(--dim); font-size: 0.85rem; }
.layout { display: grid; grid-template-columns: 280px 1fr; gap: 12px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.choice, .slot, .tree-tab, .mini {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px;
}
.choice small, .slot small { display: block; color: var(--dim); }
.doll { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.slot { text-align: left; width: 100%; }
.slot.changed { outline: 1px solid var(--amber); }
.talents { display: grid; gap: 8px; }

.trees { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 10px; overflow-x: auto; align-items: start; }
.tree-col { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-width: 260px; }
.tree-col h2 { font-size: 1.05rem; }
.talent { cursor: pointer; }
.tier { border-top: 1px solid var(--line); padding-top: 8px; }
.talent {
  width: 100%; text-align: left; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 10px; margin: 4px 0;
}
.talent:disabled { color: var(--dim); cursor: not-allowed; }
.talent .rank { color: var(--amber); }
.search { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters select, .levelbox input { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.item { width: 100%; text-align: left; margin: 4px 0; }
.blocked { color: var(--ember); }
.sheet { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.sheet th, .sheet td { border-bottom: 1px solid var(--line); text-align: left; padding: 6px 4px; vertical-align: top; }
.sheet th { color: var(--dim); font-weight: 500; }
tr.flash td { background: #4a3824; }
.assumption { border-left: 3px solid var(--ember); padding-left: 8px; }
.math { display: none; color: var(--muted); font-size: 0.92rem; }
body.math .math { display: block; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.delta-pos { color: var(--moss); }
.delta-neg { color: var(--ember); }
footer { color: var(--dim); margin-top: 18px; font-size: 0.9rem; }
.warn { background: #3a241c; border-radius: 10px; padding: 8px 10px; }
@media (max-width: 900px) {
  .columns, .class-grid, .layout, .split { grid-template-columns: 1fr; }
}

#req-dock { position: fixed; right: 18px; bottom: 18px; z-index: 20; width: 320px; }
#req-toggle {
  float: right; width: 64px; height: 64px; padding: 0; border-radius: 18px;
  border: 1px solid var(--amber); background: #140f0c; overflow: hidden; box-shadow: var(--shadow);
}
#req-toggle img { width: 100%; height: 100%; object-fit: cover; display: block; }
.req-panel {
  clear: both; margin-bottom: 10px; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px; box-shadow: var(--shadow);
}
.req-title { font-size: 1.05rem; margin-bottom: 4px; }
.req-note, .req-list, .req-warn { color: var(--muted); font-size: 0.86rem; }
.req-list { list-style: none; padding: 0; margin: 8px 0; max-height: 140px; overflow: auto; }
.req-list li { margin: 0 0 6px; }
.req-list span { color: var(--amber); }
.req-panel textarea {
  width: 100%; min-height: 72px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px;
}
.req-panel button {
  margin-top: 8px; background: var(--amber); color: #1a120c; border: 0; border-radius: 999px; padding: 8px 12px;
}
.req-warn { min-height: 1.2em; color: var(--bad); }

#acct-slot { width: min(280px, 100%); }
.acct-form label { display: block; margin: 6px 0; font-size: 0.86rem; color: var(--muted); }
.acct-form input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.byline { color: var(--amber); }
#saved-builds { margin-top: 12px; }

.talent-panel { padding: 0; background: transparent; border: 0; box-shadow: none; }
.talent-frame {
  background: #120e0b;
  border: 2px solid #8d6a32;
  box-shadow: inset 0 0 0 1px #3a2c18, inset 0 0 40px rgba(0,0,0,.55);
  border-radius: 6px;
  padding: 10px 12px 12px;
}
.talent-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.spec-tabs { display: flex; gap: 6px; }
.spec {
  background: #2a2418; border: 1px solid #6d5428; color: #e6d2a8;
  border-radius: 4px; padding: 6px 14px; min-width: 110px;
}
.spec.on { background: linear-gradient(#6a5224, #3d2e14); color: #f3e2b0; border-color: #e2b65a; }
.spec.locked { color: #7c7368; border-color: #3d3832; background: #1c1916; cursor: not-allowed; }
.talent-search {
  margin-left: auto; width: 180px; background: #0c0a08; border: 1px solid #6d5428;
  border-radius: 4px; padding: 6px 8px; color: #f3e6d4;
}
.unspent { display: flex; align-items: center; gap: 8px; color: #d9c7a4; font-size: 0.92rem; }
.unspent b { font-size: 1.7rem; color: #f0d48a; line-height: 1; min-width: 1.2em; text-align: right; }
.talent-frame .trees { display: grid; grid-template-columns: repeat(3, max-content); gap: 12px; justify-content: center; overflow-x: auto; }
.talent-frame .tree-col {
  background: #0e0c0a; border: 1px solid #5c4a2e; border-radius: 4px; padding: 8px 8px 10px; min-width: 0;
}
.tree-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 4px 6px; }
.tree-head h2 { font-size: 1rem; margin: 0; color: #f0e2c4; }
.tree-total { color: #f0d48a; font-size: 1.05rem; }
.tree-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 52px);
  grid-template-rows: repeat(7, 52px);
  column-gap: 18px;
  row-gap: 26px;
  width: 262px;
  height: 520px;
  margin: 0 auto;
}
.tree-lines { position: absolute; left: 0; top: 0; pointer-events: none; }
.tree-lines .line-off { stroke: #5c5348; fill: #5c5348; stroke-width: 2; }
.tree-lines .line-on { stroke: #e2b65a; fill: #e2b65a; stroke-width: 2; }
.node {
  position: relative; z-index: 1; width: 52px; height: 52px; padding: 0;
  border: 1px solid #3a342c; background: #1a1612; border-radius: 4px; overflow: hidden;
}
.node img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(1) brightness(0.45); }
.node.lit { border-color: #d7b15a; box-shadow: 0 0 0 1px #8a6a32; }
.node.lit img { filter: none; }
.node.locked { opacity: 0.72; }
.node.miss { opacity: 0.28; }
.node-rank {
  position: absolute; right: 1px; bottom: 0; min-width: 14px; padding: 0 2px;
  background: rgba(0,0,0,.72); color: #d9d0c4; font-size: 11px; line-height: 14px; text-align: center;
  font-family: Georgia, serif; pointer-events: none;
}
.node-rank.partial { color: #f0d48a; }
.node-rank.full { color: #b7e38a; }
.node-rank.zero { color: #8a8176; }
.talent-tip {
  position: fixed; z-index: 40; max-width: 280px; pointer-events: none;
  background: #14110e; border: 1px solid #8d6a32; border-radius: 4px; padding: 8px 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,.45); color: #f3e6d4;
}
.tip-name { margin: 0 0 2px; color: #f0d48a; font-size: 0.98rem; }
.tip-rank, .tip-next { margin: 0 0 4px; color: #cbb8a2; font-size: 0.82rem; }
.talent-tip p { margin: 0 0 4px; font-size: 0.88rem; }
.talent-note { color: #9a8774; font-size: 0.82rem; margin: 8px 0 0; }
@media (max-width: 980px) {
  .talent-top { flex-wrap: wrap; }
  .talent-search { margin-left: 0; }
}

.slot-wrap { position: relative; }
.slot-wrap.open { z-index: 30; }
.slot-drop {
  position: absolute;
  z-index: 40;
  max-height: 360px;
  overflow: auto;
  left: 0;
  top: 100%;
  width: max(100%, 280px);
  background: #14110e;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  box-shadow: var(--shadow);
}
.doll .slot-wrap:nth-child(even) .slot-drop { left: auto; right: 0; }
.slot-drop[hidden] { display: none; }
.slot-results { max-height: 240px; overflow: auto; margin-top: 6px; }
.slot-hit { margin: 0 0 6px; }
.slot-hit .item { margin: 0; }
.slot-hit .src a { display: inline; }

.loot-tables { display: grid; gap: 8px; margin-top: 8px; }
.loot-cat-name, .loot-cat-btn {
  color: var(--ink); font-size: 0.92rem; text-align: left;
}
.loot-cat-btn {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px;
}
.loot-cat-btn[aria-expanded="true"] { border-color: var(--amber); color: var(--amber); }
.loot-empty { margin: 2px 0 0; color: var(--muted); font-size: 0.82rem; }
.loot-body { display: grid; gap: 6px; margin-top: 6px; padding-left: 8px; }
.loot-body[hidden] { display: none; }
.loot-area-name { color: var(--amber); font-size: 0.86rem; }
.loot-boss { margin: 2px 0 4px 8px; }
.loot-boss-name { color: var(--muted); font-size: 0.84rem; }
.loot-item {
  display: flex; align-items: center; gap: 6px; width: 100%; text-align: left;
  background: transparent; border: 0; padding: 2px 0; color: var(--ink);
}
.loot-item:hover { background: rgba(226, 161, 90, 0.12); }
.loot-icon { width: 22px; height: 22px; object-fit: cover; border-radius: 2px; background: #221c16; flex: 0 0 auto; }
.slot small { display: flex; align-items: center; gap: 4px; }
.slot small .loot-icon { width: 16px; height: 16px; }
.loot-name { line-height: 1.2; }
.q-poor { color: #9d9d9d; }
.q-common { color: #ffffff; }
.q-uncommon { color: #1eff00; }
.q-rare { color: #0070dd; }
.q-epic { color: #a335ee; }
.q-legendary { color: #ff8000; }
.item-tip {
  position: fixed; z-index: 80; pointer-events: none; width: max-content; max-width: 340px;
  background: rgba(0, 0, 0, 0.94); border: 1px solid #6a5a28; padding: 8px 10px 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}
.item-tip[hidden] { display: none; }
.item-tip p { margin: 0; }
.item-tip .tip-name { font-size: 1rem; margin-bottom: 2px; }
.item-tip .tip-line, .item-tip .tip-slotline { color: #fff; }
.item-tip .tip-slotline { display: flex; justify-content: space-between; gap: 18px; }
.item-tip .tip-effect { color: #1eff00; }

.loot-place, .loot-boss-btn {
  display: block; width: 100%; text-align: left; background: transparent; border: 0;
  padding: 3px 0; color: var(--amber); font-size: 0.86rem;
}
.loot-boss-btn { color: var(--ink); }
.loot-place[aria-expanded="true"], .loot-boss-btn[aria-expanded="true"] { color: var(--amber); }
.loot-place-body, .loot-boss-body { display: grid; gap: 2px; margin: 2px 0 4px 8px; }
.loot-place-body[hidden], .loot-boss-body[hidden] { display: none; }
.loot-item.is-locked { color: var(--muted); cursor: default; }
.loot-item.is-locked:hover { background: transparent; }
