/* Reset van de basis */
body {
    background-color: #111; /* Donkere achtergrond voor de bioscoop-ervaring */
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    display: flex;           /* Flexbox zorgt voor centreren */
    justify-content: center; /* Horizontaal centreren */
    align-items: center;     /* Verticaal centreren */
    overflow: hidden;        /* Geen scrollbalken */
    font-family: 'Press Start 2P', cursive; 
}

/* De Container is de 'lijst' van de game */
#game-container {
    position: relative;
    
    /* STAP 1: Forceer de beeldverhouding (800 / 480 = 5 / 3) */
    aspect-ratio: 800 / 480;

    /* STAP 2: Schaal logica */
    /* Probeer zo hoog mogelijk te zijn (100% van schermhoogte) */
    height: 100vh;
    width: auto; /* Breedte past zich aan op basis van de hoogte + aspect-ratio */

    /* STAP 3: Maar... als we dan breder worden dan het scherm, begrens dan de breedte */
    max-width: 100vw;
    
    /* Schaduw voor diepte */
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

/* Hier voegen we een media-query toe voor als het scherm 'te smal' is (bijv. mobiel portret) */
/* Als het scherm smaller is dan onze game verhouding (5/3), draaien we de logica om */
@media (max-aspect-ratio: 800/480) {
    #game-container {
        width: 100vw; /* Vul de breedte */
        height: auto; /* Pas hoogte aan */
    }
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    /* Cruciaal voor Pixel Art: houdt pixels scherp bij schalen */
    image-rendering: pixelated; 
}

#ui-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

/* ... Rest van je UI styles (Overlay, H1, P, etc.) blijven hetzelfde ... */
.overlay {
    position: absolute;
    width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-shadow: 4px 4px 0 #000;
}

.overlay.hidden { display: none; }
.overlay.active { display: flex; }

h1.title { font-size: 3vw; margin-bottom: 2rem; color: #ffcd00; } /* Gebruik vw units voor schalende tekst */
p { font-size: 1.5vw; }
.controls-hint { margin-top: 50px; font-size: 10px; color: #ccc; }

#screen-hud {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    font-size: 16px; /* Vaste grootte of gebruik 2vw als je wilt dat HUD ook schaalt */
    text-shadow: 2px 2px 0 #000;
}

.blink { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }