/* ===== Leveling-Vorlagen ===== */
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.tpl-hero { padding: 40px 0 8px; }
.tpl-hero h1 { font-family: var(--font-title); font-size: clamp(28px, 4vw, 40px); margin: 0 0 10px; color: #f1e2cf; }
.tpl-hero p { max-width: 680px; color: var(--muted); margin: 0; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.class-card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 6px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.class-card.has-tpl { border-color: #6a3b17; background: linear-gradient(160deg, rgba(200, 121, 47, .12), transparent 60%), var(--panel); }
.class-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.class-card h3 { margin: 0; font-family: var(--font-title); font-size: 18px; color: #f1e2cf; }
.class-card .attr { font-size: 11px; color: var(--muted); white-space: nowrap; }
.asc-list { display: flex; flex-wrap: wrap; gap: 5px; }
.asc { font-size: 12px; padding: 2px 8px; border-radius: 3px; background: #201a15; border: 1px solid #3a2f24; color: #cdb99f; }
.tpl-link { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 4px; background: rgba(200, 121, 47, .15); border: 1px solid #8a4a1c; color: #f6d7b0; }
.tpl-link:hover { text-decoration: none; filter: brightness(1.15); }
.tpl-link span { font-size: 12px; color: #c9a988; }
.tpl-missing { font-size: 13px; color: #6f6255; border: 1px dashed #3a2f24; border-radius: 4px; padding: 8px 10px; text-align: center; }

.tpl-head { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: start; padding: 22px; border-radius: 8px; border: 1px solid var(--line);
  background: radial-gradient(ellipse at 0% 0%, rgba(90, 159, 224, .12), transparent 55%), radial-gradient(ellipse at 100% 0%, rgba(200, 121, 47, .14), transparent 50%), var(--panel); }
.tpl-head h1 { font-family: var(--font-title); font-size: clamp(26px, 3.6vw, 38px); margin: 0; color: #f6e7d3; line-height: 1.15; }
.tpl-sub { color: var(--muted); margin: 6px 0 12px; }
.tpl-actions { display: flex; flex-direction: column; gap: 8px; max-width: 320px; }
.howto { font-size: 13px; color: var(--muted); }
.howto summary { cursor: pointer; color: var(--accent-2); }
.howto code { font-size: 12px; background: #0f0d0b; padding: 1px 4px; border-radius: 3px; word-break: break-all; }

.sources { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.sources > div { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 6px; padding: 14px 16px; }
.src { font-size: 14px; margin-bottom: 4px; }
.compare-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; margin: 4px 0 8px; gap: 2px; }
.cb-a { background: #c8792f; } .cb-both { background: #7fb36a; } .cb-b { background: #5a9fe0; }
.compare-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.compare-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.compare p { margin: 8px 0 0; font-size: 13px; }

.phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 20px 0 0; }
.phase-btn { all: unset; cursor: pointer; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line-soft); border-right-width: 0; }
.phase-btn:first-child { border-radius: 6px 0 0 6px; }
.phase-btn:last-child { border-radius: 0 6px 6px 0; border-right-width: 1px; }
.phase-btn:hover { background: var(--panel-2); }
.phase-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.phase-btn.active { background: linear-gradient(180deg, rgba(200, 121, 47, .25), rgba(200, 121, 47, .08)); border-color: #8a4a1c; box-shadow: inset 0 -3px 0 var(--accent); }
.ph-num { grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: #261f18; border: 1px solid #4a3d30; color: var(--accent-2); align-self: center; }
.phase-btn.active .ph-num { background: var(--accent); color: #1a0f06; border-color: var(--accent-2); }
.ph-title { font-weight: 600; color: #f1e2cf; font-size: 14px; }
.ph-meta { font-size: 12px; color: var(--muted); }

.tpl-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; margin-top: 16px; align-items: start; }
.tree-panel { position: sticky; top: 72px; }
.tree-panel h2 .meta { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--muted); font-weight: 400; }
.tree-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px 0; font-size: 12px; color: var(--muted); }
.tree-tools .spacer { flex: 1; }
.lg { display: inline-flex; align-items: center; gap: 5px; }
.lg i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-sizing: border-box; }
.lg-alloc { background: #a07e3e; }
.lg-new { background: #ffe27a; box-shadow: 0 0 6px #ffe27a; }
.lg-rem { border: 2px solid #d65a4a; }
.lg-mx { border: 2px solid #5a9fe0; }
.tree-wrap { margin: 10px 14px 0; border-radius: 6px; overflow: hidden; border: 1px solid #2a231c; background: radial-gradient(ellipse at center, #15120f, #0a0908); }
svg.baum { display: block; width: 100%; height: min(62vh, 560px); cursor: grab; touch-action: none; user-select: none; }
svg.baum:active { cursor: grabbing; }
svg.baum line { stroke: #2e2720; stroke-width: 14; }
svg.baum line.alloc { stroke: #8a6a32; stroke-width: 22; }
svg.baum line.new { stroke: #ffe27a; stroke-width: 30; }
svg.baum line.mx { stroke: #3d6b9a; stroke-width: 18; stroke-dasharray: 40 30; }
svg.baum circle { fill: #3a332b; stroke: #1a1611; stroke-width: 8; }
svg.baum circle.t-n { fill: #4a4033; }
svg.baum circle.t-k { fill: #5a4a35; }
svg.baum circle.t-j { fill: #2c3a48; }
svg.baum circle.t-m { fill: #2f3b33; }
svg.baum circle.alloc { fill: #a07e3e; stroke: #5a4320; }
svg.baum circle.new { fill: #ffe27a; stroke: #fff; stroke-width: 18; }
svg.baum:not(.mit-icons) circle.new { r: 70px; }
svg.baum:not(.mit-icons) circle.t-n.new, svg.baum:not(.mit-icons) circle.t-k.new { r: 100px; }
svg.baum circle.rem { fill: #3a1d18; stroke: #d65a4a; stroke-width: 22; }
svg.baum circle.mx { stroke: #5a9fe0; stroke-width: 22; }
svg.baum circle.hl { stroke: #fff; stroke-width: 40; }
svg.baum circle:hover { stroke: #fff; stroke-width: 26; }
.tree-hint { padding: 8px 14px 12px; margin: 0; font-size: 12px; }

.phase-text { margin: 0; color: #e5d8c8; }
.gem-list { display: grid; gap: 8px; }
.gem-card { border: 1px solid var(--line-soft); border-left: 3px solid #1ba29b; border-radius: 4px; padding: 8px 10px; background: rgba(0, 0, 0, .25); }
.gem-card.is-new { border-left-color: #f5d36b; background: rgba(245, 211, 107, .05); }
.gem-top { display: flex; justify-content: space-between; gap: 8px; }
.gem-top .g-name { font-family: var(--font-item); font-size: 16px; color: #3fc7bf; }
.gem-top .g-lvl { font-size: 12px; color: var(--muted); white-space: nowrap; }
.g-sup { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.g-sup span { font-size: 12px; padding: 1px 7px; border-radius: 3px; background: #10201f; border: 1px solid #1e4441; color: #9fdcd6; }
.g-none { font-size: 12px; color: #6f6255; }
.node-list { margin: 0; padding-left: 0; list-style: none; columns: 2; column-gap: 16px; font-size: 13.5px; }
.node-list li { break-inside: avoid; padding: 2px 0; display: flex; align-items: baseline; gap: 6px; cursor: default; }
.node-list li:hover { color: #fff; }
.node-list li.notable { color: #f5d36b; font-weight: 600; }
.node-list .step { font-size: 11px; color: #5a9fe0; font-weight: 400; }
.rem-box { margin-top: 12px; font-size: 13px; padding: 8px 10px; border: 1px solid rgba(214, 90, 74, .35); background: rgba(214, 90, 74, .08); border-radius: 4px; color: #f0b3a9; }
.asc-box { margin-top: 12px; padding: 10px; border: 1px solid #4f3a6a; background: rgba(120, 80, 170, .08); border-radius: 4px; }
.asc-node { font-size: 13px; margin-top: 4px; }
.asc-node b { color: #d8b8ff; margin-right: 6px; }
.asc-node span { color: #a99abd; }
.gear-list { display: grid; gap: 8px; }
.gear-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.gear-slot { font-size: 13px; color: #ead9c4; font-weight: 600; }
.gear-slot span { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
.gear-info b { font-family: var(--font-item); font-size: 15px; color: #c8c8c8; font-weight: 500; }
.gear-info b.uq { color: #af6025; }
.gear-info ol { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: #8888ff; font-family: var(--font-item); }

@media (max-width: 980px) {
  .tpl-layout, .sources, .tpl-head { grid-template-columns: minmax(0, 1fr); }
  .tree-panel { position: static; }
  .tpl-actions { max-width: none; }
}
@media (max-width: 640px) {
  .phases { grid-template-columns: 1fr; }
  .phase-btn, .phase-btn:first-child, .phase-btn:last-child { border-radius: 0; border-right-width: 1px; border-bottom-width: 0; }
  .phase-btn:last-child { border-bottom-width: 1px; }
  .node-list { columns: 1; }
  svg.baum { height: 52vh; }
}
