/* Основной контейнер модуля */
.wheelbonus-module {
  /* Цветовые переменные */
  --primary-color: #1E2542;
  --secondary-color: #2A325A;
  --accent-color: #29671A;
  --light-color: #71B760;
  --dark-color: #12131C;
  --winner-bg: #1c1d2a;
  
  /* Типография */
  font-family: 'Google Sans', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--light-color);
  
  /* Разметка */
  display: flex;
  flex-direction: row;
  gap: 24px;
  padding: 24px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  
  /* Стили оформления */
  border-radius: 16px;
  overflow: hidden;
  margin: 15px 0;
}

/* Псевдоэлемент для фона с изображением */
.wheelbonus-module::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--dark-color);
  background-image: linear-gradient(rgba(28, 29, 42, 0.98), rgba(28, 29, 42, 0.98)), 
                    url('/static/images/wheel-bonus/main-bg.jpg');
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  background-repeat: no-repeat;
  z-index: -1;
  border-radius: inherit;
}

/* Контейнер содержимого колеса */
.wheelbonus-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 687px;
}

/* Заголовок */
.lucky-wheel-title {
  font-size: 48px;
  font-weight: 800;
  text-align: center;
  color: white;
  margin-bottom: 12px;
  text-shadow: 0 0 10px rgba(113, 183, 96, 0.5);
  letter-spacing: 2px;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
}

.lucky-wheel-title.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation-name: glow;
  animation-duration: 2s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

@keyframes glow {
  0% {
    text-shadow: 0 0 10px rgba(113, 183, 96, 0.5);
    letter-spacing: 2px;
  }
  100% {
    text-shadow: 0 0 20px rgba(113, 183, 96, 0.8),
                 0 0 30px rgba(113, 183, 96, 0.4),
                 0 0 40px rgba(113, 183, 96, 0.2);
    letter-spacing: 4px;
  }
}

/* Отображение билетов */
.tickets-display {
  background: linear-gradient(145deg, rgb(69 70 85 / 90%), rgba(28, 29, 42, 0.7));
  padding: 12px 20px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: fit-content;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgb(62 71 81 / 42%);
  transition-property: transform, box-shadow;
  transition-duration: 0.3s;
  transition-timing-function: ease;
  position: relative;
  z-index: 2;
}

.tickets-display:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(113, 183, 96, 0.1);
}

.tickets-label {
  color: white;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.tickets-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

.tickets-icon {
  font-size: 1.4em;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  animation-name: float;
  animation-duration: 2s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

@keyframes float {
  0%, 100% { 
    transform: translateY(0); 
  }
  50% { 
    transform: translateY(-3px); 
  }
}

.tickets-value {
  color: white;
  font-size: 1.4em;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.odometer.odometer-auto-theme, 
.odometer.odometer-theme-minimal {
  font-family: 'Google Sans', sans-serif;
}

.tickets-price {
  color: #bfbde3;
  font-size: 0.9em;
  background: rgb(255 255 255 / 11%);
  padding: 4px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

/* Контейнер колеса */
.wheel-container {
  width: 100%;
  background-color: #282935;
  border-radius: 12px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition-property: all;
  transition-duration: 0.3s;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.wheel-marker {
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  background-color: var(--light-color);
  transform: translateX(-50%);
  z-index: 2;
  box-shadow: 0 0 8px var(--light-color);
}

.wheel-viewport {
  overflow: hidden;
  position: relative;
}

.wheel-strip {
  display: flex;
  gap: 6px;
  transition-property: transform;
  transition-duration: 6s;
  transition-timing-function: cubic-bezier(0.32, 0.64, 0.45, 1);
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Элементы колеса */
.wheel-item {
  min-width: 60px;
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: white;
  font-weight: 700;
  font-size: 1.1em;
  transition-property: transform, box-shadow;
  transition-duration: 0.3s;
  transition-timing-function: ease;
  position: relative;
  overflow: hidden;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.wheel-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
  z-index: 1;
}

/* Цвета призов */
.wheel-item.prize-1 { 
  background: linear-gradient(135deg, #FF4B2B, #FF416C);
  box-shadow: 0 4px 12px rgba(255, 75, 43, 0.3);
}

.wheel-item.prize-2 { 
  background: linear-gradient(135deg, #2193b0, #6dd5ed);
  box-shadow: 0 4px 12px rgba(33, 147, 176, 0.3);
}

.wheel-item.prize-3 { 
  background: linear-gradient(135deg, #834d9b, #d04ed6);
  box-shadow: 0 4px 12px rgba(131, 77, 155, 0.3);
}

.wheel-item.prize-4 { 
  background: linear-gradient(135deg, #F09819, #FF512F);
  box-shadow: 0 4px 12px rgba(240, 152, 25, 0.3);
}

/* Специальные стили для значений */
.wheel-item[data-value="100"],
.wheel-item[data-value="75"],
.wheel-item[data-value="50"] {
  font-size: 1.3em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  animation-name: pulse;
  animation-duration: 2s;
  animation-iteration-count: infinite;
}

@keyframes pulse {
  0% { 
    transform: scale(1); 
  }
  50% { 
    transform: scale(1.05); 
  }
  100% { 
    transform: scale(1); 
  }
}

.wheel-item.winner {
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--light-color);
  animation-name: winner-glow;
  animation-duration: 1s;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

@keyframes winner-glow {
  from { 
    box-shadow: 0 0 20px var(--light-color); 
  }
  to { 
    box-shadow: 0 0 30px var(--light-color), 
                0 0 50px var(--light-color); 
  }
}

/* Контейнер персонажа (видео справа) */
.character-container {
  position: sticky;
  top: 24px;
  max-height: 600px;
  min-height: 400px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  mix-blend-mode: screen;
}

.character-video {
  width: auto;
  height: 100%;
  max-width: 300px;
  object-fit: contain;
  mix-blend-mode: screen;
}

/* Кнопка вращения */
.spin-button {
  background: linear-gradient(#29671A, #71B760) padding-box, 
              linear-gradient(to bottom, hsla(108, 100%, 80%, 0.7), rgba(66, 131, 50, 0)) border-box;
  color: white;
  border: 1px solid transparent;
  padding: 10px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition-property: all;
  transition-duration: 0.3s;
  transition-timing-function: ease;
  width: fit-content;
  min-width: 140px;
  box-shadow: 0 4px 12px rgba(41, 103, 26, 0.3);
  position: relative;
  z-index: 2;
  margin-bottom: 24px;
}

.spin-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(41, 103, 26, 0.4);
}

.spin-button:disabled {
  background-color: #666;
  cursor: not-allowed;
  opacity: 0.5;
}

/* Список победителей */
.winners-list {
  width: 100%;
  background-color: #282935;
  border-radius: 12px;
  padding: 12px 64px;
  position: relative;
  overflow: hidden;
  z-index: 2;
}

.winners-carousel {
  display: flex;
  transition-property: transform;
  transition-duration: 0.3s;
  transition-timing-function: ease;
  gap: 12px;
  padding-right: 24px;
}

.winner-item {
  min-width: 140px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: rgba(113, 183, 96, 0.1);
  border-radius: 8px;
  transition-property: transform;
  transition-duration: 0.3s;
  transition-timing-function: ease;
  border: 1px solid rgba(113, 183, 96, 0.2);
}

.winner-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.winner-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.winner-name {
  font-size: 0.85em;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.winner-prize {
  color: var(--light-color);
  font-weight: 700;
  font-size: 0.9em;
}

/* Навигация карусели */
.carousel-nav {
  display: flex;
  justify-content: space-between;
  position: absolute;
  top: 50%;
  left: 16px;
  right: 16px;
  transform: translateY(-50%);
  pointer-events: none;
}

.carousel-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(113, 183, 96, 0.2);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  transition-property: all;
  transition-duration: 0.3s;
  transition-timing-function: ease;
  pointer-events: auto;
}

.carousel-button:hover:not(:disabled) {
  background: rgba(113, 183, 96, 0.4);
  transform: scale(1.1);
}

.carousel-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* Адаптивность */
@media (max-width: 1024px) {
  .wheelbonus-module {
    flex-direction: column;
    padding-bottom: 50px;
  }

  .character-container {
    position: relative;
    bottom: 0; 
    left: 0;
    width: 100%;
    height: 300px;
    margin: 0;
    min-height: auto;
    z-index: 1;
    mix-blend-mode: screen;
    pointer-events: none;
  }

  .character-video {
    width: 100%;
    height: 100%; 
    object-fit: cover;
    object-position: center 30%;
    opacity: 0.8;
  }

  .wheelbonus-wrapper {
    margin-top: 0;
    padding-bottom: 0;
  }
}

@media (max-width: 768px) {
  .wheelbonus-module {
    padding: 16px;
    gap: 16px;
  }

  .lucky-wheel-title {
    font-size: 36px;
    margin-bottom: 16px;
  }

  .wheel-container {
    padding: 16px;
  }

  .character-container {
    height: 280px;
  }

  .wheel-item {
    min-width: 60px;
    height: 60px;
    font-size: 1em;
  }

  .winners-list {
    padding: 16px 48px;
  }

  .winner-item {
    min-width: 160px;
  }

  .carousel-nav {
    left: 16px;
    right: 16px;
  }
}

@media (max-width: 480px) {
  .lucky-wheel-title {
    font-size: 28px;
  }

  .tickets-display {
    padding: 12px 20px;
  }

  .wheel-container {
    padding: 12px;
  }

  .spin-button {
    padding: 10px 24px;
  }

  .winner-item {
    min-width: 140px;
    padding: 8px;
  }

  .winners-list {
    padding: 16px 60px;
    margin-bottom: 24px;
  }

  .carousel-nav {
    left: 12px;
    right: 12px;
  }

  .carousel-button {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }

  .character-container {
    height: 240px;
  }

  .character-video {
    object-position: center 20%;
  }
}

@media (min-width: 1025px) and (max-width: 1650px) {
  .wheelbonus-wrapper {
    max-width: 515px!important;
  }
}

@media (min-width: 1651px) and (max-width: 1750px) {
  .wheelbonus-wrapper {
    max-width: 590px!important;
  }
}

@media (min-width: 1751px) {
  .wheelbonus-wrapper {
    max-width: 700px!important;
  }
}