/* Word reveal animation for translated challenge targets.
   Scoped here so reveal experiments do not bloat the main stylesheet. */

.challenge-text-target[data-reveal="words"] {
    min-height: 1.25em;
    position: relative;
}

.challenge-word {
    display: inline-block;
    position: relative;
    margin: 0 0.04em;
    padding: 0 0.12em;
    visibility: visible;
    opacity: 1;
    color: transparent;
    transform: translateY(0);
    transition: opacity 260ms ease, transform 260ms ease, color 180ms ease;
    isolation: isolate;
    z-index: 0;
    cursor: pointer;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.challenge-word:not(.is-visible)::before {
    content: "";
    position: absolute;
    inset: 0.04em 0;
    border-radius: 0.62em;
    background: rgba(148,163,184,0.15);
    box-shadow: inset 0 0 0 1px rgba(108,92,231,0.055);
    pointer-events: none;
    z-index: -1;
}

.challenge-word.is-building,
.challenge-word.is-popping,
.challenge-word.is-fast-building {
    visibility: visible;
    opacity: 1;
    color: transparent;
    transform: translateY(0);
}

.challenge-word.is-building::before,
.challenge-word.is-popping::before,
.challenge-word.is-fast-building::before {
    background: linear-gradient(
        100deg,
        rgba(148,163,184,0.16),
        rgba(108,92,231,0.24),
        rgba(0,184,148,0.13),
        rgba(148,163,184,0.16)
    );
    background-size: 240% 100%;
    box-shadow: 0 5px 14px rgba(108,92,231,0.10);
    filter: opacity(78%);
    pointer-events: none;
    z-index: -1;
}

.challenge-word.is-building::before {
    animation: challengeShimmerSlot 1.55s ease-in-out infinite;
}

.challenge-word.is-fast-building::before {
    animation: challengeShimmerFastBuild 420ms ease-out both;
}

.challenge-word.is-popping {
    color: #94a3b8;
    cursor: default;
}

.challenge-word.is-popping::before {
    animation: challengeShimmerSettle 180ms ease-out both;
}

.challenge-word.is-visible {
    visibility: visible;
    opacity: 1;
    color: inherit;
    cursor: default;
    transform: translateY(0);
}

@keyframes challengeShimmerSlot {
    0% { background-position: 180% 0; opacity: 0.72; }
    50% { opacity: 1; }
    100% { background-position: -80% 0; opacity: 0.72; }
}

@keyframes challengeShimmerFastBuild {
    0% {
        transform: scaleX(0.58);
        background-position: 180% 0;
        opacity: 0.58;
    }
    72% {
        transform: scaleX(1.05);
        opacity: 1;
    }
    100% {
        transform: scaleX(1);
        background-position: -40% 0;
        opacity: 0.92;
    }
}

@keyframes challengeShimmerSettle {
    0% { transform: scale(1); opacity: 0.82; }
    100% { transform: scale(1.06); opacity: 0; }
}
