/* Celestial Path Skill Tree Styles */
.shop-stage {
    background: radial-gradient(circle at center, rgba(30, 10, 50, 0.4) 0%, transparent 80%);
}

.skill-tree-container {
    position: relative;
    width: 100%;
    /* Full width */
    max-width: 800px;
    height: 400px;
    /* Fixed height for reliable absolute positioning */
    margin: 0 auto;
    perspective: 1200px;
    display: flex !important;
    /* Force flex */
    justify-content: center;
    align-items: center;
}

/* Invisible hitbox spanning the container to detect background clicks */
.tree-hitbox {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    cursor: default;
}

.tree-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.tree-svg line {
    stroke: rgba(167, 139, 250, 0.4);
    stroke-width: 2;
    stroke-dasharray: 6 12;
    animation: flowPulse 2s linear infinite, line-flow 30s linear infinite;
    filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.6));
}

@keyframes flowPulse {

    0%,
    100% {
        opacity: 0.6;
        stroke-width: 1.5;
    }

    50% {
        opacity: 1;
        stroke-width: 3;
    }
}

@keyframes line-flow {
    from {
        stroke-dashoffset: 400;
    }

    to {
        stroke-dashoffset: 0;
    }
}

/* Minimalist glowing dots */
.skill-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 5;
    transform: translate(-50%, -50%);
    /* Centering */
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    /* Base glow, overridden by inline styles */
}

/* Base Hover */
.skill-dot:hover {
    transform: translate(-50%, -50%) scale(1.5);
    background: #e2e8f0;
}

.skill-dot.active {
    transform: translate(-50%, -50%) scale(1.8) !important;
    background: #fff !important;
    filter: brightness(1.5);
    z-index: 15;
    /* Above other dots */
}

/* Interaction States */
.skill-dot.affordable:not(.maxed):not(.locked) {
    animation: dot-pulse 2s infinite alternate ease-in-out;
}

@keyframes dot-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        filter: brightness(1);
    }

    100% {
        transform: translate(-50%, -50%) scale(1.3);
        filter: brightness(1.3);
    }
}

.skill-dot.locked {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: none !important;
}

@keyframes pop-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Popover Modals */
.star-popover {
    position: absolute;
    width: 280px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 16px;
    padding: 20px;
    z-index: 20;
    text-align: left;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    animation: pop-fade-in 0.2s ease-out forwards;

    /* Display to the right and slightly up from the dot */
    transform: translate(24px, -50%);
    pointer-events: auto;
    /* Since they are interactive */
}

.star-popover .pop-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

.pop-header .pop-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

.pop-header .pop-title {
    display: flex;
    flex-direction: column;
}

.pop-title h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pop-title span {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 1px;
}

.star-popover .pop-desc {
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.4;
    margin: 0 0 12px 0;
}

.star-popover .pop-boost {
    font-size: 0.9rem;
    color: #38bdf8;
    font-weight: 800;
    background: rgba(56, 189, 248, 0.1);
    padding: 6px 12px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 12px;
}

.star-popover .pop-boost.special {
    color: var(--accent-gold);
    background: rgba(251, 191, 36, 0.1);
}

.btn-upgrade-star {
    width: 100%;
    background: rgba(167, 139, 250, 0.15);
    border: 1px solid rgba(167, 139, 250, 0.4);
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upgrade-star:not(:disabled):hover {
    background: rgba(167, 139, 250, 0.3);
    border-color: rgba(167, 139, 250, 0.8);
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.4);
}

.btn-upgrade-star:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-upgrade-star span span {
    color: var(--accent-purple);
}

/* Diamond Constellation Positions -> Cassiopeia Mapping W */

.node-flux {
    top: 25%;
    left: 15%;
}

.pop-flux {
    top: 25%;
    left: 15%;
    transform: translate(24px, -20%);
}

.node-orbit {
    top: 75%;
    left: 32.5%;
}

.pop-orbit {
    top: 75%;
    left: 32.5%;
    transform: translate(24px, -80%);
}

.node-reach {
    top: 35%;
    left: 50%;
}

.pop-reach {
    top: 35%;
    left: 50%;
    transform: translate(24px, -40%);
}

.node-insight {
    top: 80%;
    left: 67.5%;
}

.pop-insight {
    top: 80%;
    left: 67.5%;
    transform: translate(24px, -90%);
}

.node-mystery {
    top: 20%;
    left: 85%;
}

.pop-mystery {
    top: 20%;
    left: 85%;
    transform: translate(24px, -10%);
}