body {
    background-color: #111;
    color: #fff;
    font-family: monospace;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 10px 0;
    box-sizing: border-box;
}

#game-container {
    position: relative;
}

#game-canvas {
    /* Geregeld via inline CSS van de viewport */
}

#ui-panel {
    background-color: #222;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 4px solid #555;
}

#stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-weight: bold;
    color: #0f0;
    background: #111;
    padding: 8px;
    border-radius: 4px;
    font-size: 16px;
    border: 1px solid #333;
}

#skills-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    flex-grow: 1;
}

/* Zodra het scherm smaller wordt en knoppen normaal lelijk zouden stacken,
   dwingen we ze in 2 rijen die van links naar rechts in kolommen (boven/onder) vullen */
@media (max-width: 1050px) {
    #skills-panel {
        display: grid;
        grid-template-rows: 1fr 1fr;
        grid-template-columns: repeat(5, auto);
        grid-auto-flow: column;
        justify-content: center;
    }
}

.skill-btn {
    background-color: #222;
    color: #fff;
    border: 2px solid #444;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-family: monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: auto;
    min-height: 88px;
    gap: 4px;
}

.skill-btn:hover { background-color: #444; }
.skill-btn.selected { background-color: #050; border-color: #0f0; }

.skill-icon {
    width: 32px;
    height: 56px;
    background-size: 256px 672px; /* Opschaling van het 128x336 sprite-vel */
    background-repeat: no-repeat;
    image-rendering: pixelated;
    pointer-events: none;
}

.icon-climber { background-position: 0px -448px; }
.icon-floater { background-position: 0px -112px; }
.icon-bomber  { background-position: 0px -616px; } /* Gebruikt unieke UI Iconen rij (11) */
.icon-blocker { background-position: 0px -168px; }
.icon-builder { background-position: 0px -280px; }
.icon-basher  { background-position: 0px -336px; }
.icon-miner   { background-position: -64px -392px; } /* Frame offset naar moment dat pikhouweel omhoog staat! */
.icon-digger  { background-position: 0px -224px; }
.icon-nuke    { background-position: -32px -616px; } /* Frame 2 van de UI ICONS (Rij 11) */
.icon-width   { background-position: -64px -616px; } /* Frame 3 */
.icon-lemmings{ background-position: -96px -616px; } /* Frame 4 */
.icon-rate    { background-position: -128px -616px; } /* Frame 5 */
.icon-time    { background-position: -160px -616px; } /* Frame 6 */
.icon-target  { background-position: -192px -616px; } /* Frame 7 */

.skill-count {
    font-size: 14px;
    font-weight: bold;
    pointer-events: none;
}

#controls-panel {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 5px;
    align-items: flex-start;
}

#controls-panel > * {
    min-height: 88px;
    box-sizing: border-box;
}

#controls-panel button {
    background-color: #333;
    color: #fff;
    border: 2px solid #555;
    cursor: pointer;
    font-family: monospace;
    border-radius: 4px;
}

#controls-panel button:hover { background-color: #555; }

#btn-nuke {
    background-color: #311;
    color: #fff;
    border: 2px solid #822;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-family: monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: auto;
    min-height: 88px;
    gap: 4px;
}
#btn-nuke:hover { background-color: #511; border-color: #f00; }

#btn-fast-forward, #btn-pause, #btn-restart, #btn-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 65px;
    padding: 4px;
    font-size: 12px;
}

.editor-skill-input {
    width: 40px;
    background: #222;
    color: #FFF;
    border: 1px solid #555;
    text-align: center;
    border-radius: 3px;
    padding: 2px;
    font-family: monospace;
    font-size: 12px;
}
.editor-skill-input:focus { border-color: #0F0; outline: none; }

#editor-panel {
    background-color: #222;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-top: 4px solid #555;
}

.editor-btn {
    background-color: #444;
    color: #fff;
    border: 2px solid #777;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
    font-family: monospace;
    transition: all 0.1s ease-in-out;
}

.editor-btn:hover { background-color: #666; }

.editor-btn.selected { 
    background-color: #0A0 !important; 
    border-color: #0f0 !important; 
    color: #FFF !important;
}
