/**
 * @author Firma: 4Unit Systems Integration GmbH
 *         Adresse: Jahnstraße 36, 34582 Borken (Hessen)
 *         Telefon: 05682 73 48 26
 *         E-Mail: info@4unit.com
 *         Website: https://4unit.com
 *
 * @license GPL-2.0-or-later <https://www.gnu.org/licenses/gpl-2.0.html>
 */

.fucap {
    --fucap-radius: 10px;
    --fucap-border: #d7d9de;
    --fucap-accent: #e2560f;
    --fucap-text: #1f2327;
    --fucap-muted: #6b7280;
    margin: 18px 0;
    max-width: 100%;
    color: var(--fucap-text);
    font-size: 15px;
    line-height: 1.5;
}

.fucap__label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.fucap__box {
    max-width: 320px;
}

/*
 * Bild und Schieberegler sind grafisch, nicht sprachlich: In Sprachen, die von
 * rechts nach links gelesen werden, bleibt die Laufrichtung des Puzzles gleich.
 */
.fucap__stage,
.fucap__slider {
    direction: ltr;
}

.fucap__stage {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--fucap-border);
    border-radius: var(--fucap-radius);
    background: #eef0f3;
    line-height: 0;
    touch-action: pan-y;
}

.fucap__bg {
    display: block;
    width: 100%;
    height: auto;
}

.fucap__piece {
    position: absolute;
    top: 0;
    left: 0;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .45));
    will-change: transform;
}

.fucap__slider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 4px 14px 4px 4px;
    border: 1px solid var(--fucap-border);
    border-radius: 999px;
    background: #f6f7f9;
}

.fucap__range {
    flex: 1 1 auto;
    width: 100%;
    margin: 0;
    accent-color: var(--fucap-accent);
    cursor: grab;
}

.fucap__range:active {
    cursor: grabbing;
}

.fucap__knob {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--fucap-border);
    color: var(--fucap-muted);
    font-size: 13px;
    letter-spacing: -1px;
}

.fucap__hint {
    margin-top: 6px;
    color: var(--fucap-muted);
    font-size: 13px;
    line-height: 1.4;
}

.fucap__actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
}

.fucap__link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--fucap-accent);
    font: inherit;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

.fucap__link:hover,
.fucap__link:focus-visible {
    text-decoration: none;
}

.fucap__status {
    margin-top: 8px;
    font-size: 13px;
    min-height: 1.4em;
}

.fucap--solved .fucap__status {
    color: #15803d;
    font-weight: 600;
}

.fucap--failed .fucap__status {
    color: #b42318;
}

.fucap--solved .fucap__stage {
    border-color: #15803d;
}

.fucap--solved .fucap__slider {
    opacity: .6;
    pointer-events: none;
}

.fucap__text-question {
    margin: 0 0 8px;
    font-weight: 600;
}

.fucap__text-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.fucap__input {
    flex: 0 1 140px;
    padding: 8px 10px;
    border: 1px solid var(--fucap-border);
    border-radius: 8px;
    font: inherit;
}

.fucap__button {
    padding: 8px 14px;
    border: 0;
    border-radius: 8px;
    background: var(--fucap-accent);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.fucap__note {
    color: var(--fucap-muted);
    font-size: 13px;
}

/* Honigtopf: für Menschen unsichtbar, für Maschinen les- und ausfüllbar. */
.fucap__trap {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    .fucap {
        --fucap-border: #3a3f46;
        --fucap-text: #e8eaed;
        --fucap-muted: #9aa1ab;
    }

    .fucap__stage,
    .fucap__slider {
        background: #23262b;
    }

    .fucap__knob {
        background: #2d3136;
    }

    .fucap__input {
        background: #23262b;
        color: inherit;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fucap__piece {
        transition: none !important;
    }
}
