body {
    background-color: black; /* Fallback color */
    margin: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* Starfield image background */
    background-image: url("images/starfield.jpg"); /* Path to your image */
    background-size: cover; /* Cover the entire background */
    background-position: center center; /* Center the image */
    background-repeat: no-repeat; /* Prevent tiling */
}

h1 {
    color: white;
    font-size: 3em;
    text-align: center;
    margin-bottom: 20px;
    font-family: sans-serif;
}

.constellation {
    position: relative;
    width: 80vw;
    height: 80vh;
    max-width: 800px;
    max-height: 600px;
}

.star {
    position: absolute;
    animation: twinkle 2s infinite alternate;
    display: block;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes twinkle {
    0% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

.star img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
    transition: filter 0.3s ease;
}

.star-name {
    color: white;
    font-size: 12px;
    margin-top: 5px;
    text-align: center;
    pointer-events: none;
}

.glowing img {
    animation: glow 5s infinite alternate;
}

.star:hover {
    transform: scale(1.2);
    z-index: 2;
}

.star:hover .glowing img,
.star:hover img {
    animation: glowHover 2s infinite alternate;
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 1));
}

@keyframes glow {
    0% {
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0));
    }

    50% {
        filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
    }

    100% {
        filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8));
    }
}

@keyframes glowHover {
    0% {
        filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0));
    }

    50% {
        filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.7));
    }

    100% {
        filter: drop-shadow(0 0 25px rgba(255, 255, 255, 1));
    }
}

.star:hover::after {
    content: attr(data-name);
    position: absolute;
    top: -20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.8);
    color: black;
    padding: 5px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 1;
}

.lines {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.lines line {
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 1;
}

/* Media queries for smaller screens */
@media (max-width: 768px) {
    h1 {
        font-size: 2em;
        margin-bottom: 10px;
    }

    .constellation {
        width: 90vw;
        height: 70vh;
    }

    .star {
        /* Adjust star sizes if needed */
    }

    .star-name {
        font-size: 10px;
    }

    .star:hover::after {
        font-size: 12px;
    }
}

/* Further adjustments for very small screens */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }

    .constellation {
        height: 60vh;
    }
}