body {
    margin: 0;
    padding: 0;
    background-color: #0f0f13;
    color: #00ffcc;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
}

#ui-layer {
    position: absolute;
    z-index: 10;
    background: rgba(15, 15, 19, 0.95);
    /* Mobile-friendly width but expands on desktop */
    width: 90%;
    max-width: 500px; 
    padding: 30px;
    border: 2px solid #00ffcc;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 255, 204, 0.2);
    /* Centers it perfectly regardless of body flex */
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
    backdrop-filter: blur(10px); /* Makes the game behind the menu look frosted */
    -webkit-backdrop-filter: blur(10px);
}

h1 {
    font-size: 24px; 
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 10px #00ffcc;
}

#statusMessage {
    color: #ff0055;
    text-shadow: 0 0 10px #ff0055;
    min-height: 30px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

#highScoresPanel {
    width: 100%; /* Take up full width of the parent */
    max-width: 420px;
    margin: 0 auto 20px auto;
    text-align: left;
    border: 1px solid rgba(0, 255, 204, 0.35);
    border-radius: 8px;
    padding: 12px 16px;
    background: rgba(0, 255, 204, 0.04);
    box-sizing: border-box; /* Ensures padding doesn't break width */
}

#highScoresTitle {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

#highScoresList {
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.5;
    font-weight: bold;
    color: #00ffcc;
}

.highScoreHighlight {
    color: #0f0f13;
    background: #ff0055;
    padding: 2px 6px;
    border-radius: 6px;
    box-shadow: 0 0 18px rgba(255, 0, 85, 0.35);
}

select, button {
    background: #1a1a24;
    color: #00ffcc;
    border: 1px solid #00ffcc;
    padding: 10px 20px;
    font-size: 16px;
    margin: 10px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

button:hover {
    background: #00ffcc;
    color: #0f0f13;
    box-shadow: 0 0 15px #00ffcc;
}

canvas {
    display: none;
}

* {
    -webkit-tap-highlight-color: transparent;
    touch-action: none; /* Crucial: stops the browser from handling scrolls/zooms */
}

/* Adjustments for very small screens */
@media (max-width: 480px) {
    #ui-layer {
        padding: 20px;
    }
    h1 {
        font-size: 24px;
        letter-spacing: 2px;
    }
}