* {
    box-sizing: border-box;
}

:root {
    --border-thick: 3px solid black;
    --border-thin: 2px solid black;
    --radius: 5px; /* Leicht abgerundet wie handgezeichnet */
}

body {
    font-family: 'Courier New', Courier, monospace; /* Schreibmaschinen-Look */
    background-color: white;
    color: black;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 400px; /* Smartphone Breite simulieren */
    border: var(--border-thick);
    padding: 15px;
    box-sizing: border-box;
    position: relative;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
}

/* Typografie */
h1, h2, h3 { margin-top: 0; text-transform: uppercase; }

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border: var(--border-thin);
    background: white;
    font-size: 1.1rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    color: black;
    font-weight: bold;
    box-sizing: border-box;
}

.btn:active { background: black; color: white; }

/* Menü Layout (Candy Crush Style) */
.level-tree {
    display: flex;
    flex-direction: column-reverse; /* Level 1 unten */
    gap: 20px;
    margin-top: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.level-node {
    border: var(--border-thin);
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Frage Ansicht */
.progress-bar-container {
    width: 100%;
    border: 2px solid black;
    height: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}
.progress-fill {
    background-color: black;
    height: 100%;
}

.answer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Header Icons */
.header-icons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
}

.icon-btn {
    border: var(--border-thin);
    text-decoration: none;
    color: black;
    font-weight: bold;
    /* Feste, quadratische Größe */
    width: 40px;
    height: 40px;
    /* Inhalt (Bild oder Text) exakt zentrieren */
    display: flex;
    justify-content: center;
    align-items: center;
    /* Kein Padding mehr, da wir feste Größe haben */
    padding: 0;
    background: white; /* Wichtig für den "aktiven" Zustand */
}

/* Bilder im Button anpassen */
.icon-btn img {
    max-width: 80%; /* Etwas Platz zum Rand lassen */
    max-height: 80%;
    object-fit: contain;
}

/* Level-Container: Dreht die Reihenfolge um */
.level-tree {
    display: flex;
    flex-direction: column-reverse; /* Das unterste Element im HTML wird oben angezeigt */
    gap: 15px;
    margin-top: 20px;
    overflow-y: auto;
    flex-grow: 1;
    padding-bottom: 10px; /* Abstand zum unteren Rand */
}

/* Gesperrte Level: Ausgrauen und Klicks verhindern */
.level-node.locked {
    opacity: 0.6;             /* Halb-transparent */
    background-color: #f0f0f0; /* Hellgrauer Hintergrund */
    color: #888 !important;    /* Grauer Text */
    border-color: #aaa;       /* Grauer Rahmen */
    pointer-events: none;     /* Verhindert Klicks komplett */
    cursor: default;          /* Zeigt normalen Mauszeiger */
}

.explanation-box {
    border-left: 4px solid black; /* Der schwarze Balken links */
    padding: 10px;
    margin: 20px 0;

    /* Scroll-Logik */
    max-height: 350px; /* Maximale Höhe der Box (ca. halber Bildschirm am Handy) */
    overflow-y: auto;  /* Scrollbalken anzeigen, wenn Text länger ist */
    background-color: #f9f9f9; /* Ganz leichtes Grau, um den Bereich abzuheben (optional) */
}

.explanation-box::-webkit-scrollbar {
    width: 8px;
}
.explanation-box::-webkit-scrollbar-track {
    background: #fff;
}
.explanation-box::-webkit-scrollbar-thumb {
    background: #000;
    border-radius: 4px;
}