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

body {
    overflow: hidden;
    background: #1a1209;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

#renderContainer {
    position: fixed;
    inset: 0;
    cursor: crosshair;
}

#renderContainer canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* HUD */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    z-index: 5;
}

#hud.hidden {
    display: none;
}

#hudScores {
    font-size: 22px;
    font-weight: bold;
    display: flex;
    gap: 12px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.7);
}

.hud-player { color: #a8c8e8; }
.hud-bot { color: #e8c8a0; }
.hud-sep { color: #f0e6d3; }

#hudBoules {
    display: flex;
    gap: 24px;
}

.hud-boules-row {
    display: flex;
    gap: 6px;
}

.hud-boule-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.hud-boule-dot.player { background: #4a7a9b; }
.hud-boule-dot.player.used { background: #333; }
.hud-boule-dot.bot { background: #9b6a3a; }
.hud-boule-dot.bot.used { background: #333; }

#hudTurn {
    font-size: 14px;
    color: #c4b69c;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

#hudRoundPoints {
    font-size: 18px;
    font-weight: bold;
    padding: 4px 16px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
    margin-top: 2px;
}

#hudRoundPoints.hidden {
    display: none;
}

/* Power bar */
#powerBar {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 5;
    pointer-events: none;
}

#powerBar.hidden {
    display: none;
}

#powerBarLabel, #powerBarValue {
    font-size: 12px;
    color: #f0e6d3;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

#powerBarTrack {
    width: 20px;
    height: 200px;
    background: rgba(0,0,0,0.5);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.15);
}

#powerBarFill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0%;
    background: linear-gradient(to top, #32cd32, #ffa500, #ff3333);
    border-radius: 0 0 3px 3px;
    transition: height 0.05s;
}

/* Elevation indicator */
#elevationIndicator {
    position: fixed;
    right: 30px;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 5;
    pointer-events: none;
}

#elevationIndicator.hidden {
    display: none;
}

#elevationLabel, #elevationValue {
    font-size: 12px;
    color: #f0e6d3;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

/* Overlays */
.overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    color: #f0e6d3;
    padding: 40px 60px;
    background: rgba(42, 31, 20, 0.95);
    border-radius: 16px;
    border: 2px solid #8b7355;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.overlay-content h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    color: #d4a853;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.overlay-content h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #d4a853;
}

.overlay-content p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #c4b69c;
}

.btn {
    padding: 14px 40px;
    font-size: 1.2rem;
    border: 2px solid #d4a853;
    background: transparent;
    color: #d4a853;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 2px;
    pointer-events: auto;
}

.btn:hover {
    background: #d4a853;
    color: #2a1f14;
}

/* Menu buttons */
#menuButtons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.btn-multi {
    border-color: #5ba8d4;
    color: #5ba8d4;
}

.btn-multi:hover {
    background: #5ba8d4;
    color: #2a1f14;
}

/* Multi menu */
#multiMenu {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    margin-top: 10px;
}

#multiMenu.hidden {
    display: none;
}

.btn-small {
    padding: 10px 28px;
    font-size: 1rem;
    letter-spacing: 1px;
}

#joinSection {
    display: flex;
    gap: 10px;
    align-items: center;
}

.room-input {
    width: 100px;
    padding: 10px 12px;
    font-size: 1.3rem;
    text-align: center;
    text-transform: uppercase;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid #8b7355;
    border-radius: 8px;
    color: #f0e6d3;
    letter-spacing: 4px;
    outline: none;
}

.room-input::placeholder {
    color: #6b5a4a;
    letter-spacing: 4px;
}

.room-input:focus {
    border-color: #d4a853;
}

.btn-back {
    padding: 8px 24px;
    font-size: 0.85rem;
    border-color: #8b7355;
    color: #8b7355;
    margin-top: 4px;
}

.btn-back:hover {
    background: #8b7355;
    color: #2a1f14;
}

/* Waiting room */
#waitingRoom {
    margin-top: 10px;
}

#waitingRoom.hidden {
    display: none;
}

.room-code {
    font-size: 3rem !important;
    font-family: monospace;
    letter-spacing: 8px;
    color: #d4a853 !important;
    font-weight: bold;
    margin-bottom: 10px !important;
}

@media (max-width: 600px) {
    .overlay-content {
        padding: 30px 24px;
        margin: 16px;
    }

    .overlay-content h1 {
        font-size: 2rem;
    }

    .btn {
        min-height: 48px;
        padding: 12px 32px;
    }
}
