body {
    background-color: #000;
    color: #fff;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

canvas {
    border: 4px solid #333;
    background-color: #000;
}

.ui-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 320px;
    margin-top: 10px;
    font-size: 20px;
    font-weight: bold;
}

.btn {
    background: #222;
    color: #fff;
    border: 1px solid #555;
    padding: 5px 15px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

.btn:hover { background: #444; }

.instructions {
    margin-top: 15px;
    color: #888;
    font-size: 14px;
}

#game-container {
    text-align: center;
    position: relative;
}

/* ECHTES RETRO-POPUP MENÜ */
#menu-container {
    display: none;
    background-color: rgba(10, 10, 10, 0.98) !important;
    border: 4px solid #555 !important;
    padding: 15px !important; /* Von 20px auf 15px verkleinert, um oben/unten Platz zu sparen */
    
    width: 350px !important;       
    height: 370px !important;  
    
    box-sizing: border-box !important;
    text-align: center !important;
    
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 99999 !important; 
    
    /* DIE RADIKALE LÖSUNG: VERBIETET DEN SCROLLBALKEN KOMPLETT */
    overflow: hidden !important; 
}

/* Winzige Anpassung für die Buttons, damit sie nicht klemmen */
.level-btn {
    background: #111;
    color: #fff;
    border: 2px solid #444;
    padding: 10px; /* Von 12px auf 10px verkleinert, spart massig vertikalen Platz! */
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
}

#menu-container h2 {
    margin-top: 0;
    font-size: 22px;
    color: #00a2e8;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

#menu-container p {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 15px;
}

/* Dein perfektes 3x3 Raster ohne Scrollen */
.level-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.level-btn:hover {
    background: #00a651;
    border-color: #fff;
}

.level-btn.active {
    border-color: #00a2e8;
    background: #222;
}

/* DIE PERFEKTE SYSTEMATISCHE NAVIGATION */
#menu-nav-row {
    display: grid !important;
    /* Erstellt ein sauberes Raster: 3 Buttons links, Text in der Mitte, 3 Buttons rechts */
    grid-template-columns: repeat(3, auto) 1fr repeat(3, auto) !important;
    gap: 4px !important;
    align-items: center !important;
    justify-content: center !important;
    margin-top: 15px !important;
    width: 100% !important;
}

/* ALLE PFEILE KOMPAKT UND GLEICHMÄSSIG SCHMAL */
.nav-arrow {
    padding: 6px 4px !important; /* Weniger Innenabstand links/rechts, damit es nicht quetscht */
    font-size: 11px !important;   /* Kompakte, schicke Schriftgröße */
    min-width: 32px !important;   /* Alle Pfeilboxen sind exakt gleich breit */
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* DIE SEITENANZEIGE IN DER MITTE */
#menu-nav-row span {
    font-size: 12px !important;
    font-weight: bold !important;
    color: #00a2e8 !important;
    text-align: center !important;
    white-space: nowrap !important; /* Verhindert, dass der Text umbricht */
    padding: 0 4px !important;
}