.tree-sprite-defs { position: absolute; width: 0; height: 0; pointer-events: none; }
.build-tree { grid-template-columns: minmax(0, 3.2fr) minmax(0, 1fr); gap: 1rem; }
.build-tree figure { padding: .65rem; border: 1px solid #736247; border-radius: .65rem; background: #1b2025; }
.build-tree figcaption { color: #edd7a8; }
.build-tree figure > svg, .tree > svg { background: radial-gradient(ellipse at 42% 42%, #202731, #101317 77%); border: 1px solid #544733; border-radius: .45rem; }
.build-tree figure > svg { box-sizing: border-box; }
.build-tree svg.passive-icon, .tree svg.passive-icon { background: none; border: 0; overflow: hidden; border-radius: 50%; pointer-events: none; }
.passive-icon { opacity: .48; }
.build-tree .allocated > .passive-icon, .build-tree .upcoming > .passive-icon,
.tree .on > .passive-icon, .tree .next-choice > .passive-icon { opacity: 1; }
.build-tree line, .tree .edge { stroke: #685945; }
.build-tree line.allocated, .tree .edge.on { stroke: #dfb871; stroke-width: 22; }
.build-tree circle, .tree .node circle { fill: #20232a; stroke: #97784f; }
.build-tree .allocated circle, .tree .on circle { fill: #6b5229; stroke: #efc46d; stroke-width: 15; }
.build-tree .upcoming circle, .tree .next-choice circle { stroke: #ffe198; stroke-width: 24; }
.build-tree .current-passive circle, .tree .new circle { stroke: #fff3d4; stroke-width: 24; }
.tree-context { opacity: .55; pointer-events: none; }
.tree-context line { stroke-width: 12; }
.tree-portrait .passive-icon { opacity: .72; }
.tree-legend { display: flex; gap: .8rem; flex-wrap: wrap; color: #ead9b7; font-size: .88rem; }
.tree-legend span::before { content: ''; display: inline-block; width: .55rem; height: .55rem; margin-right: .3rem; border: 2px solid #dfb871; border-radius: 50%; }
.tree-legend span:nth-child(2)::before { border-color: #fff1be; }
.tree-legend span:nth-child(3)::before { border-color: #70645a; }
@media (max-width: 700px) { .build-tree { grid-template-columns: 1fr; } }

.tree-full-lines { opacity: .63; pointer-events: none; }
.tree-full-lines line { stroke: #685945; stroke-width: 13; }
.tree-free circle { fill: #20232a; stroke: #92744d; stroke-width: 10; }
.tree-free:hover circle { stroke: #ffd780; stroke-width: 18; }
.tree-free:hover > .passive-icon { opacity: 1; }
.tree-tooltip {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  width: max-content;
  max-width: min(21rem, calc(100vw - 20px));
  padding: .65rem .8rem;
  border: 1px solid #ae8b53;
  border-radius: .35rem;
  background: #191c21;
  color: #eef0f4;
  box-shadow: 0 .4rem 1rem #0008;
  font: .9rem/1.45 system-ui, sans-serif;
}
.tree-tooltip strong, .tree-tooltip small { display: block; color: #f0cb86; }
.tree-tooltip small { font-size: .75rem; margin-bottom: .35rem; }
.tree-tooltip div { white-space: pre-line; }

.class-start-overview { display: block; margin: .45rem 0; }
.class-start { cursor: help; }
.class-start circle { fill: #20232a; stroke: #9c8058; stroke-width: 10; }
.class-start-active circle { stroke: #f0c16a; stroke-width: 18; }
.class-start:focus circle, .class-start:hover circle { stroke: #fff3d4; }
.class-start-icon, .class-start text { pointer-events: none; }
.class-start text {
  fill: #f6e5c4;
  stroke: #101317;
  stroke-width: 9;
  paint-order: stroke;
  text-anchor: middle;
  font: bold 58px system-ui, sans-serif;
}

.tree-toolbar { display: grid; gap: .75rem; margin-block: .75rem 1rem; }
.tree-search, .tree-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.tree-toolbar input, .tree-toolbar select { box-sizing: border-box; max-width: 100%; padding: .45rem .6rem; color: #edf7f8; background: #162830; border: 1px solid #68808a; border-radius: .35rem; font: inherit; }
.tree-actions a { display: inline-block; padding: .35rem .6rem; border: 1px solid #68808a; border-radius: .35rem; }
#tree-search-results { max-width: min(100%, 22rem); }
.tree .stage-choice circle { stroke: #f0bf64; stroke-width: 19; }
.tree .tree-search-match circle { stroke: #91f3e5; stroke-width: 26; }
.tree .tree-search-match > .passive-icon { opacity: 1; }
:is(#passives, #pob):fullscreen, :is(#passives, #pob).tree-expanded { box-sizing: border-box; overflow: auto; padding: clamp(.85rem, 3vw, 2rem); background: #14252d; color: #edf7f8; max-width: none; }
:is(#passives, #pob).tree-expanded { position: fixed; inset: 0; z-index: 50; }
body.tree-expanded-page { overflow: hidden; }
#passives:fullscreen .tree > svg:first-of-type, #passives.tree-expanded .tree > svg:first-of-type { max-height: 82vh; }

#pob:fullscreen .build-tree figure:first-child > svg, #pob.tree-expanded .build-tree figure:first-child > svg { height: 82vh; }

.ascendancy-order {
  margin: 1rem 0;
  padding: .8rem 1rem;
  background: #14252d;
  border: 1px solid #736247;
  border-radius: .65rem;
}
.ascendancy-order h3 { margin-top: 0; }
.ascendancy-order ol { padding-left: 1.5rem; }
.ascendancy-order li { margin-block: .3rem; }
.ascendancy-order [aria-current="step"] { outline: 2px solid #efc46d; }
.ascendancy-order button.passive-up-next { color: #ffe198; }
:is(.tree, .build-tree) svg[data-ascendancy-order] .ascendancy-step-node { cursor: pointer; }
:is(.tree, .build-tree) svg[data-ascendancy-order] .ascendancy-step-node circle { fill: #20232a; stroke: #97784f; stroke-width: 10; }
:is(.tree, .build-tree) svg[data-ascendancy-order] .ascendancy-spent circle { fill: #6b5229; stroke: #efc46d; stroke-width: 15; }
:is(.tree, .build-tree) svg[data-ascendancy-order] .ascendancy-next circle { stroke: #ffe198; stroke-width: 24; }
:is(.tree, .build-tree) svg[data-ascendancy-order] .ascendancy-step-node.tree-search-match circle { stroke: #91f3e5; }
:is(.tree, .build-tree) svg[data-ascendancy-order] .ascendancy-step-node > .passive-icon { opacity: .48; }
:is(.tree, .build-tree) svg[data-ascendancy-order] :is(.ascendancy-spent, .ascendancy-next) > .passive-icon { opacity: 1; }
