/* Ячейки в три столбца: средний смещён вниз, как на образце пользователя. */
.tree-root {
    border: 1px solid var(--gold);
    border-radius: 12px;
    text-align: center;
    padding: 14px;
    margin: 18px auto 0;
    max-width: 240px;
    font-weight: 700;
}
.ability-tree {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding-top: 14px;
    max-width: 420px;
    margin: auto;
}
.tree-lightning {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
    fill: none;
    stroke-linejoin: round;
    stroke-linecap: round;
    animation: tree-lightning-fade 1.1s ease-out forwards;
}
.tree-lightning path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: tree-lightning-draw 0.7s linear forwards;
}
.tree-lightning-glow {
    stroke: #32bd73;
    stroke-width: 9;
    opacity: 0.45;
    filter: blur(3px);
}
.tree-lightning-core {
    stroke: #9fffc6;
    stroke-width: 2;
}
@keyframes tree-lightning-draw {
    to {
        stroke-dashoffset: 0;
    }
}
@keyframes tree-lightning-fade {
    0%,
    70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}
@media (prefers-reduced-motion: reduce) {
    .tree-lightning {
        display: none;
    }
}
.tree-branch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: clamp(10px, 3vw, 24px);
    row-gap: 24px;
    min-width: 0;
    padding-bottom: 14px;
}
.tree-branch h3 {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 13px;
    position: relative;
    background: var(--panel);
    border-radius: 8px;
    padding: 8px 0;
    margin: 0;
}
.tree-node {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    min-height: 72px;
    font-size: 11px;
    overflow-wrap: anywhere;
    position: relative;
}
.tree-node span {
    font-size: 9px;
}
.tree-node:nth-of-type(3n + 2) {
    transform: translateY(14px);
}
.tree-editor {
    margin-top: 22px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}
.tree-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.tree-choices[hidden] {
    display: none;
}

.tree-choice-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    margin-top: 12px;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
}
.tree-choice {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    overflow-wrap: anywhere;
}
.tree-choice-actions,
.tree-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tree-branch-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.tree-branch-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
}
.tree-branch-dot.is-active {
    background: #22a75a;
    box-shadow: 0 0 0 3px rgb(34 167 90 / 15%);
}
