/* ===================================
   GAMEVERSE - ANIMATIONS CSS
   Custom Animations & Effects
   ================================== */

/* AOS (Animate On Scroll) Custom Animations */
[data-aos] {
    opacity: 0;
    transition-property: transform, opacity;
}

[data-aos].aos-animate {
    opacity: 1;
}

[data-aos="fade-up"] {
    transform: translateY(30px);
}

[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-down"] {
    transform: translateY(-30px);
}

[data-aos="fade-down"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-left"] {
    transform: translateX(30px);
}

[data-aos="fade-left"].aos-animate {
    transform: translateX(0);
}

[data-aos="fade-right"] {
    transform: translateX(-30px);
}

[data-aos="fade-right"].aos-animate {
    transform: translateX(0);
}

[data-aos="zoom-in"] {
    transform: scale(0.8);
}

[data-aos="zoom-in"].aos-animate {
    transform: scale(1);
}

/* Preloader Animations */
@keyframes loaderSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes loaderSpinReverse {
    from { transform: translate(-50%, -50%) rotate(360deg); }
    to { transform: translate(-50%, -50%) rotate(0deg); }
}

@keyframes preloaderPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.96);
        opacity: 0.55;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.08);
        opacity: 0.95;
    }
}

@keyframes preloaderFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes preloaderSweep {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(120%); }
}

@keyframes loadingProgress {
    0% { width: 10%; }
    45% { width: 62%; }
    75% { width: 84%; }
    100% { width: 100%; }
}

@keyframes loadingTextGlow {
    0%, 100% {
        text-shadow: 0 0 18px rgba(47, 184, 255, 0.18);
        opacity: 0.88;
    }
    50% {
        text-shadow: 0 0 22px rgba(244, 196, 79, 0.34), 0 0 34px rgba(47, 184, 255, 0.2);
        opacity: 1;
    }
}

@keyframes loadingSubtextShift {
    0%, 100% {
        opacity: 0.62;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(2px);
    }
}

.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 18%, rgba(244, 196, 79, 0.12), transparent 22%),
        radial-gradient(circle at 80% 10%, rgba(47, 184, 255, 0.12), transparent 24%),
        linear-gradient(180deg, #04070d 0%, #070b13 46%, #04070d 100%);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-ambient,
.preloader-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.preloader-ambient {
    background:
        radial-gradient(circle at center, rgba(47, 184, 255, 0.09), transparent 26%),
        radial-gradient(circle at center, rgba(244, 196, 79, 0.08), transparent 34%);
    filter: blur(18px);
    opacity: 0.85;
}

.preloader-grid {
    background-image:
        linear-gradient(rgba(96, 130, 180, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 130, 180, 0.08) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.95), transparent 88%);
    opacity: 0.35;
}

.preloader-content {
    position: relative;
    z-index: 2;
    width: min(100%, 460px);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(244, 196, 79, 0.14);
    border-radius: 30px;
    background: linear-gradient(180deg, rgba(10, 14, 23, 0.92), rgba(6, 9, 16, 0.84));
    box-shadow:
        0 28px 80px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(14px);
}

.preloader-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(47, 184, 255, 0.24);
    background: rgba(255, 255, 255, 0.03);
    color: #dbe6f5;
    font-size: 0.74rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.loader {
    position: relative;
    width: 156px;
    height: 156px;
    margin: 0 auto 1.5rem;
    flex-shrink: 0;
    animation: preloaderFloat 3.2s ease-in-out infinite;
}

.loader-core-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 116px;
    height: 116px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.14), transparent 38%),
        radial-gradient(circle, rgba(244, 196, 79, 0.22), rgba(47, 184, 255, 0.1) 62%, transparent 72%);
    filter: blur(3px);
    animation: preloaderPulse 2.8s ease-in-out infinite;
}

.loader-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
}

.loader-ring-gold {
    width: 156px;
    height: 156px;
    border: 2px solid transparent;
    border-top-color: #f4c44f;
    border-right-color: rgba(244, 196, 79, 0.55);
    box-shadow: 0 0 26px rgba(244, 196, 79, 0.18);
    animation: loaderSpin 2.8s linear infinite;
}

.loader-ring-blue {
    width: 134px;
    height: 134px;
    border: 2px solid transparent;
    border-bottom-color: #2fb8ff;
    border-left-color: rgba(47, 184, 255, 0.48);
    box-shadow: 0 0 24px rgba(47, 184, 255, 0.16);
    animation: loaderSpinReverse 2s linear infinite;
}

.loader-ring-outline {
    width: 104px;
    height: 104px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.loader-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.14), rgba(8, 12, 20, 0.86) 72%);
    border: 1px solid rgba(244, 196, 79, 0.16);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
}

.loading-text {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    font-weight: 900;
    color: #eef6ff;
    letter-spacing: 0.28em;
    margin-bottom: 0.75rem;
    width: 100%;
    animation: loadingTextGlow 2.6s ease-in-out infinite;
}

.loading-subtext {
    color: #b8c5d6;
    font-size: 0.98rem;
    letter-spacing: 0.08em;
    margin-bottom: 1.75rem;
    width: 100%;
    animation: loadingSubtextShift 2.6s ease-in-out infinite;
}

.loading-bar {
    position: relative;
    width: min(100%, 320px);
    height: 8px;
    background: rgba(31, 44, 69, 0.9);
    border-radius: 999px;
    overflow: hidden;
    margin: 0 auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.loading-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
    animation: preloaderSweep 2.2s linear infinite;
}

.loading-progress {
    position: relative;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2fb8ff 0%, #67d7ff 28%, #f4c44f 100%);
    box-shadow: 0 0 18px rgba(47, 184, 255, 0.28);
    animation: loadingProgress 2.2s ease-in-out infinite;
}

@media (max-width: 576px) {
    .preloader-content {
        padding: 1.5rem 1rem;
        border-radius: 24px;
    }

    .preloader-chip {
        font-size: 0.64rem;
        letter-spacing: 0.16em;
        margin-bottom: 1rem;
    }

    .loader {
        width: 136px;
        height: 136px;
    }

    .loader-ring-gold {
        width: 136px;
        height: 136px;
    }

    .loader-ring-blue {
        width: 116px;
        height: 116px;
    }

    .loader-core-glow {
        width: 102px;
        height: 102px;
    }

    .loading-text {
        font-size: 1.5rem;
        letter-spacing: 0.2em;
    }

    .loading-subtext {
        font-size: 0.9rem;
        line-height: 1.6;
    }
}

/* Glitch Effect */
@keyframes glitch {
    0%, 100% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
}

.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00ff;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitchBefore 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00ff00;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitchAfter 2.5s infinite linear alternate-reverse;
}

@keyframes glitchBefore {
    0% {
        clip: rect(61px, 9999px, 52px, 0);
    }
    5% {
        clip: rect(33px, 9999px, 144px, 0);
    }
    10% {
        clip: rect(121px, 9999px, 115px, 0);
    }
    /* More keyframes... */
    100% {
        clip: rect(82px, 9999px, 61px, 0);
    }
}

@keyframes glitchAfter {
    0% {
        clip: rect(26px, 9999px, 39px, 0);
    }
    5% {
        clip: rect(140px, 9999px, 107px, 0);
    }
    10% {
        clip: rect(79px, 9999px, 136px, 0);
    }
    /* More keyframes... */
    100% {
        clip: rect(25px, 9999px, 129px, 0);
    }
}

/* Particle Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-40px) translateX(-10px);
        opacity: 1;
    }
    75% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.7;
    }
}

/* Neon Glow Animation */
@keyframes neonGlow {
    0%, 100% {
        box-shadow: 
            0 0 5px rgba(0, 240, 255, 0.5),
            0 0 10px rgba(0, 240, 255, 0.4),
            0 0 20px rgba(0, 240, 255, 0.3);
    }
    50% {
        box-shadow: 
            0 0 10px rgba(0, 240, 255, 0.8),
            0 0 20px rgba(0, 240, 255, 0.6),
            0 0 30px rgba(0, 240, 255, 0.4),
            0 0 40px rgba(0, 240, 255, 0.2);
    }
}

.neon-glow {
    animation: neonGlow 2s ease-in-out infinite;
}

/* Scan Line Effect */
@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100vh);
    }
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(transparent, #00f0ff, transparent);
    opacity: 0.1;
    animation: scanline 8s linear infinite;
    pointer-events: none;
    z-index: 9998;
}

/* Text Typing Animation */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #00f0ff; }
}

.typing-text {
    overflow: hidden;
    border-right: 2px solid #00f0ff;
    white-space: nowrap;
    animation: 
        typing 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

/* Hover Lift Animation */
@keyframes hoverLift {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.hover-lift:hover {
    animation: hoverLift 0.6s ease-in-out;
}

/* Spin Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 2s linear infinite;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 2s infinite;
}

/* Shake Animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s;
}

/* Slide In Animations */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.slide-in-top {
    animation: slideInTop 0.6s ease-out;
}

.slide-in-bottom {
    animation: slideInBottom 0.6s ease-out;
}

/* Scale Animations */
@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scaleOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0);
        opacity: 0;
    }
}

.scale-in {
    animation: scaleIn 0.4s ease-out;
}

.scale-out {
    animation: scaleOut 0.4s ease-out;
}

/* Fade Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.fade-out {
    animation: fadeOut 0.5s ease-out;
}

/* Flip Animation */
@keyframes flipIn {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateY(0deg);
        opacity: 1;
    }
}

.flip-in {
    animation: flipIn 0.6s ease-out;
}

/* Blur In Animation */
@keyframes blurIn {
    from {
        filter: blur(20px);
        opacity: 0;
    }
    to {
        filter: blur(0);
        opacity: 1;
    }
}

.blur-in {
    animation: blurIn 0.8s ease-out;
}

/* Utility Classes */
.animate-delay-100 {
    animation-delay: 100ms;
}

.animate-delay-200 {
    animation-delay: 200ms;
}

.animate-delay-300 {
    animation-delay: 300ms;
}

.animate-delay-400 {
    animation-delay: 400ms;
}

.animate-delay-500 {
    animation-delay: 500ms;
}

.animate-duration-fast {
    animation-duration: 0.3s;
}

.animate-duration-normal {
    animation-duration: 0.5s;
}

.animate-duration-slow {
    animation-duration: 1s;
}

/* Smooth Transitions */
.smooth-transition {
    transition: all 0.3s ease;
}

.smooth-transition-slow {
    transition: all 0.6s ease;
}

/* Hover Effects */
.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-translate-up:hover {
    transform: translateY(-5px);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
}

/* Loading Spinner */
@keyframes spinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.spinner {
    border: 4px solid rgba(0, 240, 255, 0.1);
    border-top: 4px solid #00f0ff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spinner 1s linear infinite;
}

/* Data Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.count-up {
    animation: countUp 0.5s ease-out;
}

/* Pulsating Border */
@keyframes pulseBorder {
    0%, 100% {
        border-color: rgba(0, 240, 255, 0.3);
    }
    50% {
        border-color: rgba(0, 240, 255, 1);
    }
}

.pulse-border {
    animation: pulseBorder 2s ease-in-out infinite;
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(0, 240, 255, 0.3) 50%,
        transparent 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}
