/* ===== ПЕРЕМЕННЫЕ ===== */
:root {
  --green-dark: #0B4D2E;
  --green-main: #1A6B40;
  --green-light: #2D8A57;
  --gold: #C9A84C;
  --gold-light: #E8C96A;
  --cream: #FDFBF4;
  --cream-dark: #F5F0E0;
  --text-dark: #1A1A1A;
  --text-mid: #4A4A4A;
  --text-light: #888;
  --white: #FFFFFF;
  --shadow: 0 4px 24px rgba(11, 77, 46, 0.12);
  --shadow-hover: 0 8px 32px rgba(11, 77, 46, 0.22);
  --radius: 16px;
  --radius-sm: 10px;
}

/* ===== СБРОС И БАЗОВЫЕ СТИЛИ ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background-color: var(--cream);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

.arabic-text {
  font-family: 'Amiri', 'Cairo', serif;
  direction: rtl;
}

/* ===== ОРНАМЕНТ ФОНА ===== */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(201, 168, 76, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(26, 107, 64, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ===== ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКА ===== */
.lang-switcher {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--white);
  border: 1.5px solid var(--gold);
  border-radius: 50px;
  padding: 4px 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  padding: 4px 10px;
  border-radius: 50px;
  transition: all 0.2s;
}

.lang-btn.active {
  background: var(--green-main);
  color: var(--white);
}

.lang-divider { color: var(--gold); font-size: 12px; }

/* ===== ГЛАВНЫЕ ВКЛАДКИ ===== */
.main-tabs {
  position: fixed;
  top: 66px;
  left: 0;
  right: 0;
  z-index: 99;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(253, 251, 244, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(201, 168, 76, 0.25);
}

.main-tab-btn {
  background: var(--white);
  border: 1.5px solid var(--cream-dark);
  color: var(--text-mid);
  font-weight: 600;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.main-tab-btn.active {
  background: var(--green-main);
  border-color: var(--green-main);
  color: var(--white);
  box-shadow: 0 3px 12px rgba(26, 107, 64, 0.3);
}

.main-tab-btn:hover:not(.active) {
  border-color: var(--gold);
  color: var(--green-dark);
}

/* ===== ЛОГОТИП ===== */
.logo-wrap {
  position: fixed;
  top: 14px;
  left: 20px;
  z-index: 100;
  cursor: pointer;
}

.logo { height: 44px; width: auto; }

/* ===== КОНТЕЙНЕР ===== */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ===== ЭКРАНЫ ===== */
.screen {
  display: none;
  min-height: 100vh;
  padding: 140px 0 60px;
  animation: fadeIn 0.4s ease;
}

.screen.active { display: flex; flex-direction: column; justify-content: center; }

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

/* ===== ЭКРАН 1: ГЕРОЙ ===== */
.bismillah {
  font-family: 'Amiri', serif;
  font-size: 28px;
  color: var(--gold);
  text-align: center;
  direction: rtl;
  margin-bottom: 24px;
  letter-spacing: 1px;
}

.hero-title {
  font-size: clamp(26px, 5vw, 40px);
  font-weight: 700;
  color: var(--green-dark);
  text-align: center;
  line-height: 1.3;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-mid);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 36px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.hero-features {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-mid);
  font-weight: 500;
}

.feature-icon {
  font-size: 22px;
  background: var(--cream-dark);
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--gold);
}

/* ===== ГЛАВНОЕ МЕНЮ (стартовый экран с большими кнопками) ===== */
#screen-home.active { justify-content: flex-start; padding-top: 90px; }

.home-menu {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 480px;
  margin: 0 auto;
}

.home-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  color: inherit;
  font-family: inherit;
  box-shadow: var(--shadow);
  transition: all 0.25s;
}

.home-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: var(--shadow-hover);
}

.home-card:active { transform: translateY(0); }

.home-card-icon {
  flex: none;
  font-size: 26px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--cream-dark);
  border: 1.5px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
}

.home-card-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.home-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
}

.home-card-sub {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.4;
}

.home-card-arrow {
  flex: none;
  font-size: 20px;
  color: var(--gold);
  opacity: 0.7;
}

.home-card-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-color: var(--gold);
  box-shadow: 0 6px 24px rgba(201, 168, 76, 0.4);
}

.home-card-primary .home-card-icon {
  background: rgba(255, 255, 255, 0.35);
  border-color: var(--white);
}

.home-card-primary .home-card-title,
.home-card-primary .home-card-sub {
  color: var(--white);
}

.home-card-primary .home-card-arrow { color: var(--white); }

.home-card-primary:hover {
  border-color: var(--white);
}

/* ===== КНОПКИ ===== */
.btn-primary {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--green-main), var(--green-dark));
  color: var(--white);
  border: none;
  border-radius: 50px;
  padding: 16px 32px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 20px rgba(26, 107, 64, 0.35);
  letter-spacing: 0.3px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(26, 107, 64, 0.45);
}

.btn-primary:active { transform: translateY(0); }

/* Кнопка видео */
.btn-video {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  background: linear-gradient(135deg, #c0392b, #922b21);
  color: var(--white);
  border: none;
  border-radius: 14px;
  padding: 18px 32px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 20px rgba(192, 57, 43, 0.4);
  letter-spacing: 0.3px;
}

.btn-video:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(192, 57, 43, 0.5);
}

.btn-video:active { transform: translateY(0); }

.btn-video-icon {
  font-size: 22px;
  background: rgba(255,255,255,0.2);
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.result-watch-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  margin-top: 12px;
  line-height: 1.5;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== ЭКРАН 2: ТЕСТ ===== */
.test-header {
  text-align: center;
  margin-bottom: 28px;
}

.test-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 20px;
  text-align: center;
}

.progress-wrap { margin-bottom: 24px; }

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 8px;
  font-weight: 500;
}

.progress-bar {
  height: 8px;
  background: var(--cream-dark);
  border-radius: 50px;
  overflow: hidden;
  border: 1px solid rgba(201, 168, 76, 0.3);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-light), var(--gold));
  border-radius: 50px;
  transition: width 0.4s ease;
}

.question-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  box-shadow: var(--shadow);
  border: 1.5px solid rgba(201, 168, 76, 0.2);
}

.question-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.question-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Арабский вопрос (тип контекст) — RTL, крупнее */
.question-arabic {
  direction: rtl;
  text-align: right;
  font-family: 'Amiri', 'Cairo', serif;
  font-size: 22px;
  line-height: 2;
  letter-spacing: 0;
}

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.answer-feedback {
  margin-top: 14px;
  min-height: 36px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  transition: opacity 0.2s;
  opacity: 0;
}

.answer-feedback.show { opacity: 1; }

.answer-feedback.correct {
  background: #D4EDDA;
  color: #155724;
  border: 1.5px solid #28A745;
}

.answer-feedback.wrong {
  background: #F8D7DA;
  color: #721C24;
  border: 1.5px solid #DC3545;
}

.option-btn {
  background: var(--cream);
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  font-family: inherit;
  line-height: 1.4;
}

/* Арабские варианты ответов — RTL */
.option-arabic {
  direction: rtl;
  text-align: right;
  font-family: 'Amiri', 'Cairo', serif;
  font-size: 19px;
  letter-spacing: 0;
  line-height: 1.8;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--green-light);
  background: #EDF7F2;
  color: var(--green-dark);
}

.option-btn.correct {
  background: #D4EDDA;
  border-color: #28A745;
  color: #155724;
}

.option-btn.wrong {
  background: #F8D7DA;
  border-color: #DC3545;
  color: #721C24;
}

.option-btn:disabled { cursor: default; }

.next-wrap {
  margin-top: 20px;
  text-align: right;
}

/* ===== ЭКРАН 3: РЕЗУЛЬТАТ ===== */
.result-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px 28px;
  box-shadow: var(--shadow);
  border: 1.5px solid rgba(201, 168, 76, 0.3);
  text-align: center;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--green-main), var(--green-dark));
  border-radius: 50%;
  font-size: 28px;
  font-weight: 800;
  color: var(--gold-light);
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(26, 107, 64, 0.3);
  border: 3px solid var(--gold);
}

.result-label {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.result-level-name {
  font-size: 28px;
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: 16px;
}

.result-sublabel {
  display: inline-block;
  background: rgba(201, 168, 76, 0.15);
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-radius: 50px;
  padding: 4px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-main);
  margin-bottom: 16px;
  letter-spacing: 0.3px;
}

.result-score {
  display: inline-block;
  background: var(--cream-dark);
  border-radius: 50px;
  padding: 6px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 20px;
  border: 1px solid rgba(201, 168, 76, 0.4);
}

.result-desc {
  font-size: 15px;
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== ЭКРАН 4: ВИДЕО ===== */
.video-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--green-dark);
  text-align: center;
  margin-bottom: 10px;
}

.video-subtitle {
  font-size: 15px;
  color: var(--text-mid);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.6;
}

.video-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
  background: var(--green-dark);
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-placeholder {
  color: rgba(255,255,255,0.6);
  font-size: 15px;
  text-align: center;
  padding: 40px 20px;
}

.video-placeholder .placeholder-icon {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
}

.whatsapp-block {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1.5px solid rgba(201, 168, 76, 0.2);
}

.whatsapp-text {
  font-size: 15px;
  color: var(--text-mid);
  margin-bottom: 20px;
  line-height: 1.6;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #25D366;
  color: var(--white);
  border-radius: 50px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp:hover {
  background: #1DB954;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
}

/* ===== СПИСОК ПОДКАСТОВ ===== */
.section-title {
  font-size: clamp(24px, 4.5vw, 34px);
  font-weight: 700;
  color: var(--green-dark);
  text-align: center;
  margin-bottom: 10px;
}

.section-subtitle {
  font-size: 15px;
  color: var(--text-mid);
  text-align: center;
  margin-bottom: 32px;
  line-height: 1.6;
}

.podcast-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-pill {
  background: var(--white);
  border: 1.5px solid var(--cream-dark);
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--white);
}

.filter-pill:hover:not(.active) { border-color: var(--gold); }

.podcast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.podcast-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1.5px solid rgba(201, 168, 76, 0.2);
  cursor: pointer;
  transition: all 0.25s;
  text-align: left;
}

.podcast-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--gold);
}

.podcast-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--green-dark) center/cover no-repeat;
  position: relative;
}

.podcast-card-level {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--green-dark);
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  border: 1px solid var(--gold);
  z-index: 1;
}

.podcast-card-thumb::after {
  content: '▶';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.85);
  color: var(--green-dark);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

.podcast-card-body { padding: 14px 16px 16px; }

.podcast-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 6px;
  line-height: 1.4;
}

.podcast-card-desc {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.5;
}

.podcast-empty {
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  padding: 40px 20px;
}

/* ===== СТРАНИЦА ПОДКАСТА ===== */
.back-btn {
  background: none;
  border: none;
  color: var(--green-main);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 18px;
}

.back-btn:hover { color: var(--green-dark); text-decoration: underline; }

.podcast-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 8px;
}

.podcast-desc {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.6;
  margin-bottom: 22px;
}

.podcast-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.subtab-btn {
  background: var(--cream-dark);
  border: 1.5px solid transparent;
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
}

.subtab-btn.active {
  background: var(--green-main);
  color: var(--white);
}

.subtab-btn:hover:not(.active) { border-color: var(--gold); }

.podcast-subview { display: none; }
.podcast-subview.active { display: block; }

/* ===== ВНУТРЕННИЕ ВКЛАДКИ РАЗДЕЛА «УПРАЖНЕНИЯ» ===== */
.exercise-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px dashed rgba(201, 168, 76, 0.35);
}

.exercise-tab-btn {
  background: none;
  border: 1.5px solid var(--gold);
  color: var(--green-dark);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
}

.exercise-tab-btn.active {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}

.exercise-tab-btn:hover:not(.active) { background: rgba(201, 168, 76, 0.12); }

.exercise-subview { display: none; }
.exercise-subview.active { display: block; }

/* ===== УПРАЖНЕНИЯ ПОДКАСТА (старт / вопрос / финиш) ===== */
.quiz-start-card, .quiz-finish-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow);
  border: 1.5px solid rgba(201, 168, 76, 0.2);
  text-align: center;
}

.quiz-start-title, .quiz-finish-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 10px;
}

.reading-praise {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 12px;
  animation: reading-praise-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes reading-praise-pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

/* ===== КОНФЕТТИ ===== */
.confetti-wrap {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}

.confetti-piece {
  position: absolute;
  top: -12px;
  width: 9px;
  height: 14px;
  opacity: 0.95;
  animation-name: confetti-fall;
  animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  animation-fill-mode: forwards;
}

@keyframes confetti-fall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--drift), 105vh) rotate(var(--rot)); opacity: 0; }
}

.quiz-start-desc {
  font-size: 14px;
  color: var(--text-mid);
  margin-bottom: 22px;
  line-height: 1.6;
}

.quiz-empty {
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  padding: 24px;
}

.quiz-finish-score {
  display: inline-block;
  background: var(--cream-dark);
  border-radius: 50px;
  padding: 6px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-mid);
  margin: 6px 0 22px;
  border: 1px solid rgba(201, 168, 76, 0.4);
}

/* ===== ОБЩИЙ ПРОГРЕСС ПО ЭПИЗОДУ (все 3 блока упражнений) ===== */
.overall-progress {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
  border: 1.5px solid rgba(201, 168, 76, 0.25);
}

.overall-progress-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 10px;
}

.overall-progress-bar {
  height: 8px;
  background: var(--cream-dark);
  border-radius: 50px;
  overflow: hidden;
  border: 1px solid rgba(201, 168, 76, 0.3);
  margin-bottom: 6px;
}

.overall-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-light), var(--gold));
  border-radius: 50px;
  transition: width 0.4s ease;
}

.overall-progress-caption {
  font-size: 12.5px;
  color: var(--text-mid);
  font-weight: 500;
}

.overall-result {
  text-align: center;
}

.overall-result-pct {
  font-size: 34px;
  font-weight: 800;
  color: var(--green-dark);
  margin: 4px 0;
}

.overall-result-score {
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 10px;
}

.overall-result-grade {
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 12px;
  line-height: 1.5;
}

.overall-result-grade.grade-excellent {
  background: rgba(26, 107, 64, 0.12);
  color: var(--green-dark);
}

.overall-result-grade.grade-good {
  background: rgba(201, 168, 76, 0.15);
  color: #8a6d1f;
}

.overall-result-grade.grade-retry {
  background: rgba(196, 74, 74, 0.12);
  color: #a83c3c;
}

/* ===== ДЕКОРАТИВНАЯ ЛИНИЯ ===== */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--gold);
  font-size: 18px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ===== ТРЕНАЖЁР ЧТЕНИЯ: СПИСОК УРОКОВ ===== */
.reading-lesson-list { display: flex; flex-direction: column; gap: 12px; }

.reading-block-header {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 18px 0 -2px;
  padding-left: 2px;
}
.reading-block-header:first-child { margin-top: 0; }

.reading-lesson-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  border: 1px solid rgba(201, 168, 76, 0.15);
  transition: box-shadow 0.2s, transform 0.2s;
}

.reading-lesson-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.reading-lesson-card.locked { cursor: default; opacity: 0.6; }
.reading-lesson-card.locked:hover { box-shadow: var(--shadow); transform: none; }

.reading-lesson-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--green-main);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.reading-lesson-card.locked .reading-lesson-num { background: var(--text-light); font-size: 18px; }

.reading-lesson-info { flex: 1; }
.reading-lesson-title { font-weight: 600; font-size: 15px; color: var(--text-dark); }
.reading-lesson-sub { font-size: 12.5px; color: var(--text-mid); margin-top: 2px; }
.reading-lesson-arrow { font-size: 18px; color: var(--gold); }

/* ===== ТРЕНАЖЁР ЧТЕНИЯ: ПЛИТКИ «УЧИТЬ» ===== */
.reading-tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  direction: rtl; /* порядок плиток — как в книге, справа налево */
}

.reading-tile {
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 16px 8px 10px;
  text-align: center;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: border-color 0.15s, transform 0.1s;
}

.reading-tile:hover { border-color: var(--gold); }
.reading-tile:active { transform: scale(0.96); }
.reading-tile.playing { border-color: var(--green-main); }

.reading-tile-glyph { font-size: 32px; color: var(--green-dark); line-height: 2.4; padding: 6px 0; margin-bottom: 4px; }

/* Amiri некорректно ставит огласовки у некоторых букв (сливаются с буквой) —
   точечно используем другие шрифты для конкретных «проблемных» семей букв */
.reading-tile-glyph.font-alt-scheherazade,
.reading-quiz-option.font-alt-scheherazade { font-family: 'Scheherazade New', 'Amiri', serif; } /* ح ج خ */

.reading-tile-glyph.font-alt-harmattan,
.reading-quiz-option.font-alt-harmattan { font-family: 'Harmattan', 'Amiri', serif; } /* ع غ */
.reading-tile-name { font-size: 11.5px; color: var(--text-mid); font-weight: 600; direction: ltr; }
.reading-tile-icon { font-size: 10px; color: var(--gold); margin-top: 4px; }

.reading-tile-grid--triple { grid-template-columns: repeat(3, 1fr); }
.reading-tile-grid--no-translit .reading-tile-name { visibility: hidden; }

.reading-translit-toggle {
  display: block;
  margin: 0 0 12px auto;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.reading-translit-toggle:hover { background: rgba(201, 168, 76, 0.1); }

/* Слова длиннее слогов — уже сетка, меньше и без переноса, без фиксированной line-height под один символ */
.reading-tile-grid--words { grid-template-columns: repeat(3, 1fr); }
.reading-tile-grid--words .reading-tile-glyph { font-size: 22px; line-height: 1.6; white-space: nowrap; }

/* ===== ТРЕНАЖЁР ЧТЕНИЯ: УПРАЖНЕНИЕ «УСЛЫШЬ И ВЫБЕРИ» ===== */
.reading-quiz-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  text-align: center;
}

.reading-quiz-play-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--green-main);
  color: var(--white);
  border: none;
  font-size: 26px;
  cursor: pointer;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.reading-quiz-play-btn:hover { background: var(--green-dark); }

.reading-quiz-hint { font-size: 12.5px; color: var(--text-light); margin-bottom: 20px; }

.reading-quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  direction: rtl;
}

.reading-quiz-option {
  padding: 16px 6px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--cream-dark);
  background: var(--cream);
  font-size: 28px;
  line-height: 2;
  cursor: pointer;
  color: var(--green-dark);
}

.reading-quiz-option--words { font-size: 20px; line-height: 1.5; white-space: normal; word-break: break-word; }

.reading-quiz-option:hover:not(:disabled) { border-color: var(--gold); }
.reading-quiz-option.correct { background: rgba(45, 138, 87, 0.18); border-color: var(--green-main); }
.reading-quiz-option.wrong { background: rgba(200, 60, 60, 0.14); border-color: #c83c3c; }
.reading-quiz-option:disabled { cursor: default; }

.reading-finish-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.reading-quiz-retry-hint {
  font-size: 13px;
  color: var(--text-mid);
  margin-top: 8px;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 480px) {
  .screen { padding: 130px 0 40px; }
  .container { padding: 0 16px; }
  .question-card { padding: 20px 16px; }
  .result-card { padding: 28px 16px; }
  .hero-features { gap: 16px; }
  .feature-icon { width: 40px; height: 40px; font-size: 18px; }
  .bismillah { font-size: 22px; }
  .btn-primary { font-size: 15px; padding: 14px 24px; }
  .whatsapp-block { padding: 20px 16px; }
  .main-tabs { top: 64px; }
  .main-tab-btn { font-size: 12px; padding: 8px 12px; }
  .reading-tile-grid { grid-template-columns: repeat(3, 1fr); }
  #screen-home.active { padding-top: 78px; }
  .home-card { padding: 14px; gap: 12px; }
  .home-card-icon { width: 44px; height: 44px; font-size: 22px; }
  .home-card-title { font-size: 15px; }
  .home-card-sub { font-size: 12px; }
}

/* iPhone SE, маленькие Android (360–375px) */
@media (max-width: 390px) {
  .lang-switcher { top: 10px; right: 12px; }
  .logo-wrap { top: 10px; left: 12px; }
  .logo { height: 36px; }
  .hero-title { font-size: 22px; }
  .hero-subtitle { font-size: 14px; }
  .question-text { font-size: 16px; }
  .question-arabic { font-size: 19px; }
  .option-btn { padding: 12px 14px; font-size: 14px; }
  .option-arabic { font-size: 17px; }
  .result-badge { width: 64px; height: 64px; font-size: 22px; }
  .result-level-name { font-size: 22px; }
  .btn-whatsapp { font-size: 14px; padding: 12px 20px; }
  .hero-features { flex-direction: column; align-items: center; gap: 12px; }
  .next-wrap { text-align: center; }
}

/* ===== ВСПЛЫВАЮЩАЯ КНОПКА ПОДДЕРЖКИ ===== */
.support-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(11, 77, 46, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.support-backdrop.open { opacity: 1; pointer-events: auto; }

.support-fab {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 950;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px 13px 16px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(150deg, var(--green-light), var(--green-dark));
  color: var(--white);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(11, 77, 46, 0.35);
  transform: translateY(14px);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(.2,.9,.3,1), opacity 0.5s, box-shadow 0.25s, filter 0.2s;
}
.support-fab.show { transform: translateY(0); opacity: 1; }
.support-fab:hover { filter: brightness(1.06); box-shadow: 0 14px 32px rgba(11, 77, 46, 0.42); }
.support-fab:active { transform: translateY(1px); }
.support-fab-heart { font-size: 16px; line-height: 1; }
.support-fab-ring {
  position: absolute;
  inset: 0;
  border-radius: 50px;
  border: 2px solid var(--green-main);
  opacity: 0;
  pointer-events: none;
}
.support-fab.pulse .support-fab-ring { animation: support-ring 1.8s ease-out 1; }
@keyframes support-ring {
  0% { opacity: 0.55; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}

.support-pop {
  position: fixed;
  right: 20px;
  bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  z-index: 960;
  width: min(340px, calc(100vw - 32px));
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
  background: var(--white);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 22px 20px 18px;
  transform: translateY(12px) scale(0.97);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(.2,.9,.3,1), opacity 0.28s;
}
.support-pop.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.support-pop::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: -8px;
  width: 16px;
  height: 16px;
  background: var(--white);
  border-right: 1.5px solid var(--gold);
  border-bottom: 1.5px solid var(--gold);
  transform: rotate(45deg);
}
.support-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-light);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.support-close:hover { background: var(--cream-dark); color: var(--text-dark); }
.support-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--cream-dark);
  font-size: 24px;
  margin-bottom: 14px;
}
.support-pop-title {
  font-size: 20px;
  line-height: 1.2;
  color: var(--green-dark);
  margin-bottom: 8px;
}
.support-pop-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-mid);
  margin-bottom: 18px;
}
.support-kaspi-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  background: #F14635;
  color: var(--white);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}
.support-kaspi-btn:hover { background: #D63423; }
.support-kaspi-btn:active { transform: translateY(1px); }
.support-kaspi-logo {
  font-weight: 800;
  background: var(--white);
  color: #F14635;
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 12px;
}
.support-thanks {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-light);
  margin-top: 12px;
}

@media (max-width: 480px) {
  .support-fab {
    left: 0;
    right: 0;
    margin-inline: auto;
    width: fit-content;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    font-size: 14px;
    padding: 12px 22px 12px 18px;
  }
  .support-pop {
    right: 14px;
    left: 14px;
    width: auto;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }
  .support-pop::after { right: auto; left: 50%; margin-left: -8px; }
}

@media (prefers-reduced-motion: reduce) {
  .support-fab, .support-pop, .support-backdrop { transition: opacity 0.15s; }
  .support-fab.pulse .support-fab-ring { animation: none; }
  .support-fab { transform: none; }
}
