/* ══════════════════════════════════════════════════════════════════
   Колесо удачи (Wheel of Fortune) — стили лендинга.
   Отдельный файл, чтобы не раздувать landing.min.css и держать
   игровую механику изолированной.
   ══════════════════════════════════════════════════════════════════ */

/* Секция колеса живёт внутри .auth-container и НЕ выходит за его ширину —
   ровно как остальные блоки лендинга. Три карточки в окне получаются не за
   счёт расширения секции, а за счёт плавной (процентной) ширины карточки. */
.wheel-section {
  padding: 0 24px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Заголовок и подзаголовок — по центру в читаемой ширине. */
.wheel-section .steps-section-header {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.wheel-subtitle {
  text-align: center;
  font-size: 14px;
  color: #57606a;
  margin: 0 auto 24px;
  line-height: 1.6;
  max-width: 760px;
}

/* ── Випорт (окно барабана) ─────────────────────────────────────── */
.wheel-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  padding: 18px 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #f7f9fb 0%, #eef2f6 100%);
  border: 1px solid #e4e8ec;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}

.wheel-track {
  display: flex;
  align-items: stretch;
  gap: 14px;
  will-change: transform;
  /* Ширина 100% (а не max-content), чтобы процентная ширина карточек
     считалась от окна колеса — так в окне всегда ровно 3 карточки.
     Лишние карточки выходят за границы и обрезаются випортом. */
  width: 100%;
}

/* ── Карточка приза (полная, как карточка курса на лендинге) ─────── */
.wheel-card {
  /* Ровно 3 карточки в окне при любой ширине экрана: ширина считается
     от ширины ленты за вычетом двух промежутков по 14px. JS пересчитывает
     шаг из реального DOM, поэтому анимация остаётся корректной. */
  flex: 0 0 calc((100% - 28px) / 3);
  max-width: 420px;
  box-sizing: border-box;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #e4e8ec;
  border-top: 3px solid #068487;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  /* Карточка-ссылка (a.wheel-card) ведёт на страницу приза — как карточки
     курсов/Cambridge/программ/данных. Сбрасываем оформление ссылки. */
  text-decoration: none;
  color: inherit;
  /* Витрина содержит ВЕСЬ пул призов (~440 карточек) в ТРЁХ копиях —
     это ~1300 узлов. content-visibility: auto заставляет браузер
     пропускать раскладку/отрисовку карточек вне видимой области, поэтому
     лента остаётся лёгкой. contain-intrinsic-size задаёт «замещающий»
     размер, чтобы полоса прокрутки и геометрия не прыгали до раскладки.
     ВАЖНО: getBoundingClientRect() у карточки-цели всё равно даёт точные
     значения — браузер раскладывает её принудительно при запросе. */
  content-visibility: auto;
  contain-intrinsic-size: auto 260px;
}

.wheel-card:hover {
  box-shadow: 0 4px 12px rgba(31, 35, 40, 0.08);
  border-color: #6c727f;
  transform: translateY(-2px);
}

/* Кликабельны только карточки со страницей (a.wheel-card). Джекпот — div:
   у него нет страницы, поэтому курсор обычный и hover-подъём отключён.
   Правила идут ПОСЛЕ .wheel-card:hover — иначе общее правило перебивает их
   при равной специфичности (div.wheel-card:hover = 0,2,1 > .wheel-card:hover). */
a.wheel-card {
  cursor: pointer;
}

div.wheel-card {
  cursor: default;
}

div.wheel-card:hover {
  box-shadow: 0 0 0 1px rgba(34, 158, 217, 0.14), 0 4px 14px rgba(34, 158, 217, 0.16);
  border-color: #a9d6f0;
  transform: none;
}

.wheel-card--jackpot {
  background: linear-gradient(160deg, #f2f9fe 0%, #e3f2fd 100%);
  border-color: #a9d6f0;
  /* Явно перекрываем цвет верхней границы из .wheel-card (там #068487). */
  border-top-color: #229ed9;
  box-shadow: 0 0 0 1px rgba(34, 158, 217, 0.14), 0 4px 14px rgba(34, 158, 217, 0.16);
}

.wheel-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.wheel-card-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #57606a;
  background: #f0f3f6;
  border: 1px solid #e4e8ec;
  white-space: nowrap;
}

.wheel-card-badge--jackpot {
  color: #fff;
  background: #229ed9;
  border-color: #229ed9;
}

/* Срок доступа подписки («24 часа» / «7 дней» / «30 дней») — нейтральный
   бейдж рядом с ценой, чтобы тарифы одного продукта различались. */
.wheel-card-badge--period {
  color: #0e7490;
  background: #ecfeff;
  border-color: #a5f3fc;
}

.wheel-card-badge--free {
  color: #067647;
  background: #ecfdf3;
  border-color: #abefc6;
}

/* Приз «токены на баланс» — фиолетовый акцент (цвет приза #7C3AED). */
.wheel-card-badge--tokens {
  color: #6d28d9;
  background: #f5f3ff;
  border-color: #ddd6fe;
}

/* Заголовок — ровно как .ccl-title у карточки курса: 15px/700, без обрезки. */
.wheel-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #1f2328;
  margin-bottom: 4px;
}

/* Описание — ровно как .ccl-desc у карточки курса: 12.5px, line-height 1.5,
   текст виден полностью (без line-clamp). */
.wheel-card-desc {
  font-size: 12.5px;
  color: #57606a;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: break-word;
}

/* CTA-подпись — ровно как .ccl-label у карточки курса. */
.wheel-card-label {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: #6c727f;
}

/* ── Указатель по центру ────────────────────────────────────────── */
.wheel-pointer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(180deg, rgba(6, 132, 135, 0) 0%, #068487 18%, #068487 82%, rgba(6, 132, 135, 0) 100%);
  pointer-events: none;
  z-index: 2;
}

/* ── Кнопка и статус ────────────────────────────────────────────── */
.wheel-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.wheel-spin-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 13px 46px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  background: linear-gradient(135deg, #068487 0%, #0aa3a7 100%);
  box-shadow: 0 4px 14px rgba(6, 132, 135, 0.28);
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.wheel-spin-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6, 132, 135, 0.36);
}

.wheel-spin-btn:active:not(:disabled) {
  transform: translateY(0);
}

.wheel-spin-btn:disabled {
  cursor: default;
  opacity: 0.55;
  box-shadow: none;
}

.wheel-spin-btn--done {
  background: linear-gradient(135deg, #6c727f 0%, #8b939e 100%);
}

.wheel-status {
  font-size: 12.5px;
  color: #6c727f;
  text-align: center;
  min-height: 18px;
  line-height: 1.4;
}

/* ── Подсветка выигранной карточки ──────────────────────────────────
   После остановки ленты победитель «вспыхивает» рамкой и мягким
   свечением, чтобы пользователь успел увидеть результат ДО того,
   как откроется модалка (раньше оверлей появлялся мгновенно и
   выглядел как «серый экран»). */
.wheel-card--winner {
  border-color: #068487;
  border-top-color: #068487;
  box-shadow: 0 0 0 3px rgba(6, 132, 135, 0.28), 0 8px 26px rgba(6, 132, 135, 0.32);
  animation: wheel-winner-pulse 0.9s ease-out 2;
  z-index: 2;
}

@keyframes wheel-winner-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(6, 132, 135, 0.55), 0 8px 26px rgba(6, 132, 135, 0.32); }
  70%  { box-shadow: 0 0 0 10px rgba(6, 132, 135, 0), 0 8px 26px rgba(6, 132, 135, 0.32); }
  100% { box-shadow: 0 0 0 3px rgba(6, 132, 135, 0.28), 0 8px 26px rgba(6, 132, 135, 0.32); }
}

/* ── Модальное окно результата ────────────────────────────────────
   Плавное появление: display:none анимировать нельзя, поэтому
   используем opacity + visibility с transition. Оверлей проявляется
   за 0.25 с, а не «выскакивает» серым экраном. */
.wheel-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 24, 40, 0.55);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.wheel-modal--open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.25s ease, visibility 0s linear 0s;
}

.wheel-modal-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 16px;
  padding: 32px 26px 26px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(16, 24, 40, 0.28);
  animation: wheel-pop 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes wheel-pop {
  from { transform: scale(0.86); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.wheel-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: #8b939e;
  cursor: pointer;
  border-radius: 6px;
}

.wheel-modal-close:hover {
  background: #f0f3f6;
  color: #1f2328;
}

.wheel-modal-emoji {
  font-size: 46px;
  line-height: 1;
  margin-bottom: 10px;
}

.wheel-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: #1f2328;
  margin: 0 0 12px;
  /* Кнопка закрытия абсолютно позиционирована в правом верхнем углу
     (top:10px; right:12px; 30x30). Отступы не дают длинному заголовку
     заезжать под неё. */
  padding: 0 34px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.wheel-modal-prize {
  font-size: 16px;
  font-weight: 700;
  color: #068487;
  margin-bottom: 10px;
  line-height: 1.4;
}

.wheel-modal-note {
  font-size: 12.5px;
  color: #6c727f;
  line-height: 1.5;
  margin: 0 0 20px;
}

.wheel-modal-btn {
  display: inline-block;
  padding: 11px 30px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #068487 0%, #0aa3a7 100%);
  box-shadow: 0 4px 14px rgba(6, 132, 135, 0.28);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.wheel-modal-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6, 132, 135, 0.36);
}

/* ── Мобильная адаптация ────────────────────────────────────────── */
@media (max-width: 640px) {
  .wheel-card {
    /* На мобильных показываем ~1.15 карточки, чтобы была видна подсказка
       о прокрутке; ширина фиксированная, крупная и читаемая. */
    flex: 0 0 280px;
    max-width: none;
    padding: 14px 16px;
  }
  .wheel-card-title { font-size: 13.5px; }
  .wheel-card-desc { font-size: 11.5px; }
  .wheel-card-label { font-size: 10.5px; }
  .wheel-spin-btn { padding: 12px 38px; font-size: 14px; }
  .wheel-modal-card { padding: 28px 20px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .wheel-modal-card { animation: none; }
  .wheel-card--winner { animation: none; }
  .wheel-modal { transition: none; }
}
