@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400..800&display=swap');


:root {
    --bg-0: #03050a;
    --bg-1: #070c14;
    --bg-2: #0d1422;
    --bg-3: #141f32;
    --bg-4: #1b2940;

    --text: #ffffff;
    --text-soft: rgba(255, 255, 255, 0.80);
    --text-faint: rgba(255, 255, 255, 0.54);

    --line: rgba(191, 206, 238, 0.18);
    --line-soft: rgba(191, 206, 238, 0.10);
    --line-active: rgba(255, 255, 255, 0.95);

    --stroke: rgba(255, 255, 255, 0.10);
    --stroke-soft: rgba(255, 255, 255, 0.05);

    --shadow-1: 0 10px 24px rgba(0, 0, 0, 0.28);
    --shadow-2: 0 28px 70px rgba(0, 0, 0, 0.42);
    --shadow-3: 0 50px 150px rgba(0, 0, 0, 0.56);

    --glow-blue: rgba(112, 149, 255, 0.22);
    --glow-purple: rgba(164, 118, 255, 0.18);
    --glow-cyan: rgba(78, 210, 255, 0.14);

    --radius-xl: 42px;
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-pill: 999px;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: "Baloo 2", sans-serif;

    color: var(--text);
    background:
        radial-gradient(circle at 50% -12%, rgba(92, 123, 201, .28) 0%, rgba(92, 123, 201, 0) 34%),
        radial-gradient(circle at 14% 16%, rgba(77, 108, 178, .16), rgba(77, 108, 178, 0) 24%),
        radial-gradient(circle at 84% 12%, rgba(128, 100, 216, .13), rgba(128, 100, 216, 0) 24%),
        radial-gradient(circle at 50% 100%, rgba(25, 45, 78, .28), rgba(25, 45, 78, 0) 35%),
        linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 20%, var(--bg-2) 48%, var(--bg-3) 76%, var(--bg-4) 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 50% 35%, rgba(126, 157, 255, .08), rgba(126, 157, 255, 0) 45%),
        radial-gradient(circle at 50% 50%, rgba(97, 222, 255, .04), rgba(97, 222, 255, 0) 52%),
        linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, 0) 22%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at center, rgba(0, 0, 0, 0), rgba(0, 0, 0, .44) 100%);
}

.app {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    isolation: isolate;
}

.app::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: .22;
    background-image:
        radial-gradient(circle at 18% 18%, rgba(109, 137, 219, .18), transparent 24%),
        radial-gradient(circle at 82% 20%, rgba(95, 133, 220, .16), transparent 22%),
        radial-gradient(circle at 28% 80%, rgba(90, 205, 255, .10), transparent 18%),
        radial-gradient(circle at 72% 78%, rgba(155, 116, 255, .10), transparent 18%);
    filter: blur(60px);
}

.app::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: .04;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.9) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.9) 1px, transparent 1px);
    background-size: 140px 140px;
    mask-image: radial-gradient(circle at center, black 18%, transparent 94%);
}

.stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    cursor: grab;
    z-index: 1;
}

.stage:active {
    cursor: grabbing;
}

#viewport {
    position: absolute;
    inset: 0;
    transform-origin: 0 0;
    will-change: transform;
    transition: transform .70s cubic-bezier(.22, .61, .36, 1);
}

#links {
    position: absolute;
    inset: 0;
    overflow: visible;
    pointer-events: none;
}

#nodes {
    position: absolute;
    inset: 0;
}

/* =========================
   NODE BASE
========================= */
.node {
    position: absolute;
    min-height: 64px;
    padding: 14px 18px;
    border-radius: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    user-select: none;
    overflow: hidden;
    color: #fff;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.09);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012)),
        linear-gradient(135deg, #19263c 0%, #11192b 52%, #0a101c 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .08),
        inset 0 -1px 0 rgba(255, 255, 255, .02),
        0 14px 34px rgba(0, 0, 0, .34),
        0 28px 84px rgba(0, 0, 0, .34);
    transition:
        transform .28s cubic-bezier(.22, .61, .36, 1),
        opacity .24s ease,
        box-shadow .30s ease,
        width .28s ease,
        min-height .28s ease,
        left .38s cubic-bezier(.22, .61, .36, 1),
        top .38s cubic-bezier(.22, .61, .36, 1),
        filter .28s ease,
        border-color .28s ease,
        background .28s ease;
    z-index: 4;
}

.node::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 10%, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 24%),
        linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .014) 36%, rgba(255, 255, 255, 0) 82%);
}

.node::after {
    content: "";
    position: absolute;
    left: 14%;
    right: 14%;
    bottom: -18px;
    height: 26px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(0, 0, 0, .48), rgba(0, 0, 0, 0) 74%);
    filter: blur(15px);
    opacity: .34;
    pointer-events: none;
}

.node:hover {
    transform: translateY(-4px) scale(1.022);
    border-color: rgba(255, 255, 255, .14);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .09),
        inset 0 -1px 0 rgba(255, 255, 255, .03),
        0 18px 44px rgba(0, 0, 0, .42),
        0 36px 98px rgba(0, 0, 0, .42),
        0 0 0 1px rgba(255, 255, 255, .02);
    z-index: 30;
}

.node.focused {
    z-index: 80;
    transform: scale(1.06);
    border-color: rgba(255, 255, 255, .24);
    box-shadow:
        inset 0 2px 6px rgba(255, 255, 255, .12),

        /* gold border highlight */
        0 0 0 2px rgba(255, 230, 120, .9),

        /* strong glow */
        0 0 25px rgba(255, 210, 70, .9),

        /* outer aura */
        0 0 80px rgba(255, 200, 0, .65),

        /* huge ambient glow */
        0 0 180px rgba(255, 190, 0, .35),

        /* depth */
        0 35px 90px rgba(0, 0, 0, .55);
}

.node.focused::after {
    opacity: .46;
    bottom: -20px;
    height: 30px;
}

.node.on-path {
    opacity: 1;
}

/* =========================
   TITLE
========================= */
.title-node {
    min-height: 230px !important;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .12);
    background:
        radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 22%),
        radial-gradient(circle at 50% 46%, rgba(130, 135, 255, .22), rgba(130, 135, 255, 0) 58%),
        radial-gradient(circle at 50% 80%, rgba(76, 220, 255, .10), rgba(76, 220, 255, 0) 40%),
        linear-gradient(135deg, #2d448f 0%, #21367a 24%, #182960 49%, #101d47 72%, #09122f 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .10),
        0 0 0 1px rgba(255, 255, 255, .02),
        0 24px 60px rgba(0, 0, 0, .44),
        0 42px 130px rgba(0, 0, 0, .40),
        0 0 48px rgba(114, 136, 255, 0.12);
}

.title-node .label {
    font-size: 34px;
    line-height: 1.14;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-align: center;
    color: #ffffff;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, .24),
        0 12px 28px rgba(0, 0, 0, .36);
}

/* =========================
   COMMON INNER
========================= */
.node-inner,
.medium-inner,
.ghost-symbol-wrap {
    position: relative;
    z-index: 1;
}

.node-inner {
    width: 100%;
    height: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0;
}

.label {
    width: 100%;
    max-width: 100%;
    text-align: center;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
    letter-spacing: 0;
    color: #ffffff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .34);
}

/* =========================
   TYPOGRAPHY
========================= */
.node:not(.leaf):not(.title-node) .label {
    font-size: 24px;
    line-height: 1.22;
    font-weight: 700;
}

.node.leaf .label {
    font-size: 20px;
    line-height: 1.18;
    font-weight: 700;
    max-width: 100%;
    margin: 0 auto;
}

.one-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================
   THUMB
========================= */
.thumb {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .14);
    background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .08),
        0 8px 18px rgba(0, 0, 0, .24);
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb.initials {
    font-size: 12px;
    font-weight: 900;
    color: #fff;
    letter-spacing: .02em;
}

.thumb.small {
    width: 22px;
    height: 22px;
    border-radius: 999px;
}

/* =========================
   DEPTH COLORS
========================= */
.node[data-depth="1"]:not(.compact):not(.mini):not(.symbolized):not(.leaf) {
    background:
        radial-gradient(circle at 16% 10%, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 24%),
        linear-gradient(135deg, #254598 0%, #1e3676 55%, #142750 100%);
}

.node[data-depth="2"]:not(.compact):not(.mini):not(.symbolized):not(.leaf) {
    background:
        radial-gradient(circle at 16% 10%, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 24%),
        linear-gradient(135deg, #6430a3 0%, #4e2480 55%, #38185c 100%);
}

.node[data-depth="3"]:not(.compact):not(.mini):not(.symbolized):not(.leaf) {
    background:
        radial-gradient(circle at 16% 10%, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 24%),
        linear-gradient(135deg, #0e6d79 0%, #0d5660 55%, #083f46 100%);
}

.node.leaf:not(.mini):not(.compact):not(.medium):not(.symbolized)[data-depth="2"] {
    background:
        radial-gradient(circle at 16% 12%, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 24%),
        linear-gradient(135deg, #9c6808 0%, #7a5007 56%, #5a3b05 100%);
}

.node.leaf:not(.mini):not(.compact):not(.medium):not(.symbolized)[data-depth="3"] {
    background:
        radial-gradient(circle at 16% 12%, rgba(255, 255, 255, .09), rgba(255, 255, 255, 0) 24%),
        linear-gradient(135deg, #0f5d8a 0%, #0d486b 56%, #09354f 100%);
}

.node.leaf:not(.mini):not(.compact):not(.medium):not(.symbolized)[data-depth="4"] {
    background:
        radial-gradient(circle at 16% 12%, rgba(255, 255, 255, .09), rgba(255, 255, 255, 0) 24%),
        linear-gradient(135deg, #5a35a0 0%, #45287d 56%, #321c5c 100%);
}

.node.leaf:not(.mini):not(.compact):not(.medium):not(.symbolized)[data-depth="5"] {
    background:
        radial-gradient(circle at 16% 12%, rgba(255, 255, 255, .09), rgba(255, 255, 255, 0) 24%),
        linear-gradient(135deg, #117764 0%, #0d5e4f 56%, #094539 100%);
}

.node.leaf:not(.mini):not(.compact):not(.medium):not(.symbolized)[data-depth="6"] {
    background:
        radial-gradient(circle at 16% 12%, rgba(255, 255, 255, .09), rgba(255, 255, 255, 0) 24%),
        linear-gradient(135deg, #9a4710 0%, #79370c 56%, #582709 100%);
}

.node.leaf:not(.mini):not(.compact):not(.medium):not(.symbolized)[data-depth="7"],
.node.leaf:not(.mini):not(.compact):not(.medium):not(.symbolized)[data-depth="8"],
.node.leaf:not(.mini):not(.compact):not(.medium):not(.symbolized)[data-depth="9"] {
    background:
        radial-gradient(circle at 16% 12%, rgba(255, 255, 255, .08), rgba(255, 255, 255, 0) 24%),
        linear-gradient(135deg, #46564d 0%, #354139 56%, #252d28 100%);
}

/* =========================
   BRANCH THEMES
========================= */
.node.theme-yellow:not(.symbolized):not(.title-node) {
    background:
        radial-gradient(circle at 16% 10%, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 24%),
        linear-gradient(135deg, #9e6a08 0%, #7b5207 55%, #5a3c05 100%);
}

.node.theme-olive:not(.symbolized):not(.title-node) {
    background:
        radial-gradient(circle at 16% 10%, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 24%),
        linear-gradient(135deg, #566543 0%, #435135 55%, #313c27 100%);
}

.node.theme-green:not(.symbolized):not(.title-node) {
    background:
        radial-gradient(circle at 16% 10%, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 24%),
        linear-gradient(135deg, #13816d 0%, #0f6657 55%, #0a4a3f 100%);
}

.node.theme-orange:not(.symbolized):not(.title-node) {
    background:
        radial-gradient(circle at 16% 10%, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 24%),
        linear-gradient(135deg, #a65017 0%, #844011 55%, #612d0d 100%);
}

.node.theme-blue:not(.symbolized):not(.title-node) {
    background:
        radial-gradient(circle at 16% 10%, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 24%),
        linear-gradient(135deg, #2660ba 0%, #1d4a92 55%, #14356a 100%);
}

.node.theme-purple:not(.symbolized):not(.title-node) {
    background:
        radial-gradient(circle at 16% 10%, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 24%),
        linear-gradient(135deg, #6c37a8 0%, #542987 55%, #3b1d61 100%);
}

.node.theme-black:not(.symbolized):not(.title-node) {
    background:
        radial-gradient(circle at 16% 10%, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 24%),
        linear-gradient(135deg, #2a3442 0%, #1f2733 55%, #121821 100%);
}

/* =========================
   LEAF STYLE
========================= */
.node.leaf:not(.mini):not(.compact):not(.medium):not(.symbolized) {
    border-radius: 999px;
    padding: 14px 22px;
    min-height: 84px !important;
    border: 1px solid rgba(255, 255, 255, .09);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .07),
        0 12px 28px rgba(0, 0, 0, .30),
        0 22px 66px rgba(0, 0, 0, .34);
}

.node.leaf:not(.mini):not(.compact):not(.medium):not(.symbolized):hover {
    transform: translateY(-2px) scale(1.018);
}

/* =========================
   SYMBOLIZED NODE
========================= */
.node.symbolized,
.node.mini {
    padding: 0 !important;
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    min-height: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, .14);
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 42%),
        linear-gradient(135deg, #303b69 0%, #252d52 55%, #181d38 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .06),
        0 8px 18px rgba(0, 0, 0, .28),
        0 16px 36px rgba(0, 0, 0, .30);
}

.node.symbolized::before,
.node.compact::before,
.node.mini::before {
    inset: 1px;
    border-radius: 50% !important;
    opacity: .16;
}

.node.symbolized::after,
.node.compact::after,
.node.mini::after {
    opacity: .18;
    bottom: -8px;
    height: 16px;
}

.node.symbolized .label,
.node.compact .label,
.node.mini .label {
    display: none !important;
}

.node.symbolized .thumb,
.node.symbolized .thumb.small,
.node.compact .thumb,
.node.compact .thumb.small,
.node.mini .thumb,
.node.mini .thumb.small {
    display: none !important;
}

.ghost-symbol-wrap {
    width: 100%;
    height: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.ghost-symbol-core {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.97);
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.08),
        0 0 18px rgba(150, 183, 255, 0.18),
        0 2px 10px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    flex: none;
}

.node.symbolized:hover,
.node.symbolized.focused {
    transform: none !important;
}

/* =========================
   LINKS
========================= */
.link {
    fill: none;
    stroke: var(--line);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .78;
    transition:
        stroke .30s ease,
        opacity .30s ease,
        stroke-width .30s ease,
        d .38s cubic-bezier(.22, .61, .36, 1),
        filter .30s ease;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .22));
}

.link.active {
    stroke: var(--line-active);
    stroke-width: 4;
    opacity: 1;
    filter:
        drop-shadow(0 0 10px rgba(255, 255, 255, .12)) drop-shadow(0 0 24px rgba(142, 170, 255, .10)) drop-shadow(0 4px 14px rgba(255, 255, 255, .08));
}

.link.compact-link {
    opacity: .38;
    stroke-width: 1.9;
}

.link.mini-link {
    opacity: .24;
    stroke-width: 1.5;
}

/* =========================
   STATES
========================= */
.fade {
    opacity: .08;
    filter: saturate(.82) blur(.2px);
}

.ghost {
    opacity: .60 !important;
    filter: saturate(.90);
}

.ghost .label {
    opacity: .88;
}


.node.history-open {
    opacity: 0.88;
    transform: scale(0.96);
    filter: saturate(0.9) brightness(0.96);
}

.node.history-open:hover {
    opacity: 0.96;
    transform: translateY(-2px) scale(0.985);
}

/* =========================
   OPTIONAL PREMIUM ANIMATION
========================= */
@keyframes slowFloat {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-1.5px);
    }

    100% {
        transform: translateY(0px);
    }
}

.title-node {
    animation: slowFloat 4.8s ease-in-out infinite;
}


/* =========================
   CHILDREN HINT BULB
========================= */
.children-hint {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 2px;
    height: 2px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 3;
}

.children-hint::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 235, 140, 0.22), rgba(255, 235, 140, 0) 72%);
    animation: childrenHintGlow 1.8s ease-in-out infinite;
}

.children-hint-core {
    position: relative;
    width: 2px;
    height: 2px;
    border-radius: 999px;
    background: radial-gradient(circle at 35% 35%, #fff8d6 0%, #ffe66d 45%, #ffb800 100%);
    box-shadow:
        0 0 0 3px rgba(255, 210, 90, 0.10),
        0 0 12px rgba(255, 210, 90, 0.55),
        0 0 22px rgba(255, 187, 0, 0.32);
    animation: childrenHintPulse 1.8s ease-in-out infinite;
}

.node.focused .children-hint-core {
    box-shadow:
        0 0 0 4px rgba(255, 220, 110, 0.14),
        0 0 16px rgba(255, 220, 110, 0.72),
        0 0 28px rgba(255, 187, 0, 0.42);
}

@keyframes childrenHintPulse {
    0% {
        transform: scale(0.95);
        opacity: 0.88;
    }

    50% {
        transform: scale(1.18);
        opacity: 1;
    }

    100% {
        transform: scale(0.95);
        opacity: 0.88;
    }
}

@keyframes childrenHintGlow {
    0% {
        transform: scale(0.92);
        opacity: 0.48;
    }

    50% {
        transform: scale(1.22);
        opacity: 0.9;
    }

    100% {
        transform: scale(0.92);
        opacity: 0.48;
    }
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1100px) {
    .title-node .label {
        font-size: 28px;
    }

    .node:not(.leaf):not(.title-node) .label {
        font-size: 20px;
    }

    .node.leaf .label {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .title-node .label {
        font-size: 22px;
    }

    .node:not(.leaf):not(.title-node) .label {
        font-size: 17px;
    }

    .node.leaf .label {
        font-size: 14px;
    }

    .thumb {
        width: 34px;
        height: 34px;
    }

    .thumb.small {
        width: 20px;
        height: 20px;
    }
}