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

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

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

    /* ===== Spielbereich ===== */
    #ftbm .ftbm-spiel { max-width: 680px; margin: 34px auto 0; text-align: center; }
    #ftbm .ftbm-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;
    }
    #ftbm .ftbm-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: ftbm-hintergrund 25s linear infinite; z-index: 0; pointer-events: none;
    }
    @keyframes ftbm-hintergrund { 0% { transform: translate(0, 0) rotate(0deg); } 100% { transform: translate(-30px, -30px) rotate(360deg); } }
    #ftbm .ftbm-inhalt { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 18px; }

    /* Schwierigkeit (Segment wie Buchstabensalat) */
    #ftbm .ftbm-feld-label { display: block; margin-bottom: 6px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--ftbm-text-2); }
    #ftbm .ftbm-stufen { display: inline-flex; padding: 3px; background: #ffffff; border: 2px solid var(--ftbm-schwarz); border-radius: 100px; }
    #ftbm .ftbm-stufe {
        -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(--ftbm-schwarz); cursor: pointer;
    }
    #ftbm .ftbm-stufe:hover, #ftbm .ftbm-stufe:focus { background: var(--ftbm-flaeche); color: var(--ftbm-schwarz); }
    #ftbm .ftbm-stufe[aria-pressed="true"] { background: var(--ftbm-gelb); color: var(--ftbm-schwarz); }

    /* Raster 11 x 11: erste Zeile/Spalte = Zahlen */
    #ftbm .ftbm-brett { width: 100%; display: flex; justify-content: center; }
    #ftbm .ftbm-raster {
        display: grid;
        grid-template-columns: repeat(11, 1fr);
        grid-template-rows: repeat(11, 1fr);
        width: 100%;
        max-width: 484px;
        aspect-ratio: 1;
        padding: 6px;
        gap: 2px;
        background: rgba(255, 255, 255, 0.85);
        border: 1px solid rgba(0, 0, 0, 0.05);
        border-radius: 15px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    #ftbm .empty-cell, #ftbm .hint-cell, #ftbm .batalla-cell {
        min-width: 0; min-height: 0; position: relative;
        display: flex; align-items: center; justify-content: center;
        font-size: clamp(0.72rem, 2.6vw, 1rem);
    }
    #ftbm .hint-cell {
        background: var(--ftbm-flaeche); border-radius: 6px;
        font-weight: 600; color: var(--ftbm-schwarz);
        transition: background 0.15s ease, color 0.15s ease;
    }
    /* Live-Rueckmeldung: Zahl erreicht (gruen) bzw. ueberschritten (rot) */
    #ftbm .hint-cell.erfuellt { background: #D1FAE5; color: var(--ftbm-gruen); }
    #ftbm .hint-cell.zuviel   { background: #FEE2E2; color: #B91C1C; }
    #ftbm .batalla-cell {
        -webkit-appearance: none; appearance: none; margin: 0; padding: 0;
        width: 100%; height: 100%;
        background: #ffffff; border: 1px solid var(--ftbm-linie); border-radius: 6px;
        font-family: inherit; color: var(--ftbm-text); cursor: pointer;
        touch-action: manipulation; -webkit-tap-highlight-color: transparent;
        transition: background 0.12s ease;
    }
    #ftbm .batalla-cell:hover { background: var(--ftbm-flaeche); }
    #ftbm .batalla-cell:focus-visible { outline: 3px solid var(--ftbm-schwarz); outline-offset: 1px; z-index: 1; }
    /* Vorgaben: fest, gelb hinterlegt */
    #ftbm .batalla-cell.highlighted, #ftbm .batalla-cell.highlighted:hover { background: var(--ftbm-gelb-hell); border-color: var(--ftbm-gelb-dunkel); cursor: default; }
    #ftbm .batalla-cell.water { color: #2563EB; }
    /* Schiffsteile — Groesse relativ zur Zelle */
    #ftbm .ship-part { width: 72%; height: 72%; background: var(--ftbm-schiff); border-radius: 4px; }
    #ftbm .ship-part.ship-start  { border-radius: 50% 0 0 50%; width: 84%; }
    #ftbm .ship-part.ship-end    { border-radius: 0 50% 50% 0; width: 84%; }
    #ftbm .ship-part.ship-top    { border-radius: 50% 50% 0 0; height: 84%; }
    #ftbm .ship-part.ship-bottom { border-radius: 0 0 50% 50%; height: 84%; }
    #ftbm .ship-part.ship-middle { border-radius: 3px; width: 84%; height: 84%; }
    #ftbm .ship-part.ship-single { border-radius: 50%; width: 62%; height: 62%; }
    /* Noch unbestimmtes Teil: Form folgt, sobald die Enden feststehen */
    #ftbm .ship-part.ship-generic { background: #6B7280; outline: 2px dashed rgba(255, 255, 255, 0.6); outline-offset: -4px; }

    /* Flotte */
    #ftbm .ftbm-flotte-box { background: rgba(255, 255, 255, 0.85); border: 1px solid rgba(0, 0, 0, 0.05); border-radius: 12px; padding: 12px 16px; }
    #ftbm .ftbm-flotte { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; }
    #ftbm .ship { display: flex; align-items: center; gap: 2px; transition: opacity 0.2s ease; }
    #ftbm .ship.gefunden { opacity: 0.4; }
    #ftbm .ship.gefunden .part { background: var(--ftbm-gruen); }
    #ftbm .part { width: 22px; height: 22px; background: var(--ftbm-schiff); border-radius: 4px; }
    #ftbm .part.ship-start  { border-radius: 50% 0 0 50%; }
    #ftbm .part.ship-end    { border-radius: 0 50% 50% 0; }
    #ftbm .part.ship-single { border-radius: 50%; width: 18px; height: 18px; }

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

    /* ===== Buttons (Pill-Stil der fahrtauglich.ch-Buttons) ===== */
    #ftbm .ftbm-kontrollen { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
    #ftbm .ftbm-knopf {
        -webkit-appearance: none; appearance: none; margin: 0;
        display: inline-flex; align-items: center; justify-content: center;
        min-height: 48px; padding: 10px 26px;
        background: var(--ftbm-gelb); border: 2px solid var(--ftbm-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(--ftbm-schwarz); cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    }
    #ftbm .ftbm-knopf:hover, #ftbm .ftbm-knopf:focus { background: var(--ftbm-gelb-dunkel); border-color: var(--ftbm-gelb-dunkel); color: var(--ftbm-schwarz); }
    #ftbm .ftbm-knopf:hover { transform: translateY(-1px); }
    #ftbm .ftbm-knopf-hell { background: #ffffff; border-color: var(--ftbm-schwarz); }
    #ftbm .ftbm-knopf-hell:hover, #ftbm .ftbm-knopf-hell:focus { background: var(--ftbm-flaeche); border-color: var(--ftbm-schwarz); }
    #ftbm .ftbm-knopf:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
    #ftbm .ftbm-knopf:focus-visible, #ftbm .ftbm-stufe:focus-visible,
    #ftbm .ftbm-modal-schliessen:focus-visible, #ftbm summary:focus-visible { outline: 3px solid var(--ftbm-schwarz); outline-offset: 2px; }

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

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

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

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

    /* ===== Responsive (Elementor: Tablet <= 1024px, Handy <= 767px) ===== */
    @media (max-width: 1024px) {
        #ftbm .ftbm-titel { font-size: 45px; }
        #ftbm .ftbm-intro { font-size: 16px; margin-top: 30px; }
        #ftbm .ftbm-box   { font-size: 16px; }
    }
    @media (max-width: 768px) {
        #ftbm { max-width: 95%; }
        #ftbm .ftbm-karte { padding: 20px; }
    }
    @media (max-width: 767px) {
        #ftbm .ftbm-titel { font-size: 28px; }
        #ftbm .ftbm-intro { margin-top: 20px; }
        #ftbm .ftbm-spiel { margin-top: 24px; }
        #ftbm .ftbm-abschnitt { margin-top: 50px; }
        #ftbm .ftbm-abschnitt h2 { font-size: 28px; }
        #ftbm .ftbm-box { padding: 15px; }
    }
    @media (max-width: 520px) {
        #ftbm .ftbm-karte  { padding: 14px 6px; border-radius: 16px; }
        #ftbm .ftbm-inhalt { gap: 14px; }
        #ftbm .ftbm-raster { padding: 4px; gap: 1px; }
        #ftbm .hint-cell, #ftbm .batalla-cell { border-radius: 3px; }
        #ftbm .ftbm-stufen { width: 100%; }
        #ftbm .ftbm-stufe  { flex: 1; padding: 6px 8px; }
        #ftbm .ftbm-kontrollen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
        #ftbm .ftbm-kontrollen .ftbm-knopf:first-child { grid-column: 1 / -1; }
        #ftbm .ftbm-knopf { padding: 10px 12px; font-size: 0.95rem; }
        #ftbm .part { width: 16px; height: 16px; }
        #ftbm .part.ship-single { width: 13px; height: 13px; }
        #ftbm .ftbm-flotte { gap: 8px; }
    }
    @media (prefers-reduced-motion: reduce) {
        #ftbm *, #ftbm *::before, #ftbm *::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. */
#ftbm {
    --ftbm-schwarz: var(--ft-tinte);
    --ftbm-text: var(--ft-tinte);
    --ftbm-text-2: var(--ft-tinte-2);
    --ftbm-flaeche: var(--ft-flaeche);
    --ftbm-linie: var(--ft-linie);
    font-family: var(--ft-schrift);
    margin-top: 0;
    margin-bottom: 0;
}
#ftbm .ftbm-karte::before { animation: none; }
#ftbm .ftbm-text, #ftbm .ftbm-meldung, #ftbm .ftbm-knopf, #ftbm .ftbm-anleitung-liste li { font-size: var(--ft-fs-text); }
#ftbm .ftbm-bestzeiten, #ftbm .ftbm-ergebnis span { font-size: var(--ft-fs-klein); }
#ftbm .ftbm-stat-label { font-size: 0.95rem; letter-spacing: 0; }
#ftbm .ftbm-anleitung summary { font-size: var(--ft-fs-h4); }
#ftbm .ftbm-knopf { min-height: var(--ft-button-hoehe); font-weight: var(--ft-gewicht-fett); }
@media (max-width: 600px) {
    #ftbm .ftbm-knopf { font-size: var(--ft-fs-text); padding: 10px 16px; }
    #ftbm .ftbm-stat-label { font-size: 0.85rem; }
}
