:root {
    --ascension-panel: rgba(5, 11, 13, 0.94);
    --ascension-gold: #d9b96f;
    --ascension-gold-bright: #ffe5a0;
    --ascension-line: rgba(204, 181, 124, 0.2);
    --ascension-text: #e8eeeb;
}

body.skill-tree-page {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 50% 28%, rgba(91, 112, 102, 0.16), transparent 34rem),
        linear-gradient(180deg, rgba(2, 6, 8, 0.78), rgba(3, 8, 10, 0.97)),
        url("/app/images/assets/background/amongdemons_summon.png") center / cover fixed no-repeat,
        #030809;
}

.ascension-shell {
    width: 100%;
    padding: clamp(0.3rem, 0.7vw, 0.65rem);
}

.ascension-shell > .alert {
    width: 100%;
    margin: 0 0 0.55rem;
}

.ascension-screen {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: calc(100dvh - 4.7rem);
    overflow: hidden;
    border: 1px solid rgba(204, 181, 124, 0.24);
    border-radius: 5px;
    background: var(--ascension-panel);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.018);
}

.ascension-screen::before,
.ascension-screen::after {
    content: "";
    position: absolute;
    z-index: 10;
    width: 3.8rem;
    height: 3.8rem;
    pointer-events: none;
    border-color: rgba(217, 185, 111, 0.34);
}

.ascension-screen::before {
    top: 0.5rem;
    left: 0.5rem;
    border-top: 1px solid;
    border-left: 1px solid;
}

.ascension-screen::after {
    right: 0.5rem;
    bottom: 0.5rem;
    border-right: 1px solid;
    border-bottom: 1px solid;
}

.ascension-viewport {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    outline: none;
    scrollbar-color: rgba(217, 185, 111, 0.42) rgba(2, 7, 8, 0.8);
    scrollbar-width: thin;
}

.ascension-viewport:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(217, 185, 111, 0.3);
}

.ascension-map {
    position: relative;
    min-width: 75rem;
    min-height: 42rem;
    height: calc(100dvh - 9.5rem);
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 50%, rgba(217, 185, 111, 0.09), transparent 8.5rem),
        radial-gradient(circle at 20% 50%, rgba(217, 109, 112, 0.055), transparent 24rem),
        radial-gradient(circle at 80% 50%, rgba(232, 199, 106, 0.05), transparent 24rem),
        radial-gradient(circle, rgba(228, 222, 194, 0.11) 0 1px, transparent 1.5px) 0 0 / 4.8rem 4.8rem,
        radial-gradient(circle, rgba(228, 222, 194, 0.06) 0 1px, transparent 1.4px) 1.7rem 2.2rem / 6.3rem 6.3rem,
        linear-gradient(180deg, rgba(2, 7, 9, 0.86), rgba(2, 6, 8, 0.97));
}

.ascension-map::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent 49.94%, rgba(217, 185, 111, 0.035) 50%, transparent 50.06%),
        radial-gradient(circle at 50% 50%, transparent 0 18%, rgba(0, 0, 0, 0.08) 64%, rgba(0, 0, 0, 0.56) 100%);
}

.ascension-connections {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.ascension-connection {
    fill: none;
    stroke: var(--ascension-line);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    transition: stroke 180ms ease, filter 180ms ease;
}

.ascension-connection.is-active {
    stroke: rgba(255, 218, 127, 0.74);
    filter: drop-shadow(0 0 4px rgba(255, 205, 94, 0.35));
}

.ascension-core {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 6;
    display: grid;
    place-items: center;
    width: 8.6rem;
    height: 8.6rem;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(217, 185, 111, 0.54);
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(217, 185, 111, 0.2), rgba(6, 14, 15, 0.96) 58%, rgba(2, 7, 8, 0.99) 70%),
        #050b0d;
    box-shadow: 0 0 0 0.52rem rgba(6, 13, 14, 0.78), 0 0 0 0.6rem rgba(217, 185, 111, 0.18), 0 0 42px rgba(217, 185, 111, 0.15);
    text-align: center;
}

.ascension-core::before,
.ascension-core::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(217, 185, 111, 0.17);
    border-radius: 50%;
}

.ascension-core::before {
    inset: -1.15rem;
    border-style: dashed;
}

.ascension-core::after {
    inset: 0.55rem;
}

.ascension-core small {
    color: rgba(225, 214, 182, 0.68);
    font-size: 0.5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ascension-core strong {
    margin: 0.05rem 0;
    color: var(--ascension-gold-bright);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.5rem;
    line-height: 0.85;
}

.ascension-core > span:last-child {
    color: rgba(225, 214, 182, 0.58);
    font-size: 0.55rem;
    line-height: 1;
}

.ascension-node {
    position: absolute;
    top: var(--node-y);
    left: var(--node-x);
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5.4rem;
    height: 5.4rem;
    transform: translate(-50%, -50%);
    color: var(--ascension-text);
    cursor: pointer;
    text-align: center;
}

.ascension-node.is-locked {
    cursor: not-allowed;
    filter: grayscale(0.85);
}

/* Locked nodes stay fully opaque so the connection line never shows through the orb. */
.ascension-node.is-locked .ascension-node-orb {
    border-color: rgba(150, 156, 150, 0.28);
    background: linear-gradient(145deg, rgba(12, 18, 19, 1), rgba(3, 7, 9, 1));
    color: rgba(176, 182, 176, 0.55);
    box-shadow: 0 0 0 0.28rem rgba(4, 10, 11, 1), 0 0 0 0.34rem rgba(110, 116, 110, 0.12);
}

.ascension-node.is-locked .ascension-node-orb::before {
    border-color: rgba(150, 156, 150, 0.18);
}

.ascension-node.is-locked .ascension-node-label,
.ascension-node.is-locked .ascension-node-progress {
    opacity: 0.42;
}

/* Fade unaffordable nodes without going translucent, so the connection line stays hidden behind the orb. */
.ascension-node.is-disabled {
    cursor: not-allowed;
    filter: grayscale(0.4) brightness(0.78);
}

.ascension-node.is-disabled .ascension-node-label,
.ascension-node.is-disabled .ascension-node-progress {
    opacity: 0.6;
}

.ascension-node.is-maxed {
    cursor: default;
}

.ascension-node-orb {
    position: relative;
    display: grid;
    place-items: center;
    width: 4.7rem;
    height: 4.7rem;
    margin: 0 auto;
    border: 1px solid color-mix(in srgb, var(--path-accent) 55%, rgba(217, 185, 111, 0.32));
    border-radius: 50%;
    background:
        radial-gradient(circle, color-mix(in srgb, var(--path-accent) 15%, transparent), transparent 58%),
        linear-gradient(145deg, rgb(13, 25, 25), rgb(3, 8, 10));
    color: color-mix(in srgb, var(--path-accent) 82%, #f5e7c5);
    box-shadow: 0 0 0 0.28rem rgba(4, 10, 11, 0.94), 0 0 0 0.34rem rgba(217, 185, 111, 0.12);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.ascension-node-orb::before {
    content: "";
    position: absolute;
    inset: 0.35rem;
    border: 1px dashed color-mix(in srgb, var(--path-accent) 26%, transparent);
    border-radius: 50%;
    pointer-events: none;
}

.ascension-node-orb .ad-icon {
    width: 1.55rem;
    height: 1.55rem;
    margin: 0;
}

.ascension-branch-node .ascension-node-orb {
    width: 4.35rem;
    height: 4.35rem;
}

.ascension-mastery-node .ascension-node-orb {
    width: 4.05rem;
    height: 4.05rem;
    border-width: 2px;
    background: radial-gradient(circle, color-mix(in srgb, var(--path-accent) 12%, transparent), transparent 58%), #060c0e;
}

.ascension-node.is-invested .ascension-node-orb,
.ascension-node:focus-visible .ascension-node-orb {
    border-color: color-mix(in srgb, var(--path-accent) 84%, #e7d19a);
    box-shadow: 0 0 0 0.28rem rgba(4, 10, 11, 0.94), 0 0 0 0.36rem color-mix(in srgb, var(--path-accent) 34%, transparent), 0 0 24px color-mix(in srgb, var(--path-accent) 24%, transparent);
    outline: none;
}

.ascension-node.is-complete .ascension-node-orb,
.ascension-mastery-node.is-invested .ascension-node-orb {
    border-color: color-mix(in srgb, var(--path-accent) 88%, #fff0c6);
    box-shadow: 0 0 0 0.28rem rgba(4, 10, 11, 0.94), 0 0 0 0.38rem color-mix(in srgb, var(--path-accent) 40%, transparent), 0 0 30px color-mix(in srgb, var(--path-accent) 34%, transparent);
}

.ascension-node:not(.is-locked, .is-disabled, .is-maxed):hover .ascension-node-orb {
    transform: translateY(-2px);
}

.ascension-node-label {
    position: absolute;
    bottom: calc(100% + 0.4rem);
    left: 50%;
    width: 10.8rem;
    margin: 0;
    transform: translateX(-50%);
    color: color-mix(in srgb, var(--path-accent) 72%, #f5ecd2);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-align: center;
    text-transform: capitalize;
    text-shadow: 0 2px 7px #000;
}

.ascension-node-progress {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 50%;
    width: 10.8rem;
    transform: translateX(-50%);
    color: rgba(245, 240, 223, 0.86);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-align: center;
    text-shadow: 0 2px 7px #000;
}

.ascension-actions {
    position: relative;
    z-index: 9;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 3.75rem;
    border-top: 1px solid rgba(204, 181, 124, 0.18);
    background: rgba(3, 8, 10, 0.96);
    padding: 0.6rem clamp(1rem, 2vw, 1.65rem);
}

.ascension-ledger {
    display: grid;
    grid-template-columns: repeat(3, minmax(3.5rem, 4.2rem));
    gap: 0.35rem;
    margin-right: auto;
}

.ascension-ledger > span {
    display: grid;
    place-items: center;
    min-height: 2.45rem;
    border: 1px solid rgba(204, 181, 124, 0.14);
    border-radius: 3px;
    background: radial-gradient(circle, rgba(217, 185, 111, 0.07), transparent 70%);
}

.ascension-ledger small {
    color: rgba(220, 232, 229, 0.46);
    font-size: 0.5rem;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.ascension-ledger strong {
    color: #f5ead0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.92rem;
    line-height: 0.9;
}

.ascension-ledger .has-unspent-points {
    border-color: rgba(255, 218, 127, 0.64);
    background: radial-gradient(circle, rgba(255, 218, 127, 0.16), transparent 68%);
    box-shadow: 0 0 18px rgba(255, 205, 94, 0.08);
}

.ascension-ledger .has-unspent-points strong {
    color: var(--ascension-gold-bright);
}

.ascension-status {
    color: #d8c28b;
    font-size: 0.58rem;
    font-weight: 800;
}

.ascension-actions button {
    min-height: 2.35rem;
    border: 1px solid rgba(204, 181, 124, 0.25);
    border-radius: 2px;
    background: rgba(8, 15, 16, 0.9);
    color: rgba(230, 233, 224, 0.72);
    padding: 0.46rem 0.8rem;
    font-size: 0.61rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ascension-actions .ascension-save {
    border-color: rgba(217, 185, 111, 0.62);
    background: linear-gradient(180deg, rgba(217, 185, 111, 0.21), rgba(119, 81, 35, 0.2));
    color: #ffedba;
}

.ascension-actions button:not(:disabled):hover,
.ascension-actions button:not(:disabled):focus-visible {
    border-color: rgba(255, 226, 157, 0.78);
    color: #fff4d5;
    box-shadow: 0 0 18px rgba(217, 185, 111, 0.11);
    outline: 0;
}

.ascension-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.32;
}

@media (max-width: 767.98px) {
    .ascension-shell {
        padding: 0.35rem;
    }

    .ascension-map {
        height: 42rem;
    }

    .ascension-actions {
        align-items: stretch;
        flex-direction: column;
        padding: 0.7rem 0.85rem;
    }

    .ascension-ledger {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        margin-right: 0;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .ascension-ledger .has-unspent-points {
        animation: ascension-pulse 2.4s ease-in-out infinite;
    }
}

@keyframes ascension-pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.15); }
}
