body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #111;
    color: #fff;
    font-family: 'Press Start 2P', monospace; /* Fallback to monospace */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 800px; /* FC 4:3ish aspect ratio but wider */
    max-height: 600px;
    background-color: #000;
    border: 2px solid #444;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated; /* Sharp pixels */
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to canvas/buttons */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#score-board {
    padding: 10px;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.5);
    text-shadow: 1px 1px 0 #000;
}

#start-screen, #game-over-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border: 2px solid #fff;
    pointer-events: auto; /* Enable clicks here */
}

.hidden {
    display: none !important;
}

button {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
    font-family: inherit;
}

button:hover {
    background: #c0392b;
}

/* Mobile Controls */
#mobile-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    height: 100px;
    pointer-events: auto;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    /* Hidden by default on desktop, shown via JS if touch detected or always shown for testing */
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.control-btn:active {
    background: rgba(255, 255, 255, 0.6);
}

#dpad {
    display: flex;
    gap: 20px;
}

#action-pad {
    margin-right: 20px;
}

/* Hide mobile controls on large screens if not touch? We'll handle visibility via JS */
@media (min-width: 1024px) {
    #mobile-controls {
        display: none;
    }
}
