/* Принудительно отключаем темную тему */
* {
  color-scheme: light only !important;
}

html {
  color-scheme: light only !important;
}

/* Отключаем темную тему для всех элементов */
div, span, p, h1, h2, h3, h4, h5, h6, a, button, input, textarea, select {
  color-scheme: light only !important;
}

/* CSS переменные для высокопроизводительной анимации */
:root {
  --transition-speed: 0.15s;
  --transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Принудительно светлые цвета для всех текстовых элементов */
.attempts-info, .subscribe-status {
  color: #000 !important;
  background-color: rgba(255, 255, 255, 0.95) !important;
}

/* Принудительно светлый фон для всех блоков */
.attempts-info {
  background: rgba(255, 255, 255, 0.95) !important;
}

.subscribe-status.subscribed {
  background: #d4f8d4 !important;
  color: #2d5a2d !important;
}

.subscribe-status.not-subscribed {
  background: #f8d4d4 !important;
  color: #5a2d2d !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  text-align: center;
  background: url('img/background.png') center/cover no-repeat; /* фоновое изображение */
  color: #000 !important;
  background-color: #f0f0f0 !important; /* принудительно светлый фон */
  margin: 0;
  padding: 0; /* убираем все отступы */
  height: 100vh; /* полная высота экрана */
  overflow: hidden;
}

/* Прогресс-бар загрузки */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.loader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loader-text {
  color: #fff;
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 600;
}

.progress-bar {
  width: 250px;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  animation: progress 2s ease-in-out;
  transform-origin: left;
}

@keyframes progress {
  from { width: 0%; }
  to { width: 100%; }
}

h1 {
  display: none; /* скрываем заголовок для fullscreen */
}

/* Анимация кнопки: плавная пульсация */
@keyframes pulse {
  0%, 100% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.05);
  }
}

.spin-button {
  display: block;
  position: fixed;
  bottom: clamp(40px, 8vh, 80px);
  left: 50%;
  transform: translateX(-50%);
  width: clamp(280px, 60vw, 450px);
  height: auto;
  min-height: 120px;
  aspect-ratio: 600 / 322;
  max-height: 241px;
  cursor: pointer;
  z-index: 10;
  /* Плавный переход - автоматически адаптируется к частоте экрана (60/90/120 FPS) */
  transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1), 
              filter 0.15s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  background-image: url('img/off.png');
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  animation: pulse 2s ease-in-out infinite;
  will-change: transform, opacity;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  pointer-events: auto;
}
.spin-button.no-animation {
  animation: none;
  will-change: auto;
}

/* Состояние "активна" (зелёная кнопка) */
.spin-button.active {
  background-image: url('img/on.png');
}

/* Предзагрузка изображения on.png для быстрой смены */
.spin-button::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  z-index: -1;
  background: url('img/on.png') no-repeat;
  background-size: 0;
}

.spin-button:active { 
  transform: translateX(-50%) scale(0.98);
}

/* Информация о попытках */
.attempts-info {
  position: fixed;
  top: 3vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 16px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 220px;
  max-width: 90vw;
}

.attempts-count {
  font-size: clamp(14px, 3vw, 18px);
  font-weight: 900;
  color: #000;
  margin-bottom: 4px;
}

.attempts-count span {
  color: #5ab625;
  font-size: clamp(16px, 3.5vw, 20px);
}

.subscribe-status {
  font-size: clamp(11px, 2.5vw, 14px);
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
  margin-top: 15px;
  display: inline-block;
}

.subscribe-status.subscribed {
  background: #d4f8d4;
  color: #2d7a2d;
}

.subscribe-status.not-subscribed {
  background: #ffebee;
  color: #c62828;
}

/* Кнопка подписки на канал */
.subscribe-button {
  position: fixed;
  bottom: clamp(140px, 20vh, 180px);
  left: 50%;
  transform: translateX(-50%);
  background: #ff3b30;
  color: #fff;
  text-decoration: none;
  padding: 20px 40px;
  border-radius: 30px;
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.4);
  z-index: 15;
  display: none;
  transition: all 0.3s ease;
}

.subscribe-button:hover {
  background: #e53935;
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 6px 16px rgba(255, 59, 48, 0.5);
}

.subscribe-button:active {
  transform: translateX(-50%) scale(0.98);
}

#info {
  position: fixed;
  bottom: 25vh; /* увеличен отступ снизу чтобы не перекрывать кнопку */
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0 2vw;
  font-size: clamp(14px, 3.5vw, 20px); /* максимально уменьшен */
  line-height: 1.3;
  text-align: center;
  color: #000 !important;
  background: transparent !important; /* прозрачный фон */
  z-index: 10;
  max-width: 98vw; /* максимальная ширина */
  font-weight: 700;
}

.slot-container {
  width: 100vw;
  height: 65vh; /* уменьшаем высоту, чтобы сдвинуть вверх */
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: none;
  border-radius: 0;
  background: transparent;
  position: absolute;
  top: 10vh; /* сдвигаем вверх */
  left: 0;
}

.slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 12s cubic-bezier(0.1, 0, 0, 1); /* 12 секунд: очень быстрый старт, плавная остановка */
  position: relative;
  will-change: transform;
}

.slot-item {
  /* высота выставляется динамически из JS под текущий размер контейнера */
  width: 100%;
  height: 100%; /* полная высота контейнера */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* строго по центру */
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #000; /* черный текст на белом фоне */
  background: transparent; /* элементы не имеют своего фона */
  border-bottom: none; /* без разделителей между элементами */
  position: relative;
}

.slot-item img {
  height: 50%; /* уменьшаем иконку, так как текст крупнее */
  width: auto;
  max-width: 65%;
  object-fit: contain;
  display: block;
  margin: 0 auto 1vh;
  background: transparent;
  padding: 0;
}

.slot-item span {
  display: block;
  padding: 0 2vw;
  font-size: clamp(28px, 6vw, 40px); /* еще больше уменьшен */
  line-height: 1.2;
  font-family: 'Roboto Condensed', 'Arial Narrow', 'Helvetica Condensed', sans-serif;
  font-weight: 900;
  max-width: 90%;
  margin: 0 auto;
  letter-spacing: -0.5px;
  color: #000 !important;
  background: transparent !important; /* прозрачный фон */
}

/* Зеленая плашка для цифр скидки */
.slot-item span .discount-badge {
  display: inline-block;
  background: #5ab625 !important;
  color: #fff !important;
  padding: 0.03em 0.25em;
  border-radius: 5px;
  font-weight: 900;
  margin: 0 0.08em;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(90, 182, 37, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  font-size: 0.7em;
}

/* Красная плашка для срока действия */
#info .expiry-badge {
  display: inline-block;
  background: #ff3b30 !important;
  color: #fff !important;
  padding: 0.08em 0.35em;
  border-radius: 5px;
  font-weight: 900;
  margin: 0 0.08em;
  margin-bottom: 2vh; /* отступ снизу чтобы не перекрывать кнопку */
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(255, 59, 48, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  font-size: 0.7em;
}

button {
  position: fixed;
  bottom: 5vh; /* адаптивный отступ */
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: clamp(20px, 4.5vh, 50px) clamp(50px, 12vw, 100px); /* адаптивные отступы */
  font-family: 'Nunito', 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(32px, 8vw, 70px); /* адаптивный размер текста */
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: clamp(1px, 0.3vw, 3px);
  line-height: 1;
  min-width: 70vw; /* минимальная ширина для всех устройств */
  max-width: 90vw;
  background: linear-gradient(135deg, #c8f542 0%, #bee24d 25%, #9dd63f 50%, #7bc632 75%, #5ab625 100%); /* насыщенный градиент */
  border: none; /* убираем чёрную рамку */
  border-radius: 60px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #fff;
  z-index: 10;
  /* Кнопка без лишних теней */
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.15),
    0 4px 10px rgba(0, 0, 0, 0.1);
  /* Очень вдавленный текст (deep engraved/inset) */
  text-shadow: 
    0 2px 2px rgba(255, 255, 255, 0.6),
    0 1px 1px rgba(255, 255, 255, 0.4),
    0 -2px 2px rgba(0, 0, 0, 0.9),
    0 -3px 4px rgba(0, 0, 0, 0.7),
    0 3px 6px rgba(0, 0, 0, 0.5),
    0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 🎉 Анимация фейерверка (конфетти) */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  top: -20px;
  border-radius: 50%;
  opacity: 1;
  z-index: 9999;
  pointer-events: none;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}
