/* ============================================================
   Мобильная страница-прослойка TikTok → Telegram
   Тёмная фиолетовая тема, mobile-first
   ============================================================ */

:root {
  /* акцент для декоративных элементов: стрелка, спиннер */
  --accent: #7c6cf0;
  /* более глубокий тон — под белый текст (кнопка, номера шагов),
     чтобы контраст проходил WCAG AA */
  --accent-solid: #6a57e4;
  --accent-deep: #5b47d0;

  --text: #f2f0f8;
  --text-muted: #b0a8c6;

  --surface: rgba(255, 255, 255, 0.06);
  --surface-border: rgba(255, 255, 255, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* страховка: картинка никогда не шире контейнера,
   даже если остальные правила не подгрузились */
img {
  max-width: 100%;
}

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(120% 120% at 50% 0%, #14121f 0%, #0b0a12 60%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  /* учитываем "чёлку" и нижнюю панель iPhone */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ---------- общий каркас экрана ---------- */

/* атрибут hidden должен побеждать display:flex у .screen */
[hidden] {
  display: none !important;
}

.screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.content {
  max-width: 420px;
  width: 100%;
  text-align: center;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
}

.lead {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.emoji {
  font-size: 3rem;
  margin-bottom: 16px;
}

/* ---------- TikTok-экран: шаги инструкции ---------- */

.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.step {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-solid);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* англоязычная подпись к пункту меню: у части аудитории
   интерфейс TikTok на английском */
.alt {
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---------- скриншот-подсказка ---------- */

.shot {
  margin-top: 14px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  background: var(--surface);
}

.shot img {
  display: block;
  width: 100%;
  /* кадр вертикальный, показываем только полосу с меню */
  /* дублирует инлайновые стили в index.html — там они защищены
     от кэша, здесь остаются как единое место для правок */
  height: 130px;
  object-fit: cover;
  object-position: 50% 92%;
}

/* ---------- стрелка в правый верхний угол ---------- */

.arrow {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: 18px;
  width: 52px;
  height: 52px;
  color: var(--accent);
  animation: point 1.2s ease-in-out infinite;
  pointer-events: none;
}

.arrow svg {
  width: 100%;
  height: 100%;
}

/* стрелка "тычет" по диагонали вверх-вправо */
@keyframes point {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(7px, -7px);
  }
}

/* ---------- экран редиректа ---------- */

.spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 20px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.button {
  display: block;
  width: 100%;
  padding: 16px 20px;
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    var(--accent-solid) 0%,
    var(--accent-deep) 100%
  );
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  /* удобная зона нажатия на мобильном */
  min-height: 52px;
  transition: opacity 0.15s ease;
}

.button:active {
  opacity: 0.8;
}

/* уважаем системную настройку "меньше движения" */
@media (prefers-reduced-motion: reduce) {
  .arrow,
  .spinner {
    animation: none;
  }
}

/* ---------- debug-панель (?debug=1) ---------- */

#debug-panel {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  line-height: 1.5;
  color: #9be49b;
  white-space: pre-wrap;
  word-break: break-all;
  z-index: 10;
}

/* ---------- маленькие экраны ---------- */

@media (max-width: 360px) {
  h1 {
    font-size: 1.5rem;
  }

  .arrow {
    width: 42px;
    height: 42px;
  }
}
