body {
    margin: 0;
    overflow: hidden;
    background-color: #000;
    font-family: 'Inter', sans-serif;
}

/* ===== COSMIC LOADER BACKGROUND ===== */
#loader {
    background: radial-gradient(ellipse at center, #0a0a1a 0%, #000000 70%);
    overflow: hidden;
}

/* Starfield Container - Moving through space */
.starfield {
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    overflow: visible;
    z-index: 0;
    animation: space-travel 60s linear infinite;
}

@keyframes space-travel {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(25%) translateX(10%); }
}

/* Second star layer for parallax depth */
.starfield-layer-2 {
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    overflow: visible;
    z-index: 0;
    animation: space-travel-slow 90s linear infinite;
}

@keyframes space-travel-slow {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(25%) translateX(5%); }
}

/* Third star layer - fastest, closest stars */
.starfield-layer-3 {
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    overflow: visible;
    z-index: 0;
    animation: space-travel-fast 40s linear infinite;
}

@keyframes space-travel-fast {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(25%) translateX(15%); }
}

/* Individual Stars */
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle var(--duration, 3s) ease-in-out infinite;
    box-shadow: 0 0 var(--glow-size, 2px) var(--glow-color, rgba(255,255,255,0.5));
}

@keyframes twinkle {
    0%, 100% { opacity: var(--min-opacity, 0.2); transform: scale(1); }
    50% { opacity: var(--max-opacity, 1); transform: scale(var(--scale, 1.2)); }
}

/* Shooting Stars - REMOVED (not pertinent for clean design) */

/* Nebula Glow Effects */
.nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: nebula-pulse 8s ease-in-out infinite;
}

.nebula-1 {
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, #6366f1 0%, transparent 70%);
    top: -100px;
    left: -200px;
    animation-delay: 0s;
}

.nebula-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(ellipse, #8b5cf6 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
    animation-delay: 3s;
}

.nebula-3 {
    width: 400px;
    height: 300px;
    background: radial-gradient(ellipse, #3b82f6 0%, transparent 70%);
    top: 40%;
    right: 20%;
    animation-delay: 5s;
}

@keyframes nebula-pulse {
    0%, 100% { opacity: 0.1; transform: scale(1); }
    50% { opacity: 0.25; transform: scale(1.1); }
}

/* Floating Light Orbs */
.light-orb {
    position: absolute;
    border-radius: 50%;
    animation: float-orb var(--float-duration, 15s) ease-in-out infinite;
}

.light-orb::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle, var(--orb-color, rgba(99,102,241,0.3)) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(20px);
}

@keyframes float-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(var(--move-x, 50px), var(--move-y, -30px)) scale(1.1); }
    50% { transform: translate(calc(var(--move-x, 50px) * -0.5), calc(var(--move-y, -30px) * 1.5)) scale(0.9); }
    75% { transform: translate(calc(var(--move-x, 50px) * -1), calc(var(--move-y, -30px) * -0.5)) scale(1.05); }
}

/* Cosmic Dust Particles */
.cosmic-dust {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 40px 70px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 50px 160px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(255,255,255,0.2), transparent);
    background-size: 200px 200px;
    animation: dust-drift 60s linear infinite;
    opacity: 0.5;
}

@keyframes dust-drift {
    0% { transform: translateY(0); }
    100% { transform: translateY(-200px); }
}

/* Grid Lines - REMOVED (not pertinent for clean design) */

/* Horizon Glow */
.horizon-glow {
    position: absolute;
    bottom: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 200%;
    height: 100%;
    background: radial-gradient(ellipse at center bottom, rgba(99,102,241,0.15) 0%, transparent 50%);
    pointer-events: none;
}

/* Enhanced ETHER Title */
.ether-title {
    position: relative;
    z-index: 10;
}

.ether-title::before {
    content: 'ETHER';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #60a5fa, #a78bfa, #60a5fa);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 3s ease-in-out infinite;
    filter: blur(10px);
    opacity: 0.5;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Loader Content Container */
.loader-content {
    position: relative;
    z-index: 10;
}

/* Pulse Ring around Enter Button */
.pulse-ring {
    position: absolute;
    inset: -20px;
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 9999px;
    animation: pulse-expand 2s ease-out infinite;
}

.pulse-ring:nth-child(2) {
    animation-delay: 0.5s;
}

.pulse-ring:nth-child(3) {
    animation-delay: 1s;
}

@keyframes pulse-expand {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Title Shimmer Animation */
.ether-title {
    background: linear-gradient(90deg, #60a5fa, #a78bfa, #c084fc, #a78bfa, #60a5fa);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: title-shimmer 4s ease-in-out infinite;
    text-shadow: 0 0 80px rgba(139, 92, 246, 0.3);
}

@keyframes title-shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Glowing underline for title */
.ether-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.5), transparent);
    animation: underline-pulse 3s ease-in-out infinite;
}

@keyframes underline-pulse {
    0%, 100% { opacity: 0.3; width: 40%; }
    50% { opacity: 0.8; width: 70%; }
}

/* Deep Space Particles - Additional Layer */
.deep-space-particles {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(2px 2px at 100px 50px, rgba(139,92,246,0.4), transparent),
        radial-gradient(2px 2px at 200px 150px, rgba(59,130,246,0.3), transparent),
        radial-gradient(1px 1px at 300px 250px, rgba(99,102,241,0.5), transparent),
        radial-gradient(2px 2px at 400px 100px, rgba(167,139,250,0.4), transparent),
        radial-gradient(1px 1px at 500px 300px, rgba(96,165,250,0.3), transparent);
    background-size: 600px 400px;
    animation: deep-space-drift 120s linear infinite;
}

@keyframes deep-space-drift {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(-600px) translateY(-400px); }
}

/* Vignette Effect */
.cosmic-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.7) 100%);
    pointer-events: none;
}

/* Loading Text Glow */
#loading-text {
    text-shadow: 0 0 30px rgba(99,102,241,0.3);
}

/* Button Hover Glow */
#btn-start:hover {
    box-shadow: 0 0 30px rgba(139,92,246,0.3), inset 0 0 20px rgba(139,92,246,0.1);
}

#canvas-container {
    width: 100vw;
    height: 100vh;
}

/* Custom Scrollbar hidden */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Loader Exit Animation */
#loader.fade-out .starfield,
#loader.fade-out .nebula,
#loader.fade-out .light-orb,
#loader.fade-out .cosmic-dust,

#loader.fade-out .horizon-glow {
    animation: zoom-fade 1.5s ease-in forwards;
}

@keyframes zoom-fade {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.fade-in {
    opacity: 1;
}

canvas {
    display: block; /* Removes bottom whitespace */
}
