/**
 * Колесо удачи в ленте — scoped.
 * Не трогает custom.css / footer / mobile-card-fixes.
 */

.cotinder-lucky-wheel {
  position: relative;
}

.cotinder-lucky-wheel__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 38%, #fff8e0 0%, #f3e2b0 55%, #e8c36a 100%);
  overflow: hidden;
}

/* Beat .card-img-wrap { display:block } — otherwise the disc sits on the left. */
html body .index__post .card.user-slide.cotinder-lucky-wheel > .card-img-wrap.cotinder-lucky-wheel__media,
html body .cotinder-index-feed .index__post .card.user-slide.cotinder-lucky-wheel > .card-img-wrap.cotinder-lucky-wheel__media {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}

.cotinder-lucky-wheel__pointer {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 2;
  width: 0;
  height: 0;
  margin-left: -8px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 16px solid #c48a12;
}

.cotinder-lucky-wheel__disc {
  position: relative;
  display: block;
  width: 78%;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  flex: 0 0 auto;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 6px solid #fff;
  box-shadow: 0 8px 24px rgba(80, 50, 0, 0.18);
  transform-origin: 50% 50%;
  background: conic-gradient(
    #fff4d0 0 12.5%,
    #ffe0a3 12.5% 25%,
    #ffd07a 25% 37.5%,
    #fff4d0 37.5% 50%,
    #ffe0a3 50% 62.5%,
    #ffd07a 62.5% 75%,
    #fff4d0 75% 87.5%,
    #ffe0a3 87.5% 100%
  );
  transform: rotate(-22.5deg);
  transition: transform 1.8s cubic-bezier(0.12, 0.7, 0.2, 1);
}

.cotinder-lucky-wheel__seg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.35em;
  height: 1.35em;
  margin: -0.67em 0 0 -0.67em;
  font-size: 1.12rem;
  line-height: 1.35em;
  text-align: center;
  transform: rotate(calc(var(--i) * 45deg + 22.5deg)) translateY(-118%) rotate(calc(var(--i) * -45deg - 22.5deg));
}

.cotinder-lucky-wheel__badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.72rem;
  font-weight: 700;
  color: #8a5a12;
}

.cotinder-lucky-wheel .card-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.cotinder-lucky-wheel .card-user .user-avatar,
.cotinder-lucky-wheel__favicon {
  display: block;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  object-fit: cover;
}

.cotinder-lucky-wheel .card-likes,
.cotinder-lucky-wheel .card-desc {
  display: block;
  padding: 0 4px;
}

html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card.user-slide.cotinder-lucky-wheel > .card-desc,
.card.user-slide.cotinder-lucky-wheel > .card-desc {
  display: block !important;
  -webkit-box-orient: unset !important;
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
  overflow: visible !important;
  text-overflow: unset !important;
  max-height: none !important;
  height: auto !important;
  white-space: normal !important;
}

html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post > .card.user-slide.cotinder-lucky-wheel {
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
}

.cotinder-lucky-wheel__prices,
.cotinder-lucky-wheel__last,
.cotinder-lucky-wheel__where {
  margin: 6px 4px 0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  color: #6b4a12;
}

.cotinder-lucky-wheel__where a,
.cotinder-lucky-wheel__last a {
  color: #8a5a12;
  text-decoration: underline;
}

.cotinder-lucky-wheel__cta {
  margin: 10px 4px 6px;
  width: calc(100% - 8px);
  pointer-events: auto;
}

.cotinder-lucky-wheel__cta:disabled,
.cotinder-lucky-wheel__cta[aria-disabled="true"],
.cotinder-lucky-wheel.is-spinning .cotinder-lucky-wheel__cta {
  opacity: 0.72;
  cursor: default;
}

@media screen and (max-width: 430px) {
  .cotinder-lucky-wheel__disc {
    width: 82%;
    margin-left: auto;
    margin-right: auto;
  }

  .cotinder-lucky-wheel__cta {
    width: calc(100% - 8px);
  }
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
  .cotinder-lucky-wheel__disc {
    width: 74%;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }

  .cotinder-lucky-wheel__seg {
    font-size: 1rem;
  }
}

/* Wheel is a normal feed card. Posts sit beside it. Cached spacer must not open a hole. */
html body .index__posts > .index__post[data-lucky-wheel-slot],
html body .cotinder-index-feed .index__posts > .index__post[data-lucky-wheel-slot] {
  box-sizing: border-box;
}

html body .index__posts > .index__post[data-lucky-wheel-slot] > .card.user-slide.cotinder-lucky-wheel,
html body .cotinder-index-feed .index__posts > .index__post[data-lucky-wheel-slot] > .card.user-slide.cotinder-lucky-wheel {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}

html body .index__post .card.user-slide.cotinder-lucky-wheel .cotinder-lucky-wheel__disc,
html body .cotinder-index-feed .index__post .card.user-slide.cotinder-lucky-wheel .cotinder-lucky-wheel__disc {
  margin-left: auto !important;
  margin-right: auto !important;
}

html body .index__posts > .index__post.cotinder-lucky-wheel-spacer,
html body .cotinder-index-feed .index__posts > .index__post.cotinder-lucky-wheel-spacer,
html body .cotinder-index-feed[data-cotinder-feed-tab="last"] .index__posts > .index__post.cotinder-lucky-wheel-spacer {
  display: none !important;
  flex: 0 0 0 !important;
  width: 0 !important;
  max-width: 0 !important;
  min-width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
