body {
    margin: 0;
    overflow: hidden; /* Prevent scrollbars */
}

canvas {
    display: block; /* Remove extra space below canvas */
    position: absolute; /* Ensure canvas covers full screen, menu overlays */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Canvas is behind the menu */
}

#menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 250px; /* Default desktop width */
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent background */
    color: white;
    padding: 20px;
    box-sizing: border-box; /* Include padding in width/height */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    z-index: 1; /* Menu is on top of the canvas */
    pointer-events: auto; /* Allow mouse interactions with menu */
    display: flex;
    flex-direction: column;
}

#menu h1 {
    color: #4CAF50; /* A nice green for the title */
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

#menu p {
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #cccccc;
}

#menu ul {
    list-style-type: none;
    padding: 0;
}

#menu li {
    margin-bottom: 5px;
    font-size: 0.85em;
    color: #eeeeee;
}

#tab-controls {
    display: flex;
    margin-bottom: 15px;
}

.tab-button {
    flex: 1;
    padding: 10px 5px;
    border: none;
    background-color: #333;
    color: white;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
    border-bottom: 2px solid transparent;
}

.tab-button:hover {
    background-color: #555;
}

.tab-button.active {
    background-color: #222;
    border-bottom: 2px solid #4CAF50;
}

.tab-content {
    display: none; /* Hidden by default */
    flex-grow: 1; /* Allow content to take available space */
    overflow-y: auto; /* Enable scrolling for content if needed */
    padding-right: 10px; /* Space for scrollbar */
}

.tab-content.active {
    display: block;
}

#destruction-controls {
    padding-top: 15px;
}

#destruction-controls h2,
#creation-controls h2,
#time-controls h2 {
    color: #FF6347; /* A red-orange for destruction, consistent for creation header */
    margin-bottom: 15px;
    font-size: 1.1em;
}

#destruction-controls select,
#destruction-controls button,
#creation-controls input[type="text"],
#creation-controls input[type="number"],
#creation-controls input[type="color"],
#creation-controls button {
    width: calc(100% - 10px);
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    border: 1px solid #555;
    background-color: #333;
    color: white;
    font-size: 0.9em;
    cursor: pointer;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
}

#destruction-controls button,
#creation-controls button {
    background-color: #FF4500; /* Orange-red for the button */
    border-color: #FF4500;
}

#destruction-controls button:hover,
#creation-controls button:hover {
    background-color: #E03C00;
}

/* Style for the new Big Bang button */
#bigBangButton {
    background-color: #8B0000; /* Dark Red */
    border-color: #8B0000;
    margin-top: 15px; /* Add some space above it */
}

#bigBangButton:hover {
    background-color: #CC0000; /* Brighter red on hover */
}

.separator {
    width: 100%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.2);
    margin: 20px 0;
}

#creation-controls .input-group {
    margin-bottom: 10px;
}

#creation-controls label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.85em;
    color: #eeeeee;
}

#creation-controls input[type="color"] {
    padding: 5px; /* Adjust padding for color input */
    height: 38px; /* Standard height */
    cursor: pointer;
}

/* NEW: Time Controls specific styles */
#time-controls {
    padding-top: 15px;
    text-align: center;
}

#time-controls p {
    margin-bottom: 20px;
}

.time-control-buttons {
    display: flex;
    justify-content: center;
    gap: 20px; /* Space between buttons */
    margin-top: 20px;
}

.time-control-button {
    background-color: rgba(76, 175, 80, 0.8); /* Green, semi-transparent */
    color: white;
    border: none;
    border-radius: 8px; /* Slightly larger radius */
    width: 60px; /* Larger buttons for easier tapping */
    height: 60px;
    font-size: 2.5em; /* Larger font for symbols */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5); /* More prominent shadow */
}

.time-control-button:hover {
    background-color: rgba(69, 160, 73, 0.9);
    transform: translateY(-2px);
}

.time-control-button:active {
    background-color: rgba(62, 142, 65, 1);
    transform: translateY(0);
}

#pauseScreen {
    display: none; /* Hidden by default */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Dark overlay */
    z-index: 10; /* On top of everything */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.pause-content {
    background-color: rgba(30, 30, 30, 0.9);
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    color: white;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5); /* Green glow effect */
}

.pause-content h2 {
    color: #4CAF50;
    margin-bottom: 25px;
    font-size: 2em;
}

.pause-content button {
    background-color: #4CAF50;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.pause-content button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.pause-content button:active {
    background-color: #3e8e41;
    transform: translateY(0);
}

#planetInfo {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 300px; /* Adjusted width */
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent background */
    color: white;
    padding: 15px;
    margin: 15px; /* Spacing from edges */
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    z-index: 1; /* On top of canvas, below pause screen */
    border-radius: 8px;
    pointer-events: auto; /* Changed to auto to allow clicks on planet names */
}

#planetInfo p {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    color: #cccccc;
}

#planetInfo h3 {
    margin: 0 0 10px 0;
    color: #4CAF50;
    font-size: 1.1em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 5px;
}

#planetInfo ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    max-height: 250px; /* Increased max-height */
    overflow-y: auto;
}

#planetInfo li {
    margin-bottom: 3px;
    font-size: 0.8em;
    color: #eeeeee;
}

#planetInfo li.clickable-celestial-body {
    cursor: pointer; /* Indicate that these items are clickable */
    transition: color 0.2s ease;
}

#planetInfo li.clickable-celestial-body:hover {
    color: #4CAF50; /* Highlight on hover */
}

#planetInfo li.non-clickable-body {
    cursor: default; /* Ensure no pointer cursor */
    color: #eeeeee; /* Default color for non-clickable */
}

#planetInfo li.currently-following {
    font-weight: bold;
    color: #00FF00; /* Bright green to indicate selected/followed */
}

.menu-button {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    border: 1px solid #555;
    background-color: #333;
    color: white;
    cursor: pointer;
    font-size: 0.9em;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
}
.menu-button:hover {
    background-color: #555;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #menu {
        width: 100%;
        height: auto; /* Allow content to dictate height */
        top: 0;
        left: 0;
        padding: 10px; /* Reduce padding for mobile */
        font-size: 0.8em; /* Smaller font */
        background-color: rgba(0, 0, 0, 0.85); /* Slightly less transparent */
        max-height: 50vh; /* Limit height to half viewport height */
        overflow-y: auto; /* Enable scrolling for content if needed */
        border-radius: 0;
    }

    #menu h1 {
        font-size: 1.5em; /* Adjust header size */
        margin-bottom: 10px;
    }
    #menu p, #menu li {
        font-size: 0.7em;
    }

    #tab-controls {
        flex-wrap: wrap; /* Allow buttons to wrap */
    }
    .tab-button {
        padding: 8px 3px; /* Smaller padding */
        font-size: 0.8em;
    }
    .tab-content {
        padding-right: 5px; /* Adjust for scrollbar */
    }
    #destruction-controls select,
    #destruction-controls button,
    #creation-controls input[type="text"],
    #creation-controls input[type="number"],
    #creation-controls input[type="color"],
    #creation-controls button {
        width: 100%; /* Ensure full width within adjusted padding */
        padding: 8px; /* Smaller padding */
        font-size: 0.8em;
    }
    #creation-controls input[type="color"] {
        height: 34px; /* Adjust height */
    }

    #planetInfo {
        width: 100%;
        height: auto; /* Allow content to dictate height */
        bottom: 0;
        right: 0;
        left: 0; /* Ensure it spans full width */
        margin: 0; /* Remove margin from edges */
        padding: 10px; /* Reduce padding */
        font-size: 0.8em; /* Smaller font */
        background-color: rgba(0, 0, 0, 0.85); /* Slightly less transparent */
        max-height: 50vh; /* Limit height to half viewport height */
        overflow-y: auto; /* Enable scrolling for body list */
        border-radius: 0; /* No border radius on full-width panels */
    }

    #planetInfo h3 {
        font-size: 1em;
        margin: 0 0 5px 0; /* Adjusted margin */
    }
    #planetInfo p {
        margin: 0 0 5px 0; /* Adjusted margin */
    }
    #planetInfo ul {
        max-height: 150px; /* Smaller max height for body list on mobile */
    }
    #planetInfo li {
        font-size: 0.7em;
    }

    /* Adjust pause screen for mobile */
    .pause-content {
        padding: 20px;
        font-size: 0.9em;
    }
    .pause-content h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }
    .pause-content button {
        padding: 10px 20px;
        font-size: 0.9em;
        margin: 5px; /* Add some margin between buttons */
    }

    .menu-button {
        padding: 8px;
        font-size: 0.8em;
    }

    /* Time controls in tab on mobile */
    .time-control-button {
        width: 50px; /* Adjust size for mobile */
        height: 50px;
        font-size: 2em; /* Adjust font size for mobile */
        border-radius: 6px;
    }

    .time-control-buttons {
        gap: 10px; /* Adjust gap for mobile */
    }
}