html, body { height: 100%; }
body {
    font-family: var(--font-body);
    color: var(--text-1);
    background:
        radial-gradient(1200px 800px at 20% -10%, rgba(124, 231, 255, 0.14), transparent 55%),
        radial-gradient(900px 700px at 100% 10%, rgba(168, 128, 255, 0.16), transparent 60%),
        radial-gradient(1000px 900px at 30% 120%, rgba(255, 184, 94, 0.10), transparent 60%),
        linear-gradient(180deg, #05070e 0%, #060812 45%, #05060e 100%);
    background-attachment: fixed;
    min-height: 100dvh;
    letter-spacing: -0.005em;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 3px 3px;
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: soft-light;
    opacity: 0.6;
}

.app-shell {
    position: relative;
    min-height: 100dvh;
    z-index: 1;
}

/* Loading screen */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 50% 46%, rgba(17, 112, 83, 0.22), transparent 27%),
        radial-gradient(circle at 18% 20%, rgba(28, 225, 170, 0.08), transparent 30%),
        radial-gradient(circle at 88% 82%, rgba(222, 178, 70, 0.08), transparent 28%),
        linear-gradient(160deg, #010906 0%, #020d0a 48%, #010503 100%);
}
.loading-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .34;
    background-image:
        linear-gradient(rgba(86, 255, 203, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(86, 255, 203, .035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, #000 5%, transparent 72%);
}
.loading-aurora {
    position: absolute;
    z-index: -1;
    width: 65vw;
    height: 65vw;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .12;
    animation: loading-aurora-drift 8s ease-in-out infinite alternate;
}
.loading-aurora-one { top: 22%; left: -24%; background: #00f3a5; }
.loading-aurora-two { right: -28%; bottom: 14%; background: #d6a93f; animation-delay: -4s; }
.loading-emblem {
    position: relative;
    display: grid;
    place-items: center;
    width: 184px;
    height: 184px;
    margin-bottom: 24px;
    perspective: 700px;
}
.loading-emblem::before,
.loading-emblem::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.loading-emblem::before {
    inset: 17px;
    border: 1px solid rgba(104, 255, 203, .28);
    box-shadow: inset 0 0 24px rgba(37, 255, 184, .09), 0 0 30px rgba(37, 255, 184, .08);
}
.loading-emblem::after {
    left: 38px;
    right: 38px;
    bottom: 7px;
    height: 18px;
    background: rgba(36, 255, 181, .32);
    filter: blur(17px);
    transform: rotateX(74deg);
}
.loading-emblem img {
    position: relative;
    z-index: 4;
    width: 126px;
    height: 126px;
    object-fit: contain;
    filter: drop-shadow(0 15px 15px rgba(0, 0, 0, .52)) drop-shadow(0 0 18px rgba(70, 255, 191, .26));
    animation: loading-crystal-float 3.1s ease-in-out infinite;
}
.loading-emblem-glow {
    position: absolute;
    inset: 42px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(82, 255, 195, .32), rgba(82, 255, 195, .04) 50%, transparent 72%);
    filter: blur(8px);
    animation: loading-glow 2.2s ease-in-out infinite;
}
.loading-orbit {
    position: absolute;
    border-radius: 50%;
    border: 1px solid transparent;
}
.loading-orbit-outer {
    inset: 0;
    border-top-color: rgba(255, 213, 111, .9);
    border-right-color: rgba(63, 255, 193, .55);
    box-shadow: 0 -2px 10px rgba(255, 210, 105, .16);
    animation: loading-spin 5.4s linear infinite;
}
.loading-orbit-inner {
    inset: 27px;
    border-bottom-color: rgba(70, 255, 193, .75);
    border-left-color: rgba(255, 213, 111, .32);
    animation: loading-spin-reverse 3.7s linear infinite;
}
.loading-spark {
    position: absolute;
    z-index: 5;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #f8d778;
    box-shadow: 0 0 11px #f8d778, 0 0 23px rgba(72, 255, 195, .7);
    animation: loading-spark 2.2s ease-in-out infinite;
}
.loading-spark-one { top: 26px; right: 38px; }
.loading-spark-two { left: 27px; bottom: 48px; animation-delay: -.7s; }
.loading-spark-three { right: 24px; bottom: 55px; animation-delay: -1.4s; }
.loading-brand {
    color: #f7fbf9;
    font-size: clamp(21px, 5.7vw, 27px);
    line-height: 1;
    font-weight: 800;
    letter-spacing: .22em;
    text-indent: .22em;
    text-shadow: 0 0 22px rgba(78, 255, 197, .18);
}
.loading-label {
    margin-top: 13px;
    color: rgba(188, 216, 207, .72);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
}
.loading-progress {
    position: relative;
    width: min(232px, 62vw);
    height: 7px;
    margin-top: 24px;
    overflow: hidden;
    padding: 1px;
    border: 1px solid rgba(100, 255, 204, .2);
    border-radius: 999px;
    background: rgba(0, 0, 0, .45);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, .8), 0 0 18px rgba(45, 255, 183, .06);
}
.loading-progress span {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c895, #70f8d0 54%, #f2ca62);
    box-shadow: 0 0 12px rgba(74, 255, 195, .62);
    animation: loading-progress 1.8s cubic-bezier(.65, 0, .35, 1) infinite;
}
.loading-caption {
    margin-top: 13px;
    color: rgba(179, 203, 194, .4);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .21em;
}
.loading-particles { position: absolute; inset: 0; pointer-events: none; }
.loading-particles i {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #65f8c7;
    box-shadow: 0 0 8px rgba(86, 255, 199, .75);
    opacity: 0;
    animation: loading-particle 5s linear infinite;
}
.loading-particles i:nth-child(1) { left: 14%; top: 73%; animation-delay: -.4s; }
.loading-particles i:nth-child(2) { left: 27%; top: 32%; animation-delay: -2.7s; }
.loading-particles i:nth-child(3) { left: 42%; top: 80%; animation-delay: -1.2s; }
.loading-particles i:nth-child(4) { left: 58%; top: 24%; animation-delay: -3.6s; }
.loading-particles i:nth-child(5) { left: 74%; top: 68%; animation-delay: -2.1s; }
.loading-particles i:nth-child(6) { left: 87%; top: 38%; animation-delay: -4.4s; }
.loading-particles i:nth-child(7) { left: 65%; top: 86%; animation-delay: -.8s; }
.loading-particles i:nth-child(8) { left: 8%; top: 48%; animation-delay: -3.1s; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
@keyframes loading-spin-reverse { to { transform: rotate(-360deg); } }
@keyframes loading-crystal-float {
    0%, 100% { transform: translateY(4px) rotateY(-4deg) scale(.98); }
    50% { transform: translateY(-8px) rotateY(5deg) scale(1.035); }
}
@keyframes loading-glow { 0%, 100% { opacity: .46; transform: scale(.88); } 50% { opacity: 1; transform: scale(1.12); } }
@keyframes loading-spark { 0%, 100% { opacity: .15; transform: scale(.55); } 45% { opacity: 1; transform: scale(1.35); } }
@keyframes loading-progress { 0% { transform: translateX(-110%); } 55% { transform: translateX(100%); } 100% { transform: translateX(255%); } }
@keyframes loading-particle {
    0% { opacity: 0; transform: translate3d(0, 24px, 0) scale(.5); }
    20%, 70% { opacity: .55; }
    100% { opacity: 0; transform: translate3d(11px, -72px, 0) scale(1.15); }
}
@keyframes loading-aurora-drift { to { transform: translate3d(10%, -8%, 0) scale(1.15); } }
@media (prefers-reduced-motion: reduce) {
    .loading-screen * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Text utilities */
.text-muted { color: var(--text-3); }
.text-accent { color: var(--accent-1); }
.text-token { color: var(--token); }
.text-coin { color: var(--coin); }
.text-energy { color: var(--energy); }

.font-mono { font-family: var(--font-mono); }

.hidden-visually {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
