/* ===== ТЕСТЫ ===== */
/* Только уникальные стили для тестов (без дублирования базовых классов) */

/* Главный экран */
.tests-main-screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px;
}

.test-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.test-card:hover {
  background: #222;
  border-color: #e6c158;
  transform: translateY(-2px);
}

.test-card.locked {
  opacity: 0.7;
  background: #111;
  cursor: not-allowed;
}

.test-icon {
  width: 56px;
  height: 56px;
  background: #2a2a2a;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.test-info {
  flex: 1;
}

.test-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.test-subtitle {
  font-size: 13px;
  color: #888;
  margin-bottom: 6px;
}

.test-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.test-badge.locked {
  background: #7f8c8d;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
}

.subscribe-btn {
  background: #e6c158;
  color: #000;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.subscribe-btn:hover {
  background: #f1c40f;
  transform: scale(1.02);
}

/* ===== УРОВНИ СЛОЖНОСТИ ===== */
.icon-level-novice { background-color: #2ecc71; }
.icon-level-experienced { background-color: #3498db; }
.icon-level-specialist { background-color: #e6c158; }
.icon-level-top { background-color: #e67e22; }
.icon-level-expert { background-color: #e74c3c; }

/* Общие кнопки */
.back-btn {
  background: #2a2a2a;
  border: none;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 20px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.back-btn:hover {
  background: #3a3a3a;
}

/* ===== СТАТИСТИКА ===== */
.stats-block {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.stats-header-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: #2a2a2a;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.stat-number {
  font-size: 24px;
  font-weight: bold;
  color: #e6c158;
  line-height: 1.2;
}

.stat-label {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

.stats-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid #2a2a2a;
}

.progress-circle {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.progress-circle canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 80px;
  height: 80px;
}

.progress-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: bold;
  color: #e6c158;
}

.progress-text {
  flex: 1;
  font-size: 12px;
  color: #aaa;
  line-height: 1.6;
}

.progress-text div {
  margin: 2px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Темы и сложность */
.themes-list,
.difficulty-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.theme-card,
.difficulty-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.theme-card:hover,
.difficulty-card:hover {
  background: #222;
  border-color: #e6c158;
  transform: translateX(4px);
}

.theme-icon {
  width: 48px;
  height: 48px;
  background: #2a2a2a;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.theme-info,
.difficulty-info {
  flex: 1;
}

.theme-title,
.difficulty-title {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.theme-count,
.difficulty-count {
  font-size: 12px;
  color: #888;
}

.difficulty-emoji {
  width: 52px;
  text-align: center;
  flex-shrink: 0;
}

.progress-completed,
.progress-inprogress {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.progress-completed {
  color: #2ecc71;
}

.progress-inprogress {
  color: #f39c12;
}

/* ===== ЗАГОЛОВОК ВОПРОСА ===== */
.question-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
  margin: 16px 0 14px;
  color: #fff;
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  letter-spacing: 0.2px;
}

/* ===== ОБЩИЕ СТИЛИ ДЛЯ ВСЕХ ОТВЕТОВ ===== */
.button,
.answer-multiple {
  background: var(--btn);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
  width: 100%;
  text-align: left;
  padding: 12px;
  margin: 8px 0;
  color: #fff;
}

/* Hover — только на десктопе */
@media (hover: hover) {
  .button:hover:not(:disabled),
  .answer-multiple:hover {
    background: rgba(230, 193, 88, 0.1);
    border-color: var(--accent);
  }
}

/* Убираем липкий эффект на мобильных */
.button:active,
.answer-multiple:active {
  transform: none;
}

.button:focus-visible,
.answer-multiple:focus-visible {
  outline: none;
}

/* Единое disabled состояние для всех ответов */
.button:disabled,
.answer-multiple.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Структура ответов — одинаковая для всех */
.ans,
.answer-multiple {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Бейджи */
.badge {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 14px;
}

.ans-text {
  line-height: 1.4;
  padding-top: 2px;
  flex: 1;
  font-size: 15px;
}

/* Выбранное состояние (до отправки) */
.button.selected,
.answer-multiple.multiple-selected {
  background: rgba(230, 193, 88, 0.2);
  border-color: var(--accent);
}

/* Подсказка для multiple */
.multiple-hint {
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== АНИМАЦИЯ FLASH ===== */
@keyframes correctFlash {
  0% {
    background-color: var(--btn);
    border-color: var(--line);
    opacity: 1;
  }
  25% {
    background-color: rgba(46, 204, 113, 0.5);
    border-color: #2ecc71;
    opacity: 0.85;
  }
  50% {
    background-color: rgba(46, 204, 113, 0.3);
    border-color: #2ecc71;
    opacity: 0.95;
  }
  75% {
    background-color: rgba(46, 204, 113, 0.5);
    border-color: #2ecc71;
    opacity: 0.85;
  }
  100% {
    background-color: var(--btn);
    border-color: var(--line);
    opacity: 1;
  }
}

.button.correct-flash,
.answer-multiple.correct-flash {
  animation: correctFlash 0.5s ease-in-out 2;
}

/* ===== ПРАВИЛЬНЫЕ/НЕПРАВИЛЬНЫЕ ОТВЕТЫ ===== */
.button.correct-permanent,
.answer-multiple.correct-permanent {
  background: rgba(46, 204, 113, 0.2) !important;
  border: 2px solid #2ecc71 !important;
  position: relative;
}

.button.correct-permanent::after,
.answer-multiple.correct-permanent::after {
  content: "✓";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #2ecc71;
  font-weight: 700;
  font-size: 18px;
}

.button.wrong-permanent,
.answer-multiple.wrong-permanent {
  background: rgba(231, 76, 60, 0.2) !important;
  border: 2px solid #e74c3c !important;
  position: relative;
}

.button.wrong-permanent::after,
.answer-multiple.wrong-permanent::after {
  content: "✗";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #e74c3c;
  font-weight: 700;
  font-size: 18px;
}

/* Кнопка избранного (узкая) */
.controls-wrap .button#favoriteBtn {
  width: auto;
  min-width: 44px;
  flex: 0 0 auto;
  padding: 8px 12px;
  background: var(--btn);
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#favoriteBtn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

#favoriteBtn.hidden {
  display: none;
}

/* Стили для изображений в вопросах */
.question-image-container {
  margin: 16px 0;
  text-align: center;
  background: #1a1a1a;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #2a2a2a;
}

.question-image {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
}

/* Таймер в pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Результаты теста */
.result-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

.percent-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

/* Адаптивность */
@media (max-width: 768px) {
  .question-image {
    max-height: 200px;
  }
  
  .question-image-container {
    padding: 8px;
  }
  
  .question-title {
    font-size: 17px;
    padding-left: 10px;
  }
}

@media (max-width: 480px) {
  .question-image {
    max-height: 150px;
  }
  
  .stats-header-cards {
    gap: 8px;
  }
  
  .stat-card {
    padding: 8px;
  }
  
  .stat-number {
    font-size: 20px;
  }
  
  .stat-label {
    font-size: 10px;
  }
  
  .stats-progress {
    gap: 12px;
  }
  
  .progress-circle {
    width: 60px;
    height: 60px;
  }
  
  .progress-circle canvas {
    width: 60px;
    height: 60px;
  }
  
  .progress-percent {
    font-size: 11px;
  }
  
  .progress-text {
    font-size: 10px;
  }
  
  .question-title {
    font-size: 16px;
    padding-left: 8px;
    margin: 12px 0 10px;
  }
  
  .result-title {
    font-size: 20px;
  }
  
  .percent-number {
    font-size: 20px;
  }
}
/* ===== НОВАЯ СТАТИСТИКА (без круговой диаграммы) ===== */

/* Карточки статистики на главной */
.stats-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding: 0 4px;
}

.stats-cards .stat-card {
    flex: 1;
    min-width: 70px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    padding: 12px 8px;
    text-align: center;
}

.stats-cards .stat-number {
    font-size: 22px;
    font-weight: 700;
    color: #e6c158;
    line-height: 1.2;
}

.stats-cards .stat-label {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

/* Экран статистики */
.stats-screen {
    padding: 5px;
}

.stats-screen h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0 12px 0;
    color: #fff;
}

.stats-screen h3:first-of-type {
    margin-top: 8px;
}

.stats-section {
    background: rgba(30, 30, 50, 0.5);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
}

#backBtn {
    max-width: 180px;
    margin: 0 auto;
}

/* Компактный элемент статистики - 2 строки */
.stats-item {
    margin-bottom: 20px;
}

.stats-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.stats-item-label {
    font-size: 14px;
    font-weight: 500;
    color: #ddd;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stats-item-value {
    font-size: 14px;
    font-weight: 600;
    color: #e6c158;
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #e6c158, #f1c40f);
    width: 0%;
    transition: width 0.3s ease;
}

.stats-item-hint {
    font-size: 10px;
    color: #666;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Для тем и сложности в статистике */
.stats-theme-item,
.stats-difficulty-item {
    margin-bottom: 16px;
}

.stats-theme-header,
.stats-difficulty-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.stats-theme-name,
.stats-difficulty-name {
    font-size: 14px;
    font-weight: 500;
    color: #ddd;
}

.stats-theme-count,
.stats-difficulty-count {
    font-size: 13px;
    color: #e6c158;
}

.stats-theme-accuracy,
.stats-difficulty-accuracy {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

.stats-empty {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.stats-all-btn {
    width: 100%;
    padding: 10px;
    margin-top: 12px;
    background: rgba(230, 193, 88, 0.15);
    border: 1px solid rgba(230, 193, 88, 0.3);
    border-radius: 12px;
    color: #e6c158;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.stats-all-btn:hover {
    background: rgba(230, 193, 88, 0.25);
}

/* Результат теста (без диаграммы) */
.result-card {
    text-align: center;
    padding: 24px 20px;
}

.result-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #e6c158;
}

.result-percent {
    font-size: 48px;
    font-weight: 700;
    color: #e6c158;
    margin: 16px 0;
}

.result-progress {
    margin: 20px 0;
    height: 12px;
}

.result-progress .progress-bar-fill {
    background: #2ecc71;
}

.result-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin: 20px 0;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
}

.result-stat {
    flex: 1;
    min-width: 80px;
    text-align: center;
}

.result-stat .stat-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.result-stat .stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.result-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.result-buttons .button {
    flex: 1;
}

/* Список всех тем */
.all-themes {
    max-height: 70vh;
    overflow-y: auto;
}

/* Скрытие старой круговой диаграммы */
.progress-circle {
    display: none;
}

/* Адаптивность */
@media (max-width: 480px) {
    .stats-cards .stat-number {
        font-size: 18px;
    }
    
    .stats-cards .stat-label {
        font-size: 10px;
    }
    
    .result-percent {
        font-size: 36px;
    }
    
    .result-stat .stat-value {
        font-size: 14px;
    }
    
    .result-buttons {
        flex-direction: column;
    }
    
    .stats-screen h3 {
        font-size: 16px;
    }
    
    .stats-item-label {
        font-size: 13px;
    }
}
/* ===== НОВЫЕ СТИЛИ ДЛЯ "ПРОДОЛЖИТЬ ТЕСТ" И "РАЗБОР ОШИБОК" ===== */

/* Карточка "Продолжить тест" с кнопкой закрытия */
.test-card[onclick*="continueTest"] {
  position: relative;
}

/* Кнопка закрытия в карточке "Продолжить тест" */
.test-card .button[onclick*="discardSavedTest"] {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.test-card .button[onclick*="discardSavedTest"]:hover {
  background: rgba(231, 76, 60, 0.7);
}

.test-card .button[onclick*="discardSavedTest"]:hover .icon {
  background-color: white;
}

/* Экран разбора ошибок */
.mistakes-review-screen {
  padding: 5px;
}

.mistakes-review-screen h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 8px 0 16px 0;
  color: #fff;
}

.mistakes-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 24px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding-right: 4px;
}

/* Кнопка избранного в карточке ошибки */
.card [data-fav-btn] {
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card [data-fav-btn]:hover {
  background: rgba(230, 193, 88, 0.2);
}

.card [data-fav-btn].active {
  background: rgba(230, 193, 88, 0.3);
}

/* Иконки избранного в карточках ошибок */
.card [data-fav-btn] .icon-favorite-on {
  background-color: #e6c158;
}

.card [data-fav-btn] .icon-favorite-off {
  background-color: #888;
}

/* Заголовок карточки ошибки */
.card > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* Адаптивность */
@media (max-width: 480px) {
  .mistakes-list {
    max-height: calc(100vh - 180px);
  }
  
  .card [data-fav-btn] {
    width: 32px;
    height: 32px;
  }
}