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

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

    /* ===== Seitenkopf — Masse wie die bisherigen Elementor-Widgets ===== */
    #ftt .ftt-titel {
        margin: 0;
        font-family: inherit;
        font-size: 48px;
        font-weight: 600;
        line-height: 1.2;
        letter-spacing: 0;
        text-align: center;
        color: var(--ftt-schwarz);
    }
    #ftt .ftt-intro {
        max-width: 760px;
        margin: 50px auto 0;
        font-size: 20px;
        font-weight: 300;
        line-height: 1.5;
        text-align: center;
        color: var(--ftt-schwarz);
    }
    /* Links: schwarz mit gelber Unterstreichung — Gelb als Schrift auf Weiss
       hielte nur 1.65:1. */
    #ftt .ftt-intro a,
    #ftt .ftt-box a {
        color: var(--ftt-schwarz);
        font-weight: 400;
        text-decoration: underline;
        text-decoration-color: var(--ftt-gelb);
        text-decoration-thickness: 3px;
        text-underline-offset: 3px;
        overflow-wrap: anywhere;
    }
    #ftt .ftt-intro a:hover, #ftt .ftt-box a:hover,
    #ftt .ftt-intro a:focus, #ftt .ftt-box a:focus { color: var(--ftt-schwarz); background: rgba(255, 191, 0, 0.18); }
    #ftt a:focus-visible { outline: 3px solid var(--ftt-schwarz); outline-offset: 2px; }

    /* ===== Spielbereich ===== */
    #ftt .ftt-spiel {
        max-width: 680px;
        margin: 34px auto 0;
        text-align: center;
    }

    /* Spielkarte (Optik wie Wordle auf fahrtauglich.ch) */
    #ftt .ftt-karte {
        position: relative;
        overflow: hidden;
        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: 30px;
    }
    #ftt .ftt-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: ftt-hintergrund 25s linear infinite;
        z-index: 0;
        pointer-events: none;
    }
    @keyframes ftt-hintergrund {
        0%   { transform: translate(0, 0) rotate(0deg); }
        100% { transform: translate(-30px, -30px) rotate(360deg); }
    }
    #ftt .ftt-panel {
        position: relative;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    #ftt .ftt-text {
        max-width: 520px;
        margin: 0;
        font-size: 1.05rem;
        color: var(--ftt-text);
    }
    #ftt .ftt-start-knoepfe {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }
    #ftt .ftt-bestzeiten {
        margin: 0;
        font-size: 0.9rem;
        color: var(--ftt-text-2);
    }

    /* Statusleiste: Zeit, Fehler, naechster Kreis */
    #ftt .ftt-status {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 12px 16px;
        background: rgba(255, 255, 255, 0.7);
        border: 1px solid rgba(0, 0, 0, 0.05);
        border-radius: 12px;
    }
    #ftt .ftt-stat-zahl {
        display: block;
        font-size: 1.6rem;
        font-weight: 600;
        line-height: 1.15;
        color: var(--ftt-text);
        font-variant-numeric: tabular-nums;
    }
    #ftt .ftt-stat-label {
        display: block;
        margin-top: 2px;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: var(--ftt-text-2);
    }

    #ftt .ftt-meldung {
        min-height: 1.5em;
        margin: 0;
        font-size: 1rem;
        font-weight: 500;
        color: var(--ftt-text);
    }
    #ftt .ftt-meldung.fehler  { color: var(--ftt-fehler); }
    #ftt .ftt-meldung.erfolg  { color: var(--ftt-gruen); }

    /* Spielfeld */
    #ftt .ftt-brett {
        width: 100%;
    }
    #ftt .ftt-canvas {
        display: block;
        width: 100%;            /* JS setzt die genaue Breite */
        margin: 0 auto;
        background: #ffffff;
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 15px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        touch-action: none;   /* Ziehen auf dem Spielfeld scrollt nicht die Seite */
        cursor: crosshair;
        -webkit-user-select: none;
        user-select: none;
    }

    /* ===== Buttons (Pill-Stil der fahrtauglich.ch-Buttons) ===== */
    #ftt .ftt-kontrollen {
        display: flex;
        justify-content: center;
        gap: 12px;
        flex-wrap: wrap;
    }
    #ftt .ftt-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(--ftt-gelb);
        border: 2px solid var(--ftt-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(--ftt-schwarz);
        cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    }
    #ftt .ftt-knopf:hover,
    #ftt .ftt-knopf:focus {
        background: var(--ftt-gelb-dunkel);
        border-color: var(--ftt-gelb-dunkel);
        color: var(--ftt-schwarz);
    }
    #ftt .ftt-knopf:hover { transform: translateY(-1px); }
    #ftt .ftt-knopf-hell { background: #ffffff; border-color: var(--ftt-schwarz); }
    #ftt .ftt-knopf-hell:hover,
    #ftt .ftt-knopf-hell:focus { background: var(--ftt-flaeche); border-color: var(--ftt-schwarz); }
    #ftt .ftt-knopf:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

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

    /* ===== Spielanleitung ===== */
    #ftt .ftt-anleitung {
        margin-top: 24px;
        text-align: left;
        background: #ffffff;
        border-radius: 8px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
        padding: 15px 18px;
    }
    #ftt .ftt-anleitung summary {
        cursor: pointer;
        list-style: none;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 4px 0;
        font-size: 1.15rem;
        font-weight: 600;
        color: var(--ftt-schwarz);
        user-select: none;
    }
    #ftt .ftt-anleitung summary::-webkit-details-marker { display: none; }
    #ftt .ftt-chev { width: 20px; height: 20px; flex: 0 0 auto; transition: transform 0.2s ease; }
    #ftt .ftt-anleitung[open] .ftt-chev { transform: rotate(180deg); }
    #ftt .ftt-anleitung-liste {
        list-style: none;
        margin: 12px 0 4px;
        padding: 0;
        display: grid;
        gap: 8px;
    }
    #ftt .ftt-anleitung-liste li {
        margin: 0;
        padding: 10px 14px;
        background: var(--ftt-flaeche);
        border: 1px solid #DEDAD2;
        border-radius: 6px;
        font-size: 0.95rem;
        font-weight: 300;
        line-height: 1.55;
        color: var(--ftt-schwarz);
    }
    #ftt .ftt-anleitung-liste li strong { font-weight: 600; }

    /* ===== Textabschnitte (Kartenstil der bisherigen Textboxen) ===== */
    #ftt .ftt-abschnitt { margin-top: 70px; }
    #ftt .ftt-abschnitt h2 {
        margin: 0 0 20px;
        font-family: inherit;
        font-size: 36px;
        font-weight: 600;
        line-height: 1.2;
        letter-spacing: 0;
        text-transform: none;
        text-align: center;
        color: var(--ftt-schwarz);
    }
    #ftt .ftt-box {
        background: #ffffff;
        border-radius: 8px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
        padding: 15px 20px;
        font-size: 22px;
        font-weight: 300;
        line-height: 1.5;
        color: var(--ftt-schwarz);
        text-align: left;
    }
    #ftt .ftt-box p { margin: 0 0 14px; }
    #ftt .ftt-box p:last-child { margin-bottom: 0; }
    #ftt .ftt-box strong { font-weight: 500; }

    #ftt .ftt-tipps { margin: 0; padding-left: 1.2em; }
    #ftt .ftt-tipps li { margin: 0 0 14px; padding-left: 0.2em; }
    #ftt .ftt-tipps li:last-child { margin-bottom: 0; }
    #ftt .ftt-tipps li::marker { color: var(--ftt-gelb-dunkel); }
    #ftt .ftt-tipps strong { display: block; }

    #ftt .ftt-nutzen { list-style: none; margin: 6px 0 14px; padding: 0; }
    #ftt .ftt-nutzen li {
        display: grid;
        grid-template-columns: 2.4em 1fr;
        gap: 0 0.6em;
        padding: 14px 0;
        border-top: 1px solid var(--ftt-linie);
    }
    #ftt .ftt-nutzen li:last-child { border-bottom: 1px solid var(--ftt-linie); }
    #ftt .ftt-nutzen-nr { font-weight: 600; line-height: 1.5; color: var(--ftt-gelb-dunkel); }
    #ftt .ftt-nutzen strong { display: block; }
    #ftt .ftt-vermerk {
        padding: 10px 14px;
        background: var(--ftt-flaeche);
        border: 1px solid #DEDAD2;
        border-radius: 6px;
        font-size: 0.85em;
    }
    #ftt .ftt-quellen-titel { margin-top: 20px !important; font-weight: 500; }
    #ftt .ftt-quellen { list-style: none; margin: 0; padding: 0; font-size: 0.8em; }
    #ftt .ftt-quellen li { margin: 0 0 10px; }
    #ftt .ftt-quellen li:last-child { margin-bottom: 0; }

    /* ===== Dialog ===== */
    #ftt .ftt-modal {
        position: fixed;
        inset: 0;
        z-index: 100000;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }
    #ftt .ftt-modal.active { display: flex; }
    #ftt .ftt-modal-hintergrund {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(5px);
    }
    #ftt .ftt-modal-inhalt {
        position: relative;
        width: 100%;
        max-width: 420px;
        max-height: 85vh;
        overflow-y: auto;
        background: #ffffff;
        border-radius: 15px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
        padding: 32px 28px 28px;
        text-align: center;
        animation: ftt-modal-ein 0.25s ease;
    }
    @keyframes ftt-modal-ein {
        from { opacity: 0; transform: scale(0.96) translateY(12px); }
        to   { opacity: 1; transform: none; }
    }
    #ftt .ftt-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;
    }
    #ftt .ftt-modal-schliessen:hover,
    #ftt .ftt-modal-schliessen:focus { background: var(--ftt-flaeche); color: #374151; }
    #ftt .ftt-modal h2 {
        margin: 0 0 8px;
        font-family: inherit;
        font-size: 1.75rem;
        font-weight: 600;
        line-height: 1.2;
        color: var(--ftt-text);
    }
    #ftt .ftt-modal p { margin: 0 0 6px; color: var(--ftt-text-2); }
    #ftt .ftt-ergebnis {
        display: flex;
        justify-content: center;
        gap: 28px;
        margin: 18px 0 10px;
        flex-wrap: wrap;
    }
    #ftt .ftt-ergebnis strong {
        display: block;
        font-size: 2rem;
        font-weight: 700;
        line-height: 1.1;
        color: var(--ftt-schwarz);
        font-variant-numeric: tabular-nums;
    }
    #ftt .ftt-ergebnis span { font-size: 0.85rem; color: var(--ftt-text-2); }
    #ftt .ftt-modal-knoepfe {
        display: flex;
        gap: 10px;
        justify-content: center;
        flex-wrap: wrap;
        margin-top: 18px;
    }

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

    /* ===== Responsive (Elementor: Tablet <= 1024px, Handy <= 767px) ===== */
    @media (max-width: 1024px) {
        #ftt .ftt-titel { font-size: 45px; }
        #ftt .ftt-intro { font-size: 16px; margin-top: 30px; }
        #ftt .ftt-box   { font-size: 16px; }
    }
    @media (max-width: 768px) {
        #ftt { max-width: 95%; }
        #ftt .ftt-karte { padding: 20px; }
    }
    @media (max-width: 767px) {
        #ftt .ftt-titel { font-size: 28px; }
        #ftt .ftt-intro { margin-top: 20px; }
        #ftt .ftt-spiel { margin-top: 24px; }
        #ftt .ftt-abschnitt { margin-top: 50px; }
        #ftt .ftt-abschnitt h2 { font-size: 28px; }
        #ftt .ftt-box   { padding: 15px; }
    }
    @media (max-width: 520px) {
        #ftt .ftt-karte  { padding: 14px 8px; border-radius: 16px; }
        #ftt .ftt-panel  { gap: 14px; }
        #ftt .ftt-status { padding: 10px 8px; gap: 6px; }
        #ftt .ftt-stat-zahl { font-size: 1.3rem; }
        #ftt .ftt-stat-label { font-size: 0.66rem; letter-spacing: 0.5px; }
        #ftt .ftt-kontrollen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
        #ftt .ftt-kontrollen .ftt-knopf:first-child { grid-column: 1 / -1; }
        #ftt .ftt-knopf  { padding: 10px 14px; font-size: 0.95rem; }
    }

    @media (prefers-reduced-motion: reduce) {
        #ftt *, #ftt *::before, #ftt *::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. */
#ftt {
    --ftt-schwarz: var(--ft-tinte);
    --ftt-text: var(--ft-tinte);
    --ftt-text-2: var(--ft-tinte-2);
    --ftt-flaeche: var(--ft-flaeche);
    --ftt-linie: var(--ft-linie);
    font-family: var(--ft-schrift);
    margin-top: 0;
    margin-bottom: 0;
}
#ftt .ftt-karte::before { animation: none; }
#ftt .ftt-text, #ftt .ftt-meldung, #ftt .ftt-knopf, #ftt .ftt-anleitung-liste li { font-size: var(--ft-fs-text); }
#ftt .ftt-bestzeiten, #ftt .ftt-ergebnis span { font-size: var(--ft-fs-klein); }
#ftt .ftt-stat-label { font-size: 0.95rem; letter-spacing: 0; }
#ftt .ftt-anleitung summary { font-size: var(--ft-fs-h4); }
#ftt .ftt-knopf { min-height: var(--ft-button-hoehe); font-weight: var(--ft-gewicht-fett); }
@media (max-width: 600px) {
    #ftt .ftt-knopf { font-size: var(--ft-fs-text); padding: 10px 16px; }
    #ftt .ftt-stat-label { font-size: 0.85rem; }
}
