/* ==========================================
   ГеоПро — оформление уроков (lesson.css)
   Подключить ПОСЛЕ chest.css:
   <link rel="stylesheet" href="css/lesson.css?v=16">
   ========================================== */

/* ── Шапка урока ── */
#s-topic .topbar { padding: 12px 16px; gap: 10px; }
#s-topic .back-link { font-size: 14px; }
#topic-title {
  display: block !important; flex: 1; min-width: 0;
  font-family: var(--fb) !important; font-size: 13px !important; font-weight: 700; line-height: 1.3;
  text-align: center; overflow: hidden;
  display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
#topic-title svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }

/* ── Прогресс ── */
.theory-progress-bar { display: flex; gap: 4px; margin: 0 0 18px; }
.progress-segment { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,.1); transition: background .3s, box-shadow .3s; }
.progress-segment.completed { background: var(--primary2); }
.progress-segment.current { background: var(--primary); box-shadow: 0 0 10px rgba(92,141,255,.7); }
.progress-segment.just-completed { animation: segPulse .4s ease; }
@keyframes segPulse { 50% { transform: scaleY(2.2); background: #7ee08f; } }

/* ── Карточка урока ── */
.theory-card {
  display: flex; flex-direction: column; gap: 22px;
  padding: 22px 20px 20px; border-radius: 24px;
  background: var(--card); border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  animation: lessonIn .35s ease both;
}
@keyframes lessonIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.theory-card > .btn-primary,
#mini-mission-continue .btn-primary { width: 100%; min-height: 54px; font-size: 15px; border-radius: 16px; }

.theory-topic {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--fh); font-size: 18px; font-weight: 800; line-height: 1.3; margin-bottom: 16px;
}
.theory-card-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(92,141,255,.15); color: var(--primary);
}
.theory-card-icon svg { width: 22px; height: 22px; }

/* ── Текст ── */
.theory-text { font-size: 15px; line-height: 1.65; color: var(--text); }
.theory-p { margin: 0 0 14px; }
.theory-p:last-child { margin-bottom: 0; }
.theory-hi { color: #fff; font-weight: 700; background: linear-gradient(transparent 62%, rgba(92,141,255,.38) 62%); }
.theory-ul { margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.theory-ul li { position: relative; padding-left: 20px; font-size: 15px; line-height: 1.55; }
.theory-ul li::before { content: ''; position: absolute; left: 4px; top: .6em; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }

.icon-list-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.icon-list-item { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--card2); border: 1px solid var(--border); }
.icon-list-icon { width: 28px; height: 28px; color: var(--primary); flex-shrink: 0; }
.icon-list-icon svg { width: 100%; height: 100%; }
.icon-list-label { font-size: 12px; font-weight: 600; line-height: 1.3; }

/* ── Реплика Профессора ── */
.prof-note {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 14px;
  border-radius: 16px; background: rgba(245,166,35,.08); border: 1px solid rgba(245,166,35,.28);
}
.prof-note-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: url('/images/professor_avatar.png') center/cover no-repeat, var(--grad);
  border: 2px solid rgba(245,166,35,.55);
}
.prof-note-large .prof-note-avatar { width: 54px; height: 54px; }
.prof-note-body { flex: 1; min-width: 0; }
.prof-note-label { font-family: var(--fh); font-size: 11px; font-weight: 700; color: var(--gold); margin-bottom: 5px; }
.prof-note-text .theory-p { margin: 0 0 8px; font-size: 14px; line-height: 1.55; }
.prof-note-text .theory-p:last-child { margin-bottom: 0; }

/* ── Инфографика ── */
.infographic-img { display: block; width: 100%; border-radius: 14px; margin: 4px 0 14px; }
.infographic-conclusion {
  padding: 12px 14px; font-size: 14px; line-height: 1.55;
  background: rgba(92,141,255,.09); border-left: 3px solid var(--primary); border-radius: 0 12px 12px 0;
}
.mini-question { margin-top: 16px; }
.mini-question-prompt { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.mini-answers { display: flex; flex-direction: column; gap: 8px; }
.mini-answer-btn {
  padding: 12px 14px; text-align: left; font-family: var(--fb); font-size: 14px; font-weight: 500;
  color: var(--text); background: var(--card2); border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer;
}
.mini-answer-btn.correct { background: rgba(63,185,80,.16); border-color: var(--primary2); }
.mini-answer-btn.wrong { background: rgba(248,81,73,.16); border-color: var(--danger); }

/* ── «Нажми, чтобы увидеть» ── */
.tap-reveal-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 30px 16px; border: 2px dashed rgba(92,141,255,.5); border-radius: 18px;
  background: rgba(92,141,255,.06); cursor: pointer; animation: tapPulse 2s ease-in-out infinite;
}
@keyframes tapPulse { 50% { background: rgba(92,141,255,.14); } }
.tap-reveal-icon { font-size: 36px; }
.tap-reveal-label { font-weight: 700; font-size: 15px; }
.tap-reveal-hint { font-size: 12px; color: var(--muted); }
.tap-reveal-content { animation: lessonIn .4s ease both; }
.tap-reveal-content img { width: 100%; border-radius: 14px; margin-bottom: 12px; display: block; }
.tap-reveal-content-text { font-size: 15px; line-height: 1.6; }

/* ── Соотнеси пары ── */
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match-col { display: flex; flex-direction: column; gap: 8px; }
.match-item {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 54px;
  padding: 10px; font-size: 13px; font-weight: 600; line-height: 1.3; cursor: pointer;
  background: var(--card2); border: 1.5px solid var(--border); border-radius: 12px; transition: .15s;
}
.match-item.selected { border-color: var(--primary); background: rgba(92,141,255,.18); }
.match-item.matched { border-color: var(--primary2); background: rgba(63,185,80,.14); opacity: .8; pointer-events: none; }
.match-item.shake { animation: matchShake .35s; border-color: var(--danger); }
@keyframes matchShake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ── Вопросы ── */
#topic-content .quiz-wrap { overflow: visible; flex: none; padding: 0; gap: 14px; }
#topic-content .q-card { padding: 18px; border-radius: 18px; }
#topic-content .q-text { font-size: 16px; font-weight: 600; line-height: 1.45; }
#topic-content .ans-btn { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.ans-letter {
  width: 30px; height: 30px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08); font-family: var(--fh); font-size: 13px; font-weight: 700;
}
.ans-letter svg { width: 16px; height: 16px; }
.ans-btn.correct .ans-letter { background: var(--primary2); color: #fff; }
.ans-btn.wrong .ans-letter { background: var(--danger); color: #fff; }

/* Правда / Ложь */
.true-false-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.true-false-btn {
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 10px;
  min-height: 62px; padding: 0 12px; cursor: pointer;
  font-family: var(--fh); font-size: 15px; font-weight: 700; color: var(--text);
  background: var(--card2); border: 1.5px solid var(--border); border-radius: 16px; transition: .15s;
}
.true-false-btn:active { transform: scale(.97); }
.tf-icon { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.08); }
.tf-icon svg { width: 16px; height: 16px; }
.true-btn .tf-icon { color: var(--primary2); }
.false-btn .tf-icon { color: var(--danger); }
.true-false-btn.correct-tf { background: rgba(63,185,80,.18); border-color: var(--primary2); }
.true-false-btn.wrong-tf { background: rgba(248,81,73,.18); border-color: var(--danger); }

/* Ответ после проверки */
#micro-feedback:not(:empty) {
  padding: 14px 16px; border-radius: 14px; font-size: 14px; line-height: 1.5;
  background: rgba(255,255,255,.04); border: 1px solid var(--border); animation: lessonIn .3s ease both;
}
#micro-feedback svg { width: 16px; height: 16px; vertical-align: -3px; }

/* Картинки-варианты */
.image-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.image-option { aspect-ratio: 1; background-size: cover; background-position: center; border-radius: 14px; border: 2px solid var(--border); cursor: pointer; }
.image-option.correct-img { border-color: var(--primary2); }
.image-option.wrong-img { border-color: var(--danger); }

/* Сортировка */
.sort-hint { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.sort-list { display: flex; flex-direction: column; gap: 8px; }
.sort-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card2); border: 1px solid var(--border); border-radius: 12px; }
.sort-item.just-moved { border-color: var(--primary); background: rgba(92,141,255,.12); }
.sort-position { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: rgba(92,141,255,.18); color: var(--primary); font-family: var(--fh); font-size: 12px; font-weight: 800; }
.sort-item-text { flex: 1; font-size: 14px; line-height: 1.35; }
.sort-controls { display: flex; gap: 6px; }
.sort-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,.05); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sort-btn svg { width: 16px; height: 16px; }
.sort-btn:disabled { opacity: .3; }

/* Несколько ответов */
.multi-option { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--card2); border: 1.5px solid var(--border); border-radius: 14px; cursor: pointer; font-size: 14px; line-height: 1.4; }
.multi-option input { position: absolute; opacity: 0; pointer-events: none; }
.multi-checkbox { width: 24px; height: 24px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 2px solid var(--border); color: transparent; transition: .15s; }
.multi-checkbox svg { width: 14px; height: 14px; }
.multi-option input:checked + .multi-checkbox { background: var(--primary); border-color: var(--primary); color: #fff; }
.multi-option.correct-ms { border-color: var(--primary2); background: rgba(63,185,80,.14); }
.multi-option.wrong-ms { border-color: var(--danger); background: rgba(248,81,73,.14); }

/* ── Лайк от профессора при «Продолжить» ── */
.xp-thumbsup {
  right: 18px; bottom: 120px; left: auto; width: 68px; height: 68px;
  background: url('/images/professor_happy.png') center/contain no-repeat;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.4));
}