@font-face {
    font-family: 'IM Fell English';
    src: url('../fonts/im-fell-english.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Old Standard TT';
    src: url('../fonts/old-standard-tt.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'IBM Plex Serif';
    src: url('../fonts/ibm-plex-serif.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}

:root {
    --color-text: #222;
    --color-border: #ccc;
    --color-accent: #1B4B6B;

    --color-correct-bg: #d4edda;
    --color-correct-border: #28a745;
    --color-correct-text: #155724;

    --color-incorrect-bg: #f8d7da;
    --color-incorrect-border: #dc3545;
    --color-incorrect-text: #721c24;

    --color-weak-bg: #ffe0cc;
    --color-weak-border: #ff6600;
    --color-weak-text: #cc4400;

    --color-excellent-bg: #1a7a34;
    --color-excellent-border: #145a27;
    --color-excellent-text: #fff;

    --color-bookmarked-bg: #fff9c4;
    --color-bookmarked-border: #f0c040;
    --color-bookmarked-text: #7a6000;
}

/* Grundlayout */
body {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    max-width: 720px;
    margin: 2rem auto;
    padding: 0 1rem;
    color: var(--color-text);
    background: #f9f9f9;
    background-image: url('../images/design/ship_sketch.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

p {
    font-family: 'Old Standard TT', serif;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--color-text);
    padding-bottom: 0.5rem;
    font-family: 'IM Fell English', serif;
    font-weight: 400;
}

h2 {
    font-family: 'IM Fell English', serif;
    font-weight: 400;
}

.frage,
.antworten button,
.antwort-feedback p {
    font-family: 'IBM Plex Serif', serif;
}

/* Frage */
.frage {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
}

/* Antwort-Buttons */
.antworten {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.antworten form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0;
}

.antworten button {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background: #fff;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    min-height: 0;
    line-height: 1.6;
    appearance: none;
    -webkit-appearance: none;
}

/* Feedback-Antworten */
.antwort-feedback {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.antwort-feedback p {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    line-height: 1.6;
    margin: 0;
}

.richtig {
    background: var(--color-correct-bg);
    border-color: var(--color-correct-border) !important;
    color: var(--color-correct-text);
}

.falsch {
    background: var(--color-incorrect-bg);
    border-color: var(--color-incorrect-border) !important;
    color: var(--color-incorrect-text);
}

.neutral {
    background: #fff;
    border: 1px solid var(--color-border);;
}

/* Feedback-Text */
.feedback-text {
    font-weight: bold;
    margin-bottom: 1rem;
}

/* Nächste Frage Button */
.btn-naechste {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    background: var(--color-text);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Tonsymbole */
.ton-kurz {
    display: inline-block;
    width: 24px;
    height: 12px;
    background: #000;
    vertical-align: middle;
}

.ton-lang {
    display: inline-block;
    width: 84px;
    height: 12px;
    background: #000;
    vertical-align: middle;
}

/* Fragenübersicht */
.fragen-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.fragen-nr {
    display: inline-block;
    width: 3rem;
    height: 3rem;
    line-height: 3rem;
    text-align: center;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.9rem;
    border-width: 3px;
}

.frage-bilder {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.frage-bilder img {
    max-width: 100%;
    height: auto;
    zoom: 1.5;
}

footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.85rem;
}

footer a {
    margin-right: 1.5rem;
    text-decoration: none;
    color: #666;
}

/* Login-Formular */
.login-formular {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: #f0f0f0;
}

.login-formular input[type="text"] {
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    width: 250px;
    margin-right: 0.5rem;
}

.login-formular button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    background: var(--color-text);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Farbkodierung Lernfortschritt */
.fragen-nr.noch-nicht,
.lernbalken-segment.noch-nicht {
    background: #f0f0f0;
    color: #aaa;
    border-color: #ddd;
}

.fragen-nr.schwach,
.lernbalken-segment.schwach {
    background: var(--color-weak-bg);
    border-color: var(--color-weak-border);
    color: var(--color-weak-text);
}

.fragen-nr.gut,
.lernbalken-segment.gut {
    background: var(--color-correct-bg);
    border-color: var(--color-correct-border);
    color: var(--color-correct-text);
}

.fragen-nr.sehr-gut,
.lernbalken-segment.sehr-gut {
    background: var(--color-excellent-bg);
    border-color: var(--color-excellent-border);
    color: var(--color-excellent-text);
}

/* Statistiktabelle */
.statistik-tabelle {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.statistik-tabelle th,
.statistik-tabelle td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.statistik-tabelle th {
    background: #f0f0f0;
    font-weight: bold;
}

.statistik-tabelle .sehr-gut {
    background: var(--color-excellent-bg);
    color: var(--color-excellent-text);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
}

.statistik-tabelle .gut {
    background: var(--color-correct-bg);
    color: var(--color-correct-text);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
}

.statistik-tabelle .schwach {
    background: var(--color-weak-bg);
    color: var(--color-weak-text);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
}

/* Prüfungsheader */
.pruefung-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-weight: bold;
}

.countdown {
    color: var(--color-text);
}

.countdown.warnung {
    color: #cc4400;
}

/* Prüfungsauswertung */
.auswertung-ergebnis {
    font-size: 1.5rem;
    font-weight: bold;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 2rem;
    text-align: center;
}

.auswertung-ergebnis.bestanden {
    background: var(--color-correct-bg);
    color: var(--color-correct-text);
    border: 1px solid var(--color-correct-border);
}

.auswertung-ergebnis.nicht-bestanden {
    background: var(--color-incorrect-bg);
    color: var(--color-incorrect-text);
    border: 1px solid var(--color-incorrect-border);
}

.falsche-frage {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

/* Merk-Button */

.h1-mit-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-merken {
    font-size: 0.85rem;
    padding: 0.3rem 0.75rem;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    min-width: 110px;
    text-align: center;
}

.btn-merken.gemerkt {
    background: var(--color-bookmarked-bg);
    border-color: var(--color-bookmarked-border);
    color: var(--color-bookmarked-text);
}

.fragen-nr.gemerkt {
    border-color: var(--color-bookmarked-border);
    border-width: 3px;
}

/* Fehler-Button */
.btn-fehler {
    font-size: 0.85rem;
    padding: 0.3rem 0.75rem;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    min-width: 140px;
    text-align: center;
}

.btn-fehler.gemeldet {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    cursor: default;
}

.statistik-tabelle tr.gemerkt-zeile {
    background: #fffde7;
}

/* Lernbalken (login.php) */
.lernbalken {
    margin-bottom: 1.5rem;
}

.lernbalken-label {
    font-weight: bold;
    margin-bottom: 0.4rem;
}

.lernbalken-leiste {
    display: flex;
    width: 100%;
    height: 1.5rem;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.lernbalken-segment {
    height: 100%;
}

/* Navigationsleiste */

nav {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
    background: #f9f9f9;
}

nav a,
.nav-dropdown-trigger {
    margin-right: 1.5rem;
    text-decoration: none;
    color: var(--color-text);
    font-weight: bold;
    font-size: 1.4rem;
    font-family: 'IM Fell English', serif;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    margin-right: 0.4rem;
}

.nav-logo-icon {
    height: 34px;
    width: auto;
}

.nav-brand {
    margin-right: auto;
}

.nav-link-hover {
    position: relative;
    padding-left: 22px;
}

.nav-link-hover .compass-tick {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #1B4B6B;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.nav-dropdown {
    position: relative;
}

/* Details/Summary zurücksetzen (Üben-Dropdown + Hamburger) */
.nav-dropdown summary,
.nav-mobile-toggle summary {
    list-style: none;
    cursor: pointer;
}
.nav-dropdown summary::-webkit-details-marker,
.nav-mobile-toggle summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0;
    background: #f9f9f9;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 10;
}

/* Jetzt über [open] gesteuert statt :hover, damit Touch-Geräte das Menü per Antippen öffnen/schließen können */
.nav-dropdown[open] .nav-dropdown-panel {
    display: block;
}

.nav-dropdown-row {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.nav-dropdown-cols {
    display: flex;
    gap: 1.5rem;
}

.nav-dropdown-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 100px;
}

.nav-dropdown-title {
    font-size: 0.75rem;
    color: #666;
    font-weight: bold;
    margin-bottom: 2px;
    display: block;
}

.nav-dropdown-col a,
.nav-dropdown-row a {
    margin-right: 0;
    font-weight: normal;
    font-size: 0.9rem;
}

.nav-disabled-top {
    color: #aaa;
    cursor: not-allowed;
    font-weight: bold;
    font-family: 'IM Fell English', serif;
    font-size: 1.4rem;
    margin-right: 1.5rem;
    padding-left: 22px;
}

.nav-disabled {
    color: #aaa;
    cursor: not-allowed;
    font-family: 'IM Fell English', serif;
    font-size: 0.9rem;
}

/* Desktop-Linkgruppe */
.nav-links-desktop {
    display: flex;
    align-items: center;
}

/* Hamburger auf Desktop unsichtbar */
.nav-mobile-toggle {
    display: none;
}

/* Hamburger-Symbol (drei Striche) */
.nav-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
}
.nav-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
}

.nav-mobile-panel {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #f9f9f9;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    padding: 1rem 1.5rem 1.5rem;
    z-index: 20;
}

.nav-mobile-toggle[open] .nav-mobile-panel {
    display: flex;
}

.nav-mobile-panel a,
.nav-mobile-panel .nav-disabled {
    margin-right: 0;
    font-size: 1rem;
    font-weight: normal;
    padding-left: 1rem;
}

.nav-mobile-panel > a:first-child {
    padding-left: 0;
}

.nav-mobile-title {
    font-size: 0.75rem;
    color: #666;
    font-weight: bold;
    margin-top: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #eee;
}

/* Ab hier: schmale Bildschirme (Handy) */
@media (max-width: 640px) {
    .nav-links-desktop {
        display: none;
    }
    .nav-mobile-toggle {
        display: block;
        margin-left: auto;
    }
    nav {
        position: relative;
    }
}

/* Hover-Effekte nur dort anwenden, wo ein echtes Zeigegerät (Maus) vorhanden ist –
   verhindert hängenbleibende graue/blaue Zustände nach dem Antippen auf Touch-Geräten */
@media (hover: hover) {
    .antworten button:hover {
        background: #eee;
    }
    nav a:hover {
        color: var(--color-accent);
    }
    .nav-link-hover:hover .compass-tick {
        opacity: 1;
    }
    .nav-dropdown-col a:hover,
    .nav-dropdown-row a:hover {
        color: var(--color-accent);
    }
    .btn-naechste:hover {
        background: #444;
    }
    .fragen-nr:hover {
        background: #eee;
    }
    .btn-merken:hover {
        background: #f5f5f5;
    }
    .btn-fehler:hover {
        background: #eee;
    }
    .login-formular button:hover {
        background: #444;
    }
    footer a:hover {
        text-decoration: underline;
    }
    .statistik-tabelle tr:hover {
        background: #f9f9f9;
    }
}