/* English Matrix - Тренажёр */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
    padding: 0 0 92px;
    justify-content: flex-end;
    flex-direction: column;
}

.main-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    max-width: 600px;
    /*margin: 20px auto 100px;
    padding: 0 20px;*/
    margin: 20px auto 0;    /* Убираем внешний отступ снизу */
    /*padding: 0 20px 20px;  /* Добавляем внутренний отступ СНИЗУ */
}



                                /* ========== КАРТОЧКА ЗВУКА ========== */
                                .sound-card {
                                    display: flex;
                                    flex-direction: column;
                                    align-items: center;
                                    justify-content: flex-start;  /* ← контент сверху */
                                    gap: 15px;
                                    min-height: auto;             /* ← не фиксируем высоту */
                                    padding-top: 5px;
                                    padding-bottom: 10px;         /* ← чтобы кнопки не прилипали к низу */
                                }
                                
                                .sound-symbol {
                                    font-size: 30px;
                                    font-family: 'Courier New', monospace;
                                    font-weight: normal;
                                    color: #FF9800;
                                    cursor: pointer;
                                    position: relative;
                                    transition: transform 0.2s;
                                }
                                
                                .sound-symbol:hover {
                                    transform: scale(1.1);
                                }
                                
                                /* Всплывающая подсказка */
                                .tooltip:hover::after {
                                    content: attr(data-tooltip);
                                    position: absolute;
                                    bottom: 120%;
                                    left: 50%;
                                    transform: translateX(-50%);
                                    background: rgba(0, 0, 0, 0.95);
                                    color: #fff;
                                    padding: 10px 18px;
                                    border-radius: 10px;
                                    font-size: 15px;
                                    font-family: 'Segoe UI', sans-serif;
                                    white-space: nowrap;
                                    z-index: 100;
                                    border: 1px solid #FF9800;
                                    pointer-events: none;
                                }
                                
                                .sound-replay-btn {
                                    background: rgba(76, 175, 80, 0.2);
                                    border: 2px solid #4CAF50;
                                    border-radius: 50%;
                                    width: 50px;
                                    height: 50px;
                                    font-size: 18px;
                                    color: #4CAF50;
                                    cursor: pointer;
                                    transition: all 0.2s;
                                    display: flex;
                                    align-items: center;
                                    justify-content: center;
                                }
                                
                                .sound-replay-btn:hover {
                                    background: #4CAF50;
                                    color: #fff;
                                    transform: scale(1.05);
                                }
                                
                                .sound-replay-btn:active {
                                    transform: scale(0.95);
                                }
                                
                                .speak-example-btn {
                                    background: rgba(33,150,243,0.2);  /* синий фон */
                                    border: 2px solid #2196F3;        /* синяя обводка */
                                    border-radius: 50%;               /* круглая */
                                    width: 50px;                      /* размер */
                                    height: 50px;
                                    font-size: 18px;                  /* иконка */
                                    color: #2196F3;                   /* синий цвет */
                                    cursor: pointer;
                                    display: flex;
                                    align-items: center;
                                    justify-content: center;
                                    padding: 0;
                                    margin-top: 10px;
                                }
                                
                                .sound-example {
                                    display: flex;
                                    flex-direction: column;  /* ← элементы друг под другом */
                                    align-items: center;
                                    gap: 8px;
                                    font-family: 'Courier New', monospace;
                                    font-size: 22px;
                                    margin-top: 10px;
                                }
                                
                                .sound-example .example-word,
                                .sound-example .example-transcription {
                                    font-size: 24px;  /* поменяй на нужный размер */
                                }
                                
                                /* Большая прямоугольная кнопка "Начать" */
                                .audio-unlock-big-btn {
                                    background: rgba(76, 175, 80, 0.2);
                                    border: 2px solid #4CAF50;
                                    border-radius: 30px;
                                    padding: 20px 40px;
                                    font-size: 22px;
                                    font-weight: bold;
                                    color: #4CAF50;
                                    cursor: pointer;
                                    transition: all 0.2s;
                                    margin: 40px auto;
                                    display: block;
                                    min-width: 200px;
                                }
                                
                                .audio-unlock-big-btn:hover {
                                    background: #4CAF50;
                                    color: #fff;
                                    transform: scale(1.03);
                                }
                                
                                .audio-unlock-big-btn:active {
                                    transform: scale(0.97);
                                }

/* Колонка карточек */
.column {
    background: rgba(45,45,45,0.8);
    border-radius: 20px;
    padding: 10px;
    width: 100%;
    max-width: 500px;
    min-height: 520px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Шапка с именем колоды */
.deck-header {
    text-align: center;
    /*margin-bottom: 20px;*/
    margin: 10px;
}

.deck-header h3 {
    font-size: 24px;
    color: #4CAF50;
    margin: 0;
}

/* Выпадающий список колод */
.deck-dropdown {
    display: none !important;
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 100px;
    background: rgba(26,26,26,0.98);
    border: 4px solid #4CAF50;
    border-radius: 20px;
    z-index: 999999;
    padding: 25px;
    overflow-y: auto;
    box-shadow: 0 20px 80px rgba(0,0,0,0.95);
    backdrop-filter: blur(20px);
}

/* А когда нужно показать */
.deck-dropdown[data-open="true"] {
    display: block !important;
}

.deck-list {
    max-height: 70vh;
}

.deck-item {
    background: rgba(45,45,45,0.8);
    padding: 20px;
    margin: 12px 0;
    border-radius: 16px;
    border: 2px solid #4CAF50;
    cursor: pointer;
    color: white;
    font-size: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.deck-item:hover {
    background: rgba(76,175,80,0.2);
    transform: translateX(5px);
}


.deck-name, .deck-stats {
    color: white !important;
}

.deck-item:last-child {
    border-bottom: none;
}

.deck-name {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.deck-stats {
    color: #888;
    font-size: 14px;
}

.column h3 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 20px;
    color: #4CAF50;
}

/* Панель счетчика */
.counter-panel {
    display: flex;
    justify-content: space-around;
    background: rgba(0,0,0,0.3);
    padding: 8px 12px;
    border-radius: 12px;
    margin: 5px 0 5px 0;  /* отступы: сверху 5, снизу 5 */
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
}

.counter-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.counter-item.new { color: #4CAF50; }      /* зеленый */
.counter-item.current { color: #2196F3; }   /* синий */
.counter-item.done { color: #FF9800; }      /* оранжевый */
.counter-item.mastered { color: #9C27B0; }  /* фиолетовый */

/* На мобилках чуть меньше */
@media (max-width: 768px) {
    .counter-panel {
        padding: 6px 10px;
        font-size: 12px;
        margin: 3px 0 10px 0;
    }
}


.anki-card {
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    border-radius: 12px;
    padding: 20px 20px;
    margin: 5px 0;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    font-size: 20px;
    font-weight: normal;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content:
    height: 270px;
    overflow-y: auto;
}

.translation-container {
    width: 100%;
    min-height: 80px;
    border-top: 1px solid rgba(255,255,255,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin: 15px 0;
    padding: 10px;
    font-size: 20px;
    color: #4CAF50;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.translation-line {
    width: 100%;
    text-align: center;
    min-height: 30px;
}

/* Контейнер для кнопки показа перевода и кнопок оценки */
.card-footer {
    width: 100%;
    margin-top: auto;  /* прижимает к низу */
}

/* Стили для кнопки показа ответа */
.show-answer-btn {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 20px 10px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
    margin: 10px 0;  /* центрируем */
    box-shadow: 0 4px 15px rgba(33,150,243,0.3);
    box-sizing: border-box;   /* ← Важно! Чтобы padding не вылезал за ширину */
}

.show-answer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33,150,243,0.4);
}

.show-answer-btn:active {
    transform: translateY(0);
}

/* Кнопки оценки */
.rating-buttons {
    display: flex;
    gap: 10px;
    justify-content: stretch; /* ← Растягиваем кнопки на всю ширину */
    margin: 7.5px 0;
    padding: 1.08px;
    flex-wrap: nowrap;        /* ← Запрещаем перенос */
    width: 100%;     /* ← На всю ширину родителя */
}

.rating-btn {
    flex: 1 1 0;              /* ← Каждая кнопка занимает равную долю */
    padding: 12px 10px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    /*min-width: 80px;*/
}

.rating-emoji {
    display: block;
    font-size: 18px;
    line-height: 1;
    margin-bottom: 4px;
}

.rating-text {
    display: block;
    font-size: 14px;
    line-height: 1;
}

.btn-again { 
    background: #f44336;
    color: white;
    border-radius: 12px;
    margin: 2px 2px 2px 2px;
}
.btn-hard {
    background: #ff9800;
    color: white;
    border-radius: 12px;
}
.btn-tomorrow {
    background: #ff9800;
    color: white;
    border-radius: 12px;
}
.btn-good {
    background: #4caf50;
    color: white;
    border-radius: 12px;
}
.btn-excellent {
    background: #2196f3;
    color: white;
}

.rating-btn:hover { transform: scale(1.05); }

.voice-mode-btn {
    background: linear-gradient(45deg, #FF9800, #F57C00);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
    margin: 2px auto;
    display: block;
    box-sizing: border-box;   /* ← Важно! */
}

.voice-mode-btn.active {
    background: linear-gradient(45deg, #f44336, #d32f2f);
}

.voice-mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,152,0,0.4);
}

.voice-status {
    text-align: center;
    font-size: 14px;
    margin-top: 10px;
    color: #FF9800;
}

.no-cards-message {
    text-align: center;
    padding: 40px 20px;
}

.congrats-emoji {
    font-size: 64px;
    margin-bottom: 20px;
}

.congrats-title {
    font-size: 28px;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 15px;
}

.congrats-subtitle {
    font-size: 16px;
    color: #aaa;
}

#voiceModeBtn {
    /*order: 2;
    margin-top: 10px;*/
}

.card-footer {
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .voice-toast {
        bottom: 80px;
        font-size: 14px;
        padding: 10px 20px;
        white-space: normal;
        max-width: 85%;
    }
}

/*Добавляем стили для нижней панели (копируем из constructor.css)*/
.bottom-panel {
    background: rgba(0,0,0,0.98);
    backdrop-filter: blur(30px);
    border-top: 2px solid #444;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    flex-shrink: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    line-height: 1.2;
    padding: 5px;
}

.home {
    background: rgba(76,175,80,0.3);
    color: #4CAF50;
    border: 2px solid #4CAF50;
    font-size: 16px;
}

.home-1 {
    background: linear-gradient(62deg, #62b3ac, #62b3ac);
    color: #4CAF50;
    border: 2px solid #545454;
        font-size: 16px;
}

.home-2 {
    background: linear-gradient(62deg, #6e6e6e, #545454);
    color: #4CAF50;
    border: 2px solid #62b3ac;
    font-size: 16px;
}

.home-3 {
    background: rgba(76,175,80,0.3);
    color: #4CAF50;
    border: 2px solid #4CAF50;
    font-size: 36px;
}

.settings {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    color: white;
    border: 2px solid #2196F3;
}

.user {
    color: #ccc;
    font-size: 14px;
    background: rgba(255,255,255,0.1);
    padding: 8px 16px;
    border-radius: 20px;
}

.decks-button {
    background: rgba(76,175,80,0.2);
    border: 2px solid #4CAF50;
    border-radius: 30px;
    padding: 10px 25px;
    color: #4CAF50;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.decks-button:hover {
    background: rgba(76,175,80,0.3);
    transform: scale(1.05);
}

/* Добавляем отступ снизу для контента, чтобы не перекрывалось панелью 
.main-container {
    margin-bottom: 100px;
}*/

.nav-tab.active {
  background: #4CAF50;
  color: #fff;
}


/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .column h3 {
        font-size: 18px;
    }
    
    .anki-card {
        font-size: 24px;
        padding: 20px;
    }
    
    .rating-btn {
        min-width: 70px;
        padding: 12px 10px
        font-size: 14px !important;
    }
    
    .task-text {
        font-size: 18px !important;
    }
}

/* ФИКС МОБИЛЬНОГО МЕНЮ */
@media (max-width: 768px) {

    
    .deck-list {
        max-height: 60vh !important;
    }
}

/* ВОЗВРАЩАЕМ КНОПКИ РАБОЧИЕ */
.decks-button {
    pointer-events: auto !important; /* кнопка всегда кликабельна */
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}