/* =====================================================
   LANGUAGE TUTOR — Las Casas  |  Mobile-first
===================================================== */

.lt-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #6a1b9a, #ab47bc);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(106,27,154,.4);
    touch-action: manipulation;
}
.lt-open-btn:active { transform: scale(.97); }

/* Modal */
.lt-modal {
    position: fixed;
    inset: 0;
    z-index: 99990;
    background: rgba(0,0,0,.9);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.lt-modal-inner {
    width: 100%;
    max-width: 420px;
    min-height: 100dvh;
    background: #120022;
    display: flex;
    flex-direction: column;
}

/* Themes */
.lt-modal[data-theme="blue"]  .lt-header  { background: #0d47a1; }
.lt-modal[data-theme="blue"]  .lt-open-btn { background: linear-gradient(135deg,#0d47a1,#42a5f5); }
.lt-modal[data-theme="green"] .lt-header  { background: #1b5e20; }
.lt-modal[data-theme="dark"]  .lt-modal-inner { background: #0a0a0a; }

/* Header */
.lt-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #6a1b9a;
    position: sticky;
    top: 0;
    z-index: 10;
}
.lt-logo { font-size: 17px; font-weight: 800; color: #fff; flex-shrink: 0; }
.lt-logo span { color: #e1bee7; font-size: 14px; }
.lt-header-stats { flex: 1; display: flex; justify-content: center; gap: 10px; }
.lt-streak, .lt-xp {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,.15);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}
.lt-streak-val, .lt-xp-val { font-weight: 800; }
.lt-close {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.4);
    background: transparent;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    touch-action: manipulation;
}
.lt-close:active { background: rgba(255,255,255,.2); }

/* Progress */
.lt-progress-wrap {
    background: #1a0030;
    padding: 6px 12px;
}
.lt-progress-bar {
    height: 8px;
    background: rgba(255,255,255,.1);
    border-radius: 4px;
    overflow: hidden;
}
.lt-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ab47bc, #e040fb);
    border-radius: 4px;
    transition: width .4s ease;
}

/* Ticker */
.lt-ticker {
    height: 36px;
    overflow: hidden;
    background: #0a0018;
    border-bottom: 1px solid #1a0030;
}
.lt-ticker-track {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: lt-scroll 30s linear infinite;
}
.lt-ticker-track:hover { animation-play-state: paused; }
@keyframes lt-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.lt-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 18px;
    text-decoration: none;
    color: #7e57c2;
    font-size: 12px;
    height: 36px;
    border-right: 1px solid #1a0030;
    transition: color .2s;
}
.lt-ticker-item:hover { color: #ce93d8; }
.lt-ticker-item img { width: 22px; height: 22px; border-radius: 4px; object-fit: cover; }
.lt-ticker-name  { font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.lt-ticker-price { color: #ce93d8; font-weight: 700; }

/* Screens */
.lt-screen { flex: 1; display: flex; flex-direction: column; }

/* ---- Выбор пары ---- */
.lt-screen--pairs { align-items: center; justify-content: flex-start; padding: 16px 12px; }
.lt-pairs-content { width: 100%; max-width: 360px; }
.lt-pairs-title {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #e1bee7;
    margin-bottom: 14px;
}
.lt-pairs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.lt-pair-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px;
    background: #1a0030;
    border: 2px solid #2a0050;
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    touch-action: manipulation;
    transition: border-color .15s, background .15s;
}
.lt-pair-btn:active, .lt-pair-btn:hover { border-color: #ab47bc; background: #220040; }
.lt-pair-flags { font-size: 20px; }
.lt-pair-label { font-size: 12px; font-weight: 600; color: #ce93d8; text-align: center; }
.lt-pair-level { font-size: 10px; color: #7e57c2; min-height: 14px; }

/* ---- Урок ---- */
.lt-screen--exercise { padding: 10px 12px; gap: 8px; }

.lt-lesson-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a0030;
    border-radius: 8px;
    padding: 6px 12px;
}
.lt-lesson-topic { font-size: 13px; font-weight: 600; color: #ce93d8; }
.lt-lesson-count  { font-size: 12px; color: #7e57c2; }

/* Общий заголовок режима */
.lt-mode-label {
    font-size: 13px;
    color: #9575cd;
    text-align: center;
    margin-bottom: 6px;
}

/* ---- Общее для режимов ----
   JS включает режим через style.display='flex'; без column флекс
   строил В РЯД: подпись слева, карточка в центре, кнопки No sé/Lo sé
   уезжали вправо за экран. Колонка: подпись СВЕРХУ → карточка →
   кнопки СНИЗУ. */
.lt-mode--card, .lt-mode--choice, .lt-mode--type {
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
}

/* ---- Карточка ---- */
.lt-card-flip {
    width: 100%;
    max-width: 340px;
    min-height: 160px;
    background: #1a0030;
    border: 2px solid #2a0050;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    position: relative;
    transition: border-color .2s;
}
.lt-card-flip:active { border-color: #ab47bc; }
.lt-card-front, .lt-card-back {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    width: 100%;
}
.lt-card-word {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    text-align: center;
    line-height: 1.2;
}
.lt-card-hint { font-size: 12px; color: #7e57c2; }
.lt-card-translation {
    font-size: 24px;
    font-weight: 700;
    color: #ce93d8;
    text-align: center;
}
.lt-card-example {
    font-size: 13px;
    color: #9575cd;
    text-align: center;
    font-style: italic;
    line-height: 1.4;
}
.lt-speak-btn {
    background: rgba(171,71,188,.2);
    border: 1px solid rgba(171,71,188,.3);
    border-radius: 50%;
    width: 36px; height: 36px;
    font-size: 16px;
    cursor: pointer;
    touch-action: manipulation;
    display: flex; align-items: center; justify-content: center;
}
.lt-speak-btn:active { background: rgba(171,71,188,.4); }

.lt-card-btns {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 340px;
    margin-top: 4px;
}
.lt-card-no, .lt-card-yes {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}
.lt-card-no  { background: #2a0050; color: #ce93d8; }
.lt-card-yes { background: #1b5e20; color: #a5d6a7; }
.lt-card-no:active  { background: #3a0060; }
.lt-card-yes:active { background: #2e7d32; }

/* ---- Выбор ---- */
.lt-mode--choice { align-items: center; }
.lt-choice-question {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.lt-choice-word {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    text-align: center;
    flex: 1;
}
.lt-choice-answers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 360px;
}
.lt-choice-btn {
    width: 100%;
    padding: 14px 16px;
    background: #1a0030;
    border: 2px solid #2a0050;
    border-radius: 10px;
    color: #e1bee7;
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    transition: background .12s, border-color .12s;
}
.lt-choice-btn:active:not([disabled]) { transform: scale(.98); }
.lt-choice-btn--correct { background: #1b5e20 !important; border-color: #4caf50 !important; color: #fff !important; }
.lt-choice-btn--wrong   { background: #4a0000 !important; border-color: #f44336 !important; color: #fff !important; }
.lt-choice-btn[disabled] { cursor: default; }

.lt-choice-feedback, .lt-type-feedback {
    width: 100%;
    max-width: 360px;
    background: #1a0030;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.lt-feedback-text    { font-size: 15px; font-weight: 700; }
.lt-feedback-example,
.lt-feedback-correct { font-size: 13px; color: #9575cd; line-height: 1.4; }
.lt-next-btn {
    align-self: flex-end;
    padding: 10px 20px;
    background: #6a1b9a;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
    margin-top: 4px;
}
.lt-next-btn:active { background: #7b1fa2; }

/* ---- Ввод ---- */
.lt-mode--type { align-items: center; }
.lt-type-question {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.lt-type-word {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    text-align: center;
    flex: 1;
}
.lt-type-hint {
    font-size: 13px;
    color: #7e57c2;
    margin-bottom: 8px;
}
.lt-type-input-wrap {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 360px;
}
.lt-type-input {
    flex: 1;
    padding: 14px 16px;
    background: #1a0030;
    border: 2px solid #2a0050;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    outline: none;
    transition: border-color .15s;
}
.lt-type-input:focus { border-color: #ab47bc; }
.lt-type-input::placeholder { color: #4a2060; }
.lt-type-submit {
    width: 50px;
    background: #6a1b9a;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    touch-action: manipulation;
    flex-shrink: 0;
}
.lt-type-submit:active { background: #7b1fa2; }

/* ---- Результат ---- */
.lt-screen--result { align-items: center; justify-content: center; padding: 16px 12px; overflow-y: auto; }
.lt-result-content { text-align: center; width: 100%; max-width: 360px; }
.lt-result-icon  { font-size: 52px; margin-bottom: 8px; }
.lt-result-title { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.lt-result-xp    { font-size: 28px; font-weight: 900; color: #ab47bc; margin: 6px 0; }
.lt-result-stats { font-size: 13px; color: #7e57c2; margin-bottom: 16px; line-height: 1.6; }

/* Реклама в результате — БОЛЬШАЯ и заметная */
.lt-result-ad { margin-bottom: 16px; }
.lt-result-ad-label {
    font-size: 12px;
    color: #7e57c2;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.lt-result-ad-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1a0030;
    border: 2px solid #ab47bc;
    border-radius: 12px;
    padding: 12px;
    text-decoration: none;
    transition: border-color .2s, background .2s;
}
.lt-result-ad-card:active { background: #220040; }
.lt-result-ad-img {
    width: 72px; height: 72px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}
.lt-result-ad-body { flex: 1; text-align: left; }
.lt-result-ad-title { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.3; margin-bottom: 4px; }
.lt-result-ad-promo { font-size: 12px; color: #ce93d8; margin-bottom: 6px; }
.lt-result-ad-cta {
    display: inline-block;
    padding: 6px 14px;
    background: #ab47bc;
    color: #fff;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.lt-result-btns { display: flex; flex-direction: column; gap: 8px; }
.lt-continue-btn {
    padding: 14px;
    background: linear-gradient(135deg, #6a1b9a, #ab47bc);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}
.lt-menu-btn {
    padding: 12px;
    background: #1a0030;
    color: #ce93d8;
    border: 1px solid #2a0050;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
}
.lt-continue-btn:active { transform: scale(.98); }
.lt-menu-btn:active     { background: #220040; }

/* ---- Реклама внизу (постоянная) ---- */
.lt-ad-block {
    border-top: 1px solid #1a0030;
    background: #0a0018;
    min-height: 64px;
    flex-shrink: 0;
}
.lt-ad-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    text-decoration: none;
    color: inherit;
}
.lt-ad-link:active { background: rgba(171,71,188,.08); }
.lt-ad-img {
    width: 52px; height: 52px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.lt-ad-body  { flex: 1; }
.lt-ad-badge { font-size: 10px; color: #4a2060; text-transform: uppercase; letter-spacing: .05em; }
.lt-ad-title { font-size: 13px; color: #e1bee7; font-weight: 700; line-height: 1.3; }
.lt-ad-label { font-size: 12px; color: #ab47bc; font-weight: 700; margin-top: 2px; }
.lt-ad-arrow { font-size: 18px; color: #ab47bc; flex-shrink: 0; }
.lt-ad-placeholder {
    padding: 18px 12px;
    text-align: center;
    font-size: 12px;
    color: #4a2060;
    font-style: italic;
}

/* Анимации */
@keyframes lt-correct {
    0%,100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}
.lt-correct-anim { animation: lt-correct .25s ease; }

@keyframes lt-wrong {
    0%,100% { transform: translateX(0); }
    25%,75% { transform: translateX(-6px); }
    50%      { transform: translateX(6px); }
}
.lt-wrong-anim { animation: lt-wrong .3s ease; }

@keyframes lt-xp-pop {
    0%   { opacity:0; transform: translateY(10px) scale(.8); }
    60%  { opacity:1; transform: translateY(-6px) scale(1.1); }
    100% { opacity:0; transform: translateY(-20px) scale(1); }
}
.lt-xp-popup {
    position: fixed;
    font-size: 16px;
    font-weight: 800;
    color: #e040fb;
    pointer-events: none;
    z-index: 99999;
    animation: lt-xp-pop .8s ease forwards;
}

/* =====================================================
   v2.0: темы, прогресс, список слов
===================================================== */

/* ---- Назад ---- */
.lt-back-btn {
    background: #1a0030;
    border: 2px solid #2a0050;
    color: #e1bee7;
    border-radius: 10px;
    min-width: 38px; min-height: 38px;
    font-size: 16px; cursor: pointer; flex-shrink: 0;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.lt-back-btn:active { background: #2a0050; }

/* ---- Экран выбора темы ---- */
.lt-screen--topics { align-items: center; padding: 14px 12px; }
.lt-topics-content { width: 100%; max-width: 380px; }
.lt-topics-head {
    display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.lt-topics-title { flex: 1; font-size: 16px; font-weight: 700; color: #e1bee7; }
.lt-topics-pair {
    font-size: 11px; color: #9575cd;
    background: #1a0030; border-radius: 16px; padding: 4px 10px;
}
.lt-topics-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.lt-topic-card {
    position: relative;
    background: #1a0030; border: 2px solid #2a0050;
    border-radius: 14px; padding: 14px 10px 12px;
    text-align: center; cursor: pointer;
    transition: transform .12s, border-color .12s;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.lt-topic-card:active { transform: scale(.96); border-color: #6a1b9a; }
.lt-topic-card--done { border-color: #4caf50; }
.lt-topic-icon { font-size: 28px; margin-bottom: 4px; }
.lt-topic-name { font-size: 13.5px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.lt-topic-progress { font-size: 11.5px; color: #9575cd; margin-bottom: 6px; }
.lt-topic-bar {
    height: 5px; background: #2a0050; border-radius: 5px; overflow: hidden;
}
.lt-topic-bar-fill {
    height: 100%; background: linear-gradient(90deg, #ab47bc, #7c4dff);
    border-radius: 5px; transition: width .3s;
}
.lt-topic-card--done .lt-topic-bar-fill { background: #4caf50; }
.lt-topic-list-btn {
    position: absolute; top: 6px; right: 6px;
    background: rgba(255,255,255,.06); border: none; color: #e1bee7;
    border-radius: 8px; min-width: 30px; min-height: 30px;
    font-size: 13px; cursor: pointer;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.lt-topic-list-btn:active { background: rgba(255,255,255,.15); }

/* ---- Экран «Todas las palabras» ---- */
.lt-screen--words { padding: 12px; }
.lt-words-head {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.lt-words-title { flex: 1; font-size: 14px; font-weight: 700; color: #e1bee7; }
.lt-words-study {
    background: linear-gradient(135deg, #ab47bc, #7c4dff);
    border: none; color: #fff; font-weight: 700; font-size: 12.5px;
    border-radius: 20px; padding: 9px 14px; cursor: pointer;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.lt-words-study:active { transform: scale(.96); }
.lt-words-list {
    flex: 1; overflow-y: auto; overscroll-behavior: contain;
    display: flex; flex-direction: column; gap: 6px;
    max-height: 60dvh;
}
.lt-word-row {
    display: flex; align-items: center; gap: 8px;
    background: #1a0030; border: 1px solid #2a0050;
    border-radius: 10px; padding: 8px 10px;
}
.lt-word-known { flex-shrink: 0; font-size: 13px; }
.lt-word-texts { flex: 1; min-width: 0; }
.lt-word-from {
    font-size: 13.5px; font-weight: 700; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lt-word-to {
    font-size: 12px; color: #9575cd;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lt-word-speak {
    flex-shrink: 0; background: rgba(255,255,255,.06); border: none;
    color: #e1bee7; border-radius: 8px;
    min-width: 34px; min-height: 34px; font-size: 13px; cursor: pointer;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.lt-word-speak:active { background: rgba(255,255,255,.15); }

/* Кнопка темы на экране результата */
.lt-topics-btn {
    background: #1a0030; border: 2px solid #2a0050; color: #e1bee7;
    border-radius: 24px; padding: 11px 18px; font-size: 13.5px;
    font-weight: 700; cursor: pointer;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
