/* ==========================================================================
   ОРФО-ТАП — режим «База ЕГЭ 1–26».
   Тёмное стекло и неон в духе игры. Стили только для новых элементов:
   существующие селекторы style.css не меняются. Переменные берём из :root
   style.css (--panel, --ink, --neon, --teal, --violet, --red, --gold,
   --line-soft и т. д.).
   ========================================================================== */

/* ---------- Карточка режима в шите «Режимы» ---------- */

.mode-card.mode-ege {
  border-color: rgba(255, 207, 92, 0.32);
  background:
    radial-gradient(130% 180% at 0% 0%, rgba(255, 207, 92, 0.14), rgba(139, 124, 246, 0.06) 55%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
}

.mode-card.mode-ege h3 {
  color: #fff4d6;
  text-shadow: 0 0 18px rgba(255, 207, 92, 0.3);
}

.mode-card.mode-ege .mode-stat {
  color: var(--gold);
  text-shadow: 0 0 14px rgba(255, 207, 92, 0.24);
}

.mode-card.mode-ege .mode-stat.is-empty {
  color: #ffc9c9;
  text-shadow: 0 0 14px rgba(255, 107, 107, 0.22);
}

.mode-card.mode-ege .mode-play {
  border-color: rgba(255, 207, 92, 0.7);
  background: linear-gradient(180deg, rgba(255, 207, 92, 0.26), rgba(255, 207, 92, 0.1));
  color: #fff4d6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 18px rgba(255, 207, 92, 0.2);
}

.mode-card.mode-ege .mode-play:hover {
  border-color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 28px rgba(255, 207, 92, 0.42);
  transform: translateY(-1px);
}

/* ---------- Кнопка на главном экране (рядом с «Тема: Всё») ---------- */

.ege-hud-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 207, 92, 0.7);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 207, 92, 0.22), rgba(255, 207, 92, 0.08));
  color: #fff4d6;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 16px rgba(255, 207, 92, 0.22);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.ege-hud-btn::before {
  content: "★";
  font-size: 11px;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 207, 92, 0.6);
}

.ege-hud-btn:hover {
  border-color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 26px rgba(255, 207, 92, 0.42);
  transform: translateY(-1px);
}

.ege-hud-btn:active {
  transform: translateY(0);
}

/* ---------- Оверлей ---------- */

/* Класс .overlay из style.css даёт фиксированное затемнение; здесь только
   поднимаем слой выше остальных оверлеев и растягиваем шит по высоте. */
.ege-overlay {
  z-index: 70;
  align-items: stretch;
  padding: clamp(8px, 2vw, 22px);
}

.ege-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 1040px);
  max-height: 100%;
  margin: 0 auto;
  padding: clamp(14px, 2vw, 24px) clamp(14px, 2.2vw, 26px);
  overflow: hidden;
  border: 1px solid rgba(255, 207, 92, 0.26);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 80% at 50% -12%, rgba(139, 124, 246, 0.18), rgba(139, 124, 246, 0) 58%),
    radial-gradient(90% 70% at 100% 108%, rgba(57, 230, 195, 0.12), rgba(57, 230, 195, 0) 62%),
    linear-gradient(165deg, rgba(19, 31, 54, 0.97) 0%, rgba(9, 15, 27, 0.98) 58%, rgba(7, 12, 23, 0.99) 100%);
  color: var(--ink);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.62),
    0 0 44px rgba(139, 124, 246, 0.14),
    0 0 0 1px rgba(255, 207, 92, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: sheetUp 0.22s ease-out;
}

.ege-sheet::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 207, 92, 0), var(--gold) 22%, var(--violet) 56%, var(--teal) 82%, rgba(57, 230, 195, 0));
  box-shadow: 0 0 18px rgba(255, 207, 92, 0.55);
  opacity: 0.95;
}

.ege-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ege-head-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ege-kicker {
  margin: 0;
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(255, 207, 92, 0.35);
}

.ege-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(19px, 2.6vw, 27px);
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-shadow: 0 0 24px rgba(139, 124, 246, 0.35);
}

.ege-close {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(160, 200, 240, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.18s ease, color 0.16s ease;
}

.ege-close:hover {
  border-color: rgba(255, 107, 107, 0.7);
  background: rgba(255, 107, 107, 0.14);
  color: #ffdcdc;
  box-shadow: 0 0 22px rgba(255, 107, 107, 0.32);
}

/* ---------- Чипы номеров ---------- */

.ege-chips {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  margin: 10px 0 0;
  padding: 2px 0 8px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 124, 246, 0.5) rgba(255, 255, 255, 0.04);
  -webkit-overflow-scrolling: touch;
}

.ege-chip {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(139, 124, 246, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink-dim);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.ege-chip:hover:not(:disabled) {
  border-color: rgba(139, 124, 246, 0.75);
  background: rgba(139, 124, 246, 0.14);
  color: var(--ink);
}

.ege-chip:active:not(:disabled) {
  transform: scale(0.96);
}

.ege-chip.is-active {
  border-color: rgba(255, 207, 92, 0.85);
  background: linear-gradient(180deg, rgba(255, 207, 92, 0.3), rgba(255, 207, 92, 0.12));
  color: #fff4d6;
  box-shadow: 0 0 18px rgba(255, 207, 92, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.ege-chip:disabled {
  opacity: 0.38;
  cursor: default;
}

/* ---------- Прогресс и статус ---------- */

.ege-progress {
  flex: 0 0 auto;
  margin: 2px 0 0;
  color: var(--teal);
  font-size: clamp(12px, 1.4vw, 14px);
  font-weight: 800;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(57, 230, 195, 0.3);
}

.ege-note {
  flex: 0 0 auto;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.ege-note.is-warn {
  color: #ffc9c9;
}

/* ---------- Карточка задания ---------- */

.ege-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.5vw, 16px);
  margin: 10px 0;
  padding: clamp(12px, 1.8vw, 20px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(57, 230, 195, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(57, 230, 195, 0.09), rgba(57, 230, 195, 0) 62%),
    linear-gradient(170deg, rgba(20, 33, 56, 0.62) 0%, rgba(9, 15, 27, 0.78) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
  scrollbar-color: rgba(57, 230, 195, 0.5) rgba(255, 255, 255, 0.04);
}

.ege-task-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.ege-task-chip {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid rgba(139, 124, 246, 0.42);
  border-radius: 999px;
  background: rgba(139, 124, 246, 0.14);
  color: #ddd7ff;
  font-size: clamp(12px, 1.5vw, 14px);
  font-weight: 800;
  line-height: 1.25;
  box-shadow: 0 0 16px rgba(139, 124, 246, 0.18), inset 0 0 12px rgba(139, 124, 246, 0.08);
}

.ege-task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.ege-badge {
  padding: 4px 10px;
  border: 1px solid rgba(57, 230, 195, 0.3);
  border-radius: 999px;
  background: rgba(57, 230, 195, 0.1);
  color: #bffaf0;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.ege-badge.is-wrong {
  border-color: rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.12);
  color: #ffc9c9;
}

.ege-instruction {
  margin: 0;
  color: var(--ink-dim);
  font-size: clamp(13px, 1.5vw, 15.5px);
  font-weight: 600;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Общий текст задания (1–3, 24–26) и текст с (N) для цифровых номеров:
   ограниченная высота и своя прокрутка, чтобы карточка не уезжала. */
.ege-task-text,
.ege-task-body {
  flex: 0 0 auto;
  min-height: 72px;
  margin: 0;
  max-height: min(34vh, 320px);
  padding: 12px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-left: 3px solid rgba(57, 230, 195, 0.42);
  border-radius: 0 14px 14px 0;
  background: rgba(4, 8, 16, 0.42);
  color: var(--ink);
  font-size: clamp(13.5px, 1.6vw, 16px);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
  scrollbar-color: rgba(57, 230, 195, 0.5) rgba(255, 255, 255, 0.04);
}

.ege-task-body {
  border-left-color: rgba(255, 207, 92, 0.5);
}

/* ---------- Общие кнопки-варианты ---------- */

.ege-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ege-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 10px 14px;
  border: 1.5px solid rgba(160, 200, 240, 0.16);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(19, 31, 54, 0.72) 0%, rgba(9, 15, 27, 0.88) 100%);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.18s ease, background 0.16s ease;
}

.ege-option:hover:not(:disabled) {
  border-color: rgba(126, 249, 126, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 24px rgba(126, 249, 126, 0.2);
  transform: translateY(-1px);
}

.ege-option:active:not(:disabled) {
  transform: scale(0.985);
}

.ege-option.is-selected {
  border-color: rgba(126, 249, 126, 0.9);
  background: linear-gradient(160deg, rgba(126, 249, 126, 0.17), rgba(57, 230, 195, 0.08));
  box-shadow: 0 0 22px rgba(126, 249, 126, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.ege-option.is-right {
  border-color: var(--neon) !important;
  background: linear-gradient(160deg, rgba(126, 249, 126, 0.24), rgba(57, 230, 195, 0.1)) !important;
  color: #f1fff4;
  box-shadow: 0 0 0 1px rgba(126, 249, 126, 0.5), 0 0 26px rgba(126, 249, 126, 0.4) !important;
}

.ege-option.is-wrong {
  border-color: var(--red) !important;
  background: linear-gradient(160deg, rgba(255, 107, 107, 0.22), rgba(255, 107, 107, 0.08)) !important;
  color: #ffe8e8;
  box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.45), 0 0 26px rgba(255, 107, 107, 0.34) !important;
}

.ege-option:disabled {
  cursor: default;
}

.ege-option:disabled:not(.is-right):not(.is-wrong) {
  opacity: 0.66;
}

.ege-option-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(57, 230, 195, 0.3);
  border-radius: 10px;
  background: rgba(57, 230, 195, 0.1);
  color: var(--teal);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ege-option-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: clamp(13.5px, 1.5vw, 15.5px);
  font-weight: 600;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.ege-choice-btn {
  min-height: 62px;
  padding: 13px 16px;
}

.ege-choice-btn .ege-option-text {
  font-size: clamp(15px, 1.8vw, 18px);
  font-weight: 700;
}

/* ---------- Цифры (15, 17–21) ---------- */

.ege-digits {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ege-digit-btn {
  width: clamp(52px, 7vw, 64px);
  height: clamp(52px, 7vw, 64px);
  border: 1.5px solid rgba(139, 124, 246, 0.4);
  border-radius: 16px;
  background: radial-gradient(circle at 50% 12%, rgba(139, 124, 246, 0.22), rgba(10, 16, 30, 0.94) 72%);
  color: var(--ink);
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 16px rgba(139, 124, 246, 0.12);
  transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.18s ease, background 0.16s ease;
}

.ege-digit-btn:hover:not(:disabled) {
  border-color: rgba(139, 124, 246, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 26px rgba(139, 124, 246, 0.4);
  transform: translateY(-2px);
}

.ege-digit-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.ege-digit-btn.is-selected {
  border-color: rgba(126, 249, 126, 0.9);
  background: radial-gradient(circle at 50% 12%, rgba(126, 249, 126, 0.3), rgba(10, 22, 18, 0.94) 74%);
  color: #eaffef;
  box-shadow: 0 0 22px rgba(126, 249, 126, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.ege-digit-btn.is-right {
  border-color: var(--neon) !important;
  background: radial-gradient(circle at 50% 12%, rgba(126, 249, 126, 0.4), rgba(10, 22, 18, 0.94) 74%) !important;
  box-shadow: 0 0 0 1px rgba(126, 249, 126, 0.55), 0 0 28px rgba(126, 249, 126, 0.45) !important;
}

.ege-digit-btn.is-wrong {
  border-color: var(--red) !important;
  background: radial-gradient(circle at 50% 12%, rgba(255, 107, 107, 0.34), rgba(24, 10, 14, 0.94) 74%) !important;
  box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.5), 0 0 26px rgba(255, 107, 107, 0.4) !important;
}

.ege-digit-btn:disabled {
  cursor: default;
}

.ege-digit-btn:disabled:not(.is-right):not(.is-wrong) {
  opacity: 0.66;
}

/* ---------- Соответствия (8, 22) ---------- */

.ege-matching {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ege-right-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 4px 14px;
  padding: 10px 12px;
  border: 1px dashed rgba(57, 230, 195, 0.22);
  border-radius: 14px;
  background: rgba(4, 8, 16, 0.34);
}

.ege-right-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink-dim);
  font-size: 12.5px;
  line-height: 1.35;
}

.ege-right-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border: 1px solid rgba(57, 230, 195, 0.28);
  border-radius: 7px;
  background: rgba(57, 230, 195, 0.12);
  color: var(--teal);
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ege-right-text {
  overflow-wrap: anywhere;
}

.ege-match-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px dashed rgba(147, 169, 198, 0.16);
}

.ege-match-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.ege-match-letter {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(139, 124, 246, 0.4);
  border-radius: 8px;
  background: rgba(139, 124, 246, 0.18);
  color: #ddd7ff;
  font-size: 13px;
  font-weight: 800;
}

.ege-match-text {
  color: var(--ink);
  font-size: clamp(13px, 1.5vw, 15px);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.ege-match-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ege-match-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1.5px solid rgba(160, 200, 240, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-dim);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.18s ease, background 0.16s ease;
}

.ege-match-btn:hover:not(:disabled) {
  border-color: rgba(57, 230, 195, 0.7);
  background: rgba(57, 230, 195, 0.12);
  color: var(--ink);
}

.ege-match-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.ege-match-btn.is-selected {
  border-color: rgba(126, 249, 126, 0.9);
  background: rgba(126, 249, 126, 0.18);
  color: #eaffef;
  box-shadow: 0 0 18px rgba(126, 249, 126, 0.28);
}

.ege-match-btn.is-right {
  border-color: var(--neon) !important;
  background: rgba(126, 249, 126, 0.24) !important;
  box-shadow: 0 0 0 1px rgba(126, 249, 126, 0.55), 0 0 22px rgba(126, 249, 126, 0.4) !important;
}

.ege-match-btn.is-wrong {
  border-color: var(--red) !important;
  background: rgba(255, 107, 107, 0.22) !important;
  box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.5), 0 0 22px rgba(255, 107, 107, 0.34) !important;
}

.ege-match-btn:disabled {
  cursor: default;
}

.ege-match-btn:disabled:not(.is-right):not(.is-wrong) {
  opacity: 0.66;
}

/* ---------- Результат проверки ---------- */

.ege-result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(160, 200, 240, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  animation: cardIn 0.22s ease-out;
}

.ege-result.is-right {
  border-color: rgba(126, 249, 126, 0.5);
  background: radial-gradient(120% 160% at 50% 0%, rgba(126, 249, 126, 0.14), rgba(9, 15, 27, 0.7) 72%);
  box-shadow: 0 0 26px rgba(126, 249, 126, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ege-result.is-wrong {
  border-color: rgba(255, 107, 107, 0.48);
  background: radial-gradient(120% 160% at 50% 0%, rgba(255, 107, 107, 0.14), rgba(17, 10, 16, 0.72) 72%);
  box-shadow: 0 0 26px rgba(255, 107, 107, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ege-verdict {
  margin: 0;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.ege-result.is-right .ege-verdict {
  color: var(--neon);
  text-shadow: 0 0 18px rgba(126, 249, 126, 0.5), 0 0 44px rgba(57, 230, 195, 0.24);
}

.ege-result.is-wrong .ege-verdict {
  color: #ffb3b3;
  text-shadow: 0 0 18px rgba(255, 107, 107, 0.45);
}

.ege-answer {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.ege-answer-label {
  color: var(--muted);
}

.ege-answer-value {
  color: var(--gold);
  font-weight: 800;
  overflow-wrap: anywhere;
  text-shadow: 0 0 12px rgba(255, 207, 92, 0.35);
}

.ege-explanation {
  margin: 0;
  max-height: 30vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--ink-dim);
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
}

.ege-why-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.ege-why-item {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.ege-why-label {
  flex: 0 0 auto;
  color: var(--violet);
  font-weight: 800;
}

.ege-why-text {
  color: var(--ink-dim);
  overflow-wrap: anywhere;
}

.ege-source-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(57, 230, 195, 0.42);
  border-radius: 999px;
  background: rgba(57, 230, 195, 0.1);
  color: #bffaf0;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.18s ease, background 0.16s ease, transform 0.12s ease;
}

.ege-source-link:hover {
  border-color: rgba(57, 230, 195, 0.9);
  background: rgba(57, 230, 195, 0.16);
  box-shadow: 0 0 20px rgba(57, 230, 195, 0.25);
  transform: translateY(-1px);
}

/* ---------- Кнопки «Проверить» / «Дальше» ---------- */

.ege-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
}

.ege-btn {
  flex: 1 1 0;
  min-height: 58px;
  border-radius: 18px;
  font-size: clamp(16px, 1.9vw, 19px);
  font-weight: 900;
}

.ege-btn-next {
  border-color: rgba(255, 207, 92, 0.7);
  background: linear-gradient(135deg, var(--gold) 0%, #ff9f43 100%);
  color: #2b1703;
  box-shadow:
    0 12px 28px rgba(255, 207, 92, 0.26),
    0 0 30px rgba(255, 207, 92, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.ege-btn-next:hover {
  filter: brightness(1.06);
  box-shadow:
    0 14px 34px rgba(255, 207, 92, 0.34),
    0 0 40px rgba(255, 207, 92, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.ege-btn-check:disabled {
  opacity: 1;
  filter: none;
  border-color: rgba(160, 200, 240, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035));
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  cursor: default;
}

/* ---------- Пустое состояние ---------- */

.ege-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: auto 0;
  padding: clamp(20px, 4vh, 44px) 16px;
  text-align: center;
}

.ege-empty-title {
  margin: 0;
  color: var(--gold);
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 800;
  text-shadow: 0 0 18px rgba(255, 207, 92, 0.35);
}

.ege-empty-text {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

/* ---------- Прокрутка ---------- */

.ege-card::-webkit-scrollbar,
.ege-task-text::-webkit-scrollbar,
.ege-task-body::-webkit-scrollbar,
.ege-explanation::-webkit-scrollbar,
.ege-chips::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.ege-card::-webkit-scrollbar-track,
.ege-task-text::-webkit-scrollbar-track,
.ege-task-body::-webkit-scrollbar-track,
.ege-explanation::-webkit-scrollbar-track,
.ege-chips::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.ege-card::-webkit-scrollbar-thumb,
.ege-task-text::-webkit-scrollbar-thumb,
.ege-task-body::-webkit-scrollbar-thumb,
.ege-explanation::-webkit-scrollbar-thumb,
.ege-chips::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(126, 249, 126, 0.6), rgba(57, 230, 195, 0.5));
  border-radius: 999px;
}

/* ---------- Узкие и низкие экраны ---------- */

@media (max-width: 640px) {
  .ege-overlay {
    padding: 0;
  }

  .ege-sheet {
    width: 100%;
    max-height: 100%;
    padding: 12px 10px max(10px, env(safe-area-inset-bottom));
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .ege-title {
    font-size: 19px;
  }

  .ege-close {
    width: 44px;
    height: 44px;
    font-size: 23px;
  }

  .ege-chip {
    min-width: 44px;
    min-height: 44px;
    padding: 0 11px;
    font-size: 12.5px;
  }

  .ege-card {
    gap: 10px;
    margin: 8px 0;
    padding: 10px;
    border-radius: 16px;
  }

  .ege-task-text,
  .ege-task-body {
    max-height: 28vh;
    padding: 10px 11px;
    font-size: 13.5px;
  }

  .ege-option {
    gap: 10px;
    min-height: 50px;
    padding: 9px 11px;
  }

  .ege-choice-btn {
    min-height: 56px;
  }

  .ege-digit-btn {
    width: 48px;
    height: 48px;
    font-size: 21px;
  }

  .ege-match-btn {
    min-width: 48px;
    min-height: 46px;
  }

  .ege-right-list {
    grid-template-columns: 1fr;
  }

  .ege-btn {
    min-height: 54px;
    font-size: 16px;
  }

  .ege-source-link {
    min-height: 42px;
  }

  .ege-explanation {
    max-height: 26vh;
  }
}

@media (max-height: 660px) {
  .ege-kicker {
    display: none;
  }

  .ege-sheet {
    padding: 10px 12px;
  }

  .ege-chips {
    padding-bottom: 4px;
  }

  .ege-card {
    gap: 8px;
    margin: 4px 0;
    padding: 10px 12px;
  }

  .ege-task-text,
  .ege-task-body {
    max-height: 26vh;
  }

  .ege-progress {
    font-size: 12px;
  }

  .ege-btn {
    min-height: 50px;
  }
}


/* ---------- Задание №6: ввод ответа ---------- */
.ege-typed { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.ege-typed-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-dim, #b9cbe4);
}
.ege-typed-input {
  min-height: 54px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(139, 124, 246, 0.55);
  background: rgba(6, 10, 21, 0.62);
  color: var(--ink, #eaf2ff);
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  outline: none;
}
.ege-typed-input::placeholder { color: var(--muted, #93a9c6); font-weight: 500; letter-spacing: 0; text-transform: none; }
.ege-typed-input:focus {
  border-color: var(--neon, #7ef97e);
  box-shadow: 0 0 0 3px rgba(126, 249, 126, 0.16);
}
.ege-typed-input.is-right { border-color: var(--neon, #7ef97e); color: #b7ffb7; }
.ege-typed-input.is-wrong { border-color: var(--red, #ff6b6b); color: #ffc0c0; }
.ege-typed-hint { margin: 0; font-size: 12.5px; color: var(--muted, #93a9c6); }
