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

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

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%, #1c2333 0%, #0d1117 60%);
  color: #f0f4f8;
  -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: #aeb9c9;
  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: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  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: #2aabee; /* фирменный голубой Telegram */
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.arrow {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: 18px;
  width: 52px;
  height: 52px;
  color: #2aabee;
  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: #2aabee;
  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, #2aabee 0%, #229ed9 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;
}

/* ---------- 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;
  }
}
