
.t-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    pointer-events: none;
}

/* ---- 1. dissolvenza ---- */
.t-fade {
    background: #000000;
    opacity: 0;
    transition: opacity 1.3s ease;
}
.t-fade.active { opacity: 1; }

/* ---- 2. glitch ---- */
.t-glitch {
    background: repeating-linear-gradient(
        0deg,
        rgba(255,0,60,0.15) 0px, rgba(255,0,60,0.15) 2px,
        rgba(0,255,255,0.15) 2px, rgba(0,255,255,0.15) 4px,
        transparent 4px, transparent 6px
    );
    mix-blend-mode: screen;
    opacity: 0;
}
.t-glitch.active {
    opacity: 1;
    animation: t-glitch-flicker 0.5s steps(6) forwards;
}
@keyframes t-glitch-flicker {
    0%   { transform: translate(0,0); }
    20%  { transform: translate(-6px, 2px); }
    40%  { transform: translate(5px, -3px); }
    60%  { transform: translate(-4px, 3px); }
    80%  { transform: translate(3px, -2px); }
    100% { transform: translate(0,0); opacity: 0; background: #000; }
}
body.t-glitching {
    animation: t-body-shake 0.5s steps(4) forwards;
}
@keyframes t-body-shake {
    0%, 100% { filter: none; }
    25%  { filter: contrast(1.4) saturate(1.6) hue-rotate(8deg); }
    50%  { filter: contrast(1.2) saturate(1.3) hue-rotate(-6deg); }
    75%  { filter: contrast(1.5) saturate(1.5) hue-rotate(4deg); }
}

/* ---- 3. disintegrazione ---- */
body.t-disintegrating > *:not(.t-overlay) {
    animation: t-dissolve 0.9s ease forwards;
}
@keyframes t-dissolve {
    0%   { filter: blur(0); opacity: 1; transform: scale(1); }
    100% { filter: blur(10px); opacity: 0; transform: scale(1.04); }
}
.t-disintegrate-bg {
    background: #000000;
    opacity: 0;
    transition: opacity 0.9s ease;
}
.t-disintegrate-bg.active { opacity: 1; }

/* ---- 4. muro di caricamento ---- */
.t-loadwall {
    background: #000000;
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.t-loadwall.active {
    opacity: 1;
    pointer-events: all;
}
.t-loadwall-inner {
    text-align: center;
    color: #999999;
    font-family: "Times New Roman", Times, serif;
}
.t-loadwall-bar {
    width: 200px;
    height: 4px;
    background: #222222;
    margin: 0 auto 20px;
    position: relative;
    overflow: hidden;
}
.t-loadwall-bar::after {
    content: "";
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: 0%;
    background: #666666;
    animation: t-loadwall-fill 2.2s ease forwards;
}
@keyframes t-loadwall-fill {
    0%   { width: 0%; }
    70%  { width: 78%; }
    100% { width: 82%; }
}
.t-loadwall-continue {
    display: none;
    color: #4d7fff;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
}
.t-loadwall-continue.show { display: inline; }
