/* ================================================================
 *  Lexilet – Vendég Dashboard CSS (lexilet-guest.css)
 *  v2.8.4.0
 *
 *  Prefix: .lxg-  (lexilet-guest)
 *  A meglévő CSS-sel nem ütközik!
 * ================================================================ */

/* ── Google Font import ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Fő wrapper ─────────────────────────────────────────────── */
.lxg-wrap {
    font-family: 'Inter', system-ui, sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 48px;
    color: #1a1a2e;
}

/* ── Lexilet kártyás wrapper felülírása panelen belül ─────── */
/* A lexilet-cards.css max-width:520px és margin:2em auto-t állít be,
   amit felülírunk, hogy a panelen belül jól nézzen ki */
.lxg-study-panel .lexilet-deck-wrapper {
    max-width: 100% !important;
    margin: 0 !important;
    padding-top: 32px !important;
    box-sizing: border-box;
}

/* Az exit gomb a guest dashboardban fölösleges → elrejtjük */
.lxg-study-panel .lexilet-exit-btn {
    display: none !important;
}

/* Panel body-n nincs felesleges overflow */
.lxg-cards-body {
    padding: 0 !important;
    overflow: hidden;
}

.lxg-cards-body .lexilet-deck-wrapper {
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
}

/*
 * ── NORMAL TEMPLATE stílusok – kártyák és panelek kontrasztosabban ──
 * Ezek a normal.css kulcsstílusait utánozzák, és felülírják az admin
 * beállított témát a vendég dashboardon belül.
 * Az .lxg-guest-dashboard szülőn belül érvényesülnek.
 */

/* Kártyalapok: meleg halvány sárga alap + erőteljesebb keret */
#lxg-guest-dashboard .lexilet-card-face {
    background: #fffde8 !important;
    border: 1.5px solid #d8ce9a !important;
    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.12),
        0 1px 4px rgba(0, 0, 0, 0.07) !important;
}

/* Fordítás figyelmeztető sor a kártya előlapján */
#lxg-guest-dashboard .lexilet-flip-hint {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.78em;
    font-weight: 700;
    color: #e74c3c;
    letter-spacing: 0.02em;
    pointer-events: none;
    animation: lxgFlipPulse 2s ease-in-out infinite;
}

@keyframes lxgFlipPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.55;
    }
}

/* Kártya fejléc (progress bar sáv területe) */
#lxg-guest-dashboard .lexilet-header {
    background: transparent;
    border-bottom: 1px solid #d8ce9a;
}

/* Gomb keretkontraszt */
#lxg-guest-dashboard .lexilet-btn {
    border: 1px solid #c0b8a8 !important;
}

/* v3.9.0.103: background: #fff hozzáadva – a cards.css erős specificitású
   szabályai pirosra/zöldre állítják a hátteret, de a color: #c0392b/#27ae60
   felülírás miatt piros-piros / zöld-zöld kombó keletkezett (olvashatatlan).
   A #fff háttér visszaállítja az "outline" gombstílust normál állapotban. */
#lxg-guest-dashboard .lexilet-btn-wrong {
    border-color: rgba(192, 57, 43, 0.45) !important;
    color: #c0392b !important;
    background: #fff !important;
}

#lxg-guest-dashboard .lexilet-btn-right {
    border-color: rgba(39, 174, 96, 0.45) !important;
    color: #27ae60 !important;
    background: #fff !important;
}

/* v3.9.0.103: Kártya-kép javítás
   A hátlapon overflow-y: auto, hogy ha van kép ami túlnyúlik,
   a felhasználó görgethessen. Scrollbar diszkrét. */
#lxg-guest-dashboard .lexilet-card-back {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.12) transparent;
}

/* Kép kissé kisebb a guest nézet szűkebb paneljéhez */
#lxg-guest-dashboard .lexilet-image-wrap img {
    max-width: 120px;
    max-height: 120px;
}

/* Befejező képernyő panel */
#lxg-guest-dashboard .lexilet-complete-inner {
    background: #fffef8 !important;
    border: 1px solid #d5d0c4 !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12) !important;
}

/* Hang sáv */
#lxg-guest-dashboard .lexilet-audio-bar {
    background: transparent;
    border-bottom: 1px solid #e8e4d4;
}

/* Gomb hover: színes háttér + fehér szöveg (v3.9.0.103 javítva)
   Kell a background is, mert a non-hover background: #fff felülírná. */
#lxg-guest-dashboard .lexilet-btn-wrong:hover {
    background: #c0392b !important;
    color: #fff !important;
    border-color: #c0392b !important;
}

#lxg-guest-dashboard .lexilet-btn-right:hover {
    background: #27ae60 !important;
    color: #fff !important;
    border-color: #27ae60 !important;
}

/* A vendég panelek maguk is kicsit kontrasztosabban */
#lxg-guest-dashboard .lxg-panel {
    border: 1.5px solid #d5d0c4;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
}


/* ══════════════════════════════════════════════════════════════
   FEJLÉC
══════════════════════════════════════════════════════════════ */
.lxg-header {
    background: linear-gradient(135deg, #6c63ff 0%, #48a999 100%);
    border-radius: 20px;
    padding: 32px 36px;
    margin-bottom: 28px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(108, 99, 255, 0.25);
}

.lxg-header-inner {
    flex: 1 1 300px;
}

.lxg-title {
    color: #fff;
    font-size: 1.6em;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.lxg-deck-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 50px;
    padding: 6px 16px;
    font-size: 0.9em;
    font-weight: 500;
}

.lxg-card-count {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 2px 10px;
    font-size: 0.85em;
}

.lxg-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #fff;
    color: #6c63ff;
    font-weight: 700;
    font-size: 0.92em;
    padding: 12px 22px;
    border-radius: 50px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: normal;
    /* sortörés engedélyezve mobilon */
    word-break: break-word;
    line-height: 1.35;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
    max-width: 100%;
    /* mobilon ne lógjon túl */
}

.lxg-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    color: #4b3fcc;
}

/* Fejléc CTA gomb mobilon teljes szélességű */
.lxg-header .lxg-cta-btn {
    flex-shrink: 0;
}

@media (max-width: 520px) {
    .lxg-header .lxg-cta-btn {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

/* ══════════════════════════════════════════════════════════════
   MAIN LAYOUT (2 oszlop)
══════════════════════════════════════════════════════════════ */
.lxg-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 780px) {
    .lxg-main {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════════════════════════
   PANEL ALAP
══════════════════════════════════════════════════════════════ */
.lxg-panel {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

.lxg-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 24px;
    border-bottom: 1px solid #f0f0f6;
    background: #fafafe;
}

.lxg-panel-header.lxg-leaderboard-header {
    margin-top: 16px;
    border-top: 2px solid #f0f0f6;
}

.lxg-panel-icon {
    font-size: 1.4em;
    line-height: 1;
}

.lxg-panel-title {
    margin: 0;
    font-size: 1.05em;
    font-weight: 600;
    color: #2d2d5e;
}

.lxg-panel-body {
    padding: 20px 24px;
}

/* ══════════════════════════════════════════════════════════════
   KÁRTYAFORGATÓS TANULÁS
══════════════════════════════════════════════════════════════ */
.lxg-study-progress-wrap {
    height: 6px;
    background: #f0f0f6;
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
}

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

.lxg-study-counter {
    text-align: center;
    font-size: 0.85em;
    color: #888;
    margin-bottom: 16px;
}

/* Kártya scene */
.lxg-card-scene {
    perspective: 900px;
    height: 240px;
    margin-bottom: 16px;
    cursor: pointer;
}

.lxg-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 14px;
}

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

.lxg-card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.lxg-card-front {
    background: linear-gradient(145deg, #f0eeff, #e8f4ff);
    border: 2px solid #d4c8ff;
}

.lxg-card-back {
    background: linear-gradient(145deg, #e8fff4, #f0fffe);
    border: 2px solid #b8eed8;
    transform: rotateY(180deg);
}

.lxg-term {
    font-size: 1.4em;
    font-weight: 700;
    color: #2d2d5e;
    margin: 0 0 8px;
    text-align: center;
    line-height: 1.3;
}

.lxg-definition {
    font-size: 1.15em;
    font-weight: 600;
    color: #1a6e5c;
    margin: 0 0 6px;
    text-align: center;
}

.lxg-example {
    font-size: 0.88em;
    color: #6c63ff;
    margin: 4px 0;
    text-align: center;
    font-style: italic;
}

.lxg-example-meaning {
    font-size: 0.82em;
    color: #888;
    margin: 2px 0;
    text-align: center;
    font-style: italic;
}

.lxg-image-wrap img {
    max-height: 70px;
    max-width: 100%;
    border-radius: 8px;
    margin-top: 6px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.lxg-flip-hint {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.72em;
    color: #a0a0bb;
    letter-spacing: 0.03em;
}

.lxg-audio-btn-wrap {
    text-align: center;
    margin-top: 4px;
}

.lxg-play-btn {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    opacity: 0.7;
    padding: 2px 6px;
    transition: opacity 0.2s;
}

.lxg-play-btn:hover {
    opacity: 1;
}

/* Navigáció */
.lxg-study-nav {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 12px;
}

.lxg-nav-btn {
    flex: 1;
    max-width: 160px;
    padding: 10px 14px;
    border: 2px solid #6c63ff;
    background: transparent;
    color: #6c63ff;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
}

.lxg-nav-btn:hover {
    background: #6c63ff;
    color: #fff;
}

.lxg-study-actions {
    text-align: center;
}

.lxg-shuffle-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 0.85em;
    cursor: pointer;
    color: #666;
    font-family: inherit;
    transition: border-color 0.2s, color 0.2s;
}

.lxg-shuffle-btn:hover {
    border-color: #6c63ff;
    color: #6c63ff;
}

/* ══════════════════════════════════════════════════════════════
   JÁTÉK PANEL
══════════════════════════════════════════════════════════════ */
.lxg-game-desc {
    font-size: 0.9em;
    color: #666;
    margin: 0 0 14px;
    line-height: 1.5;
}

.lxg-game-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 0.88em;
    color: #888;
}

.lxg-start-game-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #6c63ff, #48a999);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.05em;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.3);
    letter-spacing: 0.02em;
}

.lxg-start-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(108, 99, 255, 0.35);
}

/* A kfgame container (fullwidth az esetleges overflow-hoz) */
#lxg-game-container {
    min-height: 300px;
}

/* ══════════════════════════════════════════════════════════════
   RANGSOR
══════════════════════════════════════════════════════════════ */
.lxg-leaderboard {
    min-height: 80px;
}

.lxg-leaderboard-loading {
    text-align: center;
    color: #aaa;
    padding: 20px;
    font-size: 0.9em;
}

.lxg-leaderboard-empty {
    text-align: center;
    color: #bbb;
    padding: 20px;
    font-size: 0.88em;
}

.lxg-lb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5fa;
    transition: background 0.15s;
}

.lxg-lb-row:last-child {
    border-bottom: none;
}

.lxg-lb-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: 700;
    flex-shrink: 0;
    color: #666;
}

.lxg-lb-row.rank-1 .lxg-lb-rank {
    background: #ffd700;
    color: #5a4500;
}

.lxg-lb-row.rank-2 .lxg-lb-rank {
    background: #c0c0c0;
    color: #333;
}

.lxg-lb-row.rank-3 .lxg-lb-rank {
    background: #cd7f32;
    color: #fff;
}

.lxg-lb-medal {
    font-size: 1.1em;
}

.lxg-lb-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.95em;
    color: #2d2d5e;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lxg-lb-name.is-current {
    color: #6c63ff;
}

.lxg-lb-points {
    font-weight: 700;
    color: #f5a623;
    font-size: 0.9em;
    white-space: nowrap;
}

/* Időoszlop a rangsorban */
.lxg-lb-time {
    font-size: 0.8em;
    color: #999;
    white-space: nowrap;
    min-width: 48px;
    text-align: right;
}

.lxg-lb-time.is-best-time {
    color: #6c63ff;
    font-weight: 700;
}

/* Legjobb idő bánner */
.lxg-lb-top-banner {
    background: linear-gradient(90deg, #6c63ff15, #48a99915);
    border: 1px solid #d4c8ff;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 10px;
    font-size: 0.88em;
    font-weight: 600;
    color: #4b3fcc;
    text-align: center;
}

.lxg-leaderboard-note {
    font-size: 0.82em;
    color: #aaa;
    margin: 10px 0 8px;
    line-height: 1.4;
}

.lxg-leaderboard-cta {
    margin-top: 10px;
}

.lxg-reg-link {
    display: inline-block;
    font-size: 0.88em;
    color: #6c63ff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.lxg-reg-link:hover {
    color: #4b3fcc;
    text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════════
   NÉVBEKÉRŐ MODAL
══════════════════════════════════════════════════════════════ */
.lxg-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 50, 0.65);
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: lxgFadeIn 0.2s ease;
}

@keyframes lxgFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.lxg-modal {
    background: #fff;
    border-radius: 20px;
    padding: 36px 32px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.25);
    animation: lxgSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes lxgSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

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

.lxg-modal-icon {
    font-size: 3em;
    margin-bottom: 10px;
    line-height: 1;
}

.lxg-modal-title {
    margin: 0 0 8px;
    font-size: 1.3em;
    font-weight: 700;
    color: #2d2d5e;
}

.lxg-modal-desc {
    color: #666;
    font-size: 0.9em;
    margin: 0 0 10px;
    line-height: 1.5;
}

.lxg-modal-score {
    font-size: 1.4em;
    font-weight: 700;
    color: #f5a623;
    margin-bottom: 16px;
}

.lxg-modal-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    border: 2px solid #d4c8ff;
    border-radius: 10px;
    font-size: 1em;
    font-family: inherit;
    margin-bottom: 16px;
    transition: border-color 0.2s;
    outline: none;
}

.lxg-modal-input:focus {
    border-color: #6c63ff;
}

.lxg-modal-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 14px;
}

.lxg-modal-btn {
    padding: 11px 22px;
    border-radius: 10px;
    border: none;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
}

.lxg-modal-confirm {
    background: linear-gradient(135deg, #6c63ff, #48a999);
    color: #fff;
    box-shadow: 0 4px 14px rgba(108, 99, 255, 0.3);
}

.lxg-modal-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
}

.lxg-modal-skip {
    background: #f7f7fb;
    color: #888;
    border: 1px solid #e0e0ee;
}

.lxg-modal-skip:hover {
    background: #eee;
}

.lxg-modal-reg-note {
    font-size: 0.8em;
    color: #aaa;
    line-height: 1.5;
}

.lxg-modal-reg-note a {
    color: #6c63ff;
    text-decoration: none;
    font-weight: 600;
}

.lxg-modal-reg-note a:hover {
    text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════════
   ÖSSZEFOGLALÓ KÉPERNYŐ (játék után, névbeadás előtt)
══════════════════════════════════════════════════════════════ */
.lxg-result-banner {
    background: linear-gradient(135deg, #6c63ff10, #48a99915);
    border: 1px solid #d4c8ff;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 12px;
    text-align: center;
}

.lxg-result-pts {
    font-size: 1.6em;
    font-weight: 700;
    color: #6c63ff;
}

.lxg-result-lbl {
    font-size: 0.85em;
    color: #888;
}

/* ── Responsiv tweaks ───────────────────────────────────────── */
@media (max-width: 480px) {
    .lxg-header {
        padding: 20px 18px;
    }

    .lxg-title {
        font-size: 1.2em;
    }

    .lxg-panel-body {
        padding: 14px 14px;
    }

    .lxg-card-scene {
        height: 200px;
    }

    .lxg-modal {
        padding: 24px 18px;
    }
}