/* Quelle: 00-recon/originale/fahrtauglich/fahrtauglich-nback.html (unverändert übernommen, ausser wo vermerkt: Audio-Basis, Anzeigetexte laut TEXTE) */
    #ftnb {
        --ftnb-gelb: #FFBF00;
        --ftnb-gelb-dunkel: #E6AB00;
        --ftnb-gelb-hell: #FFF4CC;
        --ftnb-schwarz: #000000;
        --ftnb-text: #1F2937;
        --ftnb-text-2: #4B5563;
        --ftnb-flaeche: #F3F5F8;
        --ftnb-linie: #C8D5DC;
        --ftnb-zelle: #CFD8DC;
        --ftnb-gruen: #047857;
        --ftnb-fehler: #B91C1C;

        font-family: 'Poppins', sans-serif;
        color: var(--ftnb-text);
        line-height: 1.5;
        width: 100%;
        max-width: 620px;
        margin: 0 auto 40px;
        box-sizing: border-box;
        text-align: center;
    }
    #ftnb *, #ftnb *::before, #ftnb *::after { box-sizing: border-box; }
    #ftnb [hidden] { display: none !important; }

    /* Spielkarte (Optik wie Wordle auf fahrtauglich.ch). overflow: clip statt
       hidden — sonst verschiebt ein Fokus/scrollIntoView den Karteninhalt. */
    #ftnb .ftnb-karte {
        position: relative;
        overflow: clip;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        border: 2px solid #dee2e6;
        border-radius: 20px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        padding: 28px 28px 24px;
    }
    #ftnb .ftnb-karte::before {
        content: '';
        position: absolute;
        top: -50%; left: -50%;
        width: 200%; height: 200%;
        background: radial-gradient(circle, rgba(52, 58, 64, 0.05) 1px, transparent 1px);
        background-size: 30px 30px;
        animation: ftnb-hintergrund 25s linear infinite;
        z-index: 0;
        pointer-events: none;
    }
    @keyframes ftnb-hintergrund {
        0%   { transform: translate(0, 0) rotate(0deg); }
        100% { transform: translate(-30px, -30px) rotate(360deg); }
    }
    #ftnb .ftnb-inhalt {
        position: relative;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 18px;
    }

    /* Stufe und Schritte */
    #ftnb .ftnb-kontrollen {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 12px 28px;
        width: 100%;
    }
    #ftnb .ftnb-stufe { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; justify-content: center; }
    #ftnb .ftnb-etikett { font-size: 0.9rem; color: var(--ftnb-text-2); }
    #ftnb .ftnb-stufe-wert { font-size: 1.35rem; font-weight: 600; color: var(--ftnb-schwarz); }
    #ftnb .ftnb-hinweis-klein { font-size: 0.8rem; color: var(--ftnb-text-2); }
    #ftnb .ftnb-schritte { display: flex; align-items: center; gap: 10px; }
    #ftnb .ftnb-schritte label { font-size: 0.9rem; color: var(--ftnb-text-2); }
    #ftnb .ftnb-schritte input[type="range"] {
        width: 130px;
        margin: 0;
        accent-color: var(--ftnb-gelb-dunkel);
        cursor: pointer;
    }
    #ftnb .ftnb-schritte-wert { min-width: 2ch; font-weight: 600; color: var(--ftnb-schwarz); }

    /* Tonpruefung */
    #ftnb .ftnb-tonpruefung {
        width: 100%;
        padding: 16px 18px;
        background: #ffffff;
        border: 1px solid #DEDAD2;
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
        text-align: left;
    }
    #ftnb .ftnb-ton-text { margin: 0 0 12px; font-size: 0.95rem; color: var(--ftnb-text); }
    #ftnb .ftnb-ton-text strong { font-weight: 600; color: var(--ftnb-schwarz); }
    #ftnb .ftnb-ton-knoepfe { display: flex; gap: 10px; flex-wrap: wrap; }
    #ftnb .ftnb-ton-status { min-height: 1.4em; margin: 10px 0 0; font-size: 0.88rem; color: var(--ftnb-text-2); }
    #ftnb .ftnb-ton-status.ton-fehler { color: var(--ftnb-fehler); font-weight: 600; }

    /* Raster 3x3 (Mitte bleibt leer, wie im Standard mit 8 Positionen) */
    #ftnb .ftnb-gitter {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        width: 100%;
        max-width: 330px;
        aspect-ratio: 1;
    }
    #ftnb .ftnb-zelle {
        background: var(--ftnb-zelle);
        border-radius: 10px;
        transition: background-color 0.08s linear;
    }
    #ftnb .ftnb-zelle.aktiv { background: var(--ftnb-gelb); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.12) inset; }

    /* Antwortknoepfe */
    #ftnb .ftnb-antworten {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        width: 100%;
        max-width: 420px;
    }
    #ftnb .ftnb-antwort {
        -webkit-appearance: none;
        appearance: none;
        margin: 0;
        min-height: 60px;
        padding: 8px 6px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        background: #ffffff;
        border: 2px solid var(--ftnb-schwarz);
        border-radius: 14px;
        box-shadow: none;
        font-family: inherit;
        font-size: 1rem;
        font-weight: 600;
        line-height: 1.15;
        text-transform: none;
        color: var(--ftnb-schwarz);
        cursor: pointer;
        touch-action: manipulation;
        -webkit-user-select: none;
        user-select: none;
        transition: background 0.12s ease, border-color 0.12s ease;
    }
    #ftnb .ftnb-antwort:hover:not(:disabled),
    #ftnb .ftnb-antwort:focus:not(:disabled) { background: var(--ftnb-flaeche); color: var(--ftnb-schwarz); }
    #ftnb .ftnb-antwort[aria-pressed="true"]:not(:disabled) { background: var(--ftnb-gelb); border-color: var(--ftnb-gelb); }
    #ftnb .ftnb-antwort:disabled { border-color: var(--ftnb-linie); color: #9CA3AF; cursor: not-allowed; }
    #ftnb .ftnb-antwort .ftnb-taste { font-size: 0.72rem; font-weight: 400; color: var(--ftnb-text-2); }
    #ftnb .ftnb-antwort:disabled .ftnb-taste { color: #9CA3AF; }
    @media (pointer: coarse) { #ftnb .ftnb-antwort .ftnb-taste { display: none; } }
    /* Kurze Rueckmeldung beim Druecken */
    #ftnb .ftnb-antwort.blitz-richtig { background: #D1FAE5 !important; border-color: var(--ftnb-gruen) !important; }
    #ftnb .ftnb-antwort.blitz-falsch  { background: #FEE2E2 !important; border-color: var(--ftnb-fehler) !important; }

    #ftnb .ftnb-status { min-height: 1.5em; margin: 0; font-size: 0.95rem; font-weight: 500; color: var(--ftnb-text); }
    #ftnb .ftnb-fuss { margin: 0; font-size: 0.8rem; color: var(--ftnb-text-2); }

    /* ===== Buttons (Pill-Stil der fahrtauglich.ch-Buttons) ===== */
    #ftnb .ftnb-knopf {
        -webkit-appearance: none;
        appearance: none;
        margin: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 48px;
        padding: 10px 28px;
        background: var(--ftnb-gelb);
        border: 2px solid var(--ftnb-gelb);
        border-radius: 100px;
        box-shadow: none;
        font-family: inherit;
        font-size: 1rem;
        font-weight: 500;
        line-height: 1.2;
        text-transform: none;
        text-decoration: none;
        color: var(--ftnb-schwarz);
        cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    }
    #ftnb .ftnb-knopf:hover,
    #ftnb .ftnb-knopf:focus { background: var(--ftnb-gelb-dunkel); border-color: var(--ftnb-gelb-dunkel); color: var(--ftnb-schwarz); }
    #ftnb .ftnb-knopf:hover { transform: translateY(-1px); }
    #ftnb .ftnb-knopf-hell { background: #ffffff; border-color: var(--ftnb-schwarz); }
    #ftnb .ftnb-knopf-hell:hover,
    #ftnb .ftnb-knopf-hell:focus { background: var(--ftnb-flaeche); border-color: var(--ftnb-schwarz); }
    #ftnb .ftnb-knopf:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
    #ftnb .ftnb-steuerung { display: flex; gap: 10px; justify-content: center; }

    #ftnb .ftnb-knopf:focus-visible,
    #ftnb .ftnb-antwort:focus-visible,
    #ftnb .ftnb-modal-schliessen:focus-visible,
    #ftnb input:focus-visible { outline: 3px solid var(--ftnb-schwarz); outline-offset: 2px; }

    /* ===== Ergebnisdialog ===== */
    #ftnb .ftnb-modal {
        position: fixed;
        inset: 0;
        z-index: 100000;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }
    #ftnb .ftnb-modal.active { display: flex; }
    #ftnb .ftnb-modal-hintergrund { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(5px); }
    #ftnb .ftnb-modal-inhalt {
        position: relative;
        width: 100%;
        max-width: 460px;
        max-height: 88vh;
        overflow-y: auto;
        background: #ffffff;
        border-radius: 15px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
        padding: 30px 24px 24px;
        text-align: center;
        animation: ftnb-modal-ein 0.25s ease;
    }
    @keyframes ftnb-modal-ein {
        from { opacity: 0; transform: scale(0.96) translateY(12px); }
        to   { opacity: 1; transform: none; }
    }
    #ftnb .ftnb-modal-schliessen {
        -webkit-appearance: none;
        appearance: none;
        position: absolute;
        top: 8px;
        right: 8px;
        width: 44px;
        height: 44px;
        margin: 0;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        border-radius: 50%;
        font-family: inherit;
        font-size: 28px;
        line-height: 1;
        color: #6B7280;
        cursor: pointer;
    }
    #ftnb .ftnb-modal-schliessen:hover,
    #ftnb .ftnb-modal-schliessen:focus { background: var(--ftnb-flaeche); color: #374151; }
    #ftnb .ftnb-modal h2 { margin: 0 0 6px; font-family: inherit; font-size: 1.6rem; font-weight: 600; line-height: 1.2; color: var(--ftnb-text); }
    #ftnb .ftnb-modal p { margin: 0 0 6px; color: var(--ftnb-text-2); }
    #ftnb .ftnb-kanaele { display: grid; gap: 10px; margin: 16px 0 12px; }
    #ftnb .ftnb-kanal { padding: 10px 12px; background: var(--ftnb-flaeche); border-radius: 10px; }
    #ftnb .ftnb-kanal h3 { margin: 0 0 4px; font-family: inherit; font-size: 0.95rem; font-weight: 600; color: var(--ftnb-schwarz); }
    #ftnb .ftnb-werte { display: flex; justify-content: center; gap: 22px; }
    #ftnb .ftnb-werte strong { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.1; color: var(--ftnb-schwarz); font-variant-numeric: tabular-nums; }
    #ftnb .ftnb-werte span { font-size: 0.8rem; color: var(--ftnb-text-2); }
    #ftnb .ftnb-trenn { margin: 6px 0 4px; font-size: 1rem; color: var(--ftnb-text); }
    #ftnb .ftnb-trenn strong { font-size: 1.2rem; font-weight: 700; color: var(--ftnb-schwarz); }
    #ftnb .ftnb-trenn-hilfe { display: block; margin-top: 2px; font-size: 0.8rem; color: var(--ftnb-text-2); }
    #ftnb .ftnb-stufen-satz { margin: 12px 0 0 !important; padding: 8px 12px; background: var(--ftnb-gelb-hell); border-radius: 8px; font-weight: 500; color: var(--ftnb-schwarz) !important; }
    #ftnb .ftnb-modal-knoepfe { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

    #ftnb .ftnb-sr { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

    @media (max-width: 768px) {
        #ftnb { max-width: 95%; }
    }
    @media (max-width: 520px) {
        #ftnb .ftnb-karte { padding: 18px 12px 16px; border-radius: 16px; }
        #ftnb .ftnb-inhalt { gap: 14px; }
        #ftnb .ftnb-gitter { gap: 8px; max-width: 270px; }
        #ftnb .ftnb-antwort { min-height: 56px; font-size: 0.95rem; }
        #ftnb .ftnb-werte { gap: 14px; }
    }

    @media (prefers-reduced-motion: reduce) {
        #ftnb *, #ftnb *::before, #ftnb *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }

/* ===== Anpassung an das Designsystem fahrtauglich.ch (3a, Entscheid Lukas) =====
   Schrift und Grautöne aus tokens.css; kein bewegter Hintergrund (ruhig, Performance). Spiellogik unverändert. */
#ftnb {
    --ftnb-schwarz: var(--ft-tinte);
    --ftnb-text: var(--ft-tinte);
    --ftnb-text-2: var(--ft-tinte-2);
    --ftnb-flaeche: var(--ft-flaeche);
    --ftnb-linie: var(--ft-linie);
    font-family: var(--ft-schrift);
    margin-top: 0;
    margin-bottom: 0;
}
#ftnb .ftnb-karte::before { animation: none; }
#ftnb .ftnb-text, #ftnb .ftnb-meldung, #ftnb .ftnb-knopf, #ftnb .ftnb-anleitung-liste li { font-size: var(--ft-fs-text); }
#ftnb .ftnb-bestzeiten, #ftnb .ftnb-ergebnis span { font-size: var(--ft-fs-klein); }
#ftnb .ftnb-stat-label { font-size: 0.95rem; letter-spacing: 0; }
#ftnb .ftnb-anleitung summary { font-size: var(--ft-fs-h4); }
#ftnb .ftnb-knopf { min-height: var(--ft-button-hoehe); font-weight: var(--ft-gewicht-fett); }
@media (max-width: 600px) {
    #ftnb .ftnb-knopf { font-size: var(--ft-fs-text); padding: 10px 16px; }
    #ftnb .ftnb-stat-label { font-size: 0.85rem; }
}
