/* ================================================================
 *  Körforgó – Animált párosító játék (v2.8.3.1)
 *  Lexilet Plugin  |  lexilet-kfgame.css
 * ================================================================ */

.lexd-kf-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 520px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    color: #fff;
    display: flex;
    flex-direction: column;
}

/* --- Topbar --- */
.lexd-kf-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.07);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 10px;
    flex-shrink: 0;
}

.lexd-kf-progress {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.70);
    white-space: nowrap;
}

.lexd-kf-score-badge {
    background: linear-gradient(135deg, #6c63ff, #8a2be2);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.88rem;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(108, 99, 255, 0.3);
}

/* ── Időszámláló a topbarban ── */
.lexd-kf-timer {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
}

/* ── Végeredmény idő sáv ── */
.lexd-kf-final-time {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 8px 0 4px;
    letter-spacing: 0.02em;
}

.lexd-kf-final-time.is-best {
    color: #ffd700;
    font-weight: 700;
}

.lexd-kf-prev-best {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 10px;
}

/* Legjobb idő bónusz sor – arany szín */
.lexd-kf-time-bonus {
    color: #ffd700 !important;
    font-weight: 700 !important;
    font-size: 0.92rem !important;
}


.lexd-kf-exit-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 1rem;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
}

.lexd-kf-exit-btn:hover {
    background: rgba(220, 50, 50, 0.5);
    color: #fff;
}

/* --- Kérdés wrapper: overflow:hidden klippeli a futószalagot --- */
.lexd-kf-question-wrap {
    padding: 18px 20px 10px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.lexd-kf-question {
    background: rgba(255, 255, 255, 0.11);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    padding: 20px 28px;
    text-align: center;
    font-size: 1.30rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.02em;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform, opacity;
    word-break: break-word;
    /* Alapállapot: bal oldalon kívül, várakozik */
    opacity: 0;
    transform: translateX(-110%);
}

/* === FUTÓSZALAG ANIMÁCIÓK === */

/* Bejövés balról → megáll középen */
@keyframes kfConveyorIn {
    from {
        transform: translateX(-110%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Kilépés középről → jobbra ki */
@keyframes kfConveyorOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(110%);
        opacity: 0;
    }
}

/* Helyben rázás (hibás válasz) */
@keyframes kfShake {

    0%,
    100% {
        transform: translateX(0);
    }

    15% {
        transform: translateX(-8px);
    }

    30% {
        transform: translateX(8px);
    }

    45% {
        transform: translateX(-6px);
    }

    60% {
        transform: translateX(6px);
    }

    75% {
        transform: translateX(-3px);
    }

    90% {
        transform: translateX(3px);
    }
}

.lexd-kf-question.is-entering {
    animation: kfConveyorIn 0.42s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.lexd-kf-question.is-exiting {
    animation: kfConveyorOut 0.34s cubic-bezier(0.55, 0, 0.75, 0.19) forwards;
}

/* Rázáshoz: a kérdésnek translateX(0) az alapállása, ott rázódik */
.lexd-kf-question.is-stationary {
    opacity: 1;
    transform: translateX(0);
}

.lexd-kf-question.is-wrong {
    animation: kfShake 0.48s ease both;
    border-color: rgba(255, 77, 77, 0.7) !important;
    box-shadow: 0 0 22px rgba(255, 77, 77, 0.35);
}

.lexd-kf-mode-label {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.38);
    font-style: italic;
    margin-top: 6px;
    letter-spacing: 0.04em;
}

/* --- Válaszok --- */
.lexd-kf-answers-section {
    padding: 10px 20px 20px;
    flex: 1;
}

.lexd-kf-answers-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.42);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-bottom: 10px;
}

.lexd-kf-answers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

@media (max-width: 700px) {
    .lexd-kf-answers-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .lexd-kf-answers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Válasz gomb --- */
.lexd-kf-answer-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.13);
    color: rgba(255, 255, 255, 0.88);
    border-radius: 9px;
    padding: 10px 8px;
    font-size: 0.84rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.12s, box-shadow 0.15s;
    min-height: 46px;
    word-break: break-word;
    will-change: transform, opacity;
    line-height: 1.3;
}

.lexd-kf-answer-btn:hover {
    background: rgba(108, 99, 255, 0.28);
    border-color: rgba(108, 99, 255, 0.55);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.2);
}

.lexd-kf-answer-btn:active {
    transform: scale(0.97) translateY(0);
}

/* Helyes: zöld fény → skálázva eltűnik */
@keyframes kfCorrectOut {
    0% {
        background: rgba(46, 213, 115, 0.9);
        border-color: #2ed573;
        box-shadow: 0 0 24px rgba(46, 213, 115, 0.6);
        transform: scale(1.08);
        opacity: 1;
    }

    55% {
        background: rgba(46, 213, 115, 0.5);
        transform: scale(0.88);
        opacity: 0.5;
    }

    100% {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.13);
        box-shadow: none;
        transform: scale(0);
        opacity: 0;
    }
}

.lexd-kf-answer-btn.is-correct {
    animation: kfCorrectOut 0.52s ease forwards;
    pointer-events: none;
}

/* Hibás tipp: piros rázás, marad */
@keyframes kfBtnWrong {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

.lexd-kf-answer-btn.is-wrong-pick {
    animation: kfBtnWrong 0.42s ease both;
    background: rgba(231, 76, 60, 0.22) !important;
    border-color: rgba(231, 76, 60, 0.7) !important;
}

/* Új kártya alulról csúszik fel (pool-ból) */
@keyframes kfSlideUpIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.85);
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.13);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.13);
    }
}

/* is-new: nincs forwards – animáció után visszatér a normál CSS állapothoz */
.lexd-kf-answer-btn.is-new {
    animation: kfSlideUpIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Üres placeholder */
.lexd-kf-answer-btn.is-placeholder {
    opacity: 0;
    pointer-events: none;
    cursor: default;
}

/* --- Záróképernyő --- */
@keyframes kfFinishIn {
    from {
        opacity: 0;
        transform: translateX(-60px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.lexd-kf-finish {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 32px 20px;
    text-align: center;
    animation: kfFinishIn 0.5s ease both;
}

@keyframes kfBounce {
    0% {
        transform: scale(0) rotate(-10deg);
    }

    60% {
        transform: scale(1.25) rotate(5deg);
    }

    80% {
        transform: scale(0.92) rotate(-3deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

.lexd-kf-finish-icon {
    font-size: 3.8rem;
    margin-bottom: 14px;
    display: block;
    animation: kfBounce 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.lexd-kf-finish h2 {
    font-size: 1.9rem;
    color: #fff;
    margin: 0 0 6px;
    text-shadow: 0 2px 10px rgba(108, 99, 255, 0.5);
}

.lexd-kf-finish-sub {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.98rem;
    margin-bottom: 16px;
}

.lexd-kf-points-badge {
    background: linear-gradient(135deg, #6c63ff, #8a2be2);
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 8px 26px;
    border-radius: 24px;
    margin-bottom: 12px;
    box-shadow: 0 4px 18px rgba(108, 99, 255, 0.45);
    display: inline-block;
}

.lexd-kf-bonus-line {
    font-size: 0.83rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 18px;
}

.lexd-kf-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 26px;
    flex-wrap: wrap;
    justify-content: center;
}

.lexd-kf-stat {
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px 22px;
    text-align: center;
    min-width: 80px;
}

.lexd-kf-stat-val {
    font-size: 1.6rem;
    font-weight: bold;
    color: #fff;
    line-height: 1;
    margin-bottom: 4px;
}

.lexd-kf-stat-lbl {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.lexd-kf-finish-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ── Háttér fogaskerék (v3.9.0.117) ── */
@keyframes kfGearSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

.lexd-kf-gear-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(90%, 520px);
    aspect-ratio: 1 / 1;
    opacity: 0.055;
    pointer-events: none;
    z-index: 0;
    animation: kfGearSpin 55s linear infinite;
    color: #fff;
}

/* Minden közvetlen gyerek a gear fölé kerüljön */
.lexd-kf-wrap > *:not(.lexd-kf-gear-bg) {
    position: relative;
    z-index: 1;
}