/* Интерактивное обучение.
   Принцип: приложение остаётся видимым и рабочим. Мы ничего не затемняем и
   ничего не блокируем — только обводим цель и держим узкую подсказку на
   противоположной половине экрана, чтобы она не перекрывала то, на что
   показывает. */

.ff-tut {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
}

/* Обводка цели: единственный акцент, поэтому толстая и пульсирует. */
.ff-tut-ring {
  position: absolute;
  border-radius: 14px;
  pointer-events: none;
  transition: left 0.16s ease, top 0.16s ease, width 0.16s ease, height 0.16s ease;
  animation: ff-tut-pulse 1.5s ease-in-out infinite;
}

@keyframes ff-tut-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 3px rgba(var(--ff-accent-rgb), 1),
      0 0 0 7px rgba(var(--ff-accent-rgb), 0.22),
      0 0 22px 3px rgba(var(--ff-accent-rgb), 0.42);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(var(--ff-accent-rgb), 1),
      0 0 0 12px rgba(var(--ff-accent-rgb), 0.1),
      0 0 34px 7px rgba(var(--ff-accent-rgb), 0.55);
  }
}

/* Треугольник со стороны подсказки — глаз сразу видит связь текста и цели. */
.ff-tut-arrow {
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
  background: var(--ff-accent-fill, #4fe3d6);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  animation: ff-tut-bob 1.1s ease-in-out infinite;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.ff-tut-arrow--up {
  clip-path: polygon(50% 100%, 100% 0, 0 0);
}

@keyframes ff-tut-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

.ff-tut-arrow--up {
  animation-name: ff-tut-bob-up;
}

@keyframes ff-tut-bob-up {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Подсказка — узкая полоса, а не карточка на пол-экрана. */
.ff-tut-bar {
  position: fixed;
  left: 8px;
  right: 8px;
  pointer-events: auto;
  padding: 9px 12px 10px;
  border-radius: 14px;
  border: 1px solid rgba(var(--ff-accent-rgb), 0.45);
  background: var(--ff-chrome-solid, rgba(6, 27, 26, 0.96));
  color: var(--ff-text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.34);
}

html.ff-theme-light .ff-tut-bar {
  background: #fff;
  box-shadow: 0 10px 30px rgba(8, 42, 40, 0.18);
}

.ff-tut-bar--in { animation: ff-tut-in 0.18s ease; }

@keyframes ff-tut-in {
  from { opacity: 0; transform: translateY(6px); }
}

.ff-tut-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.ff-tut-badge {
  flex: none;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ff-ink, #04231f);
  background: var(--ff-accent-fill, #4fe3d6);
  border-radius: 999px;
  padding: 2px 7px;
}

.ff-tut-title {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--ff-font-display, sans-serif);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ff-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ff-tut-count {
  flex: none;
  font-family: var(--ff-font-mono, monospace);
  font-size: 0.7rem;
  color: var(--ff-text-faint);
}

.ff-tut-exit {
  flex: none;
  border: 0;
  background: none;
  padding: 0 0 0 4px;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1;
  color: var(--ff-text-faint);
  cursor: pointer;
}

.ff-tut-exit:hover { color: var(--ff-text); }

.ff-tut-text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ff-text-dim);
}

.ff-tut-text b { color: var(--ff-text); font-weight: 700; }

.ff-tut-stall {
  display: block;
  margin-top: 6px;
  color: var(--ff-amber, #ffc04d);
  font-weight: 600;
}

.ff-tut-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.ff-tut-next {
  margin-left: auto;
  border: 0;
  border-radius: 10px;
  padding: 7px 16px;
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ff-ink, #04231f);
  background: var(--ff-accent-fill, #4fe3d6);
  cursor: pointer;
}

.ff-tut-next:hover { filter: brightness(1.06); }

.ff-tut-skip {
  border: 0;
  background: none;
  padding: 4px 0;
  font: inherit;
  font-size: 0.74rem;
  color: var(--ff-text-faint);
  cursor: pointer;
  text-decoration: underline;
}

.ff-tut-skip:hover { color: var(--ff-text-dim); }

@media (min-width: 641px) {
  .ff-tut-bar {
    left: 50%;
    right: auto;
    width: min(460px, calc(100vw - 32px));
    transform: translateX(-50%);
  }
  .ff-tut-bar--in { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ff-tut-ring,
  .ff-tut-arrow { animation: none; }
  .ff-tut-bar--in { animation: none; }
}
