/* Planet base styles */
.planet {
    position: absolute;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: planetFloat 6s ease-in-out infinite;
    z-index: 1;
    width: clamp(20px, 4vw, 40px);
    height: clamp(20px, 4vw, 40px);
}

.planet::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    border-radius: 50%;
    opacity: 0.3;
    filter: blur(10px);
    background: inherit;
}

.planet::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 20%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), transparent);
    border-radius: 50%;
    filter: blur(3px);
}

@keyframes planetFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-10px) rotate(5deg);
    }

    75% {
        transform: translateY(10px) rotate(-5deg);
    }
}

.planet:hover {
    transform: scale(1.3);
    filter: brightness(1.3);
    z-index: 2;
}

.planet:hover::before {
    opacity: 0.6;
    width: 200%;
    height: 200%;
}

.planet.clicked {
    opacity: 0.6;
    animation: planetPulse 2s ease-in-out infinite, clickPulse 0.6s ease-out;
}

.planet.clicked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: clamp(12px, 2.5vw, 20px);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    background: none;
    filter: none;
    width: auto;
    height: auto;
}

@keyframes planetPulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 0.8;
    }
}

@keyframes clickPulse {
    0% {
        box-shadow: 0 0 30px currentColor;
    }

    50% {
        box-shadow: 0 0 60px currentColor, 0 0 90px currentColor;
    }

    100% {
        box-shadow: 0 0 30px currentColor;
    }
}

/* Planet types with distinct appearances */
.planet-type-1 {
    background: radial-gradient(circle at 30% 30%, #4fc3f7, #0277bd);
    box-shadow: 0 0 30px rgba(79, 195, 247, 0.6);
}

.planet-type-2 {
    background: radial-gradient(circle at 30% 30%, #ff7043, #d84315);
    box-shadow: 0 0 30px rgba(255, 112, 67, 0.6);
}

.planet-type-3 {
    background: radial-gradient(circle at 30% 30%, #66bb6a, #2e7d32);
    box-shadow: 0 0 30px rgba(102, 187, 106, 0.6);
}

.planet-type-4 {
    background: radial-gradient(circle at 30% 30%, #ba68c8, #6a1b9a);
    box-shadow: 0 0 30px rgba(186, 104, 200, 0.6);
}

.planet-type-5 {
    background: radial-gradient(circle at 30% 30%, #ffd54f, #f57c00);
    box-shadow: 0 0 30px rgba(255, 213, 79, 0.6);
}

/* Gas Giant with Stripes */
.planet-type-6 {
    background:
        repeating-linear-gradient(0deg,
            #d4a373 0px,
            #d4a373 8px,
            #c08552 8px,
            #c08552 16px,
            #a86f3f 16px,
            #a86f3f 24px,
            #8b5a2b 24px,
            #8b5a2b 32px),
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), transparent);
    box-shadow: 0 0 40px rgba(212, 163, 115, 0.7);
}

.planet-type-6::after {
    background: radial-gradient(circle at 30% 30%,
            rgba(255, 255, 255, 0.4),
            transparent 40%);
}

/* Moon-like with Craters */
.planet-type-7 {
    background: radial-gradient(circle at 30% 30%, #bdbdbd, #757575);
    box-shadow: 0 0 30px rgba(189, 189, 189, 0.5);
}

.planet-type-7::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 25% 40%, rgba(0, 0, 0, 0.3) 8%, transparent 9%),
        radial-gradient(circle at 65% 30%, rgba(0, 0, 0, 0.25) 6%, transparent 7%),
        radial-gradient(circle at 45% 70%, rgba(0, 0, 0, 0.3) 10%, transparent 11%),
        radial-gradient(circle at 80% 60%, rgba(0, 0, 0, 0.2) 7%, transparent 8%),
        radial-gradient(circle at 30% 75%, rgba(0, 0, 0, 0.25) 5%, transparent 6%),
        radial-gradient(circle at 70% 85%, rgba(0, 0, 0, 0.2) 6%, transparent 7%);
    filter: none;
    z-index: 1;
}

/* Saturn-like with Rings */
.planet-type-8 {
    background: radial-gradient(circle at 30% 30%, #f4e4c1, #d4af37);
    box-shadow: 0 0 40px rgba(244, 228, 193, 0.6);
    overflow: visible;
}

.planet-type-8::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateX(75deg);
    width: 180%;
    height: 180%;
    border-radius: 50%;
    border: clamp(3px, 0.8vw, 6px) solid rgba(200, 180, 140, 0.7);
    box-shadow:
        inset 0 0 10px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(200, 180, 140, 0.5);
    z-index: -1;
    filter: none;
    opacity: 0.8;
}

/* Ice Planet */
.planet-type-9 {
    background: radial-gradient(circle at 30% 30%, #e1f5fe, #81d4fa, #0277bd);
    box-shadow: 0 0 40px rgba(129, 212, 250, 0.7);
}

.planet-type-9::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 45%, rgba(255, 255, 255, 0.6) 15%, transparent 16%),
        radial-gradient(circle at 60% 25%, rgba(255, 255, 255, 0.5) 12%, transparent 13%),
        radial-gradient(circle at 45% 80%, rgba(255, 255, 255, 0.4) 18%, transparent 19%),
        radial-gradient(circle at 75% 70%, rgba(255, 255, 255, 0.5) 10%, transparent 11%);
    filter: none;
    opacity: 0.8;
    z-index: 1;
}

/* Lava Planet */
.planet-type-10 {
    background: radial-gradient(circle at 30% 30%, #ff6b35, #d32f2f, #5d0000);
    box-shadow: 0 0 50px rgba(255, 107, 53, 0.8);
    animation: planetFloat 6s ease-in-out infinite, lavaGlow 3s ease-in-out infinite;
}

@keyframes lavaGlow {

    0%,
    100% {
        box-shadow: 0 0 40px rgba(255, 107, 53, 0.6);
    }

    50% {
        box-shadow: 0 0 60px rgba(255, 107, 53, 1), 0 0 80px rgba(211, 47, 47, 0.6);
    }
}

.planet-type-10::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 40% 30%, rgba(255, 200, 0, 0.8) 5%, transparent 8%),
        radial-gradient(ellipse at 60% 60%, rgba(255, 150, 0, 0.7) 7%, transparent 10%),
        radial-gradient(ellipse at 25% 70%, rgba(255, 180, 0, 0.6) 6%, transparent 9%),
        radial-gradient(ellipse at 80% 40%, rgba(255, 200, 0, 0.5) 4%, transparent 7%);
    filter: none;
    opacity: 1;
    z-index: 1;
    animation: lavaFlow 4s ease-in-out infinite;
}

@keyframes lavaFlow {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

/* Stormy Gas Giant */
.planet-type-11 {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.2), transparent 40%),
        repeating-linear-gradient(-5deg,
            #5e35b1 0px,
            #5e35b1 10px,
            #7e57c2 10px,
            #7e57c2 20px,
            #9575cd 20px,
            #9575cd 30px);
    box-shadow: 0 0 45px rgba(94, 53, 177, 0.7);
}

.planet-type-11::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 60% 45%, rgba(255, 255, 255, 0.4) 8%, transparent 12%),
        radial-gradient(ellipse at 35% 55%, rgba(200, 200, 255, 0.3) 10%, transparent 15%);
    filter: blur(2px);
    z-index: 1;
    animation: stormSwirl 6s linear infinite;
}

@keyframes stormSwirl {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Desert Planet */
.planet-type-12 {
    background: radial-gradient(circle at 30% 30%, #ffcc80, #ff9800, #e65100);
    box-shadow: 0 0 35px rgba(255, 152, 0, 0.6);
}

.planet-type-12::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 25% 35%, rgba(139, 69, 19, 0.3) 12%, transparent 13%),
        radial-gradient(ellipse at 65% 50%, rgba(139, 69, 19, 0.25) 15%, transparent 16%),
        radial-gradient(ellipse at 40% 70%, rgba(139, 69, 19, 0.3) 10%, transparent 11%),
        radial-gradient(ellipse at 80% 30%, rgba(139, 69, 19, 0.2) 8%, transparent 9%);
    filter: none;
    opacity: 0.7;
    z-index: 1;
}

/* Toxic Planet */
.planet-type-13 {
    background: radial-gradient(circle at 30% 30%, #aed581, #7cb342, #558b2f);
    box-shadow: 0 0 40px rgba(124, 179, 66, 0.7);
}

.planet-type-13::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 40% 40%, rgba(205, 220, 57, 0.6) 8%, transparent 12%),
        radial-gradient(ellipse at 60% 60%, rgba(205, 220, 57, 0.5) 12%, transparent 16%),
        radial-gradient(ellipse at 30% 75%, rgba(205, 220, 57, 0.4) 10%, transparent 14%);
    filter: blur(3px);
    z-index: 1;
    opacity: 0.8;
    animation: toxicBubble 5s ease-in-out infinite;
}

@keyframes toxicBubble {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

/* Frozen Tundra Planet */
.planet-type-14 {
    background: radial-gradient(circle at 30% 30%, #ffffff, #b0bec5, #607d8b);
    box-shadow: 0 0 35px rgba(176, 190, 197, 0.6);
}

.planet-type-14::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.6) 50%, transparent 70%),
        radial-gradient(ellipse at 50% 20%, rgba(255, 255, 255, 0.8) 25%, transparent 26%),
        radial-gradient(ellipse at 50% 80%, rgba(255, 255, 255, 0.7) 30%, transparent 31%);
    filter: none;
    z-index: 1;
    opacity: 0.9;
}

/* Earth-like Planet */
.planet-type-15 {
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), transparent 40%),
        radial-gradient(ellipse at 45% 55%, #66bb6a 35%, transparent 36%),
        radial-gradient(ellipse at 70% 40%, #81c784 25%, transparent 26%),
        radial-gradient(circle at 30% 75%, #a5d6a7 20%, transparent 21%),
        radial-gradient(circle at 50% 50%, #42a5f5, #1976d2);
    box-shadow: 0 0 40px rgba(66, 165, 245, 0.6);
}

.planet-type-15::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 35% 45%, rgba(255, 255, 255, 0.9) 8%, transparent 12%),
        radial-gradient(ellipse at 60% 30%, rgba(255, 255, 255, 0.8) 10%, transparent 14%);
    filter: blur(4px);
    z-index: 1;
    opacity: 0.6;
    animation: cloudDrift 10s linear infinite;
}

@keyframes cloudDrift {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(10%);
    }
}