/* ===================================================================
   TEIL 3 — WAS MAN SONST NOCH MIT FARBE MACHEN KANN

   Drei Bauteile, alle aus der Einstellungs-App:

     Umschalter „Alle gleich / Buchstaben"
       aus `views/Settings/MultiColorSettingsBlock.jsx` — Fläche
       rgba(255,255,255,.05), Innenabstand 4, Radius 8; die zwei
       Knöpfe je flex 1, Innenabstand 6, Radius 6, 0,8rem, Gewicht 500.
       Der gewählte trägt weiße Schrift, der andere 50 % Weiß.

     Suchfeld für Farbnamen
       die Rechnung dahinter ist `matchesColorKeyword` aus
       `utils/ColorUtils.js`, wortgleich übernommen.

     Kontrast-Nachbesserung
       `ensureMinimumContrast`, ebenfalls wortgleich.

   Die Hausklassen der Seite (`fb-*`) stehen wie bei Teil 1 und 2 in
   `farbrad-buehne.css` und `farbrad-karten.css`.
   =================================================================== */

.fm-schalter {
    display: flex;
    background: rgba(255, 255, 255, .05);
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.fm-schalter button {
    flex: 1;
    border: none;
    background: transparent;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .8rem;
    font-weight: 500;
    font-family: inherit;
    color: rgba(255, 255, 255, .5);
    transition: background-color .2s, color .2s;
}

.fm-schalter button[aria-selected="true"] {
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

.fm-wort {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    padding: 22px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, .3);
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    font-size: clamp(1.6rem, 5vw, 2.6rem);
    font-weight: 800;
}

.fm-buchstabe {
    border: none;
    background: none;
    padding: 0 1px;
    font: inherit;
    color: var(--fm-grundfarbe, #3b82f6);
    cursor: pointer;
    border-radius: 4px;
    transition: outline-color .15s;
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.fm-wort[data-modus="alle"] .fm-buchstabe {
    cursor: default;
}

.fm-buchstabe[aria-pressed="true"] {
    outline-color: rgba(255, 255, 255, .55);
}

.fm-leer {
    width: .35em;
}

.fm-farben {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.fm-farbe {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid transparent;
    padding: 0;
    cursor: pointer;
    transition: transform .2s, border-color .2s;
}

.fm-farbe[aria-pressed="true"] {
    border-width: 2px;
    border-color: #fff;
    transform: scale(1.1);
}

.fm-hinweis-klein {
    margin-top: 10px;
    font-size: .8rem;
    opacity: .65;
}

.fm-suche {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.fm-suche input {
    flex: 1 1 200px;
    min-width: 0;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid rgba(128, 128, 128, .3);
    background: rgba(0, 0, 0, .25);
    color: inherit;
    font: inherit;
    font-size: .95rem;
    outline: none;
}

.fm-suche input:focus-visible {
    border-color: #60a5fa;
}

.fm-zaehler {
    font-size: .8rem;
    opacity: .7;
    white-space: nowrap;
}

.fm-treffer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    gap: 8px;
    min-height: 44px;
}

.fm-treffer i {
    display: block;
    aspect-ratio: 1/1;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .35);
}

.fm-nichts {
    grid-column: 1 / -1;
    font-size: .9rem;
    opacity: .65;
}

.fm-probe {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 12px;
    margin: 12px 0;
}

.fm-tafel {
    padding: 18px;
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 1.05rem;
}

.fm-tafel small {
    display: block;
    margin-top: 6px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    opacity: .8;
}

:root[data-thema="hell"] .fm-schalter {
    background: rgba(16, 16, 20, .06);
}

:root[data-thema="hell"] .fm-schalter button {
    color: rgba(16, 16, 20, .55);
}

:root[data-thema="hell"] .fm-schalter button[aria-selected="true"] {
    color: #101014;
    background: rgba(16, 16, 20, .10);
}

:root[data-thema="hell"] .fm-wort {
    background: rgba(16, 16, 20, .05);
}

:root[data-thema="hell"] .fm-buchstabe[aria-pressed="true"] {
    outline-color: rgba(16, 16, 20, .5);
}

:root[data-thema="hell"] .fm-farbe[aria-pressed="true"] {
    border-color: #101014;
}

:root[data-thema="hell"] .fm-suche input {
    background: rgba(16, 16, 20, .04);
}
