/* =========================================================
   PROJECT_05:59 — TGX ROUTER / HEAL RECOVERY // V4.2 MERGED
========================================================= */

.tgx-scene {
    position: fixed;
    inset: 0;
    z-index: 800;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    background: #000;
    color: #eaf8ff;
    font-family: Consolas, "Courier New", monospace;
    transition: opacity 280ms ease, visibility 280ms step-end;
}

.tgx-scene.tgx-scene-visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 280ms ease, visibility 0ms step-start;
}

.tgx-scene * { box-sizing: border-box; }
.tgx-scene:not(.tgx-scene-visible) * { animation-play-state: paused !important; }

.v4-bg-grid {
    position: absolute;
    inset: 0;
    opacity: .12;
    background-image:
        linear-gradient(rgba(87,220,255,.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(87,220,255,.12) 1px, transparent 1px);
    background-size: 52px 52px;
}

.v4-scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .2;
    background: repeating-linear-gradient(to bottom, rgba(255,255,255,.025) 0 1px, transparent 1px 4px);
}

.v4-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 160px #000;
}

.v4-nebula {
    position: absolute;
    width: 46vw;
    aspect-ratio: 1;
    border-radius: 50%;
    filter: blur(120px);
    opacity: .15;
    animation: tgxV4Float 13s ease-in-out infinite alternate;
}

.v4-nebula-p {
    right: -14vw;
    bottom: -17vh;
    background: #a93cff;
}

.v4-topline {
    position: absolute;
    left: 3vw;
    right: 3vw;
    top: 3vh;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    z-index: 12;
    color: #6feeff;
    font-size: 10px;
    letter-spacing: .2em;
    opacity: .72;
}

/* MEMBER ROUTES */
.member-auth-scene {
    background:
        radial-gradient(circle at 50% 50%, rgba(122,42,170,.08), transparent 40%),
        #010104;
}

.member-auth-stage {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 5;
    padding: 6vw;
}

.member-auth-card {
    width: min(760px, 92vw);
    border-left: 1px solid rgba(115,235,255,.28);
    padding: 34px 38px;
    background: linear-gradient(90deg, rgba(4,9,16,.92), rgba(4,5,12,.34));
    box-shadow: 0 0 70px rgba(92,216,255,.04);
}

.member-auth-kicker {
    color: #657d89;
    font-size: 9px;
    letter-spacing: .3em;
}

.member-auth-card h2 {
    margin: 10px 0 6px;
    color: #f5f8ff;
    font-size: clamp(30px, 5vw, 68px);
    letter-spacing: .06em;
    text-shadow: 0 0 22px rgba(196,84,255,.16);
}

.member-auth-main {
    color: #ce6dff;
    letter-spacing: .2em;
    font-size: 11px;
    margin-bottom: 32px;
}

.member-auth-question {
    color: #83efff;
    font-size: clamp(22px, 3.2vw, 40px);
    letter-spacing: .06em;
    margin-bottom: 14px;
}

.member-auth-input {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(111,232,255,.32);
    padding: 11px 2px;
}

.member-auth-input span { color: #cd67ff; font-size: 21px; }
.member-auth-input input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: clamp(18px, 2.8vw, 30px);
    letter-spacing: .11em;
    text-transform: uppercase;
    caret-color: #74ecff;
}

.member-auth-status {
    min-height: 22px;
    margin-top: 15px;
    color: #647b87;
    font-size: 10px;
    letter-spacing: .17em;
}
.member-auth-status.ok { color: #66ff9d; }
.member-auth-status.bad { color: #ff5268; }

.team-pulse {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(96,229,255,.08), transparent 35%);
    animation: teamPulse 3s ease-in-out infinite;
}

.team-confirm-stack {
    margin-top: 27px;
    display: grid;
    gap: 12px;
    min-height: 112px;
}

.confirm-line {
    color: #9dc5d1;
    font-size: clamp(12px, 1.3vw, 17px);
    letter-spacing: .11em;
}
.confirm-line.strong {
    color: #78ffac;
    text-shadow: 0 0 12px rgba(82,255,145,.22);
}

/* BRUNO PRIVATE CHECK */
#private-node {
    background:
        radial-gradient(circle at center, rgba(134,40,190,.08), transparent 38%),
        #010104;
}

.private-stage {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 4;
    padding: 5vw;
}
.private-panel { width: min(760px, 92vw); text-align: center; }
.private-lock {
    width: 80px;
    height: 80px;
    margin: 0 auto 22px;
    border: 1px solid rgba(200,91,255,.5);
    transform: rotate(45deg);
    display: grid;
    place-items: center;
    box-shadow: 0 0 25px rgba(181,68,255,.15);
}
.private-lock::before {
    content: "05";
    transform: rotate(-45deg);
    color: #aaf6ff;
    font-size: 18px;
}
.private-label { color: #6f8793; letter-spacing: .31em; font-size: 9px; }
.private-heading {
    margin: 12px 0 30px;
    color: #d9e9ef;
    font-size: clamp(26px, 4vw, 52px);
    letter-spacing: .08em;
}
.private-question {
    color: #80f1ff;
    font-size: clamp(20px, 2.8vw, 34px);
    margin-bottom: 13px;
}
.private-input-wrap {
    width: min(520px, 88vw);
    margin: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(201,88,255,.36);
    padding: 11px 4px;
}
.v4-prompt { color: #ca66ff; font-size: 20px; }
.private-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    text-align: left;
    font: inherit;
    font-size: clamp(18px, 2.5vw, 28px);
    letter-spacing: .12em;
    text-transform: uppercase;
}
.private-status {
    margin: 14px auto 0;
    min-height: 20px;
    color: #657e8e;
    font-size: 10px;
    letter-spacing: .18em;
}

.welcome-block { display: none; opacity: 0; }
.welcome-block.show { display: block; animation: welcomeIn .7s ease forwards; }
.welcome-small {
    color: #a9dfe8;
    letter-spacing: .22em;
    font-size: clamp(16px, 2vw, 24px);
}
.welcome-big {
    color: #f4e9ff;
    font-size: clamp(42px, 8vw, 108px);
    line-height: .93;
    margin-top: 10px;
    letter-spacing: .04em;
    text-shadow: 0 0 12px rgba(213,107,255,.48), 0 0 34px rgba(91,223,255,.18);
}
.welcome-meta {
    margin-top: 24px;
    color: #6d8290;
    font-size: 9px;
    letter-spacing: .25em;
}
.archive-open {
    margin-top: 30px;
    padding: 14px 22px;
    border: 1px solid rgba(204,99,255,.64);
    background: rgba(18,6,30,.72);
    color: #e0b9ff;
    letter-spacing: .2em;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    box-shadow: 0 0 22px rgba(192,70,255,.1);
}
.archive-open:hover { border-color: #83f2ff; color: #d9fbff; }

/* HEAL ARCHIVE */
#heal-archive-node { background: #000103; }
.heal-void {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 45% 52%, rgba(78,203,229,.045), transparent 25%), #000;
}
.tgx-grid {
    position: absolute;
    inset: 0;
    opacity: .1;
    background-image:
        linear-gradient(rgba(100,230,255,.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100,230,255,.12) 1px, transparent 1px);
    background-size: 44px 44px;
}
.tgx-stage {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(260px,340px);
    align-items: center;
    gap: 2.5vw;
    padding: 7vh 4vw 5vh;
    z-index: 3;
}
.tgx-hologram {
    position: relative;
    width: 100%;
    height: min(78vh,760px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tgx-beam {
    position: absolute;
    bottom: 2%; left: 12%; right: 12%; height: 7%;
    background: radial-gradient(ellipse, rgba(90,230,255,.37), rgba(181,70,255,.1) 44%, transparent 70%);
    filter: blur(6px);
    animation: basePulse 2s ease-in-out infinite;
}
.tgx-ring {
    position: absolute;
    width: min(62vw,780px);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px dashed rgba(104,234,255,.13);
    animation: tgxRingSpin 26s linear infinite;
}
.tgx-ring::after {
    content: "";
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    border: 1px solid rgba(199,89,255,.14);
}
.tgx-image-wrap {
    position: relative;
    width: min(72vw,1020px);
    max-height: 72vh;
    display: grid;
    place-items: center;
}
.tgx-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    opacity: .24;
    filter: brightness(.42) saturate(.52) contrast(1.2)
        drop-shadow(0 0 10px rgba(77,220,255,.16));
    animation: holoGroupFloat 4s ease-in-out infinite, holoGroupFlicker 4.6s steps(1) infinite;
}
.tgx-image-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(to bottom, transparent 0 4px, rgba(112,241,255,.11) 5px);
    mix-blend-mode: screen;
    z-index: 3;
}
.tgx-image-wrap::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    height: 13%; top: -12%;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, rgba(116,239,255,.18), rgba(221,88,255,.17), transparent);
    filter: blur(3px);
    animation: groupSweep 2.5s linear infinite;
    z-index: 4;
}
.tgx-image-wrap.corrupt .tgx-image {
    animation: tgxCorrupt .11s steps(2) infinite;
    filter: saturate(.55) contrast(1.45) hue-rotate(-28deg)
        drop-shadow(7px 0 0 rgba(255,20,70,.3))
        drop-shadow(-7px 0 0 rgba(0,230,255,.28));
}
.tgx-image-wrap.corrupt::after {
    background: linear-gradient(to bottom, rgba(255,30,70,.05), rgba(255,30,70,.35), transparent);
    animation-duration: .3s;
}

.tgx-side {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}
.tgx-title {
    color: #d26cff;
    font-size: clamp(21px,2.8vw,34px);
    letter-spacing: .08em;
    margin-bottom: 4px;
}
.tgx-subtitle {
    color: #678392;
    font-size: 9px;
    letter-spacing: .24em;
    margin-bottom: 24px;
}
.audio-panel {
    border: 1px solid rgba(109,228,255,.22);
    background: rgba(2,8,15,.7);
    padding: 18px;
}
.audio-head {
    display: flex;
    justify-content: space-between;
    color: #8fefff;
    font-size: 9px;
    letter-spacing: .18em;
}
.audio-wave {
    height: 54px;
    margin: 14px 0;
    display: flex;
    align-items: center;
    gap: 3px;
    overflow: hidden;
}
.audio-wave i {
    width: 3px;
    height: 18%;
    background: #c965ff;
    box-shadow: 0 0 7px rgba(194,91,255,.5);
    animation: waveBounce .55s ease-in-out infinite alternate;
    animation-delay: calc(var(--i) * -45ms);
}
.audio-log-name { color: #fff; font-size: 17px; margin-bottom: 7px; }
.audio-log-line {
    color: #7c9baa;
    font-size: 10px;
    line-height: 1.7;
    letter-spacing: .08em;
    min-height: 96px;
    white-space: pre-line;
}
.audio-progress {
    margin-top: 14px;
    height: 2px;
    background: rgba(112,230,255,.1);
    overflow: hidden;
}
.audio-progress > i {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg,#62eaff,#ce65ff);
    box-shadow: 0 0 8px rgba(111,232,255,.6);
    transition: width .3s linear;
}

.tgx-error-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    z-index: 8;
    background: repeating-linear-gradient(90deg, rgba(255,18,60,.08) 0 2px, transparent 2px 13px);
    mix-blend-mode: screen;
}
#heal-archive-node.corrupting .tgx-error-layer {
    opacity: .84;
    animation: errorSlice .16s steps(2) infinite;
}
#heal-archive-node.corrupting .tgx-title {
    color: #ff4c66;
    text-shadow: 0 0 14px rgba(255,52,82,.3);
}

.restore-card {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: none;
    place-items: center;
    background: rgba(0,0,0,.82);
}
.restore-card.show { display: grid; animation: restoreIn .45s ease both; }
.restore-inner {
    width: min(620px,88vw);
    border: 1px solid rgba(255,66,86,.34);
    background: rgba(10,2,7,.87);
    padding: 30px;
    text-align: center;
    box-shadow: 0 0 50px rgba(255,27,72,.08);
}
.restore-alert { color: #ff5267; letter-spacing: .24em; font-size: 11px; }
.restore-title { margin: 12px 0 8px; color: #fff; font-size: clamp(25px,4vw,48px); }
.restore-copy { color: #805862; font-size: 9px; letter-spacing: .16em; }
.restore-button {
    margin-top: 24px;
    padding: 13px 19px;
    border: 1px solid rgba(207,93,255,.62);
    background: rgba(28,7,32,.72);
    color: #eccbff;
    cursor: pointer;
    letter-spacing: .19em;
    font: inherit;
    font-size: 10px;
}
.restore-button:hover { border-color: #7ef1ff; color: #fff; }

/* HEX RECOVERY */
#hex-recovery-node { background: #000; }
.hex-recovery-noise {
    position: absolute;
    inset: 0;
    opacity: .12;
    background: repeating-linear-gradient(90deg, rgba(166,73,255,.04) 0 1px, transparent 1px 11px);
}
.hex-recovery-stage {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 5;
    padding: 5vw;
}
.hex-recovery-card {
    width: min(900px,92vw);
    padding: 34px;
    border-left: 1px solid rgba(116,231,255,.25);
    background: linear-gradient(90deg, rgba(2,7,13,.9), rgba(0,0,0,.28));
}
.memory-kicker { color: #687e8a; font-size: 9px; letter-spacing: .28em; }
.hex-recovery-card h2 {
    margin: 10px 0 24px;
    color: #fff;
    font-size: clamp(28px,4vw,56px);
    letter-spacing: .08em;
}
.hex-final-question {
    color: #d073ff;
    font-size: clamp(15px,2vw,24px);
    line-height: 1.7;
    letter-spacing: .12em;
    word-spacing: .2em;
    text-shadow: 0 0 12px rgba(194,77,255,.2);
}
.hex-recovery-input {
    margin-top: 26px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(102,230,255,.3);
    padding: 10px 0;
}
.hex-recovery-input span { color: #d068ff; font-size: 22px; }
.hex-recovery-input input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: clamp(20px,3vw,34px);
    letter-spacing: .13em;
    text-transform: uppercase;
}
.memory-status {
    min-height: 22px;
    margin-top: 14px;
    color: #627983;
    font-size: 10px;
    letter-spacing: .15em;
}
.memory-status.ok { color: #65ff9d; }
.memory-status.bad { color: #ff5169; }
.heal-confirm-stack {
    display: grid;
    gap: 13px;
    margin-top: 28px;
    min-height: 160px;
}

/* VISITOR */
#visitor-node { background: #000; }
.visitor-noise {
    position: absolute;
    inset: 0;
    opacity: .08;
    background: radial-gradient(circle at 50% 50%, rgba(111,220,245,.08), transparent 30%);
}
.visitor-stage {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 4;
}
.visitor-card { text-align: center; }
.visitor-code { color: #4e6873; font-size: 9px; letter-spacing: .22em; }
.visitor-card h2 {
    margin: 16px 0 4px;
    color: #dbe7eb;
    font-size: clamp(26px,5vw,68px);
    letter-spacing: .08em;
    font-weight: 500;
}
.visitor-heart {
    color: #d16bff;
    font-size: clamp(42px,8vw,100px);
    line-height: 1;
    text-shadow: 0 0 22px rgba(205,92,255,.3);
    animation: heartPulse 1.8s ease-in-out infinite;
}
.visitor-sub { margin-top: 14px; color: #3d515a; font-size: 8px; letter-spacing: .2em; }

.v4-flash {
    position: fixed;
    inset: 0;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 1500;
}
.v4-flash[data-kind="red"] { background: #ff3358; }
.v4-flash.fire { animation: v4Flash .18s ease; }
.v4-glitch-label {
    position: fixed;
    left: 4vw;
    bottom: 4vh;
    z-index: 1480;
    color: #ff4c68;
    font-size: 9px;
    letter-spacing: .16em;
    opacity: 0;
    pointer-events: none;
}
.v4-glitch-label.show { animation: labelGlitch .8s steps(2) infinite; }

.tgx-final-blackout {
    position: fixed;
    inset: 0;
    z-index: 1800;
    background: #000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 800ms ease, visibility 800ms step-end;
}
.tgx-final-blackout.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 800ms ease, visibility 0ms step-start;
}

@keyframes tgxV4Float { to { transform: translate(5vw,3vh) scale(1.08); } }
@keyframes teamPulse { 50% { opacity: .45; transform: scale(1.03); } }
@keyframes welcomeIn { from { opacity: 0; transform: translateY(10px); filter: blur(7px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes basePulse { 50% { opacity: .6; transform: scaleX(1.08); } }
@keyframes tgxRingSpin { to { transform: rotate(360deg); } }
@keyframes holoGroupFloat { 50% { transform: translateY(-6px) scale(1.004); } }
@keyframes holoGroupFlicker { 0%,100% { opacity: .24; } 32% { opacity: .19; } 33% { opacity: .31; } 71% { opacity: .22; } 72% { opacity: .28; } }
@keyframes groupSweep { from { transform: translateY(-40%); opacity: 0; } 15% { opacity: 1; } to { transform: translateY(770%); opacity: 0; } }
@keyframes waveBounce { to { height: 96%; background: #76efff; } }
@keyframes errorSlice { 0% { transform: translate(0); clip-path: inset(0); } 33% { transform: translate(7px,-2px); clip-path: inset(14% 0 55% 0); } 66% { transform: translate(-9px,4px); clip-path: inset(56% 0 11% 0); } }
@keyframes tgxCorrupt { 0% { transform: translate(0); } 25% { transform: translate(7px,-2px) skewX(1deg); } 50% { transform: translate(-8px,3px) skewX(-1deg); } 75% { transform: translate(5px,1px); } }
@keyframes restoreIn { from { opacity: 0; filter: blur(8px); } to { opacity: 1; filter: none; } }
@keyframes v4Flash { 0% { opacity: 0; } 35% { opacity: .88; } 100% { opacity: 0; } }
@keyframes labelGlitch { 0%,100% { opacity: .72; transform: none; } 30% { transform: translateX(7px); } 31% { transform: translateX(-5px); } 60% { opacity: .25; } }
@keyframes heartPulse { 50% { opacity: .55; transform: scale(.94); } }

@media (max-width: 900px) {
    .v4-topline { font-size: 8px; }
    .tgx-stage {
        grid-template-columns: 1fr;
        gap: 1vh;
        padding: 7vh 4vw 3vh;
    }
    .tgx-hologram { height: 55vh; }
    .tgx-image { max-height: 50vh; }
    .tgx-side { min-height: 29vh; }
}


/* =========================================================
   V4.4 — HEAL UNRESOLVED ARCHIVE IMAGE
   La imagen de 7 identidades desconocidas permanece durante
   todo el escaneo y la corrupción de HEAL.
========================================================= */
#heal-archive-node .heal-image-wrap .tgx-image {
    opacity: .48;
    filter:
        brightness(.68)
        saturate(.82)
        contrast(1.16)
        drop-shadow(0 0 14px rgba(116,76,255,.30));
}
#heal-archive-node.corrupting .heal-image-wrap .tgx-image {
    opacity: .54;
}
