/* ============================================
   ИГРОВОЙ СЛАЙДЕР - ОПТИМИЗИРОВАННАЯ ВЕРСИЯ
   ============================================ */

.game-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  user-select: none;
}

.carousel-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  padding: 10px 0;
}

.carousel-track {
  display: flex;
  gap: 20px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  cursor: grab;
}

.carousel-track.dragging {
  cursor: grabbing;
}

.carousel-track.dragging .carousel-item .item-link {
  pointer-events: none !important;
}

.carousel-item {
  flex: 0 0 auto;
  width: 180px;
  position: relative;
  cursor: pointer;
}

.carousel-item .item-link {
  display: block;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #fff;
}

.carousel-item .item-link:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 30px rgba(73, 181, 69, 0.3);
}

.carousel-item .item-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, transparent 50%, rgba(0, 0, 0, 0.7) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.carousel-item .item-link:hover::before {
  opacity: 1;
}

.carousel-item .item-img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
  border: none !important;
  transition: transform 0.3s ease;
}

.carousel-item .item-link:hover .item-img {
  transform: scale(1.05);
}

.carousel-item .item-rating {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #49b545 0%, #2bb42b 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 20px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.carousel-item .item-rating{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.carousel-item .item-rating i{
  font-size: 12px;
  line-height: 1;
}

/* на всякий — чтобы текст не плясал */
.carousel-item .item-rating__text{
  line-height: 1;
}

.carousel-item .item-link::after {
  content: 'НОВИНКА';
  position: absolute;
  top: 10px;
  left: -35px;
  background: linear-gradient(135deg, #de5a26 0%, #f15f2c 100%);
  color: #fff;
  padding: 4px 40px;
  font-size: 10px;
  font-weight: 700;
  transform: rotate(-45deg);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.carousel-item:nth-child(n+6) .item-link::after {
  display: none;
}

.carousel-control {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #49b545 0%, #2bb42b 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(73, 181, 69, 0.3);
  flex-shrink: 0;
}

.carousel-control:hover {
  background: linear-gradient(135deg, #5cc55f 0%, #49b545 100%);
  box-shadow: 0 6px 20px rgba(73, 181, 69, 0.5);
  transform: scale(1.1);
}

.carousel-control:active {
  transform: scale(0.95);
}

.carousel-control:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: scale(1);
}

.carousel-control:disabled:hover {
  background: linear-gradient(135deg, #49b545 0%, #2bb42b 100%);
  box-shadow: 0 4px 12px rgba(73, 181, 69, 0.3);
  transform: scale(1);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.carousel-item {
  animation: fadeInUp 0.5s ease backwards;
}

.carousel-item:nth-child(1) { animation-delay: 0.05s; }
.carousel-item:nth-child(2) { animation-delay: 0.1s; }
.carousel-item:nth-child(3) { animation-delay: 0.15s; }
.carousel-item:nth-child(4) { animation-delay: 0.2s; }
.carousel-item:nth-child(5) { animation-delay: 0.25s; }

/* ═══════════════════════════════════════════════
   18+ AGE GATE FOR CAROUSEL
   ═══════════════════════════════════════════════ */

/* Instant blur for all 18+ carousel items (NO transition to prevent flash) */
.carousel-item--adult .item-img {
  filter: blur(20px) brightness(.72);
  transform: scale(1.06);
}
.carousel-item--adult .item-link { pointer-events: none; }

/* Remove blur when ageGate confirmed */
.carousel-item--adult .carousel-ageGate[aria-hidden="true"] ~ .item-link .item-img,
.carousel-item--adult .carousel-ageGate[aria-hidden="true"] + .item-link .item-img,
.carousel-item--adult.age-confirmed .item-img {
  filter: none;
  transform: scale(1);
  transition: filter 0.3s ease, transform 0.3s ease;
}
.carousel-item--adult .carousel-ageGate[aria-hidden="true"] ~ .item-link,
.carousel-item--adult.age-confirmed .item-link { pointer-events: auto; }

/* Age gate overlay */
.carousel-ageGate {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  border-radius: 12px;
}

.carousel-ageGate[aria-hidden="true"] {
  display: none;
  pointer-events: none;
}

.carousel-ageGate__box {
  text-align: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.carousel-ageGate__badge {
  display: inline-block;
  padding: 6px 12px;
  background: #ef4444;
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.carousel-ageGate__text {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.carousel-ageGate__btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.carousel-ageGate__btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: 2px solid;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.carousel-ageGate__btn--yes {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}

.carousel-ageGate__btn--yes:hover {
  background: #16a34a;
  transform: translateY(-2px);
}

.carousel-ageGate__btn--no {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.carousel-ageGate__btn--no:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  transform: translateY(-2px);
}
