/* 3D Flip Card Animation */
.flip-container {
  perspective: 1000px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.flip-container:hover:not(.flipped) {
  transform: translateY(-4px);
}

.flip-container.flipped {
  pointer-events: none;
  z-index: 10;
}

.flip-container .flipper {
  transition: transform 0.6s;
  transform-style: preserve-3d;
  position: relative;
  width: 100%;
  height: 100%;
}

.flip-container.flipped .flipper {
  transform: rotateY(180deg);
  animation: flipAndGrow 0.8s ease-out forwards;
}

@keyframes flipAndGrow {
  0% {
    transform: rotateY(0deg) scale(1);
  }
  50% {
    transform: rotateY(180deg) scale(1);
  }
  100% {
    transform: rotateY(180deg) scale(1.15);
  }
}

.flip-container .front,
.flip-container .back {
  backface-visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 14px;
}

.flip-container .front {
  z-index: 2;
  transform: rotateY(0deg);
}

.flip-container .back {
transform: rotateY(180deg);
    background: var(--vtorostepennyy-cvet-bloka);
    border: 2px solid var(--orange);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    overflow: hidden;
}

.flip-container .back .prize-content {
  color: #e1e3e6;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Адаптация subject-block внутри back */
.flip-container .back .subject-block {
  transform: scale(0.75);
  margin: 0;
}

/* Обновление базовых стилей gift-item для flip-контейнера */
.gift-item.flip-container {
background: var(--akcenti);
    border: none;
    border-radius: 14px;
    padding: 4px;
    position: relative;
    overflow: visible;
    height: 100%;
    width: 100%;
    display: block;
    box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .4);
}

.gift-item.flip-container .gift-item-image {
width: 100%;
    height: 100%;
    background: var(--vtorostepennyy-cvet-bloka);
    border-radius: 10px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gift-item.flip-container .gift-item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}
