body {
    margin: 0;
    padding: 0;
    background-color: #111;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #eee;
    user-select: none;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#canvas-container {
    width: 100%;
    height: 100%;
    display: block;
}

canvas { display: block; }

/* Header & HUD */
#gameHeader.hidden, #hud.hidden, #optionsHint.hidden { display: none; }

#gameHeader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
}

h1 {
    margin: 0;
    text-shadow: 2px 2px 0px #000;
    color: #ffcc00; 
    font-style: italic;
    font-size: 2.5em;
}

#headerButtons {
    position: absolute;
    right: 20px;
    pointer-events: auto;
}

button {
    background: #333;
    color: white;
    border: 1px solid #666;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
    transition: background 0.2s;
}
button:hover { background: #555; }
button:active { background: #777; }

.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: 20px;
}

/* Menus */
.menu-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #555;
    padding: 20px 40px;
    border-radius: 8px;
    z-index: 20;
    min-width: 320px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    max-height: 90vh;
    overflow-y: auto;
}
.menu-overlay.hidden { display: none; }

.setting-group {
    background: rgba(255,255,255,0.05);
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}
.setting-group h3 { margin: 0 0 5px 0; font-size: 1rem; color: #ffcc00; }

.setting-row { display: flex; justify-content: space-between; margin: 8px 0; align-items: center; }
.slider-value { width: 30px; text-align: right; color: #ffcc00; }

.section { margin-bottom: 15px; border-bottom: 1px solid #444; }
.section p { color: #aaa; margin: 5px 0; font-weight: bold;}

.info-text { font-size: 0.8em; color: #aaa; margin-top: 5px; font-style: italic;}

input[type="checkbox"] { transform: scale(1.3); cursor: pointer; }

/* Toggle Buttons for Physics */
.toggle-group {
    display: flex;
    gap: 0;
}
.toggle-btn {
    border-radius: 0;
    padding: 5px 10px;
    font-size: 0.9em;
}
.toggle-btn:first-child { border-radius: 4px 0 0 4px; }
.toggle-btn:last-child { border-radius: 0 4px 4px 0; }
.toggle-btn.active {
    background-color: #ffcc00;
    color: #000;
    border-color: #ffcc00;
}

/* HUD */
#hud {
    position: absolute;
    bottom: 20px;
    left: 20px;
    pointer-events: none;
    font-family: monospace;
    font-size: 1.2em;
    text-shadow: 1px 1px 0 #000;
}
#p1Score { color: #ff6666; }
#p2Score { color: #6666ff; }

/* Bottom Left Hint */
.bottom-left-hint {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 0.9em;
    color: rgba(255,255,255,0.5);
    z-index: 10;
    pointer-events: none;
    font-family: monospace;
}
.clickable { cursor: pointer; color: #aaa; text-decoration: underline; }
