:root {
    --heritage-shadow-deep: rgba(14, 1, 6, 0.25);
    --heritage-shadow-soft: rgba(20, 3, 8, 0.16);
    --heritage-sparkle: #f5dea0;
    --heritage-sparkle-core: #fff7d8;
    --heritage-guide: rgba(236, 211, 157, 0.26);
    --heritage-guide-text: #f0d79f;
}

/* A teljes fa finoman elemelkedik a bársony háttértől. */
.tree-stage #edges {
    filter:
        drop-shadow(0 4px 5px var(--heritage-shadow-soft))
        drop-shadow(0 10px 16px rgba(12, 0, 5, 0.08));
}

.tree-stage #nodes {
    filter:
        drop-shadow(0 7px 9px var(--heritage-shadow-soft))
        drop-shadow(0 18px 26px var(--heritage-shadow-deep));
}

/* Az effekt-réteg NEM az #edges gyereke. Így sem a branch-layout, sem a
   motion/layout observer nem tekinti valódi családfa-élnek. */
#heritage-effects,
#heritage-guides {
    pointer-events: none;
}

.tree-stage .heritage-gold-sheen {
    fill: none;
    stroke: var(--heritage-sparkle-core);
    stroke-width: 1.65;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    opacity: 0.84;
    stroke-dasharray: 7 93;
    stroke-dashoffset: 0;
    filter:
        drop-shadow(0 0 1.4px rgba(255, 248, 214, 0.92))
        drop-shadow(0 0 4px rgba(236, 200, 116, 0.48));
    animation: heritage-gold-sweep 6.4s linear infinite;
}

.tree-stage .heritage-gold-sheen.uncertain {
    opacity: 0.52;
}

@keyframes heritage-gold-sweep {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -100; }
}

/* Többgenerációs nézet: finom infografika-szerű generációs segédvonalak. */
.heritage-generation-line {
    stroke: var(--heritage-guide);
    stroke-width: 1;
    stroke-dasharray: 3 8;
    vector-effect: non-scaling-stroke;
}

.heritage-generation-label-bg {
    fill: rgba(52, 8, 19, 0.84);
    stroke: rgba(224, 195, 128, 0.34);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.heritage-generation-label {
    fill: var(--heritage-guide-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    dominant-baseline: middle;
}

.heritage-generation-guide.is-focus .heritage-generation-line {
    stroke: rgba(245, 220, 158, 0.42);
}

.heritage-generation-guide.is-focus .heritage-generation-label-bg {
    fill: rgba(69, 12, 27, 0.94);
    stroke: rgba(241, 211, 143, 0.58);
}

.heritage-generation-guide.is-focus .heritage-generation-label {
    fill: #fff0c1;
}

/* Zenevezérlő: csak akkor jelenik meg, ha a hangfájl tényleg elérhető. */
.heritage-audio-control {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 5px 3px 3px;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    background: rgba(251, 250, 246, 0.88);
}

.heritage-audio-control[hidden] {
    display: none !important;
}

.heritage-audio-button {
    min-height: 30px;
    padding: 5px 9px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-size: 0.76rem;
    white-space: nowrap;
}

.heritage-audio-button:hover,
.heritage-audio-button[aria-pressed="true"] {
    background: var(--paper-2);
}

.heritage-audio-volume {
    width: 72px;
    accent-color: #8a6c3d;
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    .tree-stage .heritage-gold-sheen {
        display: none !important;
    }
}

@media (max-width: 720px) {
    .heritage-audio-volume {
        display: none;
    }

    .heritage-generation-label {
        font-size: 9px;
    }
}
