/* ========================================================================
   UNIVERS MARCEAUTDML — IMMERSIVE SPACE EXPERIENCE
   ======================================================================== */

/* --- RESET & BASE --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    touch-action: none;
    -webkit-overflow-scrolling: none;
    overscroll-behavior: none;
}

body {
    background-color: #020314;
    color: #FAFAFA;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

/* --- WEBGL CANVAS --- */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    display: block;
}

/* --- SHOOTING STARS CSS LAYER --- */
.shooting-stars-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.shooting-star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    filter: blur(0.5px);
}

.shooting-star::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 80px;
    height: 1.5px;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.9), rgba(189, 130, 247, 0.4), transparent);
    border-radius: 0 50% 50% 0;
}

@keyframes shootingStar {
    0% {
        opacity: 0;
        transform: translate(0, 0) rotate(var(--angle));
    }
    5% {
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) rotate(var(--angle));
    }
}

/* --- UI OVERLAY --- */
.universe-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 3;
    overflow: hidden;
    pointer-events: none;
}

/* --- PLANET WRAPPER (Logo + clickable zone) --- */
.planet-wrapper {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    pointer-events: auto;
    transform: translate(-50%, -50%);
    will-change: left, top, transform;
    transition: filter 0.3s ease;
    /* Generous click target */
    padding: 8px 16px;
    border-radius: 50%;
}

.planet-wrapper:hover {
    z-index: 999 !important;
    filter: brightness(1.3);
}

/* --- PLANET LOGO --- */
.planet-logo {
    height: 28px;
    width: auto;
    max-width: 100px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(189, 130, 247, 0.5));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                filter 0.3s ease;
    position: relative;
    z-index: 2;
}

.planet-wrapper:hover .planet-logo {
    transform: scale(1.2) translateY(-4px);
    filter: drop-shadow(0 0 16px rgba(189, 130, 247, 0.8))
           drop-shadow(0 0 30px rgba(189, 130, 247, 0.4));
}

/* --- PLANET LABEL --- */
.planet-label {
    position: absolute;
    bottom: -30px;
    white-space: nowrap;
    color: #FAFAFA;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.6px;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
    background: rgba(2, 3, 20, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 5px 12px;
    border-radius: 16px;
    border: 1px solid rgba(189, 130, 247, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.planet-wrapper:hover .planet-label {
    opacity: 1;
    transform: translateY(0);
}

/* --- CENTER PLANET (Sun) --- */
.center-wrapper {
    z-index: 100;
    padding: 12px 20px;
}

.center-wrapper .planet-logo {
    height: 40px;
    max-width: 130px;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.4))
           drop-shadow(0 0 30px rgba(189, 130, 247, 0.5));
}

.center-wrapper:hover .planet-logo {
    transform: scale(1.15) translateY(-3px);
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.6))
           drop-shadow(0 0 40px rgba(189, 130, 247, 0.7));
}

.center-wrapper .planet-label {
    bottom: -35px;
    font-size: 0.8rem;
}

/* --- ORBITING PLANETS --- */
.orbiting-wrapper {
    padding: 6px 12px;
}

/* --- INTRO OVERLAY --- */
.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(ellipse at center, #0a0a2e 0%, #020314 70%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.intro-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.intro-logo-ring {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid rgba(189, 130, 247, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    animation: introRingSpin 4s linear infinite;
}

.ring-glow {
    width: 12px;
    height: 12px;
    background: #BD82F7;
    border-radius: 50%;
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 15px #BD82F7, 0 0 30px rgba(189, 130, 247, 0.5);
}

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

.intro-content h2 {
    font-size: 1.6rem;
    font-weight: 300;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
}

.intro-subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 6px;
    color: #BD82F7;
    text-transform: uppercase;
}

.loader {
    width: 120px;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 16px;
}

.loader-track {
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #BD82F7, transparent);
    border-radius: 4px;
    animation: loaderSlide 1.5s ease-in-out infinite;
}

@keyframes loaderSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .planet-logo {
        height: 22px;
        max-width: 80px;
    }

    .center-wrapper .planet-logo {
        height: 32px;
        max-width: 100px;
    }

    .planet-label {
        font-size: 0.65rem;
        padding: 4px 8px;
        bottom: -24px;
    }

    .center-wrapper .planet-label {
        bottom: -28px;
        font-size: 0.7rem;
    }

    .intro-content h2 {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }

    .intro-subtitle {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .planet-logo {
        height: 18px;
        max-width: 65px;
    }

    .center-wrapper .planet-logo {
        height: 26px;
        max-width: 80px;
    }

    .planet-label {
        font-size: 0.6rem;
        bottom: -20px;
    }
}
