/* Тренажёр словарей на страницах материалов. */

.nm-drill {
  /* Сверху отступ обязателен: блок стоит между оглавлением и текстом, и без
     него карточка слипалась с соседом в одну полосу. Снизу — воздух до
     первого заголовка материала. */
  margin: 28px 0;
  /* Якорь #proverte-sebya уводил заголовок под липкую шапку сайта. */
  scroll-margin-top: 96px;
  padding: 24px 26px;
  border: 1.5px solid var(--line-2, rgba(223, 153, 91, .3));
  border-radius: 18px;
  background: var(--surface, #fff);
  box-shadow: var(--shadow-sm, 0 6px 18px rgba(79, 54, 24, .07));
}

.nm-drill h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.25; }

.nm-drill-note {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2, #6B5B45);
}

.nm-drill-actions .nm-drill-note { margin-bottom: 0; }

/* ── Ход прогона ─────────────────────────────────────────────────────── */

.nm-drill-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-3, #8B7C66);
}

.nm-drill-score { color: var(--brand-deep, #8C5422); }

.nm-drill-bar {
  height: 5px;
  margin-bottom: 18px;
  border-radius: 99px;
  background: var(--bg-warm, #FDF3E3);
  overflow: hidden;
}

.nm-drill-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--brand, #DF995B);
  transition: width .3s cubic-bezier(.22, 1, .36, 1);
}

.nm-drill-q {
  margin: 0 0 16px;
  font-size: 19px;
  line-height: 1.4;
  font-weight: 700;
}

.nm-drill-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 9px;
}

.nm-drill-option {
  padding: 14px 16px;
  border: 1.5px solid var(--line, rgba(223, 153, 91, .22));
  border-radius: 13px;
  background: var(--bg, #FFFCF5);
  color: var(--ink, #2C2318);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s, transform .16s, background .16s;
}

.nm-drill-option:hover:not(:disabled) { border-color: var(--brand, #DF995B); transform: translateY(-1px); }
.nm-drill-option:disabled { cursor: default; opacity: .75; }

.nm-drill-option.is-right {
  border-color: var(--good, #3F9D63);
  background: rgba(63, 157, 99, .12);
  opacity: 1;
}

.nm-drill-option.is-wrong {
  border-color: var(--danger, #C4553D);
  background: rgba(196, 85, 61, .1);
  opacity: 1;
}

.nm-drill-after {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-2, rgba(223, 153, 91, .3));
}

.nm-drill-after b { font-size: 15px; }

.nm-drill-hint {
  flex: 1 1 240px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2, #6B5B45);
}

.nm-drill-next { margin-left: auto; }

/* ── Итог ────────────────────────────────────────────────────────────── */

.nm-drill-result {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.nm-drill-result-num {
  font-family: 'Unbounded', system-ui, sans-serif;
  font-size: 28px;
  line-height: 1;
  color: var(--brand-deep, #8C5422);
  font-variant-numeric: tabular-nums;
}

.nm-drill-result span { font-size: 15px; font-weight: 700; color: var(--ink-2, #6B5B45); }

.nm-drill-misses {
  margin: 0 0 18px;
  padding: 14px 16px 14px 32px;
  border-radius: 13px;
  background: var(--bg-warm, #FDF3E3);
}

.nm-drill-misses li { margin-bottom: 6px; font-size: 14px; line-height: 1.5; }
.nm-drill-misses li:last-child { margin-bottom: 0; }
.nm-drill-misses span { color: var(--ink-2, #6B5B45); }

.nm-drill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .nm-drill-bar i, .nm-drill-option { transition: none; }
}

@media (max-width: 560px) {
  .nm-drill { padding: 18px 15px; border-radius: 15px; }
  .nm-drill-q { font-size: 17px; }
  .nm-drill-options { grid-template-columns: 1fr; }
  .nm-drill-next { margin-left: 0; width: 100%; justify-content: center; }
  .nm-drill-actions .btn { width: 100%; justify-content: center; }
}
