/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');

/* --- Grund-Setup & Farben --- */
:root {
    --dark-blue: #003659;
    --light-blue: #e5eef4;
    --red-wrong: #c10e17;
    --green-correct: #28a745;
    --white: #ffffff;
}

body {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400; /* Regular */
    /* color:background-color: var(--light-blue);*/
    var(--dark-blue);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

/* --- Allgemeiner Container-Stil --- */
#welcome-container, #quiz-container {
    width: 90%;
    max-width: 960px;
    background-color: var(--white);
    border-radius: 20px;
    padding: 40px;
    /*box-shadow: 0 10px 40px rgba(0, 54, 89, 0.1);*/
    text-align: center; 
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700; /* Bold */
    color: var(--dark-blue);
}
h1 { font-size: 2.5em; margin-top: 0; }
h2 { font-size: 2em; margin-top: 40px; border-top: 2px solid var(--light-blue); padding-top: 30px; }
h3 { font-size: 1.5em; }

/* --- Willkommens-Bildschirm Stile --- */
.intro-text {
    font-size: 1.2em;
    line-height: 1.6;
    max-width: 600px;
    margin: 15px auto 30px auto;
}
.mode-selection {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 20px;
}
.mode-box {
    border: 2px solid var(--light-blue);
    border-radius: 15px;
    padding: 25px;
    text-align: left;
}
.mode-box p { font-size: 1.1em; line-height: 1.6; }
.mode-box button { margin-top: 15px; }

/* --- Allgemeiner Button-Style --- */
button {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    background: var(--dark-blue);
    color: var(--white);
    padding: 18px 30px;
    border-radius: 33px;
    border: none;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 54, 89, 0.2);
}
button.button-secondary {
    background: none;
    color: var(--dark-blue);
    border: 2px solid var(--dark-blue);
}
button.button-secondary:hover {
    background: var(--light-blue);
    box-shadow: none;
    transform: translateY(-2px);
}

/* --- Quiz-Header --- */
#quiz-header {
    display: flex;
    flex-wrap: wrap; /* Für kleine Bildschirme */
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--light-blue);
    gap: 15px; /* Abstand zwischen Titel und Nav */
}
#quiz-header h2 {
    margin: 0;
    font-size: 1.8em;
    text-align: left; 
    flex-grow: 1; /* Sorgt dafür, dass der Titel den Platz einnimmt */
}
#quiz-header nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    flex-shrink: 0; /* Verhindert, dass Buttons unschön gestaucht werden */
}
#quiz-header nav button {
    padding: 12px 24px; /* Etwas kompakter */
    font-size: 0.9em;
    font-weight: 700;
}

/* --- Spiel-Steuerung --- */
#game-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

/* --- Punktestand --- */
#score-counter {
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--dark-blue);
}

/* --- Errungenschaftsleiste --- */
#achievement-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin-bottom: 25px;
    min-height: 30px; /* Verhindert Springen des Layouts */
    font-size: 1.5em; /* Macht Emojis größer */
}

/* --- Die Karte (Frage & Antwort-Optionen) --- */
#card {
    background-color: #fdfdfd;
    border: 1px solid var(--light-blue);
    border-radius: 15px;
    padding: 35px;
    margin-bottom: 30px;
}

/* --- Aufgabenstellung pro Karte --- */
#task-reminder {
    font-size: 0.9em;
    font-style: italic;
    color: #555;
    margin-top: -15px;
    margin-bottom: 20px;
}

#question-area {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 30px;
}

/* --- Antwort-Optionen (Buttons) --- */
#options-area { display: flex; flex-direction: column; gap: 15px; }
#options-area button {
    background: var(--white);
    color: var(--dark-blue);
    border: 2px solid var(--dark-blue);
    width: 100%;
    text-align: left;
    padding: 20px 25px;
    font-weight: 400;
}
#options-area button:hover {
    background-color: var(--light-blue);
    transform: translateY(-2px);
    box-shadow: none;
}
#options-area button.correct {
    background: var(--green-correct);
    border-color: var(--green-correct);
    color: var(--white);
    font-weight: 700;
}
#options-area button.wrong {
    background: var(--red-wrong);
    border-color: var(--red-wrong);
    color: var(--white);
    font-weight: 700;
}
#options-area button:disabled { opacity: 0.7; cursor: not-allowed; }
#options-area button:disabled:hover { transform: none; background-color: inherit; }
#options-area button.correct:disabled { background: var(--green-correct); opacity: 1; }
#options-area button.wrong:disabled { background: var(--red-wrong); opacity: 1; }

/* --- Auflösungs-Bereich ("Gewendete Karte") --- */
#answer-area {
    margin-top: 20px;
    padding: 30px;
    background-color: var(--light-blue);
    border-radius: 15px;
    text-align: left;
}
#answer-area h3 { margin-top: 0; font-size: 1.8em; }
#answer-area p { 
    font-size: 1.1em; 
    line-height: 1.6; 
    white-space: pre-wrap; /* WICHTIG: Behält Zeilenumbrüche im Beispieltext bei */
}
#answer-area p strong { font-weight: 700; }
#answer-area button#btn-next {
    margin-top: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* --- Feedback Toast Stile --- */
#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.toast {
    padding: 12px 25px;
    border-radius: 33px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--white);
    box-shadow: 0 4px 15px rgba(0, 54, 89, 0.2);
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(30px);
}

.toast.correct { background-color: var(--green-correct); }
.toast.wrong { background-color: var(--red-wrong); }

/* Die Animation */
.toast.show {
    animation: husch-und-weg 2s ease-out forwards;
}

@keyframes husch-und-weg {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
}

/* Utility-Klasse */
.hidden {
    display: none;
}

/* ... (Alle Stile von oben bleiben gleich, BIS AUF ...) ... */

/* --- Willkommens-Bildschirm Stile --- */
/* ... (Stile .intro-text, .mode-selection, .mode-box bleiben gleich) ... */

/* NEU: Stile für Level-Auswahl */
#level-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.level-button {
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 700;
    /* Nutzt den "secondary" Button-Stil */
    background: none;
    color: var(--dark-blue);
    border: 2px solid var(--dark-blue);
}

.level-button:hover {
    background: var(--light-blue);
    transform: translateY(-2px);
    box-shadow: none;
}

/* Zeigt das aktiv ausgewählte Level an */
.level-button.active {
    background: var(--dark-blue);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 54, 89, 0.2);
}


/* ... (Restliche Stile für Quiz-Header, Game-Controls, Score, Card, etc. bleiben gleich) ... */

/* --- Auflösungs-Bereich ("Gewendete Karte") --- */
#answer-area {
    margin-top: 20px;
    padding: 30px;
    background-color: var(--light-blue);
    border-radius: 15px;
    text-align: left;
}
#answer-area h3 { margin-top: 0; font-size: 1.8em; }
#answer-area p { 
    font-size: 1.1em; 
    line-height: 1.6; 
    white-space: pre-wrap;
}
#answer-area p strong { font-weight: 700; }
#answer-area button#btn-next {
    margin-top: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* NEU: Stile für Statistik-Ansicht (um sicherzustellen, dass sie zentriert ist) */
#answer-stats-content {
    text-align: center;
}
#answer-stats-content h3 {
    font-size: 2em;
}
#answer-stats-content p {
    font-size: 1.3em;
    white-space: normal; /* Erlaubt Zeilenumbruch */
}


/* ... (Restliche Stile für Toast und Animationen bleiben gleich) ... */

/* Utility-Klasse */
.hidden {
    display: none;
}


/* fonts */
@font-face {
  font-family: "OpenSans Light";
  font-style: normal;
  font-weight: 300;
  src: local(""), url("/assets/webfonts/opensans/OpenSans-Light.ttf") format("truetype");
}
@font-face {
  font-family: "OpenSans Regular";
  font-style: normal;
  font-weight: 400;
  src: local(""), url("/assets/webfonts/opensans/OpenSans-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "OpenSans SemiBold";
  font-style: normal;
  font-weight: 600;
  src: local(""), url("/assets/webfonts/opensans/OpenSans-SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "OpenSans Bold";
  font-style: normal;
  font-weight: 700;
  src: local(""), url("/assets/webfonts/opensans/OpenSans-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "Quicksand Light";
  font-style: normal;
  font-weight: 300;
  src: local(""), url("/assets/webfonts/quicksand/static/Quicksand-Light.ttf") format("truetype");
}
@font-face {
  font-family: "Quicksand Regular";
  font-style: normal;
  font-weight: 400;
  src: local(""), url("/assets/webfonts/quicksand/static/Quicksand-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Quicksand SemiBold";
  font-style: normal;
  font-weight: 600;
  src: local(""), url("/assets/webfonts/quicksand/static/Quicksand-SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "Quicksand Bold";
  font-style: normal;
  font-weight: 700;
  src: local(""), url("/assets/webfonts/quicksand/static/Quicksand-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "Montserrat Light";
  font-style: normal;
  font-weight: 300;
  src: local(""), url("/assets/webfonts/Montserrat/static/Montserrat-Light.ttf") format("truetype");
}
@font-face {
  font-family: "Montserrat Regular";
  font-style: normal;
  font-weight: 400;
  src: local(""), url("/assets/webfonts/Montserrat/static/Montserrat-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Montserrat SemiBold";
  font-style: normal;
  font-weight: 600;
  src: local(""), url("/assets/webfonts/Montserrat/static/Montserrat-SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "Montserrat Bold";
  font-style: normal;
  font-weight: 700;
  src: local(""), url("/assets/webfonts/Montserrat/static/Montserrat-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "Epilogue Light";
  font-style: normal;
  font-weight: 300;
  src: local(""), url("/assets/webfonts/Epilogue/static/Epilogue-Light.ttf") format("truetype");
}
@font-face {
  font-family: "Epilogue Regular";
  font-style: normal;
  font-weight: 400;
  src: local(""), url("/assets/webfonts/Epilogue/static/Epilogue-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Epilogue SemiBold";
  font-style: normal;
  font-weight: 600;
  src: local(""), url("/assets/webfonts/Epilogue/static/Epilogue-SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "Epilogue Bold";
  font-style: normal;
  font-weight: 700;
  src: local(""), url("/assets/webfonts/Epilogue/static/Epilogue-Bold.ttf") format("truetype");
}