body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #333;
    color: white;
}
#game-container {
    text-align: center;
    position: relative; /* Needed for absolute positioning of children */
}
#lives-counter {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.2em;
    color: #4caf50; /* Green color for lives */
    z-index: 100;
}
#timer {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.2em;
    z-index: 100; /* Ensure it's on top of the canvas */
}
#instructions {
    margin-top: 1em;
}
#restart-button {
    margin-top: 1em;
    padding: 10px 20px;
    font-size: 1.1em;
    cursor: pointer;
    border-radius: 5px;
    border: none;
    background-color: #4caf50;
    color: white;
}
#highscore-modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    color: #333;
}
#highscore-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    border-radius: 10px;
    text-align: center;
}
#highscore-list {
    list-style-type: none;
    padding: 0;
    text-align: left;
}
#highscore-list li {
    font-family: 'Courier New', Courier, monospace;
    padding: 5px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
}
#highscore-list li:last-child {
    border-bottom: none;
}
#close-scores-button {
    margin-top: 1em;
    padding: 10px 20px;
    font-size: 1.1em;
    cursor: pointer;
    border-radius: 5px;
    border: none;
    color: white;
}
#name-input {
    width: 80%; padding: 10px; margin: 10px 0;
}
#submit-score-button {
    padding: 10px 20px;
    font-size: 1.1em;
    cursor: pointer;
    border-radius: 5px;
    border: none;
    background-color: #4caf50;
    color: white;
}
#end-game-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 202; /* On top of everything else */
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7);
    color: #333;
}
#end-game-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    border-radius: 10px;
    text-align: center;
}
#end-game-title {
    font-size: 2em;
    margin-bottom: 1em;
}
#highscore-submission {
    display: none; /* Hidden by default */
    margin-bottom: 1em;
    border-top: 1px solid #ccc;
    padding-top: 1em;
}
#top-controls {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    gap: 10px;
}
#top-controls button {
    padding: 5px 10px;
    background-color: #4caf50;
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}
#pause-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    z-index: 150;
    /* Center text with flexbox */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
/* The "Paused" text itself */
#pause-overlay p {
    font-size: 3em;
    margin: 0;
}
/* The new resume button on the overlay */
#resume-button {
    margin-top: 1em;
    padding: 10px 20px;
    font-size: 1.1em;
    cursor: pointer;
    border-radius: 5px;
    border: none;
    background-color: #4caf50;
    color: white;
}
/* Hide overlay when it doesn't have the 'visible' class */
#pause-overlay:not(.visible) {
    display: none;
}

/* Remove the default blue outline on focused buttons for a cleaner look */
button:focus {
    outline: none;
}