body.cosmic-background-enabled { isolation: isolate; }
.cosmic-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.cosmic-background canvas {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.cosmic-nebula {
    position: absolute;
    inset: 0;
}
.cosmic-meteor {
    position: absolute;
    top: 0;
    left: 0;
    width: 112px;
    height: 2px;
    margin-left: -112px;
    transform-origin: right center;
    border-radius: 50%;
    background: linear-gradient(90deg, transparent, #6585fa72 60%, #f0dbff);
    opacity: 0;
}
.cosmic-nebula::before,
.cosmic-nebula::after {
    content: "";
    position: absolute;
    width: min(58%, 650px);
    height: min(65%, 480px);
    opacity: .7;
}
.cosmic-nebula::before {
    top: -10%;
    left: 4%;
    background: radial-gradient(ellipse, #a855f72d, transparent 71%);
}
.cosmic-nebula::after {
    bottom: -12%;
    right: 3%;
    background: radial-gradient(ellipse, #6366f132, #38bdf814 42%, transparent 72%);
}
@media (prefers-reduced-motion: no-preference) {
    .dashboard-overview > .home-card-glass,
    .dashboard-home-actions > .dashboard-home-action {
        animation: cosmic-arrive 320ms cubic-bezier(.22,.72,.26,1) backwards;
    }
    .dashboard-overview > :nth-child(2),
    .dashboard-home-actions > :nth-child(2) { animation-delay: 45ms; }
    .dashboard-home-actions > :nth-child(3) { animation-delay: 90ms; }
    .dashboard-overview > :focus-within,
    .dashboard-home-actions > :focus-visible { animation: none; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .cosmic-nebula::before { animation: cosmic-breathe-left 24s ease-in-out infinite alternate; }
    .cosmic-nebula::after { animation: cosmic-breathe-right 28s ease-in-out infinite alternate; }
    .cosmic-background[data-cosmic-paused] .cosmic-nebula::before,
    .cosmic-background[data-cosmic-paused] .cosmic-nebula::after { animation-play-state: paused; }
    .dashboard-home-actions .dashboard-home-action {
        position: relative;
        overflow: hidden;
        transition: transform 180ms ease-out;
    }
    .dashboard-home-actions .dashboard-home-action:hover { transform: translate3d(0, -3px, 0); }
    .dashboard-home-action::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: linear-gradient(108deg, transparent 35%, #fff3 50%, transparent 65%);
        opacity: 0;
    }
    .dashboard-home-action:hover::before { animation: cosmic-sweep 580ms ease-out; }
    .dashboard-wallet-link .vip-premium-card[data-cosmic-tilt] {
        transform: translate3d(0, -3px, 0) rotateX(var(--cosmic-tilt-x, 0deg)) rotateY(var(--cosmic-tilt-y, 0deg));
        transition-property: transform;
        transition-duration: 105ms;
        will-change: transform;
    }
}
.cosmic-ripple-host { position: relative; }
.cosmic-ripple-clip {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
}
.cosmic-ripple-dot {
    position: absolute;
    border-radius: 50%;
    background: #bca7ff;
}
@keyframes cosmic-breathe-left {
    from { transform: translate3d(0, 0, 0); opacity: .55; }
    to { transform: translate3d(6%, 9%, 0) scale(1.09); opacity: .9; }
}
@keyframes cosmic-breathe-right {
    from { transform: translate3d(0, 0, 0) scale(1.04); opacity: .57; }
    to { transform: translate3d(-7%, -8%, 0); opacity: .88; }
}
@keyframes cosmic-arrive {
    from { transform: translate3d(0, 7px, 0); opacity: .7; }
    to { transform: translate3d(0, 0, 0); opacity: 1; }
}
@keyframes cosmic-sweep {
    0% { transform: translate3d(-75%, 0, 0); opacity: 0; }
    30% { opacity: .65; }
    100% { transform: translate3d(75%, 0, 0); opacity: 0; }
}

@view-transition { navigation: auto; }

::view-transition { background: #070913; }
::view-transition-group(root) { animation-duration: 180ms; }
::view-transition-old(root) { animation: mihu-page-exit 180ms ease-out both; }
::view-transition-new(root) { animation: mihu-page-enter 180ms ease-out both; }

@keyframes mihu-page-exit { to { opacity: .7; } }
@keyframes mihu-page-enter { from { opacity: 0; } to { opacity: 1; } }

#mihuTopProgress {
    position: fixed;
    inset: 0 0 auto;
    z-index: 2000;
    height: 3px;
    background: linear-gradient(90deg, #a855f7, #b184ff 55%, #38bdf8 83%, #f472b6);
    box-shadow: 0 0 9px #a855f7ad;
    transform: scaleX(.12);
    transform-origin: left center;
    pointer-events: none;
}
#mihuTopProgress[data-state="loading"] { animation: mihu-progress-loading 2.2s cubic-bezier(.12,.7,.2,1) both; }
#mihuTopProgress[data-state="finish"] { animation: mihu-progress-finish 280ms ease-out both; }
@keyframes mihu-progress-loading { to { transform: scaleX(.86); } }
@keyframes mihu-progress-finish {
    from { opacity: 1; transform: scaleX(.86); }
    42% { opacity: 1; transform: scaleX(1); }
    to { opacity: 0; transform: scaleX(1); }
}

.mihu-spotlight-host { position: relative; }
.mihu-spotlight-clip {
    position: absolute;
    inset: -1px;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    border-radius: inherit;
}
.mihu-spotlight-glow {
    position: absolute;
    width: 250px;
    height: 250px;
    top: 0;
    left: 0;
    transform: translate3d(-300px, -300px, 0);
    background: radial-gradient(circle, #b783ff38, #5c83f921 35%, transparent 70%);
    will-change: transform;
}
.mihu-counter-running { position: relative; font-variant-numeric: tabular-nums; }
.mihu-counter-measure { opacity: 0; }
.mihu-counter-visual { position: absolute; inset: 0 auto auto 0; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
    ::view-transition-group(root),
    ::view-transition-old(root),
    ::view-transition-new(root) { animation-duration: .01ms; }
    #mihuTopProgress[data-state] { animation: none; transform: scaleX(1); }
    #mihuTopProgress[data-state="finish"] { opacity: 0; }
    .mihu-spotlight-clip, .cosmic-meteor { display: none; }
}
