﻿/* ===== Loading Screen ===== */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Halloween Loading Screen */
.halloween-loading {
    background: linear-gradient(135deg, #0a0a0f 0%, #1a0f0a 50%, #2a1505 100%);
    overflow: hidden;
}

.loading-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

/* Pumpkin Animation */
.pumpkin-animation {
    font-size: 6rem;
    animation: pumpkinPulse 1.5s ease-in-out infinite, pumpkinGlow 2s ease-in-out infinite;
    filter: drop-shadow(0 0 30px #ff6600);
    margin-bottom: 2rem;
}

.pumpkin-animation img {
    width: 250px;
    height: 250px;
    object-fit: contain;
}

@keyframes pumpkinPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes pumpkinGlow {
    0%, 100% {
        filter: drop-shadow(0 0 20px #ff6600);
    }
    50% {
        filter: drop-shadow(0 0 40px #ff8800) drop-shadow(0 0 60px #ffaa00);
    }
}

/* Flying Bats */
.loading-bats {
    position: absolute;
    top: 20%;
    left: 0;
    width: 100%;
    height: 100px;
    pointer-events: none;
}

.bat {
    position: absolute;
    font-size: 2rem;
    opacity: 0;
    animation: batFly 4s linear infinite;
}

.bat img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.bat-1 {
    top: 10%;
    animation-delay: 0s;
}

.bat-2 {
    top: 50%;
    animation-delay: 1.3s;
}

.bat-3 {
    top: 80%;
    animation-delay: 2.6s;
}

@keyframes batFly {
    0% {
        left: -10%;
        opacity: 0;
        transform: translateY(0) rotate(-10deg);
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 110%;
        opacity: 0;
        transform: translateY(0) rotate(10deg);
    }
}

/* Loading Text */
.loading-text {
    font-size: 1.5rem;
    color: #ffb366;
    font-weight: 600;
    letter-spacing: 4px;
    margin-bottom: 2rem;
    animation: textFlicker 2s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(255, 102, 0, 0.8);
}

@keyframes textFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Loading Bar */
.loading-bar {
    width: 300px;
    height: 8px;
    background: rgba(255, 179, 102, 0.2);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 102, 0, 0.4);
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(255, 102, 0, 0.3);
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #ff6600 0%, #ff8800 50%, #ffaa00 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 102, 0, 0.8);
    animation: progressGlow 1.5s ease-in-out infinite;
}

@keyframes progressGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 102, 0, 0.6);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 136, 0, 1);
    }
}

/* Spider Web Corners */
.web-corner {
    position: absolute;
    width: 200px;
    height: 200px;
    opacity: 0.6;
    pointer-events: none;
    background-size: contain;
    background-repeat: no-repeat;
    filter: brightness(0) invert(1);
}

.web-top-left {
    top: 0;
    left: 0;
    background-image: url("/pictures/main/web-left.png");
}

.web-top-right {
    top: 0;
    right: 0;
    background-image: url("/pictures/main/web-right.png");
}

/* Fade in animation for web corners */
.web-corner {
    animation: webFadeIn 1s ease-in forwards;
}

@keyframes webFadeIn {
    from { opacity: 0; }
    to { opacity: 0.3; }
}

/* ===== Hello Kitty Loading Screen ===== */
.hellokitty-loading {
    background: linear-gradient(135deg, #ffe0f0 0%, #ffb6d9 50%, #ffc9e3 100%);
    overflow: hidden;
}

/* Hello Kitty Animation */
.hellokitty-loading .pumpkin-animation {
    filter: none !important; /* Removed glow effect */
    animation: none !important; /* Removed pulse animation */
}

.hellokitty-loading .pumpkin-animation img {
    width: 280px;
    height: 280px;
    animation: none !important; /* Removed pulse animation */
}

/* Flying Hearts */
.hellokitty-loading .loading-bats {
    top: 10%;
}

.hellokitty-loading .bat {
    font-size: 2.5rem;
}

.hellokitty-loading .bat::before {
    content: '';
}

.hellokitty-loading .bat img {
    display: block;
    width: 80px;
    height: 80px;
}

.hellokitty-loading .bat-1 {
    top: 20%;
    animation: knifeFloat1 4s ease-in-out infinite;
    animation-delay: 0s;
}

.hellokitty-loading .bat-1 img {
    content: url('/pictures/main/kittyknife1.png');
}

.hellokitty-loading .bat-2 {
    top: 60%;
    animation: knifeFloat2 5s ease-in-out infinite;
    animation-delay: 0.7s;
}

.hellokitty-loading .bat-2 img {
    content: url('/pictures/main/kittyknife2.png');
}

.hellokitty-loading .bat-3 {
    top: 35%;
    animation: knifeFloat3 4.5s ease-in-out infinite;
    animation-delay: 1.4s;
}

.hellokitty-loading .bat-3 img {
    content: url('/pictures/main/kittyknife3.png');
}

@keyframes heartFloat {
    0% {
        left: -10%;
        opacity: 0;
        transform: translateY(0) rotate(0deg) scale(0.8);
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: translateY(-40px) rotate(15deg) scale(1.2);
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 110%;
        opacity: 0;
        transform: translateY(-80px) rotate(30deg) scale(0.8);
    }
}

/* Knife 1: Волнистая траектория сверху */
@keyframes knifeFloat1 {
    0% {
        left: -10%;
        opacity: 0;
        transform: translateY(0) rotate(-20deg) scale(0.7);
    }
    15% {
        opacity: 1;
    }
    30% {
        transform: translateY(-60px) rotate(10deg) scale(1.1);
    }
    60% {
        transform: translateY(40px) rotate(-25deg) scale(1);
    }
    85% {
        opacity: 1;
    }
    100% {
        left: 110%;
        opacity: 0;
        transform: translateY(-20px) rotate(45deg) scale(0.6);
    }
}

/* Knife 2: Диагональная траектория снизу */
@keyframes knifeFloat2 {
    0% {
        left: -10%;
        opacity: 0;
        transform: translateY(50px) rotate(45deg) scale(0.6);
    }
    20% {
        opacity: 1;
    }
    40% {
        transform: translateY(-30px) rotate(-15deg) scale(1.2);
    }
    70% {
        transform: translateY(20px) rotate(30deg) scale(0.9);
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 110%;
        opacity: 0;
        transform: translateY(-70px) rotate(-40deg) scale(0.7);
    }
}

/* Knife 3: Зигзаг из центра */
@keyframes knifeFloat3 {
    0% {
        left: -10%;
        opacity: 0;
        transform: translateY(-30px) rotate(60deg) scale(0.8);
    }
    12% {
        opacity: 1;
    }
    25% {
        transform: translateY(50px) rotate(-30deg) scale(1.15);
    }
    50% {
        transform: translateY(-40px) rotate(20deg) scale(1.05);
    }
    75% {
        transform: translateY(30px) rotate(-10deg) scale(0.95);
    }
    88% {
        opacity: 1;
    }
    100% {
        left: 110%;
        opacity: 0;
        transform: translateY(-50px) rotate(50deg) scale(0.65);
    }
}

/* Kawaii Text */
.hellokitty-loading .loading-text {
    color: #ff69b4;
    text-shadow: 0 0 15px rgba(255, 105, 180, 0.6);
    animation: kawaiiPulse 1.5s ease-in-out infinite;
    margin-top: -80px;
    margin-bottom: 2rem;
}

@keyframes kawaiiPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Pink Loading Bar */
.hellokitty-loading .loading-bar {
    background: rgba(255, 182, 217, 0.3);
    border: 2px solid rgba(255, 105, 180, 0.5);
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.4);
    margin-top: -80px;
}

.hellokitty-loading .loading-progress {
    background: linear-gradient(90deg, #ff69b4 0%, #ff85c1 50%, #ffb6d9 100%);
    box-shadow: 0 0 15px rgba(255, 105, 180, 0.8);
    animation: pinkProgressGlow 1.5s ease-in-out infinite;
}

@keyframes pinkProgressGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 105, 180, 0.6);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 105, 180, 1), 0 0 40px rgba(255, 182, 217, 0.8);
    }
}

/* Bow Corners */
.hellokitty-loading .web-corner {
    opacity: 0.4;
    filter: none;
}

.hellokitty-loading .web-top-left {
    background-image: url("/pictures/main/star-icon.png");
    top: 15%;
    left: 10%;
    opacity: 1;
    filter: brightness(1);
}

.hellokitty-loading .web-top-right {
    background-image: url("/pictures/main/star-icon.png");
    top: 70%;
    right: 15%;
    opacity: 1;
    filter: brightness(1);
}

@keyframes bowRotate {
    0%, 100% {
        transform: rotate(0deg) scale(1);
        opacity: 0.4;
    }
    50% {
        transform: rotate(10deg) scale(1.1);
        opacity: 0.6;
    }
}

@keyframes starGlow {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8)) brightness(1.1);
        opacity: 0.9;
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 1)) drop-shadow(0 0 30px rgba(255, 255, 255, 0.8)) brightness(1.3);
        opacity: 1;
    }
}

/* Hide sparkles for Hello Kitty theme */
.hellokitty-loading::before,
.hellokitty-loading::after {
    display: none;
}

@keyframes knifeFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
    }
}

/* ===== Transition Loading Screen (Halloween ↔ Hello Kitty) ===== */
.transition-loading {
    background: linear-gradient(135deg, #0a0a0f 0%, #1a0f0a 50%, #2a1505 100%);
    overflow: hidden;
    animation: backgroundTransition 3s ease-in-out forwards;
}

/* Transition to Hello Kitty */
.transition-loading.to-hellokitty {
    animation: backgroundToKitty 3s ease-in-out forwards;
}

/* Transition to Halloween */
.transition-loading.to-halloween {
    animation: backgroundToHalloween 3s ease-in-out forwards;
}

@keyframes backgroundToKitty {
    0% {
        background: linear-gradient(135deg, #0a0a0f 0%, #1a0f0a 50%, #2a1505 100%);
    }
    100% {
        background: linear-gradient(135deg, #ffe0f0 0%, #ffb6d9 50%, #ffc9e3 100%);
    }
}

@keyframes backgroundToHalloween {
    0% {
        background: linear-gradient(135deg, #ffe0f0 0%, #ffb6d9 50%, #ffc9e3 100%);
    }
    100% {
        background: linear-gradient(135deg, #0a0a0f 0%, #1a0f0a 50%, #2a1505 100%);
    }
}

/* Transition KittyTV Animation */
.transition-loading .pumpkin-animation {
    animation: tvPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 30px #ff6600);
}

.transition-loading.to-hellokitty .pumpkin-animation {
    animation: tvPulse 2s ease-in-out infinite, tvToKitty 3s ease-in-out forwards;
}

.transition-loading.to-halloween .pumpkin-animation {
    animation: tvPulse 2s ease-in-out infinite, tvToHalloween 3s ease-in-out forwards;
}

@keyframes tvPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes tvToKitty {
    0% {
        filter: drop-shadow(0 0 30px #ff6600) hue-rotate(0deg) saturate(1);
    }
    100% {
        filter: drop-shadow(0 0 30px #ff69b4) hue-rotate(320deg) saturate(1.5) brightness(1.2);
    }
}

@keyframes tvToHalloween {
    0% {
        filter: drop-shadow(0 0 30px #ff69b4) hue-rotate(320deg) saturate(1.5) brightness(1.2);
    }
    100% {
        filter: drop-shadow(0 0 30px #ff6600) hue-rotate(0deg) saturate(1);
    }
}

.transition-loading .pumpkin-animation img {
    width: 300px;
    height: 300px;
}

/* Transition Flying Elements */
.transition-loading .loading-bats {
    top: 15%;
}

/* Start with bats, transition to hearts */
.transition-loading.to-hellokitty .bat {
    animation: batToHeart 3s ease-in-out forwards, heartFloat 5s ease-in-out infinite 3s;
}

.transition-loading.to-halloween .bat {
    animation: heartToBat 3s ease-in-out forwards, batFly 4s linear infinite 3s;
}

/* Initially show bat images */
.transition-loading .bat img {
    display: block;
    opacity: 1;
    transition: opacity 1.5s ease;
}

.transition-loading .bat::before {
    content: '';
    opacity: 0;
    transition: opacity 1.5s ease;
}

/* Transition to hearts */
.transition-loading.to-hellokitty .bat img {
    opacity: 0;
    animation: fadeOut 1.5s ease-in-out forwards;
}

.transition-loading.to-hellokitty .bat::before {
    content: '💗';
    font-size: 2.5rem;
    opacity: 0;
    animation: fadeIn 1.5s ease-in-out 1.5s forwards;
}

/* Transition to bats */
.transition-loading.to-halloween .bat::before {
    content: '💗';
    font-size: 2.5rem;
    opacity: 1;
    animation: fadeOut 1.5s ease-in-out forwards;
}

.transition-loading.to-halloween .bat img {
    opacity: 0;
    animation: fadeIn 1.5s ease-in-out 1.5s forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes batToHeart {
    0% { transform: translateX(0) rotate(0deg); }
    50% { transform: translateX(20px) rotate(180deg) scale(1.2); }
    100% { transform: translateX(0) rotate(360deg); }
}

@keyframes heartToBat {
    0% { transform: translateX(0) rotate(0deg); }
    50% { transform: translateX(-20px) rotate(-180deg) scale(1.2); }
    100% { transform: translateX(0) rotate(-360deg); }
}

/* Transition Text */
.transition-loading.to-hellokitty .loading-text {
    animation: textToKitty 3s ease-in-out forwards;
}

.transition-loading.to-halloween .loading-text {
    animation: textToHalloween 3s ease-in-out forwards;
}

@keyframes textToKitty {
    0% {
        color: #ffb366;
        text-shadow: 0 0 10px rgba(255, 102, 0, 0.8);
    }
    50% {
        transform: scale(1.3) rotate(10deg);
        opacity: 0.5;
    }
    100% {
        color: #ff69b4;
        text-shadow: 0 0 15px rgba(255, 105, 180, 0.6);
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes textToHalloween {
    0% {
        color: #ff69b4;
        text-shadow: 0 0 15px rgba(255, 105, 180, 0.6);
    }
    50% {
        transform: scale(1.3) rotate(-10deg);
        opacity: 0.5;
    }
    100% {
        color: #ffb366;
        text-shadow: 0 0 10px rgba(255, 102, 0, 0.8);
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Transition Progress Bar */
.transition-loading.to-hellokitty .loading-bar {
    animation: barToKitty 3s ease-in-out forwards;
}

.transition-loading.to-halloween .loading-bar {
    animation: barToHalloween 3s ease-in-out forwards;
}

@keyframes barToKitty {
    0% {
        background: rgba(255, 179, 102, 0.2);
        border-color: rgba(255, 102, 0, 0.4);
        box-shadow: 0 0 20px rgba(255, 102, 0, 0.3);
    }
    100% {
        background: rgba(255, 182, 217, 0.3);
        border-color: rgba(255, 105, 180, 0.5);
        box-shadow: 0 0 20px rgba(255, 105, 180, 0.4);
    }
}

@keyframes barToHalloween {
    0% {
        background: rgba(255, 182, 217, 0.3);
        border-color: rgba(255, 105, 180, 0.5);
        box-shadow: 0 0 20px rgba(255, 105, 180, 0.4);
    }
    100% {
        background: rgba(255, 179, 102, 0.2);
        border-color: rgba(255, 102, 0, 0.4);
        box-shadow: 0 0 20px rgba(255, 102, 0, 0.3);
    }
}

.transition-loading.to-hellokitty .loading-progress {
    animation: progressToKitty 3s ease-in-out forwards, pinkProgressGlow 1.5s ease-in-out infinite 3s;
}

.transition-loading.to-halloween .loading-progress {
    animation: progressToHalloween 3s ease-in-out forwards, progressGlow 1.5s ease-in-out infinite 3s;
}

@keyframes progressToKitty {
    0% {
        background: linear-gradient(90deg, #ff6600 0%, #ff8800 50%, #ffaa00 100%);
        box-shadow: 0 0 15px rgba(255, 102, 0, 0.8);
    }
    100% {
        background: linear-gradient(90deg, #ff69b4 0%, #ff85c1 50%, #ffb6d9 100%);
        box-shadow: 0 0 15px rgba(255, 105, 180, 0.8);
    }
}

@keyframes progressToHalloween {
    0% {
        background: linear-gradient(90deg, #ff69b4 0%, #ff85c1 50%, #ffb6d9 100%);
        box-shadow: 0 0 15px rgba(255, 105, 180, 0.8);
    }
    100% {
        background: linear-gradient(90deg, #ff6600 0%, #ff8800 50%, #ffaa00 100%);
        box-shadow: 0 0 15px rgba(255, 102, 0, 0.8);
    }
}

/* Transition Corner Decorations */
.transition-loading.to-hellokitty .web-corner {
    animation: webToBow 3s ease-in-out forwards;
}

.transition-loading.to-halloween .web-corner {
    animation: bowToWeb 3s ease-in-out forwards;
}

@keyframes webToBow {
    0% {
        opacity: 0.6;
        filter: brightness(0) invert(1);
        transform: rotate(0deg) scale(1);
    }
    50% {
        opacity: 0;
        transform: rotate(180deg) scale(0.5);
    }
    100% {
        opacity: 0.4;
        filter: none;
        transform: rotate(360deg) scale(1);
    }
}

@keyframes bowToWeb {
    0% {
        opacity: 0.4;
        filter: none;
        transform: rotate(0deg) scale(1);
    }
    50% {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    100% {
        opacity: 0.6;
        filter: brightness(0) invert(1);
        transform: rotate(-360deg) scale(1);
    }
}

/* ===== Crash Animation Loading Screen (Kitty Car → Krik) ===== */
.crash-scene {
    position: absolute;
    bottom: 150px;
    left: 0;
    width: 100%;
    height: 200px;
    pointer-events: none;
    display: none; /* Hidden by default */
}

/* Show crash scene only on crash transition */
.crash-loading .crash-scene {
    display: block;
}

/* Hide crash scene on regular loading screens */
.halloween-loading .crash-scene,
.hellokitty-loading .crash-scene {
    display: none;
}

/* Kitty Car */
.kitty-car {
    position: absolute;
    width: 150px;
    height: auto;
    left: -200px;
    bottom: 0;
    z-index: 10;
}

.crash-loading.to-hellokitty .kitty-car {
    filter: brightness(1.2) drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

/* Krik Character */
.krik-character {
    position: absolute;
    width: 120px;
    height: auto;
    left: calc(80% - 190px);
    bottom: -27px;
    z-index: 9;
}

.crash-loading.to-hellokitty .krik-character {
    filter: brightness(1.3) drop-shadow(0 0 15px rgba(255, 255, 255, 0.4));
}

/* Crash Effect (flash) */
.crash-effect {
    position: absolute;
    left: calc(80% - 210px);
    bottom: 10px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255, 200, 0, 0.6) 30%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, 0) scale(0);
    opacity: 0;
    z-index: 11;
}

/* Krik Spirit (Ghost) */
.krik-spirit {
    position: absolute;
    width: 50px;
    height: auto;
    left: calc(80% - 190px);
    bottom: 50px;
    z-index: 12;
    opacity: 0;
    transform: translateY(0) rotate(0deg);
    filter: brightness(0) invert(1);
}

/* Crash Animation - Halloween to Kitty */
.crash-loading.to-hellokitty {
    animation: backgroundCrashToKitty 4s ease-in-out forwards;
}

.crash-loading.to-halloween {
    animation: backgroundCrashToHalloween 4s ease-in-out forwards;
}

@keyframes backgroundCrashToKitty {
    0% {
        background: linear-gradient(135deg, #0a0a0f 0%, #1a0f0a 50%, #2a1505 100%);
    }
    40% {
        background: linear-gradient(135deg, #0a0a0f 0%, #1a0f0a 50%, #2a1505 100%);
    }
    100% {
        background: linear-gradient(135deg, #ffe0f0 0%, #ffb6d9 50%, #ffc9e3 100%);
    }
}

@keyframes backgroundCrashToHalloween {
    0% {
        background: linear-gradient(135deg, #ffe0f0 0%, #ffb6d9 50%, #ffc9e3 100%);
    }
    40% {
        background: linear-gradient(135deg, #ffe0f0 0%, #ffb6d9 50%, #ffc9e3 100%);
    }
    100% {
        background: linear-gradient(135deg, #0a0a0f 0%, #1a0f0a 50%, #2a1505 100%);
    }
}

/* Car driving animation */
.crash-loading.to-hellokitty .kitty-car {
    animation: carDrive 2s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes carDrive {
    0% {
        left: -200px;
        transform: translateY(0) rotate(0deg);
    }
    45% {
        left: calc(80% - 300px);
        transform: translateY(0) rotate(0deg);
    }
    50% {
        left: calc(80% - 250px);
        transform: translateY(-10px) rotate(-5deg);
    }
    55% {
        left: calc(80% - 230px);
        transform: translateY(0) rotate(3deg);
    }
    60% {
        left: calc(80% - 200px);
        transform: translateY(0) rotate(0deg);
    }
    100% {
        left: calc(100% + 50px);
        transform: translateY(0) rotate(0deg);
    }
}

/* Krik getting hit animation */
.crash-loading.to-hellokitty .krik-character {
    animation: krikFall 2s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

/* Spirit rising animation */
.crash-loading.to-hellokitty .krik-spirit {
    animation: spiritRise 3s ease-out 1s forwards;
    display: block;
}

@keyframes spiritRise {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) rotate(0deg) scale(1.2);
    }
    5% {
        opacity: 0.9;
        transform: translateY(-15px) translateX(8px) rotate(12deg) scale(1.1);
    }
    15% {
        opacity: 1;
        transform: translateY(-35px) translateX(-8px) rotate(-12deg) scale(1);
    }
    25% {
        transform: translateY(-60px) translateX(10px) rotate(15deg) scale(0.95);
    }
    35% {
        transform: translateY(-90px) translateX(-10px) rotate(-15deg) scale(0.9);
    }
    45% {
        transform: translateY(-130px) translateX(12px) rotate(18deg) scale(0.85);
    }
    55% {
        transform: translateY(-170px) translateX(-12px) rotate(-18deg) scale(0.8);
    }
    65% {
        transform: translateY(-220px) translateX(15px) rotate(20deg) scale(0.75);
    }
    75% {
        transform: translateY(-280px) translateX(-10px) rotate(-15deg) scale(0.7);
    }
    85% {
        transform: translateY(-350px) translateX(8px) rotate(10deg) scale(0.6);
        opacity: 0.7;
    }
    95% {
        transform: translateY(-420px) translateX(0) rotate(0deg) scale(0.5);
        opacity: 0.3;
    }
    100% {
        transform: translateY(-500px) translateX(0) rotate(0deg) scale(0.3);
        opacity: 0;
    }
}

@keyframes krikFall {
    0% {
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 1;
    }
    45% {
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateX(-20px) translateY(-30px) rotate(-15deg);
        opacity: 1;
    }
    55% {
        transform: translateX(-40px) translateY(-10px) rotate(-45deg);
        opacity: 1;
    }
    70% {
        transform: translateX(-80px) translateY(0) rotate(-90deg);
        opacity: 1;
    }
    100% {
        transform: translateX(-100px) translateY(0) rotate(-90deg);
        opacity: 0.8;
    }
}

/* Crash flash effect */
.crash-loading.to-hellokitty .crash-effect {
    animation: crashFlash 0.5s ease-out 2s forwards;
}

@keyframes crashFlash {
    0% {
        transform: translate(-50%, 50%) scale(0);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, 50%) scale(1.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, 50%) scale(2.5);
        opacity: 0;
    }
}

/* Screen shake effect */
.crash-loading.to-hellokitty .loading-content {
    animation: screenShake 0.5s ease-in-out 2s;
}

@keyframes screenShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Decorations transition after crash */
.crash-loading.to-hellokitty .loading-bats {
    animation: decorationsFade 1s ease-out 2.5s forwards;
}

.crash-loading.to-hellokitty .web-corner {
    animation: decorationsFade 1s ease-out 2.5s forwards, webToBow 1.5s ease-in-out 2.5s forwards;
}

@keyframes decorationsFade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Text transition after crash */
.crash-loading.to-hellokitty .loading-text {
    animation: textCrashTransition 2s ease-in-out 2s forwards;
}

@keyframes textCrashTransition {
    0% {
        color: #ffb366;
        text-shadow: 0 0 10px rgba(255, 102, 0, 0.8);
    }
    50% {
        transform: scale(1.3);
        opacity: 0.3;
    }
    100% {
        color: #ff69b4;
        text-shadow: 0 0 15px rgba(255, 105, 180, 0.6);
        transform: scale(1);
        opacity: 1;
    }
}

/* Progress bar transition */
.crash-loading.to-hellokitty .loading-bar {
    animation: barCrashToKitty 2s ease-in-out 2s forwards;
}

.crash-loading.to-hellokitty .loading-progress {
    animation: progressCrashToKitty 2s ease-in-out 2s forwards;
}

@keyframes barCrashToKitty {
    0% {
        background: rgba(255, 179, 102, 0.2);
        border-color: rgba(255, 102, 0, 0.4);
        box-shadow: 0 0 20px rgba(255, 102, 0, 0.3);
    }
    100% {
        background: rgba(255, 182, 217, 0.3);
        border-color: rgba(255, 105, 180, 0.5);
        box-shadow: 0 0 20px rgba(255, 105, 180, 0.4);
    }
}

@keyframes progressCrashToKitty {
    0% {
        background: linear-gradient(90deg, #ff6600 0%, #ff8800 50%, #ffaa00 100%);
        box-shadow: 0 0 15px rgba(255, 102, 0, 0.8);
    }
    100% {
        background: linear-gradient(90deg, #ff69b4 0%, #ff85c1 50%, #ffb6d9 100%);
        box-shadow: 0 0 15px rgba(255, 105, 180, 0.8);
    }
}

/* Reverse animation - Kitty to Halloween */
.crash-loading.to-halloween .kitty-car {
    animation: carReverse 3s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes carReverse {
    0% {
        left: calc(80% - 200px);
        transform: scaleX(-1) translateY(0);
    }
    100% {
        left: -200px;
        transform: scaleX(-1) translateY(0);
    }
}

.crash-loading.to-halloween .krik-character {
    animation: krikChase 3s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes krikChase {
    0% {
        left: calc(80% - 50px);
        bottom: -32px;
        transform: scaleX(-1) rotate(0deg);
    }
    5% {
        transform: scaleX(-1) rotate(-8deg);
    }
    10% {
        transform: scaleX(-1) rotate(8deg);
    }
    15% {
        transform: scaleX(-1) rotate(-8deg);
    }
    20% {
        transform: scaleX(-1) rotate(8deg);
    }
    25% {
        transform: scaleX(-1) rotate(-8deg);
    }
    30% {
        transform: scaleX(-1) rotate(8deg);
    }
    35% {
        transform: scaleX(-1) rotate(-8deg);
    }
    40% {
        transform: scaleX(-1) rotate(8deg);
    }
    45% {
        transform: scaleX(-1) rotate(-8deg);
    }
    50% {
        transform: scaleX(-1) rotate(8deg);
    }
    55% {
        transform: scaleX(-1) rotate(-8deg);
    }
    60% {
        transform: scaleX(-1) rotate(8deg);
    }
    65% {
        transform: scaleX(-1) rotate(-8deg);
    }
    70% {
        transform: scaleX(-1) rotate(8deg);
    }
    75% {
        transform: scaleX(-1) rotate(-8deg);
    }
    80% {
        transform: scaleX(-1) rotate(8deg);
    }
    85% {
        transform: scaleX(-1) rotate(-8deg);
    }
    90% {
        transform: scaleX(-1) rotate(8deg);
    }
    95% {
        transform: scaleX(-1) rotate(-8deg);
    }
    100% {
        left: -50px;
        bottom: -32px;
        transform: scaleX(-1) rotate(0deg);
    }
}
