:root {
    --bg-dark: #121212;         
    --bg-panel: #1e1e1e;       
    --primary-orange: #ff6600;  
    --primary-hover: #e65c00;   
    --text-main: #e0e0e0;      
    --white: #ffffff;
    --border-radius: 12px;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

html, body {
    /* WICHTIG: Kein flex-center mehr, damit es oben anfängt und Platz hat */
    background-color: var(--bg-dark);
    font-family: 'Segoe UI', sans-serif;
    color: var(--text-main);
    display: block; 
    overflow-y: auto; /* Erlaubt Scrollen nach unten zu den Buttons */
    min-height: 100vh;
}

/* WRAPPER */
#wrapper {
    width: 500px;           /* Nutzt fast die ganze Breite */
    max-width: 1200px;    /* HIER: Ändere diesen Wert für noch mehr Breite */
    margin: 40px auto;    /* Zentriert den Wrapper und gibt oben/unten Platz */
    background: var(--bg-panel);
    border: 3px solid #333;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

/* SCOREBAR */
#scorebar {
    padding: 20px;
    font-size: 24px;
    font-weight: 700;
    background: #252525;
    color: var(--primary-orange);
    text-align: center;
    text-transform: uppercase;
}

/* BEENDEN BUTTON */
.finish-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--primary-orange);
    color: var(--white);
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    text-transform: uppercase;
}

/* SPIELFELD */
#gameCanvas {
    height: 300px;
    width: 100%;
    aspect-ratio: 1 / 1; /* Bleibt ein Quadrat - wird so hoch wie breit! */
    background: #000;
    image-rendering: pixelated;
    display: block;
}

/* STEUERUNG */
#buttons {
    height: fit-content;
    padding:10px;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-top: 2px solid #333;
}

.btn-row {
    display: flex;
}

.ctrl-btn {
    width: 80px;
    height: 50px;
    font-size: 32px;
    background-color: #2a2a2a;
    color: white;
    border: 1px solid #444;
    border-radius: 12px;
    margin: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.ctrl-btn:active {
    background-color: var(--primary-orange);
}

#center {
    width: 80px;
    height: 80px;
    background: transparent;
    border: none;
}

/* MOBILE ANPASSUNG */
@media (max-width: 600px) {
    #wrapper {
        width: 100%;
        margin: 0;
        border-radius: 0;
    }
}