html, body {
    margin: 0;
    padding: 0;
    background: #000b0d; /* Matching your Sea of Space theme */
    overflow: hidden;
    /* This centers the canvas container */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

canvas {
    display: block;
    background: radial-gradient(circle, #001f24 0%, #00050a 100%);
    image-rendering: pixelated;
    
    /* Fixed game resolution centered on screen */
    width: 1920px;
    height: 1080px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
    border: 2px solid #1a3c40;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* menu overlay styles */
#menuOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(40,0,60,0.85); /* semi-transparent dark purple */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #0ff;
    font-family: 'Press Start 2P', cursive;
    text-align: center;
    z-index: 10;
}

#menuTitle {
    font-size: 2.5rem;
    color: #0ff;
    text-shadow: 0 0 10px #0ff, 0 0 20px #0ff;
    animation: floatTitle 2s ease-in-out infinite;
}

#launchBtn {
    margin: 20px 0;
    padding: 10px 20px;
    background: transparent;
    border: 2px solid #0ff;
    color: #0ff;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    transition: background 0.3s, color 0.3s;
}

#launchBtn:hover {
    background: #0ff;
    color: #000;
}

#menuInstructions {
    font-size: 0.75rem;
    margin-top: 10px;
    color: #0ff;
}

@keyframes floatTitle {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* settings button */
#settingsBtn {
    margin: 10px 0;
    padding: 10px 20px;
    background: transparent;
    border: 2px solid #0ff;
    color: #0ff;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    transition: background 0.3s, color 0.3s;
}

#settingsBtn:hover {
    background: #0ff;
    color: #000;
}

/* settings panel overlay */
#settingsPanel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 20, 30, 0.95); /* Deep space blue */
    display: none; /* Hidden by default */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#settingsContent {
    background: rgba(40, 0, 60, 0.95);
    border: 3px solid #0ff;
    padding: 40px;
    border-radius: 5px;
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    color: #0ff;
}

#settingsTitle {
    font-size: 2rem;
    margin-bottom: 30px;
    text-shadow: 0 0 10px #0ff;
}

#volumeControl {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#volumeControl label {
    font-size: 1rem;
}

#volumeSlider {
    width: 200px;
    height: 10px;
    cursor: pointer;
    accent-color: #0ff;
}

#volumeValue {
    font-size: 0.9rem;
    color: #0ff;
}

#closeSettingsBtn {
    margin-top: 30px;
    padding: 10px 20px;
    background: transparent;
    border: 2px solid #0ff;
    color: #0ff;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    transition: background 0.3s, color 0.3s;
}

#closeSettingsBtn:hover {
    background: #0ff;
    color: #000;
}

/* pause menu styles */
/* Update these sections in style.css */
/* Ensure Settings Panel is on top of the Pause Menu */
#settingsPanel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 20, 30, 0.98); /* Slightly more opaque */
    display: none; 
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100; /* Higher than #pauseMenu's 50 */
}

#pauseMenu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 5, 10, 0.8);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

#pauseContent {
    background: #0a0a0a;
    border: 3px solid #0ff; /* Dynamic via JS */
    padding: 30px 40px;
    border-radius: 5px;
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    color: #fff;
    min-width: 300px;
}

#pauseTitle {
    font-size: 1.8rem;
    margin-bottom: 25px;
    text-shadow: 0 0 10px #0ff;
}

#pauseContent button {
    display: block;
    width: 100%;
    margin: 10px 0;
    padding: 12px 20px;
    background: transparent;
    border: 2px solid #0ff;
    color: #0ff;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.75rem;
    transition: background 0.3s, color 0.3s;
}

#pauseContent button:hover {
    background: #0ff;
    color: #000;
}

#levelSelectorPanel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 5, 10, 0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 150;
}

#levelList {
    width: 400px;
    max-height: 60vh;
    overflow-y: auto;
    margin: 20px 0;
    padding: 20px;
    border: 2px solid #333;
    background: rgba(255, 255, 255, 0.05);
}

.level-item {
    padding: 15px;
    margin: 10px 0;
    border: 2px solid transparent;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    text-align: left;
    transition: 0.2s;
}

.level-item.locked {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #444 !important;
}

.level-item:not(.locked):hover {
    filter: brightness(1.3);
    border-color: #fff;
}