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

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

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

    /* ===== Spielbereich ===== */
    #fts .fts-spiel { max-width: 680px; margin: 34px auto 0; text-align: center; }
    #fts .fts-karte {
        position: relative;
        overflow: hidden;
        overflow: clip;   /* clip: Fokus auf ein Feld darf den Karteninhalt nicht verschieben */
        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;
    }
    #fts .fts-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: fts-hintergrund 25s linear infinite; z-index: 0; pointer-events: none;
    }
    @keyframes fts-hintergrund { 0% { transform: translate(0, 0) rotate(0deg); } 100% { transform: translate(-30px, -30px) rotate(360deg); } }
    #fts .fts-inhalt { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 16px; }

    /* Schwierigkeit */
    #fts .fts-stufen { display: inline-flex; padding: 3px; background: #ffffff; border: 2px solid var(--fts-schwarz); border-radius: 100px; }
    #fts .schwierigkeit-knopf {
        -webkit-appearance: none; appearance: none; margin: 0;
        min-height: 40px; padding: 6px 18px; background: transparent; border: none; border-radius: 100px;
        font-family: inherit; font-size: 0.95rem; font-weight: 500; color: var(--fts-schwarz); cursor: pointer;
    }
    #fts .schwierigkeit-knopf:hover, #fts .schwierigkeit-knopf:focus { background: var(--fts-flaeche); color: var(--fts-schwarz); }
    #fts .schwierigkeit-knopf.aktiv { background: var(--fts-gelb); color: var(--fts-schwarz); }

    /* Fehlergrenze + Zeit */
    #fts .fts-kontrollen { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 24px; width: 100%; }
    #fts .fts-fehler { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--fts-text-2); }
    #fts .fts-fehler input[type="range"] { accent-color: var(--fts-gelb-dunkel); cursor: pointer; width: 110px; margin: 0; }
    #fts .fts-fehler-anzeige { min-width: 3.4rem; font-weight: 600; color: var(--fts-text); font-variant-numeric: tabular-nums; }
    #fts .fts-fehler-anzeige.warnung { color: var(--fts-fehler); }
    #fts .fts-zeit { display: flex; align-items: center; gap: 10px; }
    #fts .fts-zeit-anzeige { min-width: 3.6rem; font-size: 1.15rem; font-weight: 600; color: var(--fts-text); font-variant-numeric: tabular-nums; }
    #fts .fts-zeit-knopf {
        -webkit-appearance: none; appearance: none; margin: 0;
        min-height: 38px; padding: 4px 16px; background: #ffffff; border: 2px solid var(--fts-schwarz); border-radius: 100px;
        font-family: inherit; font-size: 0.9rem; font-weight: 500; color: var(--fts-schwarz); cursor: pointer;
    }
    #fts .fts-zeit-knopf:hover, #fts .fts-zeit-knopf:focus { background: var(--fts-flaeche); color: var(--fts-schwarz); }

    /* Spielfeld — quadratisch, beide Achsen explizit (aus der TMB-Version) */
    #fts .fts-brett { width: 100%; max-width: 504px; container-type: inline-size; }
    #fts .sudoku-grid {
        display: grid;
        grid-template-columns: repeat(9, 1fr);
        grid-template-rows: repeat(9, 1fr);
        width: 100%;
        aspect-ratio: 1;
        background: #ffffff;
        border: 3px solid var(--fts-schwarz);
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    #fts .sudoku-zelle {
        position: relative; min-width: 0; min-height: 0;
        display: flex; align-items: center; justify-content: center;
        background: #ffffff;
        border-right: 1px solid var(--fts-linie);
        border-bottom: 1px solid var(--fts-linie);
        cursor: pointer; touch-action: manipulation;
        transition: background 0.12s ease;
    }
    /* 3x3-Blockgrenzen */
    #fts .sudoku-zelle:nth-child(3n)  { border-right: 2.5px solid var(--fts-schwarz); }
    #fts .sudoku-zelle:nth-child(9n)  { border-right: none; }
    #fts .sudoku-zelle:nth-child(n+19):nth-child(-n+27),
    #fts .sudoku-zelle:nth-child(n+46):nth-child(-n+54) { border-bottom: 2.5px solid var(--fts-schwarz); }
    #fts .sudoku-zelle:nth-child(n+73) { border-bottom: none; }

    #fts .notiz-gitter { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); pointer-events: none; padding: 1px; }
    #fts .notiz-gitter span {
        display: flex; align-items: center; justify-content: center;
        font-weight: 500; line-height: 1; color: var(--fts-text-2);
        font-size: clamp(0.42rem, 1.25vw, 0.6rem);
        font-size: max(0.5rem, 2.9cqw);
        visibility: hidden;
    }
    #fts .notiz-gitter span.gesetzt { visibility: visible; }
    #fts .sudoku-zelle.hat-wert .notiz-gitter { display: none; }

    #fts .sudoku-zelle input {
        -webkit-appearance: none; appearance: none;
        width: 100%; height: 100%; margin: 0; padding: 0;
        text-align: center; border: none; border-radius: 0; background: transparent; box-shadow: none;
        font-family: inherit; font-weight: 500;
        /* mind. 16px, sonst zoomt iOS beim Fokus hinein */
        font-size: max(1rem, clamp(0.7rem, 3.5vw, 1.2rem));
        font-size: max(1rem, 6.2cqw);
        color: var(--fts-blau);
        cursor: pointer; outline: none; caret-color: transparent;
    }
    #fts .sudoku-zelle input.vorgegeben    { color: var(--fts-schwarz); font-weight: 700; cursor: default; }
    #fts .sudoku-zelle input.loesung-zelle { color: #6B7280; }
    #fts .sudoku-zelle.gleiche-zahl        { background: #EEF2FF; }
    #fts .sudoku-zelle.ausgewaehlt         { background: var(--fts-gelb-hell); box-shadow: inset 0 0 0 2px var(--fts-schwarz); }
    #fts .sudoku-zelle.fehler              { background: #FEE2E2; box-shadow: inset 0 0 0 2px #EF4444; }
    #fts .sudoku-zelle.fehler input        { color: var(--fts-fehler); }

    /* Ziffernblock — auf allen Geraeten sichtbar */
    #fts .ziffern-pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: 100%; max-width: 504px; }
    #fts .ziffer-knopf {
        -webkit-appearance: none; appearance: none; margin: 0; padding: 0;
        min-height: 52px; touch-action: manipulation;
        background: #ffffff; border: 1px solid var(--fts-linie); border-radius: 10px;
        font-family: inherit; font-size: 1.35rem; font-weight: 600; color: var(--fts-text);
        cursor: pointer; transition: background 0.12s ease;
    }
    #fts .ziffer-knopf:hover, #fts .ziffer-knopf:focus { background: var(--fts-gelb-hell); color: var(--fts-text); }
    #fts .ziffer-knopf:active { background: var(--fts-gelb); }
    #fts .ziffer-knopf.loeschen { font-size: 1rem; color: var(--fts-fehler); }
    /* Vollstaendig gesetzte Ziffer: unsichtbar, Platz bleibt (Fingerposition) */
    #fts .ziffer-knopf.fertig { visibility: hidden; pointer-events: none; }

    /* ===== Buttons (Pill-Stil der fahrtauglich.ch-Buttons) ===== */
    #fts .fts-aktionen { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
    #fts .fts-knopf {
        -webkit-appearance: none; appearance: none; margin: 0;
        display: inline-flex; align-items: center; justify-content: center; gap: 6px;
        min-height: 48px; padding: 10px 22px;
        background: #ffffff; border: 2px solid var(--fts-schwarz); border-radius: 100px; box-shadow: none;
        font-family: inherit; font-size: 0.98rem; font-weight: 500; line-height: 1.2; text-transform: none; text-decoration: none;
        color: var(--fts-schwarz); cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    }
    #fts .fts-knopf:hover, #fts .fts-knopf:focus { background: var(--fts-flaeche); color: var(--fts-schwarz); }
    #fts .fts-knopf:hover { transform: translateY(-1px); }
    #fts .fts-knopf-gelb { background: var(--fts-gelb); border-color: var(--fts-gelb); }
    #fts .fts-knopf-gelb:hover, #fts .fts-knopf-gelb:focus { background: var(--fts-gelb-dunkel); border-color: var(--fts-gelb-dunkel); }
    #fts .fts-knopf[aria-pressed="true"] { background: var(--fts-schwarz); color: #ffffff; }
    #fts .fts-knopf svg { width: 17px; height: 17px; flex-shrink: 0; }
    #fts .fts-knopf:focus-visible, #fts .schwierigkeit-knopf:focus-visible, #fts .ziffer-knopf:focus-visible,
    #fts .fts-zeit-knopf:focus-visible, #fts .fts-modal-schliessen:focus-visible, #fts summary:focus-visible { outline: 3px solid var(--fts-schwarz); outline-offset: 2px; }

    /* ===== Spielanleitung ===== */
    #fts .fts-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; }
    #fts .fts-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(--fts-schwarz); user-select: none; }
    #fts .fts-anleitung summary::-webkit-details-marker { display: none; }
    #fts .fts-chev { width: 20px; height: 20px; flex: 0 0 auto; transition: transform 0.2s ease; }
    #fts .fts-anleitung[open] .fts-chev { transform: rotate(180deg); }
    #fts .fts-anleitung-liste { list-style: none; margin: 12px 0 4px; padding: 0; display: grid; gap: 8px; }
    #fts .fts-anleitung-liste li { margin: 0; padding: 10px 14px; background: var(--fts-flaeche); border: 1px solid #DEDAD2; border-radius: 6px; font-size: 0.95rem; font-weight: 300; line-height: 1.55; color: var(--fts-schwarz); }
    #fts .fts-anleitung-liste li strong { font-weight: 600; }

    /* ===== Textabschnitte (Kartenstil der bisherigen Textboxen) ===== */
    #fts .fts-abschnitt { margin-top: 70px; }
    #fts .fts-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(--fts-schwarz); }
    #fts .fts-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(--fts-schwarz); text-align: left; }
    #fts .fts-box p { margin: 0 0 14px; }
    #fts .fts-box p:last-child { margin-bottom: 0; }
    #fts .fts-box strong { font-weight: 500; }
    #fts .fts-tipps { margin: 0; padding-left: 1.2em; }
    #fts .fts-tipps li { margin: 0 0 14px; padding-left: 0.2em; }
    #fts .fts-tipps li:last-child { margin-bottom: 0; }
    #fts .fts-tipps li::marker { color: var(--fts-gelb-dunkel); }
    #fts .fts-tipps strong { display: block; }
    #fts .fts-nutzen { list-style: none; margin: 6px 0 0; padding: 0; }
    #fts .fts-nutzen li { display: grid; grid-template-columns: 2.4em 1fr; gap: 0 0.6em; padding: 14px 0; border-top: 1px solid var(--fts-linie); }
    #fts .fts-nutzen li:last-child { border-bottom: 1px solid var(--fts-linie); }
    #fts .fts-nutzen-nr { font-weight: 600; line-height: 1.5; color: var(--fts-gelb-dunkel); }
    #fts .fts-nutzen strong { display: block; }
    #fts .fts-quellen-titel { margin-top: 20px !important; font-weight: 500; }
    #fts .fts-quellen { list-style: none; margin: 0; padding: 0; font-size: 0.8em; }

    /* ===== Dialoge ===== */
    #fts .fts-modal { position: fixed; inset: 0; z-index: 100000; display: none; align-items: center; justify-content: center; padding: 20px; }
    #fts .fts-modal.active { display: flex; }
    #fts .fts-modal-hintergrund { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(5px); }
    #fts .fts-modal-inhalt { position: relative; width: 100%; max-width: 440px; 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: fts-modal-ein 0.25s ease; }
    @keyframes fts-modal-ein { from { opacity: 0; transform: scale(0.96) translateY(12px); } to { opacity: 1; transform: none; } }
    #fts .fts-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; }
    #fts .fts-modal-schliessen:hover, #fts .fts-modal-schliessen:focus { background: var(--fts-flaeche); color: #374151; }
    #fts .fts-modal h2 { margin: 0 0 8px; font-family: inherit; font-size: 1.75rem; font-weight: 600; line-height: 1.2; color: var(--fts-text); }
    #fts .fts-modal p { margin: 0 0 6px; color: var(--fts-text-2); }
    #fts .fts-ergebnis { display: flex; justify-content: center; gap: 24px; margin: 16px 0 14px; flex-wrap: wrap; }
    #fts .fts-ergebnis strong { display: block; font-size: 1.8rem; font-weight: 700; line-height: 1.1; color: var(--fts-schwarz); font-variant-numeric: tabular-nums; }
    #fts .fts-ergebnis span { font-size: 0.85rem; color: var(--fts-text-2); }
    #fts .fts-modal-knoepfe { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
    #fts .fts-modal-hinweis { color: var(--fts-gruen) !important; font-size: 0.9rem; }

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

    /* ===== Responsive (Elementor: Tablet <= 1024px, Handy <= 767px) ===== */
    @media (max-width: 1024px) {
        #fts .fts-titel { font-size: 45px; }
        #fts .fts-intro { font-size: 16px; margin-top: 30px; }
        #fts .fts-box   { font-size: 16px; }
    }
    @media (max-width: 768px) {
        #fts { max-width: 95%; }
        #fts .fts-karte { padding: 20px; }
    }
    @media (max-width: 767px) {
        #fts .fts-titel { font-size: 28px; }
        #fts .fts-intro { margin-top: 20px; }
        #fts .fts-spiel { margin-top: 24px; }
        #fts .fts-abschnitt { margin-top: 50px; }
        #fts .fts-abschnitt h2 { font-size: 28px; }
        #fts .fts-box { padding: 15px; }
    }
    @media (max-width: 520px) {
        #fts .fts-karte  { padding: 14px 6px; border-radius: 16px; }
        #fts .fts-inhalt { gap: 12px; }
        #fts .fts-stufen { width: 100%; }
        #fts .schwierigkeit-knopf { flex: 1; padding: 6px 8px; }
        #fts .fts-kontrollen { gap: 10px 16px; }
        #fts .fts-fehler input[type="range"] { width: 80px; }
        #fts .ziffer-knopf { min-height: 48px; font-size: 1.2rem; }
        #fts .fts-aktionen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
        #fts .fts-knopf { padding: 10px 8px; font-size: 0.92rem; }
    }
    @media (prefers-reduced-motion: reduce) {
        #fts *, #fts *::before, #fts *::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. */
#fts {
    --fts-schwarz: var(--ft-tinte);
    --fts-text: var(--ft-tinte);
    --fts-text-2: var(--ft-tinte-2);
    --fts-flaeche: var(--ft-flaeche);
    --fts-linie: var(--ft-linie);
    font-family: var(--ft-schrift);
    margin-top: 0;
    margin-bottom: 0;
}
#fts .fts-karte::before { animation: none; }
#fts .fts-text, #fts .fts-meldung, #fts .fts-knopf, #fts .fts-anleitung-liste li { font-size: var(--ft-fs-text); }
#fts .fts-bestzeiten, #fts .fts-ergebnis span { font-size: var(--ft-fs-klein); }
#fts .fts-stat-label { font-size: 0.95rem; letter-spacing: 0; }
#fts .fts-anleitung summary { font-size: var(--ft-fs-h4); }
#fts .fts-knopf { min-height: var(--ft-button-hoehe); font-weight: var(--ft-gewicht-fett); }
@media (max-width: 600px) {
    #fts .fts-knopf { font-size: var(--ft-fs-text); padding: 10px 16px; }
    #fts .fts-stat-label { font-size: 0.85rem; }
}
