/* Loading screen — bright, matches the landing page (Oct 31 2026) */
#app-loader {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--z-loader);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background:
        radial-gradient(700px 500px at 20% 10%, rgba(91, 76, 240, .10), transparent 65%),
        radial-gradient(640px 460px at 85% 85%, rgba(255, 176, 32, .12), transparent 62%),
        #fbf8f3 !important;
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: opacity .5s ease;
}

#app-loader .fl-mark {
    position: relative;
    width: 96px;
    height: 83px;
    margin-bottom: 30px;
    animation: fl-enter .8s cubic-bezier(.23, 1, .32, 1) both;
}
#app-loader .fl-mark img {
    position: relative;
    display: block;
    width: 96px;
    height: 83px;
    filter: drop-shadow(0 12px 18px rgba(91, 76, 240, .35)) drop-shadow(0 2px 3px rgba(27, 31, 59, .10));
    z-index: 2;
    transform-origin: 50% 100%;
    animation: fl-rise 1.6s cubic-bezier(.45, 0, .25, 1) .8s infinite;
}
#app-loader .fl-glow {
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, .35), rgba(255, 107, 107, .15) 45%, transparent 70%);
    filter: blur(8px);
    animation: fl-breathe 2.4s ease-in-out infinite;
}

/* Ground shadow: shrinks as the logo lifts */
#app-loader .fl-shadow {
    position: absolute;
    left: 50%;
    bottom: -14px;
    width: 64px;
    height: 10px;
    margin-left: -32px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(27, 31, 59, .22), transparent 70%);
    animation: fl-shadow 1.6s cubic-bezier(.45, 0, .25, 1) .8s infinite;
}

/* Sparkles drifting upward behind the logo */
#app-loader .fl-spark {
    position: absolute;
    bottom: 10px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    opacity: 0;
    z-index: 1;
    animation: fl-spark 1.6s ease-out infinite;
}
#app-loader .fl-spark.s1 { left: 4px;  background: #8b5cf6; animation-delay: .9s; }
#app-loader .fl-spark.s2 { right: 2px; background: #ff6b6b; animation-delay: 1.25s; width: 5px; height: 5px; }
#app-loader .fl-spark.s3 { left: 26px; background: #ffb020; animation-delay: 1.6s; width: 5px; height: 5px; }
#app-loader .fl-spark.s4 { right: 22px; background: #12b886; animation-delay: 1.95s; }

/* Wordmark: solid colours (gradient text renders soft) */
#app-loader .fl-word {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: #1b1f3b !important;
    -webkit-text-fill-color: #1b1f3b !important;
    background: none !important;
    animation: fl-up .6s cubic-bezier(.23, 1, .32, 1) .1s both;
}
#app-loader .fl-word span {
    color: #5b4cf0 !important;
    -webkit-text-fill-color: #5b4cf0 !important;
}
#app-loader .fl-tag {
    margin-top: 8px;
    font-size: .95rem;
    font-weight: 500;
    color: #6b7090;
    letter-spacing: 0;
    animation: fl-up .6s cubic-bezier(.23, 1, .32, 1) .18s both;
}

/* Slim sliding bar */
#app-loader .fl-bar {
    position: relative;
    width: 148px;
    height: 4px;
    margin-top: 26px;
    border-radius: 99px;
    background: rgba(91, 76, 240, .12);
    overflow: hidden;
    animation: fl-up .6s cubic-bezier(.23, 1, .32, 1) .26s both;
}
#app-loader .fl-bar i {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    border-radius: 99px;
    background: linear-gradient(90deg, #5b4cf0, #8b5cf6, #ff6b6b);
    animation: fl-slide 1.15s cubic-bezier(.65, 0, .35, 1) infinite;
}

@keyframes fl-enter { from { opacity: 0; transform: translateY(46px) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes fl-rise {
    0%   { transform: translateY(0) scale(1, 1); }
    12%  { transform: translateY(0) scale(1.08, .88); }      /* crouch */
    40%  { transform: translateY(-26px) scale(.95, 1.07); }   /* reach up */
    55%  { transform: translateY(-30px) scale(1, 1); }        /* top */
    82%  { transform: translateY(0) scale(1.04, .95); }       /* land */
    92%, 100% { transform: translateY(0) scale(1, 1); }
}
@keyframes fl-shadow {
    0%, 12%, 92%, 100% { transform: scale(1); opacity: 1; }
    55% { transform: scale(.55); opacity: .45; }
    82% { transform: scale(1.08); opacity: 1; }
}
@keyframes fl-spark {
    0%   { opacity: 0; transform: translateY(0) scale(.6); }
    20%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(-70px) scale(1.1); }
}
@keyframes fl-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fl-breathe { 0%, 100% { opacity: .55; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes fl-slide { 0% { left: -40%; } 100% { left: 100%; } }

@media (prefers-reduced-motion: reduce) {
    #app-loader *, #app-loader .fl-bar i { animation: none !important; }
    #app-loader .fl-bar i { left: 30%; }
}
