/* ===== Tokens ===== */
:root {
  --bg: #0d0f1e;
  --bg-2: #13162b;
  --panel: #171a33;
  --panel-2: #1d2140;
  --line: #2a2f55;
  --line-soft: #222648;
  --text: #eef0ff;
  --muted: #9aa0c8;
  --faint: #6a7099;
  --accent: #f5c542;        /* DQ-Gold */
  --accent-2: #4aa8ff;      /* Schleim-Blau */
  --accent-ink: #1a1400;
  --danger: #ff6b6b;
  --shadow: 0 20px 50px -20px rgba(0,0,0,.6);
  --radius: 18px;
  --radius-sm: 10px;

  --fam-slime: #4aa8ff;
  --fam-dragon: #ff7a52;
  --fam-nature: #5cc96b;
  --fam-beast: #e3a443;
  --fam-material: #a3afc2;
  --fam-demon: #b678ff;
  --fam-undead: #6fc7aa;

  --rank-G: #8c92ad;
  --rank-F: #6ccf7f;
  --rank-E: #46c4c9;
  --rank-D: #4a9cff;
  --rank-C: #a77bff;
  --rank-B: #ff9a3d;
  --rank-A: #ff5d5d;
  --rank-S: #f5c542;
  --rank-X: #ff6fd8;
}
:root[data-theme="light"] {
  --bg: #f4f2ea;
  --bg-2: #ebe8dc;
  --panel: #ffffff;
  --panel-2: #f7f5ee;
  --line: #ddd8c8;
  --line-soft: #e9e5d8;
  --text: #1b1d33;
  --muted: #5d6185;
  --faint: #8d90ab;
  --accent: #c48d00;
  --accent-2: #1f7fe0;
  --accent-ink: #fff;
  --shadow: 0 18px 40px -22px rgba(40,30,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 60%),
    radial-gradient(900px 400px at -10% 10%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ===== Topbar ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(145deg, var(--accent-2), #2a5fd6);
  position: relative; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25);
}
.logo-mark::before {
  content: ""; position: absolute; inset: 7px 8px 6px;
  background: #fff; clip-path: path("M9 0C11 4 18 8 18 13 18 17 14 20 9 20S0 17 0 13C0 8 7 4 9 0Z");
}
.logo-text em { font-style: normal; color: var(--accent); }
.logo-text b { color: var(--accent-2); }

.select-wrap select {
  appearance: none; -webkit-appearance: none;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239aa0c8'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 32px 8px 12px; font-size: 14px; cursor: pointer;
}
.select-wrap select:focus-visible, .icon-btn:focus-visible, .tabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.tabs a {
  text-decoration: none; padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--muted);
  border: 1px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

.topbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel);
  display: grid; place-items: center; cursor: pointer; color: var(--accent);
}
.icon-btn:hover { border-color: var(--accent); }

/* ===== Main ===== */
main { flex: 1; padding-top: 22px !important; padding-bottom: 40px !important; }
.meta-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.meta-line .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--muted); }

.picker-row { display: flex; gap: 14px; align-items: flex-end; margin-bottom: 16px; flex-wrap: wrap; }
.picker-row .grow { flex: 1; min-width: 260px; }

/* ===== Combobox ===== */
.combo { position: relative; margin-top: 6px; }
.combo-field {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px 10px;
}
.combo-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.combo-field .num { color: var(--faint); font-size: 12px; min-width: 38px; }
.combo-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; font-weight: 600; padding: 8px 0; }
.combo-field input::placeholder { color: var(--faint); font-weight: 500; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40;
  max-height: 340px; overflow: auto; margin: 0; padding: 6px; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.combo-list[hidden] { display: none; }
.combo-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.combo-list li .alt { margin-left: auto; color: var(--faint); font-size: 12px; }
.combo-list li.active, .combo-list li:hover { background: var(--panel-2); }
.combo-list .empty { color: var(--muted); cursor: default; }

/* ===== Buttons / chips ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 10px 16px; font-weight: 600; font-size: 14px;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--line); background: var(--panel-2); white-space: nowrap;
}
.chip .sw { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); }
.rank {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px;
  font-weight: 800; font-size: 12px; color: #0d0f1e; background: var(--rc, var(--rank-G)); flex: none;
}
.rank.lg { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
.famdot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }

/* ===== Dex card ===== */
.card {
  display: grid; grid-template-columns: minmax(300px, 5fr) 7fr;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.hero {
  position: relative; padding: 22px; min-height: 420px; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(400px 260px at 50% 62%, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%),
    linear-gradient(160deg, color-mix(in srgb, var(--c) 16%, var(--panel-2)), var(--panel-2));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.hero-top { display: flex; justify-content: space-between; align-items: baseline; }
.hero-top .num { font-size: 15px; color: var(--muted); }
.hero h1 { margin: 6px 0 8px; font-size: clamp(26px, 4vw, 38px); line-height: 1.05; letter-spacing: -.02em; }
.hero .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.hero .alt-names { margin-top: 10px; color: var(--muted); font-size: 13px; display: grid; gap: 2px; }
.hero .alt-names span b { color: var(--faint); font-weight: 600; margin-right: 6px; font-size: 11px; letter-spacing: .08em; }
.hero-art { flex: 1; display: grid; place-items: center; position: relative; min-height: 220px; }
.hero-art .watermark {
  position: absolute; font-weight: 800; font-size: 220px; line-height: 1; color: color-mix(in srgb, var(--c) 18%, transparent);
  z-index: -1; user-select: none; letter-spacing: -.06em;
}
.hero-art svg, .hero-art .mon-img { width: min(200px, 60%); height: auto; filter: drop-shadow(0 18px 24px rgba(0,0,0,.35)); animation: bob 4s ease-in-out infinite; }
.hero-art .spark { position: absolute; color: var(--accent); opacity: .7; font-size: 18px; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.hero-art .mon-img { width: min(240px, 72%); aspect-ratio: 1; object-fit: contain; }
@media (prefers-reduced-motion: reduce) { .hero-art svg, .hero-art .mon-img { animation: none; } }
.hero-foot { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.hero-foot .pill { border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; background: color-mix(in srgb, var(--panel) 60%, transparent); }

.side { padding: 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.side-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.side-head h2 { margin: 2px 0 0; font-size: 24px; letter-spacing: -.01em; }
.side-head .sub { color: var(--muted); font-size: 13px; }
.count-badges { display: flex; gap: 8px; }
.count-badge { text-align: center; border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; background: var(--panel-2); }
.count-badge b { display: block; font-size: 20px; color: var(--accent); line-height: 1.1; }
.count-badge span { font-size: 11px; color: var(--muted); }

.section-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; margin: 0 0 8px; }
.section-title .n { color: var(--faint); font-weight: 500; }
.recipe-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.recipe {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel-2);
}
.recipe .op { color: var(--faint); font-weight: 700; }
.recipe .tag { margin-left: auto; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.recipe .tag.cond { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); margin-left: 0; }
.mon-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 4px; border-radius: 8px;
  text-decoration: none; font-weight: 600; font-size: 14px; border: 1px solid transparent;
}
.mon-link:hover { border-color: var(--line); background: var(--panel); }
.mon-link.self { color: var(--accent); }
.mystery { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-style: italic; font-size: 13px; padding: 3px 8px; border: 1px dashed var(--line); border-radius: 8px; }
.fam-pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; padding: 3px 8px; border-radius: 8px; background: color-mix(in srgb, var(--c) 14%, transparent); }
.empty-note { color: var(--muted); font-size: 13px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; }
.info { display: flex; gap: 8px; color: var(--muted); font-size: 12px; align-items: flex-start; }
.info::before { content: "ⓘ"; color: var(--accent); }
.more-btn { background: none; border: 0; color: var(--accent-2); cursor: pointer; padding: 4px 0; font-size: 13px; font-weight: 600; }

/* ===== Pager ===== */
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 14px; }
.pager a { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 4px; }
.pager a:hover { color: var(--text); }
.pager a:last-child { justify-self: end; }
.pager .mid { display: flex; align-items: center; gap: 8px; }
.pager .mid .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ===== Collapsible ===== */
details.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; margin-top: 10px; }
details.panel summary { cursor: pointer; padding: 14px 18px; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 10px; }
details.panel summary::-webkit-details-marker { display: none; }
details.panel summary::before { content: "▸"; color: var(--accent); transition: transform .2s; }
details.panel[open] summary::before { transform: rotate(90deg); }
details.panel .panel-body { padding: 0 18px 18px; }
.stat-ghost { display: grid; gap: 10px; }
.stat-ghost .row { display: grid; grid-template-columns: 110px 40px 1fr; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.stat-ghost .bar { height: 8px; border-radius: 99px; background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 14px); }

/* ===== Calculator ===== */
.calc-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; }
.parent-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.parent-card .mini { display: flex; align-items: center; gap: 14px; min-height: 84px; }
.parent-card .mini svg, .parent-card .mini .mon-img { width: 70px; height: 70px; flex: none; }
.parent-card .mini h3 { margin: 0 0 4px; font-size: 20px; }
.calc-plus { display: grid; place-items: center; gap: 8px; align-content: center; }
.calc-plus .plus { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 800; color: var(--accent-ink); background: var(--accent); }
.result-card { margin-top: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.result-main {
  display: flex; align-items: center; gap: 20px; padding: 22px; flex-wrap: wrap;
  background: linear-gradient(120deg, color-mix(in srgb, var(--c, var(--accent)) 18%, var(--panel-2)), var(--panel-2));
  border-bottom: 1px solid var(--line);
}
.result-main svg, .result-main .mon-img { width: 96px; height: 96px; flex: none; }
.result-main h2 { margin: 2px 0 6px; font-size: 30px; letter-spacing: -.02em; }
.result-main h2 a { text-decoration: none; }
.result-main h2 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.result-rules { padding: 18px 22px; display: grid; gap: 10px; }
.rule { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 12px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--panel-2); }
.rule.win { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel-2)); }
.rule.off { opacity: .55; }
.rule .idx { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--line); font-size: 13px; }
.rule.win .idx { background: var(--accent); color: var(--accent-ink); }
.rule h4 { margin: 0 0 4px; font-size: 14px; }
.rule .what { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.rank-table { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.rank-cell { display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); }

/* ===== Recipes view ===== */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.subtabs button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.subtabs button.active { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.search {
  flex: 1; min-width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; outline: 0;
}
.search:focus { border-color: var(--accent); }
.check { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
td { padding: 6px 14px; border-bottom: 1px solid var(--line-soft); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel-2); }
td .op { color: var(--faint); font-weight: 700; }

.matrix { border-collapse: separate; border-spacing: 4px; font-size: 13px; }
.matrix th, .matrix td { border: 0; padding: 0; background: transparent; position: static; }
.matrix th { padding: 6px 8px; text-transform: none; letter-spacing: 0; font-size: 12px; }
.matrix th.row-h { text-align: right; }
.matrix td .cell {
  min-width: 132px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-soft); padding: 6px; display: grid; gap: 2px;
}
.matrix td .cell.same { display: grid; place-items: center; color: var(--faint); min-height: 64px; background: repeating-linear-gradient(45deg, transparent 0 6px, var(--line-soft) 6px 7px); }
.matrix td .cell .mon-link { font-size: 12px; padding: 2px 6px 2px 2px; }
.matrix-legend { color: var(--muted); font-size: 13px; margin: 0 0 10px; }

/* ===== Family grid (dex overview) ===== */
.grid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 10px; }
.grid-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line-soft); font-size: 14px; font-weight: 600; min-width: 0;
}
.grid-item span.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-item:hover { border-color: var(--c); }
.grid-item.current { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }
.grid-item svg, .grid-item .mon-img { width: 26px; height: 26px; flex: none; }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--line-soft); padding-top: 18px !important; padding-bottom: 24px !important; color: var(--muted); font-size: 13px; }
.footer-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer strong { color: var(--text); }
.footer strong em { font-style: normal; color: var(--accent); }
.legal { font-size: 12px; color: var(--faint); margin: 10px 0 0; }

/* ===== Responsive ===== */
@media (max-width: 880px) {
  .card { grid-template-columns: 1fr; }
  .hero { border-right: 0; border-bottom: 1px solid var(--line); min-height: 360px; }
  .calc-grid { grid-template-columns: 1fr; }
  .calc-plus { grid-auto-flow: column; justify-content: center; }
  .topbar-right { margin-left: 0; }
}
@media (max-width: 560px) {
  .tabs { order: 5; width: 100%; overflow-x: auto; }
  .tabs a { flex: 1; text-align: center; padding: 6px 8px; }
  .side-head { flex-direction: column; }
  .hero-art .watermark { font-size: 160px; }
  .recipe .tag { margin-left: 0; }
}

/* ===== Grundwerte ===== */
.scale-legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.scale-legend .sw { width: 18px; height: 6px; border-radius: 9px; margin-left: 6px; }
.scale-legend .sw.lo { background: hsl(20 85% 58%); }
.scale-legend .sw.hi { background: hsl(130 60% 52%); }
.stat-rows { display: grid; gap: 10px; }
.stat-row { display: grid; grid-template-columns: 120px 52px 1fr; align-items: center; gap: 12px; font-size: 15px; }
.stat-row .lbl { color: var(--muted); }
.stat-row .val { font-weight: 700; text-align: right; }
.sbar { height: 10px; border-radius: 99px; background: var(--line-soft); overflow: hidden; display: block; }
.sbar > span { display: block; height: 100%; border-radius: inherit; background: hsl(calc(var(--h) * 1deg) 75% 55%); }
.stat-total { display: grid; grid-template-columns: 120px 72px 1fr; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.stat-total span { font-weight: 700; }
.stat-total b { font-size: 26px; color: var(--accent); }
.stat-total .sbar > span { background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff)); }

/* ===== Panels ===== */
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.panel-grid > details.panel { margin-top: 10px; }
details.panel summary .n { color: var(--faint); font-weight: 500; font-size: 13px; }
.synth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.trait-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.trait-list li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-soft); }
.trait-list li span { color: var(--muted); font-size: 13px; }
.talent-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 10px; }
.talent-name { font-weight: 800; font-size: 18px; color: var(--accent); }
.talent-head .tag, .tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.learn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.learn-list li { display: grid; grid-template-columns: 54px 1fr; gap: 10px; align-items: start; padding: 8px 10px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-soft); }
.learn-list .pts { font-weight: 700; color: var(--accent-2); font-size: 15px; }
.learn-list .pts small { font-size: 10px; color: var(--faint); margin-left: 2px; }
.learn-list .d { color: var(--muted); font-size: 13px; margin-top: 2px; }
.kind { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; padding: 1px 6px; border-radius: 6px; margin-left: 4px; vertical-align: 2px; }
.kind.action { background: color-mix(in srgb, var(--accent-2) 18%, transparent); color: var(--accent-2); }
.kind.trait { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.trivia { margin: 0; font-size: 15px; line-height: 1.6; }

/* ===== Resistenzen ===== */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.res { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--panel-2); border-left: 4px solid var(--rc); }
.res .rn { font-weight: 600; font-size: 14px; }
.res .rp { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 13px; color: var(--rc); font-weight: 700; }
.res .rv { font-size: 12px; color: var(--muted); }
.lv0 { --rc: #ff6b6b; } .lv1 { --rc: var(--faint); } .lv2 { --rc: #6ccf7f; } .lv3 { --rc: #46c4c9; } .lv4 { --rc: #a77bff; } .lv5 { --rc: #f5c542; }
.res-legend { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.res-key { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--rc); color: var(--rc); }

@media (max-width: 880px) {
  .panel-grid, .synth-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .stat-row { grid-template-columns: 96px 44px 1fr; gap: 8px; }
  .stat-total { grid-template-columns: 96px 60px 1fr; gap: 8px; }
}

/* ===== Fundorte / Boss ===== */
.habitat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.habitat-list li { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-soft); }
.habitat-list .hn { font-weight: 600; font-size: 14px; }
.habitat-list li.general .hn { color: var(--muted); font-weight: 500; }
.habitat-list .hb { height: 6px; border-radius: 9px; background: var(--line-soft); overflow: hidden; }
.habitat-list .hb span { display: block; height: 100%; background: var(--fam-nature); border-radius: inherit; }
.habitat-list .hc { font-size: 12px; color: var(--muted); white-space: nowrap; }
.chip.boss { border-color: var(--rank-A); color: var(--rank-A); }

/* Monster-Icons aus den Spieldateien */
.mon-img { display: block; object-fit: contain; }
.mon-img.thumb { flex: none; width: 22px; height: 22px; margin: -3px 0; }
.combo-list li .mon-img.thumb { width: 28px; height: 28px; margin: -4px 0; }
.combo-field .mon-img { width: 26px; height: 26px; flex: none; }
.grid-item .mon-img { width: 34px; height: 34px; margin: -4px 0; }
.chip .fam-ic { width: 16px; height: 16px; border-radius: 4px; flex: none; }

/* ===== Zuchtplan (Rückwärts-Synthese) ===== */
.plan-hero {
  display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 24px; align-items: center;
  padding: 22px 26px; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow);
  background:
    radial-gradient(300px 220px at 95px 50%, color-mix(in srgb, var(--c) 32%, transparent), transparent 70%),
    linear-gradient(160deg, color-mix(in srgb, var(--c) 14%, var(--panel)), var(--panel));
}
.plan-art { display: grid; place-items: center; }
.plan-art .mon-img, .plan-art svg {
  width: 100%; max-width: 190px; height: auto; aspect-ratio: 1; object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(0,0,0,.35)); animation: bob 4s ease-in-out infinite;
}
.plan-head h1 { margin: 6px 0; font-size: clamp(24px, 3.6vw, 36px); line-height: 1.08; letter-spacing: -.02em; }
.plan-intro { margin: 0 0 14px; color: var(--muted); font-size: 14px; max-width: 62ch; }
.pstats { display: flex; gap: 10px; flex-wrap: wrap; }
.pstat { display: grid; gap: 4px; min-width: 112px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--panel-2) 85%, transparent); }
.pstat b { font-family: "JetBrains Mono", monospace; font-size: 26px; line-height: 1; color: var(--accent); }
.pstat span { font-size: 12px; color: var(--muted); }
.plan-direct { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; font-weight: 600; }

.plan-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 14px; margin-top: 14px; align-items: start; }
.plan-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px 18px; }
.plan-panel header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.plan-panel h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.plan-panel header .n { font-family: "JetBrains Mono", monospace; color: var(--faint); font-size: 13px; }
.plan-shop { position: sticky; top: 80px; }
.btn.small { padding: 6px 12px; font-size: 12px; border-radius: 10px; }

/* Baum mit Verbindungslinien */
.ptree { overflow-x: auto; padding-bottom: 2px; }
.pkids { margin-left: 30px; }
.pkids > .pnode { position: relative; padding: 8px 0 0 20px; }
.pkids > .pnode::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid var(--line); }
.pkids > .pnode:last-child::before { bottom: auto; height: 39px; }
.pkids > .pnode::after { content: ""; position: absolute; left: 0; top: 39px; width: 16px; border-top: 2px solid var(--line); }
.pcard {
  display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 7px 12px 7px 8px;
  background: var(--panel-2); border: 1px solid var(--line-soft); border-left: 3px solid var(--c); border-radius: 14px;
}
.pnode.root > .pcard { min-height: 74px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 20%, var(--panel-2)), var(--panel-2) 70%); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); border-left-color: var(--c); }
.pnode.root > .pkids { margin-left: 36px; }
.pcard > .pimg, .pcard > svg, .shop-list .pimg, .shop-list li > svg {
  width: 46px; height: 46px; flex: none; border-radius: 12px;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 24%, transparent), transparent 70%);
}
.pnode.root > .pcard > .pimg, .pnode.root > .pcard > svg { width: 58px; height: 58px; }
.pinfo { flex: 1; min-width: 0; display: grid; gap: 4px; }
.pname { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); text-decoration: none; min-width: 0; }
.pname .pn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pname:hover .pn { color: var(--accent); }
.pmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.prule { color: var(--muted); }
.parea {
  padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--fam-nature) 15%, transparent); color: color-mix(in srgb, var(--fam-nature) 75%, var(--text));
}
.parea.unknown { background: transparent; border: 1px dashed var(--line); color: var(--faint); font-weight: 500; white-space: normal; }
.pflex { font-size: 11.5px; color: var(--faint); }
.pside { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.pstep {
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  color: var(--accent-ink); background: var(--accent); padding: 3px 9px; border-radius: 999px;
}
.palt { font: inherit; font-size: 11px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; cursor: pointer; white-space: nowrap; }
.palt:hover { border-color: var(--accent); color: var(--text); }
.pbadge { flex: none; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pbadge.catch { background: color-mix(in srgb, var(--fam-nature) 20%, transparent); color: var(--fam-nature); }
.pbadge.unknown { border: 1px dashed var(--line); color: var(--faint); }
.pnode.leaf.done > .pcard { opacity: .5; }
.pnode.leaf.done .pname .pn, .shop-list li.done .pname .pn { text-decoration: line-through; }

/* Fangliste */
.shop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.shop-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-soft); border-left: 3px solid var(--c); }
.shop-list li.done { opacity: .55; }
.shop-list .pimg, .shop-list li > svg { width: 38px; height: 38px; }
.pcount { font-family: "JetBrains Mono", monospace; font-weight: 800; font-size: 15px; color: var(--accent); flex: none; }
.pcheck { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.pcheck input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pcheck span { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.pcheck input:checked + span { background: var(--fam-nature); border-color: var(--fam-nature); }
.pcheck input:checked + span::after { content: "✓"; color: #0d0f1e; font-weight: 900; font-size: 13px; line-height: 1; }
.pcheck input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .plan-art .mon-img, .plan-art svg { animation: none; } }

@media (max-width: 880px) {
  .plan-grid { grid-template-columns: 1fr; }
  .plan-shop { position: static; }
}
@media (max-width: 560px) {
  .plan-hero { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 16px; }
  .plan-intro { display: none; }
  .pstat { min-width: 0; flex: 1; padding: 8px 10px; }
  .pstat b { font-size: 20px; }
  .plan-panel { padding: 14px 12px; }
  .pkids, .pnode.root > .pkids { margin-left: 16px; }
  .pkids > .pnode { padding-left: 12px; }
  .pkids > .pnode::after { width: 9px; top: 35px; }
  .pkids > .pnode:last-child::before { height: 35px; }
  .pcard { gap: 8px; min-height: 54px; padding: 6px 8px 6px 6px; }
  .pcard > .pimg, .pcard > svg, .pnode.root > .pcard > .pimg, .pnode.root > .pcard > svg { width: 40px; height: 40px; }
  .pbadge.catch { padding: 3px 7px; }
}
