:root {
    --pl-primary: #5b4bfb;
    --pl-primary-glow: rgba(91, 75, 251, 0.2);
    --pl-accent: #ff7b54;
    --pl-accent-glow: rgba(255, 123, 84, 0.2);
    --pl-gold: #f6c445;
    --pl-bg-dark: #f1f5f9;
    --pl-bg-mid: #ffffff;
    --pl-white: #0f172a;
    --pl-text-secondary: #64748b;
}

#sunrise-preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 30%, var(--pl-bg-mid) 0%, var(--pl-bg-dark) 100%);
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    will-change: opacity, visibility;
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0s;
}

#sunrise-preloader.preloader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0.7s;
}

/* ─── SUN RISE ORBIT ─── */
.pl-orbit {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
}

.pl-sun {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffe082, var(--pl-gold), var(--pl-accent));
    box-shadow: 0 0 50px var(--pl-gold), 0 0 100px var(--pl-accent-glow), 0 0 30px var(--pl-primary-glow);
    animation: plSunPulse 2.8s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

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

/* Rotating dashed ring */
.pl-orbit-ring {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px dashed rgba(0, 0, 0, 0.15);
    animation: plRingSpin 6s linear infinite;
    z-index: 1;
}

@keyframes plRingSpin {
    to { transform: rotate(360deg); }
}

/* Solid inner ring */
.pl-orbit-ring-solid {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.08);
    animation: plRingSpin 10s linear infinite reverse;
    z-index: 1;
}

/* ─── BRAND TEXT ─── */
.pl-brand {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--pl-white);
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 4px;
    opacity: 0;
    animation: plFadeUp 0.7s 0.3s ease-out forwards;
    will-change: transform, opacity;
}

.pl-brand .gradient {
    background: linear-gradient(135deg, var(--pl-gold) 0%, var(--pl-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: plShimmer 3s ease-in-out infinite;
}

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

.pl-tagline {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--pl-text-secondary);
    margin-bottom: 28px;
    opacity: 0;
    animation: plFadeUp 0.7s 0.45s ease-out forwards;
    will-change: transform, opacity;
}

/* ─── PERCENTAGE ─── */
.pl-percentage {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 34px;
    font-weight: 800;
    color: var(--pl-white);
    letter-spacing: -1px;
    margin-bottom: 10px;
    opacity: 0;
    animation: plFadeUp 0.7s 0.55s ease-out forwards;
    will-change: transform, opacity;
}

.pl-percentage span {
    font-size: 16px;
    font-weight: 700;
    color: var(--pl-gold);
    margin-left: 2px;
}

/* ─── PROGRESS BAR ─── */
.pl-progress-track {
    width: 240px;
    height: 5px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    opacity: 0;
    animation: plFadeUp 0.7s 0.65s ease-out forwards;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.pl-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--pl-primary), var(--pl-accent));
    transition: width 0.35s ease-out;
    position: relative;
}

.pl-progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pl-gold);
    box-shadow: 0 0 10px var(--pl-gold);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pl-progress-fill.active::after {
    opacity: 1;
}

/* ─── STATUS TEXT ─── */
.pl-status {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--pl-text-secondary);
    letter-spacing: 0.8px;
    text-align: center;
    min-height: 18px;
    opacity: 0;
    animation: plFadeUp 0.7s 0.75s ease-out forwards;
    will-change: transform, opacity;
}

.pl-status.swap {
    animation: plStatusSwap 0.45s ease forwards;
}

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

@keyframes plStatusSwap {
    0%   { opacity: 1; transform: translateY(0); }
    40%  { opacity: 0; transform: translateY(-6px); }
    60%  { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ─── MINIMAL PARTICLES (very light) ─── */
.pl-dots {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.pl-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--pl-primary-glow);
    opacity: 0;
    animation: plDotFloat linear infinite;
}

.pl-dot:nth-child(1) { left: 12%; bottom: -10px; animation-duration: 7s; animation-delay: 0s; width: 2px; height: 2px; }
.pl-dot:nth-child(2) { left: 28%; bottom: -10px; animation-duration: 8s; animation-delay: 1s; width: 3px; height: 3px; }
.pl-dot:nth-child(3) { left: 42%; bottom: -10px; animation-duration: 9s; animation-delay: 2s; width: 2px; height: 2px; }
.pl-dot:nth-child(4) { left: 58%; bottom: -10px; animation-duration: 7.5s; animation-delay: 0.5s; width: 3px; height: 3px; }
.pl-dot:nth-child(5) { left: 72%; bottom: -10px; animation-duration: 8.5s; animation-delay: 1.5s; width: 2px; height: 2px; }
.pl-dot:nth-child(6) { left: 88%; bottom: -10px; animation-duration: 9.5s; animation-delay: 2.5s; width: 3px; height: 3px; }

@keyframes plDotFloat {
    0%   { transform: translateY(0); opacity: 0; }
    10%  { opacity: 0.6; }
    90%  { opacity: 0.6; }
    100% { transform: translateY(-100vh); opacity: 0; }
}

/* ─── BODY LOCK ─── */
body.preloader-active {
    overflow: hidden;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .pl-orbit { width: 130px; height: 130px; margin-bottom: 28px; }
    .pl-sun { width: 64px; height: 64px; }
    .pl-brand { font-size: 18px; letter-spacing: 1.5px; }
    .pl-tagline { font-size: 10px; letter-spacing: 2.5px; }
    .pl-percentage { font-size: 28px; }
    .pl-progress-track { width: 200px; }
}

@media (max-width: 420px) {
    .pl-orbit { width: 110px; height: 110px; margin-bottom: 24px; }
    .pl-sun { width: 54px; height: 54px; }
    .pl-brand { font-size: 15px; letter-spacing: 1px; }
    .pl-tagline { font-size: 9px; letter-spacing: 2px; margin-bottom: 22px; }
    .pl-percentage { font-size: 24px; }
    .pl-progress-track { width: 170px; height: 4px; }
}

@media (prefers-reduced-motion: reduce) {
    .pl-sun, .pl-orbit-ring, .pl-orbit-ring-solid, .pl-dot {
        animation: none !important;
    }
    .pl-sun { transform: scale(1); opacity: 0.9; box-shadow: 0 0 40px var(--pl-gold); }
    .pl-brand, .pl-tagline, .pl-percentage, .pl-progress-track, .pl-status {
        animation: none !important;
        opacity: 1 !important;
    }
    #sunrise-preloader.preloader-hidden {
        transition: opacity 0.3s ease;
    }
}