body {
    margin: 0;
    overflow: hidden;
    background-color: #000000; /* Solid black background */
}

canvas {
    display: block;
    position: absolute; /* Ensure canvas is positioned for z-index to work */
    z-index: 0; /* Place canvas behind controls */
}

.controls {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
    color: white;
    font-family: sans-serif;
    z-index: 1; /* Place controls above canvas */
}

.controls label,
.controls input {
    vertical-align: middle;
    margin-right: 5px;
}

.tooltip {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    pointer-events: none; /* Allows clicks to pass through */
    opacity: 0;
    transition: opacity 0.2s;
    font-family: sans-serif;
    font-size: 14px;
    max-width: 200px; /* Limit width for better readability */
    text-align: left;
    z-index: 1; /* Place tooltip above canvas */
}

.simulation-time-display {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
    color: white;
    font-family: sans-serif;
    font-size: 16px;
    text-align: center;
    z-index: 1; /* Place time display above canvas */
}

/* Starry background */
.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: -1; /* Place stars behind everything */
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle linear infinite;
}

.shooting-star {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0) 100%);
    border-radius: 50%;
    transform: rotate(45deg); /* Angle of the tail */
    opacity: 0;
    pointer-events: none;
}

.attribution {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-family: sans-serif;
    font-size: 12px;
    text-align: center;
    z-index: 1;
}

.attribution a {
    color: #99ccff;
    text-decoration: none;
}

.attribution a:hover {
    text-decoration: underline;
}

@keyframes twinkle {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}