* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #000;
    color: white;
    overflow: hidden;
}

.container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

h1 {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: 2em;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    z-index: 10;
}

.controls {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px 30px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.info {
    position: absolute;
    bottom: 30px;
    /* Moved to bottom to avoid control overlap */
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    z-index: 10;
    pointer-events: none;
    /* Allow clicks to pass through */
}

button {
    padding: 10px 20px;
    font-size: 16px;
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #357ABD;
}

label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

input[type="range"] {
    width: 150px;
    cursor: pointer;
}

#speedValue {
    min-width: 30px;
    display: inline-block;
}

#container3d {
    width: 100%;
    height: 100%;
}

#container3d canvas {
    display: block;
    cursor: grab;
}

#container3d canvas:active {
    cursor: grabbing;
}

.planet-info {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
    max-width: 250px;
}

.planet-info h3 {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    color: #4A90E2;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

.instruction {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin-bottom: 10px;
}

#planetList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.planet-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    padding: 5px;
    border-radius: 5px;
    transition: background 0.3s;
    cursor: pointer;
}

.planet-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.planet-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 1.5em;
        top: 10px;
        width: 100%;
        text-align: center;
    }

    .controls {
        top: auto;
        bottom: 20px;
        flex-direction: column;
        width: 90%;
        max-width: 300px;
        gap: 10px;
        padding: 15px;
    }

    .planet-info {
        top: 60px;
        /* Below title */
        right: 10px;
        padding: 10px;
        max-width: 150px;
        max-height: 30vh;
        /* Scrollable if too long */
        overflow-y: auto;
    }

    .planet-info h3 {
        font-size: 1em;
        margin-bottom: 10px;
    }

    .planet-item {
        font-size: 12px;
        padding: 3px;
    }

    .info {
        top: auto;
        bottom: 240px;
        /* Moved higher to clear stacked controls */
        font-size: 12px;
        width: 100%;
        text-align: center;
        pointer-events: none;
    }

    /* Adjust button and range size for touch */
    button {
        padding: 8px 15px;
        font-size: 14px;
    }

    input[type="range"] {
        width: 100px;
    }
}