body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px 0;
    background-color: #f0f0f0;
    font-family: 'Arial', sans-serif;
    touch-action: manipulation;
    overflow-x: hidden;
}

#gameContainer {
    position: relative;
    text-align: center;
    border: 2px solid #333;
    box-shadow: 5px 5px 10px rgba(0,0,0,0.2);
    background-color: #ffffff; /* Fallback if canvas/background image fails */
    max-width: 100%;
    /* Set explicit dimensions if canvas isn't filling it,
       but canvas width/height attributes should define this primarily */
    /* width: 800px; */
    /* height: 500px; */
}

#gameTitleArea {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 700px;
    text-align: center;
    z-index: 5;
    color: #333333; /* CHANGE IF YOUR BACKGROUND IS DARK */
    pointer-events: none;
}

#gameTitleArea h1 {
    font-size: 28px;
    margin-bottom: 5px;
    font-weight: bold;
    /* text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.7); /* Optional for readability */
}

#gameTitleArea .subtitle {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 5px;
}

#gameTitleArea .highscore {
    font-size: 16px;
    color: #444444; /* CHANGE IF YOUR BACKGROUND IS DARK */
    margin-top: 0;
}

#gameCanvas {
    display: block; /* Removes extra space below canvas if container doesn't have explicit size */
    /* background-color: transparent; /* Ensure canvas itself is transparent if background is set on gameContainer or via JS draw */
}

#scoreDisplay {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 20px;
    color: #333;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 10;
}

#gameOverMessage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(240, 240, 240, 0.95);
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    text-align: center;
    z-index: 20;
}

#gameOverMessage h2 {
    margin-top: 0;
    color: #d9534f;
}

#restartButton {
    padding: 10px 20px;
    font-size: 16px;
    color: white;
    background-color: #5cb85c;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.2s;
}

#restartButton:hover {
    background-color: #4cae4c;
}