/* ============================================================
   Lexilet – 3D Flashcard Styles
   ============================================================ */

/* ============================================================
   CSS Változók – Tanulókártya gombok
   A template CSS-ek (dark/funny/normal) ezeket írják felül
   a .lexilet-deck-wrapper scope-on belül.
   ============================================================ */
:root {
    /* Válaszgombok alapszínei (háttér) */
    --lex-btn-wrong-color: #c0392b;
    --lex-btn-wrong-hover: #a93226;
    --lex-btn-wrong-border: rgba(192, 57, 43, 0.35);
    --lex-btn-hard-color: #e8860c;
    --lex-btn-hard-hover: #cf7508;
    --lex-btn-hard-border: rgba(232, 134, 12, 0.4);
    --lex-btn-right-color: #27ae60;
    --lex-btn-right-hover: #219a52;
    --lex-btn-right-border: rgba(39, 174, 96, 0.35);
    --lex-btn-base-bg: #fff;
    --lex-btn-text-color: #fff;

    /* Gomb alap tulajdonságok */
    --lex-btn-key-bg: #f0f0f0;
    --lex-btn-key-color: #888;

    /* Befejező képernyő gombok */
    --lex-btn-restart-bg: linear-gradient(135deg, #6c63ff, #5a52e0);
    --lex-btn-restart-color: #fff;
    --lex-btn-restart-shadow: 0 2px 8px rgba(108, 99, 255, 0.35);
    --lex-btn-back-bg: #f0f0f0;
    --lex-btn-back-color: #555;
    --lex-btn-back-border: 1px solid #ccc;
    --lex-btn-switch-bg: linear-gradient(135deg, #e67e22, #c0630e);
    --lex-btn-switch-color: #fff;
    --lex-btn-switch-shadow: 0 2px 8px rgba(230, 126, 34, 0.35);

    /* Exit gomb */
    --lex-exit-bg: rgba(0, 0, 0, 0.06);
    --lex-exit-color: #888;
    --lex-exit-hover-bg: #5a52e0;
    --lex-exit-hover-color: #fff;
}

/* -- Wrapper ------------------------------------------------- */
.lexilet-deck-wrapper {
    max-width: 520px;
    margin: 0.5em auto;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    position: relative;
    overflow-x: hidden !important;
    /* Prevent scroll on swipe */
    touch-action: pan-y;
    /* Allow vertical scroll, handle horizontal swipe in JS */
}

/* Nuclear fix for horizontal scrolling */
html,
body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* -- Header -------------------------------------------------- */
.lexilet-header {
    margin-bottom: 10px;
}

/* v3.6.6.6 – Kompakt fejléc: mód badge + hangszóró + X egy sorban */
.lexilet-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.lexilet-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.lexilet-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

/* -- Progress ------------------------------------------------ */
.lexilet-progress {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.lexilet-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6c63ff, #48c6ef);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.lexilet-counter {
    text-align: center;
    font-size: 0.9rem;
    color: #888;
    font-weight: 600;
}

/* -- Live stat badges ---------------------------------------- */
.lexilet-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    user-select: none;
}

.lexilet-stat-wrong {
    color: #c0392b;
    background: rgba(192, 57, 43, 0.08);
}

.lexilet-stat-right {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.08);
}

.lexilet-stat-icon {
    font-size: 0.8rem;
}

/* -- 3D Scene ------------------------------------------------ */
.lexilet-scene {
    perspective: 1000px;
    width: 100%;
    aspect-ratio: 4 / 3;
    cursor: pointer;
}

.lexilet-card {
    width: 100%;
    height: 100%;
    position: relative;
    touch-action: pan-y;
    /* Critical for swipe */
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(.4, .2, .2, 1);
    border: 1px solid #ddd;
    border-radius: 16px;
}

.lexilet-card.is-flipped {
    transform: rotateY(180deg);
}

/* -- Swipe animations ---------------------------------------- */
.lexilet-card.swipe-left {
    animation: lexilet-swipe-left 0.35s ease-in forwards;
}

.lexilet-card.swipe-right {
    animation: lexilet-swipe-right 0.35s ease-in forwards;
}

@keyframes lexilet-swipe-left {
    0% {
        transform: translateX(0) rotate(0);
        opacity: 1;
    }

    100% {
        transform: translateX(-120%) rotate(-8deg);
        opacity: 0;
    }
}

@keyframes lexilet-swipe-right {
    0% {
        transform: translateX(0) rotate(0);
        opacity: 1;
    }

    100% {
        transform: translateX(120%) rotate(8deg);
        opacity: 0;
    }
}

.lexilet-card.is-flipped.swipe-left {
    animation: lexilet-swipe-left-flipped 0.35s ease-in forwards;
}

.lexilet-card.is-flipped.swipe-right {
    animation: lexilet-swipe-right-flipped 0.35s ease-in forwards;
}

@keyframes lexilet-swipe-left-flipped {
    0% {
        transform: rotateY(180deg) translateX(0) rotate(0);
        opacity: 1;
    }

    100% {
        transform: rotateY(180deg) translateX(120%) rotate(8deg);
        opacity: 0;
    }
}

@keyframes lexilet-swipe-right-flipped {
    0% {
        transform: rotateY(180deg) translateX(0) rotate(0);
        opacity: 1;
    }

    100% {
        transform: rotateY(180deg) translateX(-120%) rotate(-8deg);
        opacity: 0;
    }
}

.lexilet-card.swipe-down {
    animation: lexilet-swipe-down 0.35s ease-in forwards;
}

.lexilet-card.is-flipped.swipe-down {
    animation: lexilet-swipe-down-flipped 0.35s ease-in forwards;
}

@keyframes lexilet-swipe-down {
    0% {
        transform: translateX(0) rotate(0);
        opacity: 1;
    }

    100% {
        transform: translateY(120%) rotate(3deg);
        opacity: 0;
    }
}

@keyframes lexilet-swipe-down-flipped {
    0% {
        transform: rotateY(180deg) translateX(0) rotate(0);
        opacity: 1;
    }

    100% {
        transform: rotateY(180deg) translateY(120%) rotate(3deg);
        opacity: 0;
    }
}

/* -- Card faces ---------------------------------------------- */
.lexilet-card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    /* Added subtle border */
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08),
        0 1px 4px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    box-sizing: border-box;
    overflow: hidden;
}

.lexilet-card-back {
    transform: rotateY(180deg);
}

/* -- Audio vezérlő sáv (v2.8.0) ------------------------------ */
.lexilet-audio-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 2px 6px 0;
}

/* Globális némítás gomb a kártya felett */
.lexilet-mute-toggle {
    background: transparent;
    border: 1px solid #e0dff8;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 1.2rem;
    cursor: pointer;
    color: #6c63ff;
    user-select: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    line-height: 1;
}

.lexilet-mute-toggle:hover {
    background: rgba(108, 99, 255, 0.08);
    border-color: #6c63ff;
}

.lexilet-mute-toggle.is-muted {
    color: #aaa;
    border-color: #ddd;
}

.lexilet-mute-toggle.is-muted:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: #bbb;
}

/* Kis ▶ play gomb a kifejezés alatt (előlap) */
.lexilet-term-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 4px auto 0;
    background: #f4f3ff;
    border: 1px solid #d0c9ff;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.8rem;
    color: #6c63ff;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
    line-height: 1;
}

.lexilet-term-play:active {
    transform: scale(0.95);
}

.lexilet-term-play .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.lexilet-term-play:hover {
    background: #e0dff8;
    border-color: #6c63ff;
}

/* -- Card content -------------------------------------------- */
.lexilet-card-content {
    text-align: center;
    width: 100%;
    /* Ensure term text doesn't overlap progress pills at the bottom */
}

/* Front face gets extra bottom padding to make room for pills */
.lexilet-card-front .lexilet-card-content {
    padding-bottom: 44px;
}

.lexilet-term {
    font-size: 2rem;
    font-weight: 700;
    color: #222;
    margin: 0;
    line-height: 1.3;
    word-break: break-word;
}

.lexilet-definition {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px;
    line-height: 1.35;
    word-break: break-word;
}

.lexilet-example {
    font-size: 1rem;
    color: #7952b3;
    /* Lexilet purple */
    font-style: normal;
    margin: 0;
    line-height: 1.5;
}

.lexilet-example:empty {
    display: none;
}

.lexilet-example-meaning {
    font-size: 0.95rem;
    color: #777;
    font-style: italic;
    margin: 4px 0 0;
    line-height: 1.4;
}

.lexilet-example-meaning:empty {
    display: none;
}

/* Fordított mód: példamondat fordítása az előlapon (v3.5.2.11) */
.lexilet-front-example-meaning {
    font-size: 0.95rem;
    color: #888;
    font-style: italic;
    margin: 10px 0 0;
    line-height: 1.4;
    word-break: break-word;
}

/* ▶ play gomb a hátlapon (fordított mód) – v2.8.0 */
.lexilet-term-play-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 2px auto 6px;
    background: #f4f3ff;
    border: 1px solid #d0c9ff;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.8rem;
    color: #6c63ff;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
    line-height: 1;
}

.lexilet-term-play-back:active {
    transform: scale(0.95);
}

.lexilet-term-play-back .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.lexilet-term-play-back:hover {
    background: #e0dff8;
    border-color: #6c63ff;
}

/* Példamondat wrapper + kis ▶ play gomb (hátlap) – v2.8.0 */
.lexilet-example-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.lexilet-example-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f4f3ff;
    border: 1px solid #d0c9ff;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.72rem;
    color: #6c63ff;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
    line-height: 1;
}

.lexilet-example-play:active {
    transform: scale(0.95);
}

.lexilet-example-play .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.lexilet-example-play:hover {
    background: #e0dff8;
    border-color: #6c63ff;
}

/* v3.6.0.5 – AI kártyakép megjelenítés a tanulási nézetben */
.lexilet-image-wrap {
    margin-top: 14px;
    text-align: center;
}

.lexilet-image-wrap img {
    max-width: 175px;
    max-height: 175px;
    border-radius: 10px;
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background: #f8f8f8;
}

.lexilet-image-wrap:empty {
    display: none;
}

/* -- Controls ------------------------------------------------ */
.lexilet-controls {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-top: 22px;
}

.lexilet-btn {
    flex: 1;
    max-width: 200px;
    padding: 14px 0;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 12px;
    border: 2px solid transparent;
    background: #fff;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
}

.lexilet-btn:active {
    transform: scale(0.96);
}

.lexilet-btn-key {
    display: inline-block;
    font-size: 0.7rem;
    background: var(--lex-btn-key-bg);
    color: var(--lex-btn-key-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    vertical-align: middle;
}

/* Válaszgomb alap stílusok – a színek a CSS változókból jönnek */
.lexilet-btn-wrong {
    color: var(--lex-btn-wrong-color);
    border-color: var(--lex-btn-wrong-border);
}

.lexilet-btn-hard {
    color: var(--lex-btn-hard-color);
    border-color: var(--lex-btn-hard-border);
}

.lexilet-btn-right {
    color: var(--lex-btn-right-color);
    border-color: var(--lex-btn-right-border);
}

/* -- Completion screen --------------------------------------- */
.lexilet-complete {
    /* In-flow element, replaces card scene */
    display: block;
}

/* Osztályalapú kontroll-elrejtés (WordPress téma !important override ellen) */
.lexilet-deck-wrapper.is-complete .lexilet-controls {
    display: none !important;
}

.lexilet-complete-inner {
    text-align: center;
    background: #fff;
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08),
        0 1px 4px rgba(0, 0, 0, 0.04);
    animation: lexilet-pop 0.4s ease;
}

.lexilet-complete-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.lexilet-complete-inner h2 {
    margin: 0 0 8px;
    font-size: 1.6rem;
    color: #222;
}

.lexilet-complete-msg {
    color: #666;
    font-size: 1rem;
    margin: 0 0 24px;
}

/* -- Stats grid ---------------------------------------------- */
.lexilet-stats-grid {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 28px;
}

.lexilet-stats-item {
    text-align: center;
}

.lexilet-stats-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    color: #333;
}

.lexilet-stats-ok .lexilet-stats-value {
    color: #27ae60;
}

.lexilet-stats-fail .lexilet-stats-value {
    color: #c0392b;
}

.lexilet-stats-label {
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

/* -- Complete actions ---------------------------------------- */
.lexilet-complete-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 12px;
}

.lexilet-complete-actions .lexilet-btn {
    flex: 1 1 0;
    min-width: 0;
}

.lexilet-btn-restart {
    background: var(--lex-btn-restart-bg);
    color: var(--lex-btn-restart-color) !important;
    border: none !important;
    padding: 14px 24px;
    font-size: 1rem;
    box-shadow: var(--lex-btn-restart-shadow);
    max-width: none;
}

.lexilet-btn-restart:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.lexilet-btn-back {
    color: var(--lex-btn-back-color);
    border: var(--lex-btn-back-border);
    background: var(--lex-btn-back-bg);
    padding: 8px 24px;
    font-size: 0.95rem;
    max-width: none;
    text-decoration: none;
}

.lexilet-btn-back:hover {
    color: #333;
    background: #e4e4e4;
    text-decoration: none;
    box-shadow: none;
}

@keyframes lexilet-pop {
    0% {
        transform: scale(0.85);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* -- Responsive ---------------------------------------------- */
@media (max-width: 600px) {
    .lexilet-deck-wrapper {
        max-width: 100%;
        padding: 0 12px;
        box-sizing: border-box;
    }

    .lexilet-scene {
        aspect-ratio: 9 / 10;
    }

    .lexilet-term {
        font-size: 1.55rem;
    }

    .lexilet-definition {
        font-size: 1.2rem;
    }

    .lexilet-card-face {
        padding: 24px 20px;
        border-radius: 14px;
    }

    /* v3.6.0.7: belső margó biztosítása mobilon – term ne érjen a kerethez */
    .lexilet-card-content {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    /* v3.9.0.64: definition margó + sortávolság szűkítés mobilon */
    .lexilet-definition {
        margin-bottom: 8px;
    }
    .lexilet-example {
        line-height: 1.35;
    }
    .lexilet-example-meaning {
        line-height: 1.3;
    }

    /* v3.6.0.7: kisebb kép mobilon, ne lógjon ki */
    .lexilet-image-wrap {
        margin-top: 8px;
    }
    .lexilet-image-wrap img {
        max-width: 150px;
        max-height: 150px;
    }

    .lexilet-btn {
        padding: 16px 0;
        font-size: 1rem;
        border-radius: 10px;
    }

    .lexilet-stats-grid {
        gap: 16px;
    }

    .lexilet-stats-value {
        font-size: 1.6rem;
    }

    body .lexilet-deck-wrapper .lexilet-complete-inner {
        padding: 14px 12px !important;
    }

    body .lexilet-deck-wrapper .lexilet-complete-icon {
        font-size: 1.6rem !important;
        margin-bottom: 2px !important;
    }

    body .lexilet-deck-wrapper .lexilet-complete-inner h2 {
        font-size: 1.1rem !important;
        margin-bottom: 2px !important;
    }

    body .lexilet-deck-wrapper .lexilet-complete-msg {
        font-size: 0.85rem !important;
        margin: 0 0 10px !important;
    }

    body .lexilet-deck-wrapper .lexilet-stats-grid {
        gap: 10px !important;
        margin-bottom: 12px !important;
    }

    body .lexilet-deck-wrapper .lexilet-stats-value {
        font-size: 1.2rem !important;
    }

    body .lexilet-deck-wrapper .lexilet-stats-label {
        font-size: 0.7rem !important;
    }

    body .lexilet-deck-wrapper .lexilet-complete-actions {
        gap: 6px !important;
    }

    body .lexilet-deck-wrapper .lexilet-btn-restart {
        padding: 8px 14px !important;
        font-size: 0.85rem !important;
    }

    /* Fejléc (progress bar + számlálók) elrejtése a gratulációs képernyőn */
    body .lexilet-deck-wrapper.is-complete .lexilet-header {
        display: none !important;
    }
}

/* ============================================================
   v1.8.0 – Exit Button (v3.6.6.6: bekerült a kompakt fejléc sorba)
   ============================================================ */
.lexilet-exit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--lex-exit-bg);
    color: var(--lex-exit-color);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

/* Régi audio bar – hátrafelé kompatibilitás (HTML-ben már nincs) */
.lexilet-audio-bar {
    display: none;
}

body .lexilet-deck-wrapper .lexilet-exit-btn:hover {
    background: var(--lex-exit-hover-bg) !important;
    color: var(--lex-exit-hover-color) !important;
}

/* ============================================================
   v1.7.1 – Audio No-Audio State
   ============================================================ */
.lexilet-audio-btn.no-audio {
    opacity: 0.2;
    cursor: default;
    pointer-events: none;
    text-decoration: line-through;
}

/* v1.7.1 – Forced Contrast szekció TÖRÖLVE (v3.5.0.31)
   A gomb stílusok mostantól a fájl végén lévő egyetlen blokkban vannak,
   CSS változókkal. Lásd: "VÉGSŐ GOMB BLOKK" szekció. */

/* ============================================================
   v2.3.6.1 – Fordított mód UI: mode badge, pills, switch btn
   ============================================================ */

/* -- Mód badge a fejlécben ---------------------------------- */
.lexilet-mode-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(108, 99, 255, 0.1);
    color: #6c63ff;
    width: fit-content;
    border: 1.5px solid rgba(108, 99, 255, 0.2);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.lexilet-mode-badge.is-reverse {
    background: rgba(230, 126, 34, 0.1);
    color: #e67e22;
    border-color: rgba(230, 126, 34, 0.25);
}

/* Red Zone mód badge (v3.5.2.0) */
.lexilet-mode-badge.is-red-zone {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.3);
    font-weight: 600;
}

/* No ::before - JS sets the arrow in textContent */

/* -- Progress pills a kártya alján -------------------------- */
/* NOTE: .lexilet-card-front already has position:absolute via .lexilet-card-face
   We must NOT add position:relative here - it breaks the 3D card layout!
   The pills use position:absolute relative to .lexilet-card-face which is already positioned. */

.lexilet-progress-pills {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 0 20px;
    pointer-events: none;
    z-index: 3;
    /* pills sit on top of card content */
}

/* v3.9.0.19: Pill-ek elrejtése a kártya hátulján – a backdrop-filter
   megtöri a backface-visibility:hidden-t, ezért a tükörképük átüt. */
.lexilet-card.is-flipped .lexilet-progress-pills {
    visibility: hidden;
}

.lexilet-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    border: 1.5px solid #e0e0e8;
    background: rgba(255, 255, 255, 0.85);
    color: #bbb;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.lexilet-pill.is-active {
    color: #fff;
    border-color: transparent;
    transform: scale(1.06);
}

.lexilet-pill-normal.is-active {
    background: #6c63ff;
}

.lexilet-pill-reverse.is-active {
    background: #e67e22;
}

/* -- Switch direction gomb (completion screen) -------------- */
.lexilet-btn-switch-dir {
    background: var(--lex-btn-switch-bg);
    color: var(--lex-btn-switch-color) !important;
    border: none !important;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    max-width: none;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: var(--lex-btn-switch-shadow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lexilet-btn-switch-dir:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* -- Lexi Pont Float (v2.8.0.3) ------------------------------ */
.lex-point-float {
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    font-weight: bold;
    color: #6c63ff;
    background: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 16px;
    animation: lexFloatUp 1.5s ease-out forwards;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

@keyframes lexFloatUp {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -80%) scale(1.1);
    }

    80% {
        opacity: 1;
        transform: translate(-50%, -120%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -150%) scale(1);
    }
}

/* =================================================================
 * v3.4.2.0 – Kártya-magyarázat (info_text) – ⓘ gomb + modal
 * ================================================================= */

/* ⓘ gomb a kártya hátlapján – a play gombéval azonos méret és stílus */
/* FONTOS: a lexilet-tour.css is definiálja a .lexilet-info-btn osztályt (17px kör),
   ezért itt !important-tal felül kell írni a height és min-width értékeket is.
   A display tulajdonságot a JS vezérli (renderCard) – NE legyen itt !important! */
.lexilet-info-btn {
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    background: #f4f3ff !important;
    border: 1px solid #d0c9ff !important;
    border-radius: 20px !important;
    padding: 4px 10px !important;
    font-size: 14px !important;
    color: #6c63ff !important;
    cursor: pointer !important;
    user-select: none;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
    line-height: 1 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    font-weight: normal !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    outline: none !important;
}

.lexilet-info-btn:hover {
    background: #e8e5ff !important;
    border-color: #b0a4ff !important;
}

.lexilet-info-btn:active {
    transform: scale(0.95);
}

.lexilet-info-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(107, 124, 255, 0.3) !important;
}

/* Felugró modal overlay */
.lexd-info-text-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    box-sizing: border-box;
    animation: lexdInfoFadeIn 0.18s ease;
}

@keyframes lexdInfoFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lexd-info-text-box {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    max-width: 480px;
    width: 100%;
    padding: 24px 24px 20px;
    position: relative;
    animation: lexdInfoSlideUp 0.2s ease;
}

@keyframes lexdInfoSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.lexd-info-text-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.15s;
}

.lexd-info-text-close:hover {
    color: #333;
}

.lexd-info-text-title {
    font-size: 1rem;
    font-weight: 600;
    color: #6b7cff;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lexd-info-text-icon {
    font-size: 1.15rem;
}

.lexd-info-text-body {
    font-size: 0.97rem;
    color: #333;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ============================================================
   v3.5.0.31 – VÉGSŐ GOMB BLOKK (CSS változókkal)
   Ez az EGYETLEN hely, ahol a válaszgombok végleges stílusai
   definiálva vannak. A színek CSS változókból jönnek (:root),
   amiket a template CSS-ek a .lexilet-deck-wrapper scope-on
   belül felülírhatnak – nincs szükség !important-ra vagy
   magas specificitásra a template-ekben.
   ============================================================ */

/* -- Alap kontrollgombok (WP téma reset) -------------------- */
html body .lexilet-deck-wrapper .lexilet-controls {
    display: flex !important;
    gap: 8px !important;
    justify-content: center !important;
    padding: 0 4px !important;
}

html body .lexilet-deck-wrapper.is-complete .lexilet-controls {
    display: none !important;
}

html body .lexilet-deck-wrapper .lexilet-controls .lexilet-btn {
    border: 2px solid transparent !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    font-size: 1rem !important;
    padding: 12px 6px !important;
    flex: 1 !important;
    max-width: 200px !important;
    white-space: nowrap !important;
}

/* Focus: NEM állítjuk a background-ot! Csak outline/shadow reset */
html body .lexilet-deck-wrapper .lexilet-controls .lexilet-btn:focus,
html body .lexilet-deck-wrapper .lexilet-controls .lexilet-btn:visited {
    outline: none !important;
    box-shadow: none !important;
}

/* -- Nem tudtam (piros) – teli színes háttér, fehér szöveg -- */
html body .lexilet-deck-wrapper .lexilet-controls .lexilet-btn-wrong {
    background: var(--lex-btn-wrong-color) !important;
    color: var(--lex-btn-text-color) !important;
    border-color: var(--lex-btn-wrong-color) !important;
}

/* -- Nehéz volt (narancs) ----------------------------------- */
html body .lexilet-deck-wrapper .lexilet-controls .lexilet-btn-hard {
    background: var(--lex-btn-hard-color) !important;
    color: var(--lex-btn-text-color) !important;
    border-color: var(--lex-btn-hard-color) !important;
}

/* -- Tudtam (zöld) ------------------------------------------ */
html body .lexilet-deck-wrapper .lexilet-controls .lexilet-btn-right {
    background: var(--lex-btn-right-color) !important;
    color: var(--lex-btn-text-color) !important;
    border-color: var(--lex-btn-right-color) !important;
}

/* -- Desktop hover: gombok sötétednek ----------------------- */
@media (hover: hover) and (pointer: fine) {
    html body .lexilet-deck-wrapper .lexilet-controls .lexilet-btn-wrong:hover {
        background: var(--lex-btn-wrong-hover) !important;
        color: var(--lex-btn-text-color) !important;
        border-color: var(--lex-btn-wrong-hover) !important;
    }
    html body .lexilet-deck-wrapper .lexilet-controls .lexilet-btn-hard:hover {
        background: var(--lex-btn-hard-hover) !important;
        color: var(--lex-btn-text-color) !important;
        border-color: var(--lex-btn-hard-hover) !important;
    }
    html body .lexilet-deck-wrapper .lexilet-controls .lexilet-btn-right:hover {
        background: var(--lex-btn-right-hover) !important;
        color: var(--lex-btn-text-color) !important;
        border-color: var(--lex-btn-right-hover) !important;
    }
    /* Hover+focus kombináció is működjön (kattintás után is) */
    html body .lexilet-deck-wrapper .lexilet-controls .lexilet-btn-wrong:focus:hover {
        background: var(--lex-btn-wrong-hover) !important;
        color: var(--lex-btn-text-color) !important;
    }
    html body .lexilet-deck-wrapper .lexilet-controls .lexilet-btn-hard:focus:hover {
        background: var(--lex-btn-hard-hover) !important;
        color: var(--lex-btn-text-color) !important;
    }
    html body .lexilet-deck-wrapper .lexilet-controls .lexilet-btn-right:focus:hover {
        background: var(--lex-btn-right-hover) !important;
        color: var(--lex-btn-text-color) !important;
    }
}

/* -- Befejező képernyő gombjai ------------------------------ */
html body .lexilet-deck-wrapper .lexilet-btn-restart {
    background: var(--lex-btn-restart-bg) !important;
    color: var(--lex-btn-restart-color) !important;
    box-shadow: var(--lex-btn-restart-shadow) !important;
}

html body .lexilet-deck-wrapper .lexilet-btn-restart:hover {
    opacity: 0.9 !important;
}

html body .lexilet-deck-wrapper .lexilet-btn-back {
    background: var(--lex-btn-back-bg) !important;
    color: var(--lex-btn-back-color) !important;
    border: var(--lex-btn-back-border) !important;
}

/* -- Mobil -------------------------------------------------- */
@media (max-width: 600px) {
    html body .lexilet-deck-wrapper .lexilet-controls .lexilet-btn {
        font-size: 0.9rem !important;
        padding: 12px 4px !important;
    }

    /* Válaszgombok: mobil active effekt (villanás) */
    html body .lexilet-deck-wrapper .lexilet-controls .lexilet-btn-wrong:active {
        background: var(--lex-btn-wrong-hover) !important;
    }
    html body .lexilet-deck-wrapper .lexilet-controls .lexilet-btn-hard:active {
        background: var(--lex-btn-hard-hover) !important;
    }
    html body .lexilet-deck-wrapper .lexilet-controls .lexilet-btn-right:active {
        background: var(--lex-btn-right-hover) !important;
    }

    /* Fejléc elrejtése a gratulációs képernyőn */
    html body .lexilet-deck-wrapper.is-complete .lexilet-header {
        display: none !important;
    }
}

/* ================================================================
 *  v3.5.2.12 – Kártya háttérszínek (szótár + tanulás mód)
 * ================================================================ */
.lex-bg-red    { background-color: #ffe0e0 !important; }
.lex-bg-green  { background-color: #d6f5da !important; }
.lex-bg-blue   { background-color: #d8e8ff !important; }
.lex-bg-yellow { background-color: #fff3b0 !important; }