/* All keyframe animations used in the application */

@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

@keyframes zoom-in-fade-up {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 15px var(--accent-cyan), inset 0 0 8px rgba(0, 229, 255, 0.3); }
    50% { box-shadow: 0 0 25px var(--accent-cyan), 0 0 10px var(--accent-cyan), inset 0 0 8px rgba(0, 229, 255, 0.3); }
}

@keyframes pulse-glow-yellow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0,0,0,0.2), 0 0 30px var(--accent-gold-glow);
    }
    50% {
        box-shadow: 0 4px 15px rgba(0,0,0,0.25), 0 0 40px var(--accent-gold-glow);
    }
}

@keyframes pop-in-focus {
    from { opacity: 0; filter: blur(3px); transform: scale(0.95); }
    to { opacity: 1; filter: blur(0); transform: scale(1); }
}

/* Optimized animation for mobile devices to improve performance */
@keyframes pop-in-focus-mobile {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes vignette-reveal {
    from { background: radial-gradient(ellipse at center, transparent 0%, var(--bg-color) 50%); }
    to { background: radial-gradient(ellipse at center, transparent 100%, var(--bg-color) 120%); }
}
@keyframes slide-in-from-top {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes slide-in-from-bottom {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes slide-in-from-left { from { transform: translateX(-50px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slide-in-from-right { from { transform: translateX(50px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes dramatic-zoom-glow {
    0% { opacity: 0; transform: scale(1.8); filter: blur(5px); text-shadow: none; }
    70% { opacity: 1; transform: scale(1); filter: blur(0); }
    85% { text-shadow: 0 0 35px currentColor, 0 0 20px white; }
    100% { opacity: 1; transform: scale(1); filter: blur(0); text-shadow: 0 0 15px var(--accent-glow); }
}
@keyframes delayed-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes list-item-fade-in {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes screen-shake { /* Softer, less jarring version */
    0%, 100% { transform: translate(0, 0) rotate(0); }
    20% { transform: translate(1px, -2px) rotate(-0.2deg); }
    40% { transform: translate(-1px, 2px) rotate(0.2deg); }
    60% { transform: translate(2px, 1px) rotate(0); }
    80% { transform: translate(-2px, -1px) rotate(-0.2deg); }
}

/* Enhanced sleek special ability animations */
@keyframes smooth-fade-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

@keyframes elegant-slide-up {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes premium-glow {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(0, 229, 255, 0.3),
            0 0 40px rgba(0, 229, 255, 0.2),
            0 0 60px rgba(0, 229, 255, 0.1),
            inset 0 0 20px rgba(0, 229, 255, 0.2);
    }
    50% {
        box-shadow:
            0 0 30px rgba(0, 229, 255, 0.5),
            0 0 60px rgba(0, 229, 255, 0.3),
            0 0 90px rgba(0, 229, 255, 0.2),
            inset 0 0 30px rgba(0, 229, 255, 0.3);
    }
}

@keyframes energy-surge {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 0;
    }
}

@keyframes holographic-shimmer {
    0% {
        background-position: -200% center;
        filter: hue-rotate(0deg);
    }
    100% {
        background-position: 200% center;
        filter: hue-rotate(360deg);
    }
}

@keyframes neural-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes quantum-shift {
    0% {
        transform: translateX(-100%) skewX(-15deg);
        opacity: 0;
    }
    50% {
        transform: translateX(0) skewX(0deg);
        opacity: 1;
    }
    100% {
        transform: translateX(100%) skewX(15deg);
        opacity: 0;
    }
}

@keyframes temporal-distortion {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: blur(0px);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
        filter: blur(2px);
    }
}

@keyframes shield-ripple {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes cosmic-rotation {
    from {
        transform: rotate(0deg) scale(1);
    }
    to {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes premium-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
        filter: blur(0px);
    }
    to {
        opacity: 0;
        transform: scale(1.1);
        filter: blur(5px);
    }
}

/* Sleek special ability styles */
.sleek-ability-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2147483647 !important;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    animation: smooth-fade-in 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    will-change: opacity, transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.sleek-ability-title {
    position: relative;
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 800;
    text-align: center;
    color: #fff;
    text-shadow:
        0 0 10px rgba(0, 229, 255, 0.8),
        0 0 20px rgba(0, 229, 255, 0.6);
    animation: elegant-slide-up 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    white-space: nowrap;
    letter-spacing: 0.05em;
    will-change: transform, opacity;
    backface-visibility: hidden;
    z-index: 20;
    margin: 0;
    padding: 0;
}

.sleek-ability-subtitle {
    position: relative;
    font-size: clamp(1rem, 4vw, 2rem);
    font-weight: 600;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    animation: elegant-slide-up 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
    opacity: 0;
    white-space: nowrap;
    margin: 0.5rem 0 0;
    padding: 0;
    z-index: 20;
}

.sleek-ability-icon {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(3rem, 12vw, 6rem);
    animation: elegant-slide-up 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.8));
}

/* Sabotage - Enhanced sleek version */
.sleek-sabotage-knife {
    position: absolute;
    font-size: 2.5rem;
    animation: quantum-shift 2s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.8));
}

.sleek-sabotage-overlay {
    background: radial-gradient(circle at center, rgba(139, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.8) 100%);
}

.sleek-sabotage-title {
    color: #ff4444;
    text-shadow:
        0 0 20px rgba(255, 68, 68, 0.8),
        0 0 40px rgba(255, 68, 68, 0.6),
        0 0 60px rgba(255, 68, 68, 0.4);
}

/* AI Co-Pilot - Enhanced sleek version */
.sleek-ai-overlay {
    background: radial-gradient(circle at center, rgba(0, 100, 255, 0.2) 0%, rgba(0, 0, 0, 0.8) 100%);
}

.sleek-ai-title {
    background: linear-gradient(45deg, #00d4ff, #090979, #00d4ff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: holographic-shimmer 3s ease-in-out infinite;
}

.sleek-neural-node {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #00d4ff, transparent);
    border-radius: 50%;
    animation: neural-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
}

.sleek-neural-connection {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00d4ff, transparent);
    animation: quantum-shift 3s ease-in-out infinite;
    opacity: 0.6;
}

/* PNL Leech - Enhanced sleek version */
.sleek-leech-overlay {
    background: radial-gradient(circle at center, rgba(128, 0, 128, 0.3) 0%, rgba(0, 0, 0, 0.8) 100%);
}

.sleek-leech-title {
    color: #9932cc;
    text-shadow:
        0 0 20px rgba(153, 50, 204, 0.8),
        0 0 40px rgba(153, 50, 204, 0.6),
        0 0 60px rgba(153, 50, 204, 0.4);
}

.sleek-energy-orb {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, #9932cc, transparent);
    animation: energy-surge 2s ease-in-out infinite;
    box-shadow:
        0 0 30px rgba(153, 50, 204, 0.6),
        inset 0 0 20px rgba(153, 50, 204, 0.4);
}

/* Market Surge - Enhanced sleek version */
.sleek-surge-overlay {
    background: radial-gradient(circle at center, rgba(0, 255, 0, 0.2) 0%, rgba(0, 0, 0, 0.8) 100%);
}

.sleek-surge-title {
    color: #00ff00;
    text-shadow:
        0 0 20px rgba(0, 255, 0, 0.8),
        0 0 40px rgba(0, 255, 0, 0.6),
        0 0 60px rgba(0, 255, 0, 0.4);
}

.sleek-chart-line {
    position: absolute;
    width: 200px;
    height: 100px;
    border: 3px solid #00ff00;
    border-bottom: none;
    border-left: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    clip-path: polygon(0 100%, 20% 80%, 40% 60%, 60% 30%, 80% 10%, 100% 0%);
    animation: elegant-slide-up 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    box-shadow:
        0 0 20px rgba(0, 255, 0, 0.6),
        inset 0 0 10px rgba(0, 255, 0, 0.4);
}

/* Phantom Trade - Enhanced sleek version */
.sleek-phantom-overlay {
    background: radial-gradient(circle at center, rgba(138, 43, 226, 0.3) 0%, rgba(0, 0, 0, 0.8) 100%);
}

.sleek-phantom-title {
    color: #da70d6;
    text-shadow:
        0 0 20px rgba(218, 112, 214, 0.8),
        0 0 40px rgba(218, 112, 214, 0.6),
        0 0 60px rgba(218, 112, 214, 0.4);
}

.sleek-phantom-portal {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 3px solid #da70d6;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: temporal-distortion 3s ease-in-out infinite;
    box-shadow:
        0 0 30px rgba(218, 112, 214, 0.6),
        inset 0 0 20px rgba(218, 112, 214, 0.4);
}

/* Liquidity Spike - Enhanced sleek version */
.sleek-liquidity-overlay {
    background: radial-gradient(circle at center, rgba(255, 165, 0, 0.3) 0%, rgba(0, 0, 0, 0.8) 100%);
}

.sleek-liquidity-title {
    color: #ffa500;
    text-shadow:
        0 0 20px rgba(255, 165, 0, 0.8),
        0 0 40px rgba(255, 165, 0, 0.6),
        0 0 60px rgba(255, 165, 0, 0.4);
}

.sleek-explosion-ring {
    position: absolute;
    border: 2px solid #ffa500;
    border-radius: 50%;
    animation: shield-ripple 2s ease-out infinite;
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.6);
}

/* Rewind - Enhanced sleek version */
.sleek-rewind-overlay {
    background: radial-gradient(circle at center, rgba(0, 191, 255, 0.3) 0%, rgba(0, 0, 0, 0.8) 100%);
}

.sleek-rewind-title {
    color: #00bfff;
    text-shadow:
        0 0 20px rgba(0, 191, 255, 0.8),
        0 0 40px rgba(0, 191, 255, 0.6),
        0 0 60px rgba(0, 191, 255, 0.4);
}

.sleek-time-spiral {
    position: absolute;
    width: 150px;
    height: 150px;
    border: 3px solid #00bfff;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: cosmic-rotation 4s linear infinite;
    box-shadow:
        0 0 20px rgba(0, 191, 255, 0.6),
        inset 0 0 15px rgba(0, 191, 255, 0.4);
}

/* Insurance - Enhanced sleek version */
.sleek-insurance-overlay {
    background: radial-gradient(circle at center, rgba(255, 215, 0, 0.3) 0%, rgba(0, 0, 0, 0.8) 100%);
}

.sleek-insurance-title {
    color: #ffd700;
    text-shadow:
        0 0 20px rgba(255, 215, 0, 0.8),
        0 0 40px rgba(255, 215, 0, 0.6),
        0 0 60px rgba(255, 215, 0, 0.4);
}

.sleek-shield-ring {
    position: absolute;
    border: 4px solid #ffd700;
    border-radius: 50%;
    animation: shield-ripple 2.5s ease-out infinite;
    box-shadow:
        0 0 30px rgba(255, 215, 0, 0.6),
        inset 0 0 20px rgba(255, 215, 0, 0.4);
}

/* Cooldown Refresh - Enhanced sleek version */
.sleek-refresh-overlay {
    background: radial-gradient(circle at center, rgba(255, 20, 147, 0.3) 0%, rgba(0, 0, 0, 0.8) 100%);
}

.sleek-refresh-title {
    color: #ff1493;
    text-shadow:
        0 0 20px rgba(255, 20, 147, 0.8),
        0 0 40px rgba(255, 20, 147, 0.6),
        0 0 60px rgba(255, 20, 147, 0.4);
}

.sleek-cosmic-ring {
    position: absolute;
    border: 3px solid #ff1493;
    border-radius: 50%;
    animation: cosmic-rotation 3s linear infinite;
    box-shadow:
        0 0 25px rgba(255, 20, 147, 0.6),
        inset 0 0 15px rgba(255, 20, 147, 0.4);
}

/* Responsive design */
@media (max-width: 768px) {
    .sleek-ability-title {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }

    .sleek-ability-subtitle {
        font-size: clamp(0.8rem, 3vw, 1.5rem);
    }

    .sleek-ability-icon {
        font-size: clamp(2rem, 8vw, 4rem);
    }
}
@keyframes flash-green {
    50% { text-shadow: 0 0 15px var(--price-green), 0 0 8px white; color: var(--price-green); }
}
@keyframes flash-red {
    50% { text-shadow: 0 0 15px var(--price-red), 0 0 8px white; color: var(--price-red); }
}

@keyframes power-up-despawn {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0); opacity: 0; }
}

@keyframes power-up-spawn {
    0% { transform: scale(0.5) rotate(-180deg); opacity: 0; }
    70% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes powerup-toast-out {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-20px) scale(0.8); }
}

@keyframes duel-intro-player-anim {
    0% { transform: translateX(-100vw) skewX(-20deg); opacity: 0; }
    40% { transform: translateX(0) skewX(-20deg); opacity: 1; }
    60% { transform: translateX(0) skewX(0); opacity: 1; }
    100% { transform: translateX(0) skewX(0); opacity: 1; }
}
@keyframes duel-intro-opponent-anim {
    0% { transform: translateX(100vw) skewX(20deg); opacity: 0; }
    40% { transform: translateX(0) skewX(20deg); opacity: 1; }
    60% { transform: translateX(0) skewX(0); opacity: 1; }
    100% { transform: translateX(0) skewX(0); opacity: 1; }
}
@keyframes duel-intro-vs-anim {
    0%, 50% { transform: scale(5); opacity: 0; filter: blur(10px); }
    80% { transform: scale(0.9); opacity: 1; filter: blur(0); }
    100% { transform: scale(1); opacity: 1; filter: blur(0); }
}

@keyframes overtime-timer-pulse {
    0% {
        transform: scale(1);
        text-shadow: 0 0 0 rgba(186, 85, 211, 0);
    }
    40% {
        transform: scale(1.15);
        color: #BA55D3; /* Ability Purple */
        text-shadow: 0 0 25px #BA55D3, 0 0 10px white;
    }
    100% { transform: scale(1); }
}

@keyframes particle-burst-up {
    0% {
        transform: translate(-50%, -50%) scale(0.5); /* Start centered on the origin point */
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(var(--s)) rotate(var(--r));
        opacity: 0;
    }
}

@keyframes particle-anim {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

@keyframes event-timer-countdown {
    from { stroke-dashoffset: 100; }
    to { stroke-dashoffset: 0; }
}

@keyframes slide-in-bounce-out {
    0% { transform: translateX(110%); opacity: 0; }
    10% { transform: translateX(-5%); opacity: 1; } /* Overshoot for bounce effect */
    15% { transform: translateX(0); opacity: 1; }   /* Settle */
    85% { transform: translateX(0); opacity: 1; }   /* Stay on screen */
    100% { transform: translateX(110%); opacity: 0; }
}

@keyframes friend-toast-in-out {
    0% { transform: translateX(-120%); opacity: 0; }
    10% { transform: translateX(0); opacity: 1; }
    90% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(-120%); opacity: 0; }
}

@keyframes duel-invite-slide-in {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes duel-toast-fade-in-out {
    0% { transform: translateY(-20px); opacity: 0; }
    15% { transform: translateY(0); opacity: 1; }
    85% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-20px); opacity: 0; }
}

@keyframes frozen-icon-effect {
    0% { opacity: 0; transform: scale(0); }
    10% { /* Pop in */
        opacity: 1;
        transform: scale(1.3);
        text-shadow: 0 0 20px white, 0 0 12px rgba(0, 191, 255, 1);
    }
    20% { /* Settle to a semi-transparent state */
        opacity: 0.6;
        transform: scale(1);
        text-shadow: 0 0 6px rgba(0, 191, 255, 0.7);
    }
    /* Hold and shimmer phase until 90% */
    30%, 70% { opacity: 0.65; transform: scale(1.05) rotate(15deg); text-shadow: 0 0 10px rgba(0, 191, 255, 0.8); }
    50% { opacity: 0.6; transform: scale(1) rotate(-15deg); text-shadow: 0 0 6px rgba(0, 191, 255, 0.7); }
    90% { /* Start fade out */
        opacity: 0.5; transform: scale(1) rotate(0deg);
    }
    /* Fade out */
    100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
}

@keyframes ghost-float-fade {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    20% { transform: translateY(-10px) scale(1.1); opacity: 0.9; }
    80% { transform: translateY(-50px) scale(0.9); opacity: 0.9; }
    100% { transform: translateY(-60px) scale(0.8); opacity: 0; }
}

@keyframes smoke-rise-and-fade {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    20% { opacity: 0.9; }
    100% { transform: translateY(-90px) scale(3) rotate(45deg); opacity: 0; }
}

@keyframes drift-and-fade {
    0% {
        transform: translateX(-120%) translateY(15vh) scale(0.7) rotate(-30deg);
        opacity: 0;
    }
    /* Increased opacity during the animation for better visibility */
    25% { opacity: 1; }
    75% { opacity: 1; }
    100% {
        transform: translateX(120%) translateY(-15vh) scale(1.5) rotate(30deg);
        opacity: 0;
    }
}

@keyframes pulse-yellow {
    0%, 100% { text-shadow: 0 0 5px #FFD700; }
    50% { text-shadow: 0 0 15px #FFD700, 0 0 8px white; }
}

@keyframes slide-and-fade {
    0% { transform: translateY(20px); opacity: 0; } 15% { transform: translateY(0); opacity: 1; }
    85% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(20px); opacity: 0; }
}

@keyframes bg-grid-pan { from { background-position: 0 0; } to { background-position: 40px 40px; } }
@keyframes bg-blitz-flicker {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.3; }
}

/* Enhanced Special Ability Animations */
@keyframes knife-throw {
    0% {
        transform: translate(-100vw, -50vh) rotate(-720deg) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translate(-80vw, -40vh) rotate(-360deg) scale(1);
    }
    50% {
        transform: translate(0vw, 0vh) rotate(0deg) scale(1.5);
        filter: drop-shadow(0 0 30px rgba(255, 0, 0, 0.9));
    }
    60% {
        transform: translate(20vw, 10vh) rotate(180deg) scale(1.2);
        filter: drop-shadow(0 0 50px rgba(255, 100, 0, 1));
    }
    100% {
        transform: translate(100vw, 50vh) rotate(1080deg) scale(0);
        opacity: 0;
    }
}

@keyframes ai-digital-rain {
    0% {
        transform: translateY(-100vh) scale(0);
        opacity: 0;
        filter: blur(2px);
    }
    20% {
        opacity: 1;
        transform: translateY(-20vh) scale(1);
        filter: blur(0);
    }
    80% {
        opacity: 1;
        transform: translateY(80vh) scale(1);
        filter: blur(0);
    }
    100% {
        transform: translateY(120vh) scale(0);
        opacity: 0;
        filter: blur(3px);
    }
}

@keyframes market-surge-chart {
    0% {
        transform: translateY(100vh) scaleY(0);
        opacity: 0;
    }
    15% {
        opacity: 1;
        transform: translateY(80vh) scaleY(0.3);
    }
    50% {
        transform: translateY(20vh) scaleY(1.2);
        filter: drop-shadow(0 0 40px rgba(0, 255, 0, 0.8));
    }
    85% {
        opacity: 1;
        transform: translateY(-20vh) scaleY(0.8);
    }
    100% {
        transform: translateY(-50vh) scaleY(0);
        opacity: 0;
    }
}

@keyframes phantom-trade-teleport {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
        filter: blur(10px);
    }
    25% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0.8;
        filter: blur(0);
    }
    50% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
        filter: blur(0);
    }
    75% {
        transform: scale(1.5) rotate(540deg);
        opacity: 0.8;
        filter: blur(0);
    }
    100% {
        transform: scale(0) rotate(720deg);
        opacity: 0;
        filter: blur(10px);
    }
}

@keyframes liquidity-explosion-burst {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    20% {
        transform: scale(0.5);
        opacity: 1;
    }
    50% {
        transform: scale(2);
        opacity: 1;
        filter: drop-shadow(0 0 60px rgba(255, 165, 0, 1));
    }
    100% {
        transform: scale(4);
        opacity: 0;
        filter: blur(5px);
    }
}

@keyframes rewind-time-reverse {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: scale(1.2) rotate(-180deg);
        opacity: 1;
        filter: drop-shadow(0 0 40px rgba(138, 43, 226, 0.8));
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(-360deg);
        opacity: 0;
    }
}

@keyframes cooldown-refresh-pulse {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    20% {
        transform: scale(1.2) rotate(90deg);
        opacity: 1;
    }
    40% {
        transform: scale(0.8) rotate(180deg);
        opacity: 0.8;
    }
    60% {
        transform: scale(1.2) rotate(270deg);
        opacity: 1;
    }
    80% {
        transform: scale(0.8) rotate(360deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(0) rotate(450deg);
        opacity: 0;
    }
}

@keyframes knife-trail {
    0% {
        transform: translateX(-100vw) translateY(0) scale(0);
        opacity: 0;
    }
    20% {
        opacity: 0.8;
        transform: translateX(-50vw) translateY(0) scale(1);
    }
    80% {
        opacity: 0.8;
        transform: translateX(50vw) translateY(0) scale(1);
    }
    100% {
        transform: translateX(100vw) translateY(0) scale(0);
        opacity: 0;
    }
}

@keyframes blood-splatter {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, -50%) scale(1.5) rotate(180deg);
        opacity: 1;
        filter: drop-shadow(0 0 30px rgba(255, 0, 0, 0.9));
    }
    70% {
        transform: translate(-50%, -50%) scale(1.2) rotate(360deg);
        opacity: 1;
        filter: drop-shadow(0 0 20px rgba(255, 0, 0, 0.7));
    }
    100% {
        transform: translate(-50%, -50%) scale(0) rotate(540deg);
        opacity: 0;
        filter: blur(3px);
    }
}

@keyframes holographic-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 60px rgba(0, 150, 255, 1)) drop-shadow(0 0 120px rgba(0, 255, 255, 0.8));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 80px rgba(0, 150, 255, 1)) drop-shadow(0 0 160px rgba(0, 255, 255, 1));
        transform: scale(1.1);
    }
}

@keyframes neural-pulse {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes code-rain-fall {
    0% {
        transform: translateY(-100vh);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

@keyframes processing-ring-rotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
        opacity: 0;
    }
}

@keyframes stars-pan {
    from { background-position: 0 0, 0 0, 0 0; }
    to { 
        /* Pan layers at different speeds and directions for parallax */
        background-position: -10000px 5000px, -7500px 3750px, -5000px 2500px; 
    }
}

@keyframes tick-up {
    from { transform: translateY(15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes tick-down {
    from { transform: translateY(-15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes power-up-toast-anim {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -120%);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -120%);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -150%);
    }
}

@keyframes level-up-fade-in {
    from { opacity: 0; transform: scale(0.8) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes shine-effect {
    0% { transform: translateX(-150%) skewX(-20deg); }
    100% { transform: translateX(250%) skewX(-20deg); }
}

@keyframes premium-gradient-pan {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes premium-shimmer {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

@keyframes store-content-fade-in {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes claim-reward-pop {
    0% {
        transform: scale(1);
        filter: brightness(1);
        box-shadow: 0 0 20px var(--accent-glow); /* from .claimable */
    }
    50% {
        transform: scale(1.1);
        filter: brightness(2.5);
        box-shadow: 0 0 40px var(--accent-cyan), 0 0 20px white;
    }
    100% {
        transform: scale(1);
        filter: brightness(0.6);
        box-shadow: none;
    }
}

@keyframes claim-reward-pop-premium {
    0% {
        transform: scale(1);
        filter: brightness(1);
        box-shadow: 0 0 20px var(--accent-gold-glow); /* from .claimable.premium */
    }
    50% {
        transform: scale(1.1);
        filter: brightness(2.5);
        box-shadow: 0 0 40px var(--accent-gold), 0 0 20px white;
    }
    100% {
        transform: scale(1);
        filter: brightness(0.6);
        box-shadow: none;
    }
}

@keyframes special-ability-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes deplete-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* Victory Particle Effects */
.particle {
    position: absolute;
    width: 8px;
    height: 16px;
    border-radius: 2px;
    opacity: 0;
    animation: fall 4s linear infinite;
    background-color: hsl( calc(var(--i) * 3), 90%, 65% );
}

@keyframes fall {
    0% {
        transform: translateY(-20vh) rotateZ(0deg) rotateX(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(120vh) rotateZ(720deg) rotateX(360deg);
        opacity: 0;
    }
}

#game-over-screen.victory .particle {
    animation-delay: calc(var(--i) * 0.025s);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotate-nebula {
    0% {
        transform: translate(-25%, -25%) rotate(0deg);
    }
    100% {
        transform: translate(-25%, -25%) rotate(360deg);
    }
}

/* Special Ability Animations */

@keyframes special-ability-entrance {
    from {
        opacity: 0;
        transform: scale(0.8);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

/* Sabotage Animation - Knife cutting across screen */
@keyframes sabotage-knife-slash {
    0% {
        transform: translateX(-100vw) translateY(-50vh) rotate(-45deg) scale(0.3);
        opacity: 0;
    }
    5% {
        opacity: 1;
        filter: drop-shadow(0 0 40px rgba(255, 0, 0, 1)) drop-shadow(0 0 20px rgba(255, 255, 255, 1));
    }
    25% {
        transform: translateX(-50vw) translateY(-25vh) rotate(-45deg) scale(2);
        opacity: 1;
    }
    50% {
        transform: translateX(0vw) translateY(0vh) rotate(-45deg) scale(2.5);
        opacity: 1;
        filter: drop-shadow(0 0 50px rgba(255, 0, 0, 1)) drop-shadow(0 0 25px rgba(255, 255, 255, 1));
    }
    75% {
        transform: translateX(50vw) translateY(25vh) rotate(-45deg) scale(2);
        opacity: 1;
    }
    90% {
        transform: translateX(100vw) translateY(50vh) rotate(-45deg) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translateX(150vw) translateY(75vh) rotate(-45deg) scale(0.2);
        opacity: 0;
    }
}

@keyframes sabotage-slash-effect {
    0% {
        transform: scaleX(0) scaleY(0);
        opacity: 0;
    }
    20% {
        transform: scaleX(0.1) scaleY(0.1);
        opacity: 0.8;
    }
    50% {
        transform: scaleX(1.2) scaleY(1.2);
        opacity: 1;
    }
    100% {
        transform: scaleX(2) scaleY(2);
        opacity: 0;
    }
}

@keyframes sabotage-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(1.1);
        filter: blur(5px);
    }
}

/* AI Co-Pilot Animation */
@keyframes ai-hologram-flicker {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.9;
        filter: hue-rotate(0deg);
    }
    25% {
        transform: scale(1.1) rotate(5deg);
        opacity: 1;
        filter: hue-rotate(30deg);
    }
    50% {
        transform: scale(0.9) rotate(-5deg);
        opacity: 0.8;
        filter: hue-rotate(-30deg);
    }
    75% {
        transform: scale(1.05) rotate(3deg);
        opacity: 0.95;
        filter: hue-rotate(15deg);
    }
}

@keyframes ai-grid-scan {
    0% {
        transform: translateY(-100vh);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

@keyframes ai-fade-out {
    from {
        opacity: 1;
        filter: blur(0);
    }
    to {
        opacity: 0;
        filter: blur(8px);
        transform: scale(0.9);
    }
}

/* PNL Leech Animation */
@keyframes leech-drain-effect {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    20% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
    80% {
        transform: scale(1) rotate(1260deg);
        opacity: 1;
    }
    100% {
        transform: scale(0.8) rotate(1440deg);
        opacity: 0;
    }
}

@keyframes leech-beam-pulse {
    0%, 100% {
        transform: scaleY(1);
        opacity: 0.8;
    }
    50% {
        transform: scaleY(1.2);
        opacity: 1;
    }
}

@keyframes leech-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
        filter: blur(3px);
    }
}

/* Market Surge Animation */
@keyframes market-surge-explosion {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    20% {
        transform: scale(0.5) rotate(90deg);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(2) rotate(360deg);
        opacity: 0;
    }
}

@keyframes surge-chart-growth {
    0% {
        transform: scaleY(0);
        opacity: 0;
    }
    30% {
        transform: scaleY(0.3);
        opacity: 0.6;
    }
    70% {
        transform: scaleY(1.2);
        opacity: 1;
    }
    100% {
        transform: scaleY(1);
        opacity: 0.8;
    }
}

@keyframes surge-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(1.2);
        filter: blur(4px);
    }
}

/* Phantom Trade Animation */
@keyframes phantom-ghostly-appear {
    0% {
        transform: translateY(50vh) scale(0.5);
        opacity: 0;
        filter: blur(10px);
    }
    30% {
        transform: translateY(20vh) scale(1.2);
        opacity: 0.8;
        filter: blur(2px);
    }
    70% {
        transform: translateY(-20vh) scale(0.8);
        opacity: 0.6;
        filter: blur(1px);
    }
    100% {
        transform: translateY(-50vh) scale(0.3);
        opacity: 0;
        filter: blur(5px);
    }
}

@keyframes phantom-mist-drift {
    0% {
        transform: translateX(-50vw) translateY(0) scale(1);
        opacity: 0;
    }
    20% {
        opacity: 0.6;
    }
    80% {
        opacity: 0.6;
    }
    100% {
        transform: translateX(50vw) translateY(-20vh) scale(1.5);
        opacity: 0;
    }
}

@keyframes phantom-fade-out {
    from {
        opacity: 1;
        filter: blur(0);
    }
    to {
        opacity: 0;
        filter: blur(10px);
        transform: scale(0.7);
    }
}

/* Liquidity Spike Animation */
@keyframes liquidity-explosion-burst {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    15% {
        transform: scale(0.3);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.8);
        opacity: 1;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

@keyframes liquidity-waves-ripple {
    0% {
        transform: scale(0);
        opacity: 0.8;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes liquidity-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(1.3);
        filter: blur(6px);
    }
}

/* Market Rewind Animation */
@keyframes rewind-clock-spin {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    20% {
        transform: scale(1.2) rotate(-180deg);
        opacity: 1;
    }
    80% {
        transform: scale(1) rotate(-1080deg);
        opacity: 1;
    }
    100% {
        transform: scale(0.8) rotate(-1440deg);
        opacity: 0;
    }
}

@keyframes rewind-spiral-effect {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.5) rotate(-720deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(2) rotate(-1440deg);
        opacity: 0;
    }
}

@keyframes rewind-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
        filter: blur(4px);
    }
}

/* PNL Insurance Animation */
@keyframes insurance-shield-protect {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    30% {
        transform: scale(1.3) rotate(10deg);
        opacity: 1;
    }
    70% {
        transform: scale(1) rotate(-10deg);
        opacity: 1;
    }
    100% {
        transform: scale(0.9) rotate(0deg);
        opacity: 0.8;
    }
}

@keyframes insurance-barrier-block {
    0% {
        transform: scaleY(0);
        opacity: 0;
    }
    20% {
        transform: scaleY(1.2);
        opacity: 1;
    }
    80% {
        transform: scaleY(1);
        opacity: 0.8;
    }
    100% {
        transform: scaleY(0.8);
        opacity: 0;
    }
}

@keyframes insurance-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
        filter: blur(3px);
    }
}

/* Cooldown Refresh Animation */
@keyframes refresh-icon-spin {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.5) rotate(540deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(1080deg);
        opacity: 0.8;
    }
}

@keyframes refresh-energy-burst {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(2);
        opacity: 0.8;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

@keyframes refresh-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(1.1);
        filter: blur(2px);
    }
}

/* Special Ability Overlay Base Styles */
.special-ability-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2147483647 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    will-change: opacity, transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Chart-contained overlays for duels - positioned within chart container */
.special-ability-overlay.chart-contained {
    position: absolute !important;
    background: transparent !important;
}

/* For non-duel scenarios (like dev tools), keep the dark background */
.special-ability-overlay.dark-background {
    background: radial-gradient(circle at center, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.95) 100%);
}

.special-ability-hero {
    --ability-accent: #00d4ff;
    --hero-offset-x: -50%;
    --hero-offset-y-hidden: 18px;
    position: absolute;
    top: clamp(0.8rem, 4vw, 2.6rem);
    left: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.4rem, 1.4vw, 1rem);
    text-align: center;
    padding: clamp(0.75rem, 2.1vw, 1.25rem) clamp(0.9rem, 3vw, 1.6rem);
    border-radius: clamp(1rem, 3vw, 1.6rem);
    background: rgba(6, 14, 28, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 32px rgba(2, 8, 18, 0.35), 0 0 36px rgba(0, 0, 0, 0.18);
    transform: translate(var(--hero-offset-x), var(--hero-offset-y-hidden)) scale(0.94);
    opacity: 0;
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease-out;
    max-width: clamp(240px, 68vw, 420px);
    width: auto;
    color: #f8fbff;
    backdrop-filter: blur(14px);
    margin: 0;
    pointer-events: none;
    z-index: 60;
}

.special-ability-hero::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 80px var(--ability-accent, #00d4ff);
    opacity: 0.6;
    pointer-events: none;
}

.special-ability-hero.visible {
    transform: translate(var(--hero-offset-x), 0) scale(1);
    opacity: 1;
}

.special-ability-hero.layout-top-center {
    left: 50%;
    --hero-offset-x: -50%;
}

.special-ability-hero.layout-top-right {
    left: auto;
    right: clamp(1rem, 5vw, 3rem);
    align-items: flex-end;
    text-align: right;
    --hero-offset-x: 0;
}

.special-ability-hero.layout-top-left {
    left: clamp(1rem, 5vw, 3rem);
    align-items: flex-start;
    text-align: left;
    --hero-offset-x: 0;
}

.special-ability-hero.layout-bottom-center {
    top: auto;
    bottom: clamp(1rem, 5vw, 3rem);
    left: 50%;
    --hero-offset-y-hidden: -18px;
}

@media (max-width: 640px) {
    .special-ability-hero {
        top: clamp(0.6rem, 3vw, 1.4rem);
        padding: clamp(0.6rem, 4vw, 0.9rem) clamp(0.75rem, 5vw, 1.2rem);
        gap: clamp(0.35rem, 2.8vw, 0.7rem);
        max-width: clamp(220px, 84vw, 340px);
    }

    .special-ability-hero__icon {
        font-size: clamp(2rem, 12vw, 3.6rem);
    }

    .special-ability-hero__title {
        font-size: clamp(1.2rem, 5vw, 1.9rem);
        letter-spacing: 0.08em;
    }

    .special-ability-hero__subtitle {
        font-size: clamp(0.75rem, 3.6vw, 1rem);
    }
}

.special-ability-hero__icon {
    font-size: clamp(2.4rem, 8vw, 4rem);
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.4));
}

.special-ability-hero__title {
    font-size: clamp(1.45rem, 4.2vw, 2.5rem);
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-shadow: 0 0 18px rgba(0, 0, 0, 0.35);
}

.special-ability-hero__subtitle {
    font-size: clamp(0.85rem, 3.4vw, 1.25rem);
    opacity: 0.9;
    font-weight: 600;
}

.special-ability-hero__meta {
    font-size: clamp(0.75rem, 2.7vw, 0.95rem);
    color: rgba(240, 244, 255, 0.7);
    max-width: 28ch;
}

.special-ability-hero--sabotage {
    --ability-accent: #ff4d6d;
    background: linear-gradient(160deg, rgba(82, 0, 12, 0.72), rgba(10, 0, 0, 0.82));
}

.special-ability-hero--ai {
    --ability-accent: #35f6b3;
    background: linear-gradient(160deg, rgba(0, 40, 56, 0.72), rgba(2, 12, 26, 0.88));
}

.special-ability-hero--leech {
    --ability-accent: #ff5ef0;
    background: linear-gradient(150deg, rgba(64, 0, 56, 0.78), rgba(15, 0, 24, 0.88));
}

.special-ability-hero--surge {
    --ability-accent: #48d7ff;
    background: linear-gradient(155deg, rgba(0, 46, 76, 0.72), rgba(4, 16, 32, 0.88));
}

.special-ability-hero--phantom {
    --ability-accent: #b19bff;
    background: linear-gradient(150deg, rgba(48, 22, 83, 0.78), rgba(16, 12, 32, 0.88));
}

.special-ability-hero--liquidity {
    --ability-accent: #ffb347;
    background: linear-gradient(150deg, rgba(80, 33, 0, 0.75), rgba(24, 12, 0, 0.88));
}

.special-ability-hero--rewind {
    --ability-accent: #6dd5ff;
    background: linear-gradient(150deg, rgba(8, 42, 79, 0.75), rgba(6, 18, 32, 0.88));
}

.special-ability-hero--insurance {
    --ability-accent: #ffd166;
    background: linear-gradient(150deg, rgba(64, 42, 0, 0.78), rgba(24, 20, 0, 0.88));
}

.special-ability-hero--refresh {
    --ability-accent: #ffd166;
    background: linear-gradient(150deg, rgba(60, 14, 50, 0.78), rgba(20, 6, 24, 0.88));
}

.market-surge-candles {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    width: min(78%, 560px);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: clamp(8px, 1.2vw, 14px);
    pointer-events: none;
    z-index: 45;
}

.market-surge-candle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.market-surge-candle-wick {
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(72, 215, 255, 0.2));
    animation: market-candle-flare 1.8s ease-in-out infinite;
}

.market-surge-candle-body {
    width: clamp(12px, 2vw, 18px);
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, rgba(72, 215, 255, 1), rgba(0, 170, 200, 0.9));
    box-shadow: 0 0 14px rgba(72, 215, 255, 0.8);
    animation: market-candle-grow 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: bottom center;
}

.market-surge-candle-label {
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    color: rgba(205, 239, 255, 0.6);
    text-transform: uppercase;
}

.market-surge-candle.active .market-surge-candle-body {
    transform: scaleY(1.3);
    box-shadow: 0 0 22px rgba(72, 215, 255, 0.95);
}

.market-surge-candle.active .market-surge-candle-label {
    color: rgba(255, 255, 255, 0.95);
}

@keyframes market-candle-grow {
    0% {
        transform: scaleY(0.05);
        opacity: 0;
    }
    60% {
        opacity: 1;
    }
    100% {
        transform: scaleY(1);
        opacity: 1;
    }
}

@keyframes market-candle-flare {
    0%, 100% {
        opacity: 0.35;
        transform: scaleY(1);
    }
    50% {
        opacity: 1;
        transform: scaleY(1.15);
    }
}

.sabotage-slice-path {
    position: absolute;
    top: 50%;
    left: 5%;
    height: 6px;
    width: var(--slice-length, 480px);
    transform: rotate(var(--slice-angle, -12deg));
    transform-origin: left center;
    filter: drop-shadow(0 0 12px rgba(255, 77, 109, 0.7));
    pointer-events: none;
    z-index: 110;
}

.sabotage-slice-path::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 92, 92, 0.9), rgba(255, 255, 255, 0));
    box-shadow: 0 0 18px rgba(255, 92, 92, 0.65);
    animation: sabotage-slice-trail 0.55s ease-out forwards;
}

.sabotage-slice-glow {
    position: absolute;
    inset: -10px 0;
    background: radial-gradient(circle at center, rgba(255, 92, 92, 0.35), transparent 70%);
    opacity: 0;
    animation: sabotage-slice-glow 0.7s ease-out forwards;
}

.sabotage-slice-knife {
    position: absolute;
    top: 50%;
    left: 0;
    font-size: clamp(2.8rem, 8vw, 4.5rem);
    transform: translate(-40%, -50%) rotate(18deg);
    animation: sabotage-knife-flight 0.65s cubic-bezier(0.42, 0, 0.58, 1) forwards;
    text-shadow: 0 0 20px rgba(255, 92, 92, 0.6);
}

.sabotage-ember {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 140, 140, 1), rgba(255, 140, 140, 0));
    animation: sabotage-ember-rise 0.9s ease-out forwards;
    pointer-events: none;
    z-index: 105;
}

.sabotage-chart-fracture {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 2px, transparent 2px 32px);
    mix-blend-mode: screen;
    opacity: 0;
    animation: sabotage-fracture-fade 1.6s ease-out forwards;
    pointer-events: none;
    z-index: 60;
}

@keyframes sabotage-slice-trail {
    0% {
        transform: scaleX(0.05);
        opacity: 0.9;
    }
    45% {
        transform: scaleX(1.05);
        opacity: 1;
    }
    100% {
        transform: scaleX(1.08);
        opacity: 0.15;
    }
}

@keyframes sabotage-slice-glow {
    0% { opacity: 0; }
    30% { opacity: 0.7; }
    100% { opacity: 0; }
}

@keyframes sabotage-knife-flight {
    0% {
        transform: translate(-10%, -50%) rotate(12deg) scale(0.95);
        filter: drop-shadow(0 0 12px rgba(255, 92, 92, 0.6));
    }
    45% {
        transform: translate(calc(var(--knife-end, 420px) * 0.55), -40%) rotate(-8deg) scale(1.05);
    }
    100% {
        transform: translate(var(--knife-end, 420px), -30%) rotate(-42deg) scale(1);
        filter: drop-shadow(0 0 2px rgba(255, 92, 92, 0.2));
    }
}

@keyframes sabotage-ember-rise {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0.8);
    }
    40% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(var(--ember-x, 40px), var(--ember-y, -120px)) scale(0.2);
    }
}

@keyframes sabotage-fracture-fade {
    0% {
        opacity: 0.8;
        transform: scale(1.02);
    }
    100% {
        opacity: 0;
        transform: scale(1.08);
    }
}

@media (prefers-reduced-motion: reduce) {
    .special-ability-hero {
        transition: none;
    }
}

.dev-ability-tester-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 12, 28, 0.78);
    backdrop-filter: blur(18px);
    z-index: 10050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease-out;
}

.dev-ability-tester-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.dev-ability-tester-panel {
    width: min(540px, 92vw);
    max-height: min(560px, 90vh);
    overflow: hidden;
    padding: clamp(1.4rem, 3vw, 2rem);
    border-radius: 22px;
    background: linear-gradient(155deg, rgba(10, 24, 48, 0.94), rgba(2, 10, 24, 0.92));
    border: 1px solid rgba(90, 190, 255, 0.25);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    transform: translateY(24px) scale(0.96);
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 2vw, 1.5rem);
    color: #f0f6ff;
}

.dev-ability-tester-overlay.open .dev-ability-tester-panel {
    transform: translateY(0) scale(1);
}

.dev-ability-tester-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.dev-ability-tester-title {
    font-size: clamp(1.35rem, 4vw, 1.9rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dev-ability-tester-close {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
    color: #f0f6ff;
    font-size: 1rem;
    display: grid;
    place-items: center;
    transition: background 160ms ease, transform 160ms ease;
}

.dev-ability-tester-close:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.05);
}

.dev-ability-tester-subtitle {
    font-size: clamp(0.9rem, 3vw, 1.05rem);
    color: rgba(173, 208, 255, 0.82);
}

.dev-ability-tester-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: clamp(0.75rem, 2vw, 1.1rem);
    overflow-y: auto;
    padding-right: 0.25rem;
}

.dev-ability-tester-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: clamp(0.85rem, 2vw, 1.1rem);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: inherit;
    font-size: 0.95rem;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
    cursor: pointer;
}

.dev-ability-tester-card:hover,
.dev-ability-tester-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(160, 220, 255, 0.45);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35), 0 0 16px rgba(120, 200, 255, 0.25);
    outline: none;
}

.dev-ability-tester-card.active {
    border-color: rgba(120, 200, 255, 0.65);
    box-shadow: 0 0 20px rgba(120, 200, 255, 0.35);
}

.dev-ability-tester-icon {
    font-size: clamp(1.8rem, 6vw, 2.6rem);
}

.dev-ability-tester-name {
    font-weight: 600;
    letter-spacing: 0.04em;
}

.dev-ability-tester-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.dev-ability-tester-autoplay {
    flex: 1;
    min-width: 200px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.75), rgba(238, 90, 36, 0.78));
    color: #fff;
    font-weight: 600;
    padding: 0.85rem 1.2rem;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.dev-ability-tester-autoplay:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(238, 90, 36, 0.35);
}

.dev-ability-tester-autoplay:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dev-ability-tester-status {
    font-size: 0.9rem;
    color: rgba(173, 208, 255, 0.75);
}

.dev-ability-tester-helper {
    font-size: 0.85rem;
    color: rgba(173, 208, 255, 0.65);
}

.dev-ability-tester-helper code {
    background: rgba(0, 0, 0, 0.35);
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    font-size: 0.82rem;
}

.market-surge-ripple {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 2px solid rgba(72, 215, 255, 0.8);
    transform: translate(-50%, -50%);
    animation: market-ripple 0.55s ease-out forwards;
    pointer-events: none;
    z-index: 80;
}

@keyframes market-ripple {
    0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0.9; }
    100% { transform: translate(-50%, -50%) scale(2.4); opacity: 0; }
}

.ai-trace {
    position: absolute;
    font-family: monospace;
    font-size: 1rem;
    color: rgba(0, 255, 136, 0.9);
    text-shadow: 0 0 12px rgba(0, 255, 136, 0.8);
    animation: ai-trace-fade 0.6s ease-out forwards;
    pointer-events: none;
    z-index: 90;
}

@keyframes ai-trace-fade {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -90%) scale(0.6); }
}

.ai-flare {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.55), transparent 70%);
    transform: translate(-50%, -50%);
    animation: ai-flare-pop 0.7s ease-out forwards;
    pointer-events: none;
    z-index: 85;
}

@keyframes ai-flare-pop {
    0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.4); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.8); }
}

.phantom-echo {
    position: absolute;
    font-size: 2rem;
    transform: translate(-50%, -50%);
    animation: phantom-echo-float 0.8s ease-out forwards;
    filter: drop-shadow(0 0 10px rgba(177, 155, 255, 0.8));
    opacity: 0.8;
    pointer-events: none;
    z-index: 60;
}

@keyframes phantom-echo-float {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
    100% { opacity: 0; transform: translate(-30%, -120%) scale(1.2); }
}

.liquidity-ripple {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 2px solid rgba(255, 165, 0, 0.9);
    transform: translate(-50%, -50%);
    animation: liquidity-ripple-wave 0.9s ease-out forwards;
    pointer-events: none;
    z-index: 70;
}

@keyframes liquidity-ripple-wave {
    0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.4); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(3); }
}

.leech-orb {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 94, 240, 0.9), rgba(255, 94, 240, 0));
    pointer-events: none;
    z-index: 80;
}

.insurance-spark {
    position: absolute;
    font-size: 1.2rem;
    color: rgba(255, 215, 0, 0.9);
    transform: translate(-50%, -50%);
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.8);
    animation: insurance-spark-fade 0.65s ease-out forwards;
    pointer-events: none;
    z-index: 90;
}

@keyframes insurance-spark-fade {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.7); }
    100% { opacity: 0; transform: translate(-50%, -110%) scale(1.4); }
}

.cooldown-spark {
    position: absolute;
    font-size: 1.1rem;
    color: rgba(255, 20, 147, 0.9);
    transform: translate(-50%, -50%);
    text-shadow: 0 0 12px rgba(255, 20, 147, 0.8);
    animation: cooldown-spark-fade 0.6s ease-out forwards;
    pointer-events: none;
    z-index: 85;
}

@keyframes cooldown-spark-fade {
    0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.6); }
    100% { opacity: 0; transform: translate(-50%, -80%) scale(1.4); }
}

@media (max-width: 640px) {
    .dev-ability-tester-panel {
        width: 94vw;
        padding: 1.2rem;
        gap: 1rem;
    }

    .dev-ability-tester-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dev-ability-tester-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dev-ability-tester-overlay,
    .dev-ability-tester-panel,
    .dev-ability-tester-card,
    .dev-ability-tester-autoplay,
    .special-ability-hero {
        transition: none;
    }
}

/* Sabotage Specific Styles */
.sabotage-knife {
    position: absolute;
    font-size: 6rem;
    animation: sabotage-knife-slash 2s ease-in-out forwards;
    filter: drop-shadow(0 0 30px rgba(255, 0, 0, 0.9)) drop-shadow(0 0 15px rgba(255, 255, 255, 0.8));
    z-index: 15;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
}

.sabotage-slash {
    position: absolute;
    width: 200vw;
    height: 15px;
    background: linear-gradient(90deg, transparent, rgba(255, 0, 0, 0.9), transparent);
    animation: sabotage-slash-effect 1s ease-out 0.5s forwards;
    transform-origin: center;
    filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.8));
}

.sabotage-subtext {
    position: absolute;
    font-weight: 700;
    text-shadow: 0 0 15px rgba(255, 107, 107, 0.8);
    animation: fadeInUp 1s ease-out 0.8s forwards;
}

.sabotage-text {
    position: relative;
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 900;
    color: #ff0000;
    text-shadow:
        0 0 30px rgba(255, 0, 0, 0.9),
        0 0 15px rgba(255, 255, 255, 0.8),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    animation: dramatic-zoom-glow 1s ease-out 0.3s forwards;
    z-index: 15;
    text-align: center;
    width: 100%;
}

.sabotage-caster {
    position: relative;
    font-size: clamp(1rem, 4vw, 1.5rem);
    color: #ff6666;
    text-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
    animation: fadeInUp 1s ease-out 0.8s forwards;
}

.sabotage-text-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    z-index: 20;
}

/* AI Co-Pilot Specific Styles */
.ai-hologram {
    position: absolute;
    font-size: 5rem;
    animation: ai-hologram-flicker 2.5s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(0, 255, 255, 0.8));
    z-index: 10;
}

.ai-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 255, 0.1) 0px,
        rgba(0, 255, 255, 0.1) 1px,
        transparent 1px,
        transparent 20px
    ),
    repeating-linear-gradient(
        90deg,
        rgba(0, 255, 255, 0.1) 0px,
        rgba(0, 255, 255, 0.1) 1px,
        transparent 1px,
        transparent 20px
    );
    animation: ai-grid-scan 3s linear infinite;
    z-index: 5;
}

.ai-text {
    position: relative;
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 25px rgba(0, 255, 255, 0.8);
    animation: dramatic-zoom-glow 1s ease-out 0.2s forwards;
    z-index: 15;
    text-align: center;
    width: 100%;
}

.ai-subtext {
    position: relative;
    font-size: clamp(1rem, 4vw, 1.2rem);
    color: #66ffff;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
    animation: fadeInUp 1s ease-out 0.6s forwards;
    text-align: center;
    width: 100%;
}

/* PNL Leech Specific Styles */
.leech-effect {
    position: absolute;
    width: 300px;
    height: 300px;
    border: 3px solid #9932cc;
    border-radius: 50%;
    animation: leech-drain-effect 2s ease-in-out forwards;
    filter: drop-shadow(0 0 20px rgba(153, 50, 204, 0.8));
    z-index: 10;
}

.leech-beam {
    position: absolute;
    width: 10px;
    height: 50vh;
    background: linear-gradient(180deg, transparent, #9932cc, transparent);
    animation: leech-beam-pulse 1s ease-in-out infinite;
    z-index: 8;
}

.leech-text {
    position: relative;
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    font-weight: bold;
    color: #9932cc;
    text-shadow: 0 0 25px rgba(153, 50, 204, 0.8);
    animation: dramatic-zoom-glow 1s ease-out 0.3s forwards;
    z-index: 15;
    text-align: center;
    width: 100%;
}

.leech-amount {
    position: relative;
    font-size: clamp(1rem, 4vw, 1.5rem);
    color: #cc66ff;
    text-shadow: 0 0 15px rgba(153, 50, 204, 0.6);
    animation: fadeInUp 1s ease-out 0.7s forwards;
    text-align: center;
    width: 100%;
}

/* Market Surge Specific Styles */
.market-surge {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.8), transparent);
    border-radius: 50%;
    animation: market-surge-explosion 2.2s ease-out forwards;
    z-index: 8;
}

.surge-chart {
    position: absolute;
    width: 200px;
    height: 150px;
    bottom: 30%;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    clip-path: polygon(0 100%, 20% 80%, 40% 60%, 60% 40%, 80% 20%, 100% 0%, 100% 100%);
    animation: surge-chart-growth 2.2s ease-out 0.3s forwards;
    z-index: 9;
}

.surge-text {
    position: absolute;
    top: 25%;
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    animation: dramatic-zoom-glow 1s ease-out 0.2s forwards;
    z-index: 15;
}

.surge-boost {
    position: absolute;
    top: 40%;
    font-size: 1.3rem;
    color: #ffed4e;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    animation: fadeInUp 1s ease-out 0.6s forwards;
}

/* Phantom Trade Specific Styles */
.phantom-figure {
    position: absolute;
    font-size: 4rem;
    animation: phantom-ghostly-appear 2s ease-in-out forwards;
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.6));
    opacity: 0.7;
    z-index: 10;
}

.phantom-mist {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.2), transparent);
    animation: phantom-mist-drift 2s ease-in-out forwards;
    z-index: 5;
}

.phantom-text {
    position: absolute;
    top: 30%;
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 0 25px rgba(255, 255, 255, 0.8);
    animation: dramatic-zoom-glow 1s ease-out 0.3s forwards;
    z-index: 15;
}

.phantom-deception {
    position: absolute;
    top: 45%;
    font-size: 1.2rem;
    color: #cccccc;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    animation: fadeInUp 1s ease-out 0.7s forwards;
}

/* Liquidity Spike Specific Styles */
.liquidity-explosion {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 69, 0, 0.8), rgba(255, 140, 0, 0.4), transparent);
    border-radius: 50%;
    animation: liquidity-explosion-burst 2s ease-out forwards;
    z-index: 8;
}

.liquidity-waves {
    position: absolute;
    width: 800px;
    height: 800px;
    border: 5px solid rgba(255, 140, 0, 0.6);
    border-radius: 50%;
    animation: liquidity-waves-ripple 2s ease-out 0.2s forwards;
    z-index: 7;
}

.liquidity-text {
    position: absolute;
    top: 25%;
    font-size: 2.5rem;
    font-weight: bold;
    color: #ff4500;
    text-shadow: 0 0 30px rgba(255, 69, 0, 0.8);
    animation: dramatic-zoom-glow 1s ease-out 0.2s forwards;
    z-index: 15;
}

.liquidity-effect {
    position: absolute;
    top: 40%;
    font-size: 1.3rem;
    color: #ff8c00;
    text-shadow: 0 0 15px rgba(255, 140, 0, 0.6);
    animation: fadeInUp 1s ease-out 0.6s forwards;
}

/* Market Rewind Specific Styles */
.rewind-clock {
    position: absolute;
    font-size: 4rem;
    animation: rewind-clock-spin 2.3s ease-in-out forwards;
    filter: drop-shadow(0 0 25px rgba(138, 43, 226, 0.8));
    z-index: 10;
}

.rewind-spiral {
    position: absolute;
    width: 400px;
    height: 400px;
    border: 3px solid rgba(138, 43, 226, 0.6);
    border-radius: 50%;
    border-style: dashed;
    animation: rewind-spiral-effect 2.3s ease-out 0.3s forwards;
    z-index: 8;
}

.rewind-text {
    position: absolute;
    top: 25%;
    font-size: 2.5rem;
    font-weight: bold;
    color: #8a2be2;
    text-shadow: 0 0 25px rgba(138, 43, 226, 0.8);
    animation: dramatic-zoom-glow 1s ease-out 0.2s forwards;
    z-index: 15;
}

.rewind-effect {
    position: absolute;
    top: 40%;
    font-size: 1.3rem;
    color: #9932cc;
    text-shadow: 0 0 15px rgba(138, 43, 226, 0.6);
    animation: fadeInUp 1s ease-out 0.6s forwards;
}

/* PNL Insurance Specific Styles */
.insurance-shield {
    position: absolute;
    font-size: 4rem;
    animation: insurance-shield-protect 2s ease-in-out forwards;
    filter: drop-shadow(0 0 25px rgba(0, 255, 0, 0.8));
    z-index: 10;
}

.insurance-barrier {
    position: absolute;
    width: 100%;
    height: 20px;
    background: linear-gradient(90deg, rgba(0, 255, 0, 0.8), rgba(0, 255, 0, 0.4));
    animation: insurance-barrier-block 2s ease-out 0.5s forwards;
    z-index: 8;
}

.insurance-text {
    position: absolute;
    top: 25%;
    font-size: 2.5rem;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 25px rgba(0, 255, 0, 0.8);
    animation: dramatic-zoom-glow 1s ease-out 0.2s forwards;
    z-index: 15;
}

.insurance-protection {
    position: absolute;
    top: 40%;
    font-size: 1.2rem;
    color: #66ff66;
    text-shadow: 0 0 15px rgba(0, 255, 0, 0.6);
    animation: fadeInUp 1s ease-out 0.6s forwards;
}

/* Cooldown Refresh Specific Styles */
.refresh-icon {
    position: absolute;
    font-size: 4rem;
    animation: refresh-icon-spin 1.8s ease-in-out forwards;
    filter: drop-shadow(0 0 20px rgba(0, 191, 255, 0.8));
    z-index: 10;
}

.refresh-energy {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 191, 255, 0.6), transparent);
    border-radius: 50%;
    animation: refresh-energy-burst 1.8s ease-out 0.3s forwards;
    z-index: 8;
}

.refresh-text {
    position: absolute;
    top: 25%;
    font-size: 2.5rem;
    font-weight: bold;
    color: #00bfff;
    text-shadow: 0 0 25px rgba(0, 191, 255, 0.8);
    animation: dramatic-zoom-glow 1s ease-out 0.2s forwards;
    z-index: 15;
}

.refresh-reset {
    position: absolute;
    top: 40%;
    font-size: 1.2rem;
    color: #66ccff;
    text-shadow: 0 0 15px rgba(0, 191, 255, 0.6);
    animation: fadeInUp 1s ease-out 0.6s forwards;
}

/* Regular Ability Animations */

/* Overclock Animation */
.overclock-lightning {
    position: absolute;
    font-size: 4rem;
    animation: overclock-bolt-strike 1.5s ease-in-out forwards;
    filter: drop-shadow(0 0 25px rgba(255, 255, 0, 0.9));
    z-index: 10;
}

.overclock-speed {
    position: absolute;
    width: 500px;
    height: 200px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 0, 0.6), transparent);
    clip-path: polygon(0 50%, 100% 0, 100% 100%);
    animation: overclock-speed-lines 1.5s ease-in-out forwards;
    z-index: 8;
}

.overclock-text {
    position: absolute;
    top: 25%;
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffff00;
    text-shadow: 0 0 25px rgba(255, 255, 0, 0.9);
    animation: dramatic-zoom-glow 1s ease-out 0.2s forwards;
    z-index: 15;
}

.overclock-boost {
    position: absolute;
    top: 40%;
    font-size: 1.2rem;
    color: #ffff66;
    text-shadow: 0 0 15px rgba(255, 255, 0, 0.7);
    animation: fadeInUp 1s ease-out 0.6s forwards;
}

@keyframes overclock-bolt-strike {
    0% {
        transform: translateY(-50vh) scale(0) rotate(0deg);
        opacity: 0;
    }
    20% {
        transform: translateY(0vh) scale(1.2) rotate(180deg);
        opacity: 1;
    }
    80% {
        transform: translateY(0vh) scale(1) rotate(540deg);
        opacity: 1;
    }
    100% {
        transform: translateY(50vh) scale(0.8) rotate(720deg);
        opacity: 0;
    }
}

@keyframes overclock-speed-lines {
    0% {
        transform: translateX(-100vw) scaleX(0);
        opacity: 0;
    }
    30% {
        transform: translateX(0vw) scaleX(1);
        opacity: 0.8;
    }
    70% {
        transform: translateX(0vw) scaleX(1);
        opacity: 0.8;
    }
    100% {
        transform: translateX(100vw) scaleX(0);
        opacity: 0;
    }
}

@keyframes overclock-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(1.1);
        filter: blur(3px);
    }
}

/* Freeze Animation */
.freeze-ice {
    position: absolute;
    font-size: 4rem;
    animation: freeze-crystal-form 1.8s ease-in-out forwards;
    filter: drop-shadow(0 0 20px rgba(135, 206, 250, 0.9));
    z-index: 10;
}

.freeze-crystals {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(135, 206, 250, 0.4), transparent);
    animation: freeze-spread 1.8s ease-out forwards;
    z-index: 8;
}

.freeze-text {
    position: absolute;
    top: 25%;
    font-size: 2.5rem;
    font-weight: bold;
    color: #87ceeb;
    text-shadow: 0 0 25px rgba(135, 206, 250, 0.9);
    animation: dramatic-zoom-glow 1s ease-out 0.3s forwards;
    z-index: 15;
}

.freeze-effect {
    position: absolute;
    top: 40%;
    font-size: 1.2rem;
    color: #add8e6;
    text-shadow: 0 0 15px rgba(135, 206, 250, 0.7);
    animation: fadeInUp 1s ease-out 0.7s forwards;
}

@keyframes freeze-crystal-form {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    30% {
        transform: scale(1.3) rotate(90deg);
        opacity: 1;
    }
    70% {
        transform: scale(1) rotate(270deg);
        opacity: 1;
    }
    100% {
        transform: scale(0.9) rotate(360deg);
        opacity: 0.8;
    }
}

@keyframes freeze-spread {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.6;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes freeze-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
        filter: blur(4px);
    }
}

/* Smoke Screen Animation */
.smoke-cloud {
    position: absolute;
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse at center, rgba(128, 128, 128, 0.8), rgba(64, 64, 64, 0.4), transparent);
    border-radius: 50%;
    animation: smoke-expand 2s ease-out forwards;
    z-index: 8;
}

.smoke-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background: repeating-radial-gradient(
        circle at 25% 25%,
        rgba(128, 128, 128, 0.3) 0px,
        rgba(128, 128, 128, 0.1) 10px,
        transparent 15px
    );
    animation: smoke-drift 2s ease-in-out forwards;
    z-index: 7;
}

.smoke-text {
    position: absolute;
    top: 25%;
    font-size: 2.5rem;
    font-weight: bold;
    color: #808080;
    text-shadow: 0 0 20px rgba(128, 128, 128, 0.8);
    animation: dramatic-zoom-glow 1s ease-out 0.2s forwards;
    z-index: 15;
}

.smoke-effect {
    position: absolute;
    top: 40%;
    font-size: 1.2rem;
    color: #a0a0a0;
    text-shadow: 0 0 15px rgba(128, 128, 128, 0.6);
    animation: fadeInUp 1s ease-out 0.6s forwards;
}

@keyframes smoke-expand {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    20% {
        transform: scale(0.5);
        opacity: 0.8;
    }
    80% {
        transform: scale(1.2);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes smoke-drift {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    30% {
        opacity: 0.6;
    }
    70% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-30px) rotate(45deg);
        opacity: 0;
    }
}

@keyframes smoke-fade-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(1.2);
        filter: blur(5px);
    }
}

/* Mobile optimization for special ability animations */
@media (max-width: 768px) {
    .special-ability-overlay {
        background: radial-gradient(circle at center, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.98) 100%);
    }

    .sabotage-text,
    .ai-text,
    .leech-text,
    .surge-text,
    .phantom-text,
    .liquidity-text,
    .rewind-text,
    .insurance-text,
    .refresh-text {
        font-size: 1.8rem !important;
    }

    .sabotage-caster,
    .ai-subtext,
    .leech-amount,
    .surge-boost,
    .phantom-deception,
    .liquidity-effect,
    .rewind-effect,
    .insurance-protection,
    .refresh-reset {
        font-size: 1rem !important;
    }

    .sabotage-knife,
    .ai-hologram,
    .phantom-figure,
    .rewind-clock,
    .insurance-shield,
    .refresh-icon {
        font-size: 3rem !important;
    }

    .market-surge,
    .liquidity-explosion,
    .leech-effect {
        width: 250px !important;
        height: 250px !important;
    }

    .liquidity-waves {
        width: 400px !important;
        height: 400px !important;
    }

    .refresh-energy {
        width: 300px !important;
        height: 300px !important;
    }
}

/* Enhanced Special Ability Animations */

/* Sabotage - Flying Knife Effect */
@keyframes knife-slash {
    0% {
        transform: translateX(-100vw) translateY(-50vh) rotate(-45deg) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: translateX(50vw) translateY(0vh) rotate(-45deg) scale(1.2);
        opacity: 1;
    }
    60% {
        transform: translateX(100vw) translateY(50vh) rotate(-45deg) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translateX(150vw) translateY(100vh) rotate(-45deg) scale(0.8);
        opacity: 0;
    }
}

@keyframes screen-shatter {
    0% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 95% 20%, 100% 40%, 90% 60%, 100% 80%, 95% 100%, 0 100%);
    }
    80% {
        clip-path: polygon(0 0, 20% 5%, 40% 0, 60% 10%, 80% 0, 100% 15%, 100% 100%, 0 100%);
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 0;
    }
}

/* AI Co-Pilot - Digital Matrix Effect */
@keyframes matrix-rain {
    0% {
        transform: translateY(-100vh);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

@keyframes hologram-flicker {
    0%, 100% {
        opacity: 1;
        filter: brightness(1) contrast(1);
    }
    25% {
        opacity: 0.8;
        filter: brightness(1.2) contrast(1.1);
    }
    50% {
        opacity: 0.9;
        filter: brightness(0.9) contrast(1.2);
    }
    75% {
        opacity: 0.85;
        filter: brightness(1.1) contrast(0.9);
    }
}

/* PNL Leech - Energy Drain Effect */
@keyframes energy-drain-pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.8;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes soul-stream {
    0% {
        transform: translateX(0) translateY(0) scale(1);
        opacity: 0;
    }
    20% {
        opacity: 0.8;
    }
    80% {
        opacity: 0.6;
    }
    100% {
        transform: translateX(100px) translateY(-50px) scale(0.5);
        opacity: 0;
    }
}

/* Market Surge - Explosive Growth */
@keyframes chart-explosion {
    0% {
        transform: scale(0.5) rotate(0deg);
        opacity: 0;
    }
    20% {
        transform: scale(1.2) rotate(5deg);
        opacity: 1;
    }
    40% {
        transform: scale(1.5) rotate(-5deg);
        opacity: 1;
    }
    60% {
        transform: scale(1.8) rotate(3deg);
        opacity: 0.8;
    }
    80% {
        transform: scale(2) rotate(-2deg);
        opacity: 0.4;
    }
    100% {
        transform: scale(2.5) rotate(0deg);
        opacity: 0;
    }
}

@keyframes currency-burst {
    0% {
        transform: translateY(0) scale(0);
        opacity: 0;
    }
    20% {
        transform: translateY(-20px) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-200px) scale(0.5);
        opacity: 0;
    }
}

/* Phantom Trade - Ethereal Effects */
@keyframes phantom-portal {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
        filter: blur(10px);
    }
    30% {
        transform: scale(1) rotate(180deg);
        opacity: 0.8;
        filter: blur(2px);
    }
    70% {
        transform: scale(1.2) rotate(360deg);
        opacity: 0.6;
        filter: blur(1px);
    }
    100% {
        transform: scale(0) rotate(540deg);
        opacity: 0;
        filter: blur(10px);
    }
}

@keyframes ghost-trail {
    0% {
        transform: translateX(-50px) translateY(0);
        opacity: 0;
    }
    50% {
        transform: translateX(50px) translateY(-30px);
        opacity: 0.6;
    }
    100% {
        transform: translateX(150px) translateY(-60px);
        opacity: 0;
    }
}

/* Liquidity Spike - Shockwave Effects */
@keyframes shockwave-blast {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(2);
        opacity: 0.5;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes liquid-splash {
    0% {
        transform: scale(0) translateY(0);
        opacity: 0;
    }
    30% {
        transform: scale(1.2) translateY(-20px);
        opacity: 1;
    }
    70% {
        transform: scale(0.8) translateY(10px);
        opacity: 0.6;
    }
    100% {
        transform: scale(0.5) translateY(0);
        opacity: 0;
    }
}

/* Rewind - Time Distortion */
@keyframes time-vortex {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    25% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0.8;
    }
    50% {
        transform: scale(2) rotate(360deg);
        opacity: 0.6;
    }
    75% {
        transform: scale(1) rotate(540deg);
        opacity: 0.4;
    }
    100% {
        transform: scale(0) rotate(720deg);
        opacity: 0;
    }
}

@keyframes clock-reverse {
    0% {
        transform: rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: rotate(-720deg);
        opacity: 0;
    }
}

/* Insurance - Shield Effects */
@keyframes shield-bubble {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    30% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    70% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(0.8);
        opacity: 0;
    }
}

@keyframes divine-light {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(2) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(3) rotate(360deg);
        opacity: 0;
    }
}

/* Cooldown Refresh - Cosmic Energy */
@keyframes cosmic-ring-expand {
    0% {
        transform: scale(0);
        opacity: 1;
        border-width: 4px;
    }
    100% {
        transform: scale(8);
        opacity: 0;
        border-width: 1px;
    }
}

@keyframes energy-core {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.5);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes particle-burst {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(var(--tx), var(--ty)) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(calc(var(--tx) * 2), calc(var(--ty) * 2)) scale(0);
        opacity: 0;
    }
}
