/* Dragon Earn Premium Animated Preloader Stylesheet */

#dragon-preloader {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background-color: #090909;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    pointer-events: all;
    backface-visibility: hidden;
    transform: scale(1);
    opacity: 1;
    transition: opacity 350ms cubic-bezier(0.25, 1, 0.5, 1), transform 350ms cubic-bezier(0.25, 1, 0.5, 1), visibility 350ms;
}

#dragon-preloader.preloader-exit {
    opacity: 0;
    transform: scale(0.96);
    visibility: hidden;
    pointer-events: none;
}

/* Soft Radial Lighting behind the Dragon */
.preloader-radial-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 140, 0, 0.12) 0%, rgba(247, 183, 51, 0.03) 50%, transparent 100%);
    filter: blur(40px);
    pointer-events: none;
    z-index: 1;
    transform: translate3d(0, 0, 0);
}

/* Subtle Smoke overlay */
.preloader-smoke {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 40%, rgba(9, 9, 9, 0.8) 100%);
    opacity: 0.7;
    z-index: 2;
    pointer-events: none;
}

/* Preloader Content Wrapper */
.preloader-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

/* Dragon Container & Idle Animation */
.dragon-holder {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate3d(0, 0, 0);
    animation: dragon-float 4s ease-in-out infinite;
}

.dragon-holder svg {
    width: 100%;
    height: 100%;
}

/* Breathing & Head Idle motion */
.dragon-body {
    transform-origin: 100px 140px;
    animation: dragon-breathe 4s ease-in-out infinite;
}

@keyframes dragon-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -6px, 0); }
}

@keyframes dragon-breathe {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.02) rotate(-1deg); }
}

/* Elegant Fire Breathing Animation */
.fire-breath-container {
    position: absolute;
    top: 92px; /* Positioned near snout */
    left: 20px;
    width: 90px;
    height: 40px;
    pointer-events: none;
    z-index: 4;
}

.fire-particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, #FFD86A 10%, #FF7A00 60%, rgba(226, 75, 34, 0));
    opacity: 0;
    transform: scale(0.2) translate3d(60px, 10px, 0);
    transform-origin: center;
}

/* Staggered fire particles moving left and expanding */
.fire-particle-1 { animation: breathe-fire 2.4s ease-in-out infinite 0s; }
.fire-particle-2 { animation: breathe-fire 2.4s ease-in-out infinite 0.6s; }
.fire-particle-3 { animation: breathe-fire 2.4s ease-in-out infinite 1.2s; }
.fire-particle-4 { animation: breathe-fire 2.4s ease-in-out infinite 1.8s; }

@keyframes breathe-fire {
    0% {
        opacity: 0;
        transform: scale(0.2) translate3d(60px, 10px, 0);
    }
    30% {
        opacity: 0.85;
    }
    70% {
        opacity: 0.4;
    }
    100% {
        opacity: 0;
        transform: scale(1.4) translate3d(-30px, -5px, 0);
        filter: blur(2px);
    }
}

/* Floating Embers in Background */
.ember-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.preloader-ember {
    position: absolute;
    background: #F7B733;
    border-radius: 50%;
    opacity: 0;
    animation: float-ember 5s linear infinite;
}

@keyframes float-ember {
    0% {
        opacity: 0;
        transform: translate3d(0, 100px, 0) scale(0.8);
    }
    20% {
        opacity: 0.6;
    }
    80% {
        opacity: 0.4;
    }
    100% {
        opacity: 0;
        transform: translate3d(-30px, -150px, 0) scale(1.2);
    }
}

/* Scanning Progress Indicator */
.progress-line-container {
    position: relative;
    width: 180px;
    height: 3px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 99px;
    margin-top: 10px;
    overflow: hidden;
    z-index: 5;
}

.scanner-laser {
    position: absolute;
    height: 100%;
    width: 60px;
    background: linear-gradient(90deg, transparent, #F7B733, #FF7A00, #F7B733, transparent);
    border-radius: 99px;
    transform: translate3d(-60px, 0, 0);
    animation: scan-laser 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    filter: drop-shadow(0 0 4px #FF7A00);
}

@keyframes scan-laser {
    0% { transform: translate3d(-60px, 0, 0); }
    50% { transform: translate3d(180px, 0, 0); }
    100% { transform: translate3d(-60px, 0, 0); }
}

/* Typography Title */
.preloader-title {
    color: #FFD86A;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 6px;
    margin-top: 24px;
    animation: subtle-fade 3s ease-in-out infinite;
    z-index: 5;
    opacity: 0.7;
    padding-left: 6px; /* Offset letter-spacing on last char */
}

@keyframes subtle-fade {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.9; }
}
