:root { 
    color-scheme: light; 
    --primary-blue: #083056;
    --highlight-blue: #69b7ff;
    --border-blue: #4ea7f2;
    --bg-light: #eaf4ff;
}

html, body { 
    height: 100%; 
    margin: 0;
    overflow-x: hidden;
}

body {
    background: #7ec4ff;
    color: var(--primary-blue);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

/* Header Bereich */
.topbar {
    text-align: center;
    padding: 16px 8px;
    background: var(--highlight-blue);
    border-bottom: 2px solid var(--border-blue);
    color: var(--primary-blue);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.topbar h1 { 
    margin: 0; 
    font-size: 24px; 
    letter-spacing: 0.5px; 
    text-transform: uppercase;
}

.subtitle { 
    margin: 6px 0 0; 
    font-size: 14px; 
    opacity: 0.9;
}

/* Hauptbereich mit Spiel */
main { 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 16px;
}

#game {
    width: 960px; 
    max-width: 100%; 
    aspect-ratio: 16 / 9; 
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3); 
    overflow: hidden;
    background: #000; /* Verhindert weißes Blitzen beim Laden */
    border: 4px solid white;
}

/* Steuerung unter dem Spiel */
.levelbar {
    width: 960px; 
    max-width: 100%;
    display: flex; 
    flex-wrap: wrap;
    align-items: center; 
    gap: 12px;
    padding: 10px 0;
}

.levelbar span {
    font-weight: bold;
    font-size: 14px;
}

.levelbar .lvl {
    border: 2px solid var(--border-blue);
    background: var(--bg-light);
    color: var(--primary-blue);
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    outline: none;
}

.levelbar .lvl:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Zusammengeführte Active-Regel */
.levelbar .lvl.active {
    background: var(--primary-blue) !important;
    border-color: var(--primary-blue);
    color: white !important;
    font-weight: bold;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.levelbar .hint {
    margin-left: auto;
    font-size: 13px;
    background: rgba(255,255,255,0.3);
    padding: 4px 10px;
    border-radius: 20px;
}

/* Für kleinere Bildschirme */
@media (max-width: 600px) {
    .levelbar {
        justify-content: center;
    }
    .levelbar .hint {
        margin-left: 0;
        text-align: center;
        width: 100%;
    }
}
