/* 전체 영역 컨테이너 */
.tarotSection {
  width: 100%;
  height: 260px;
  display: flex;
  flex-direction: column;
  text-align: center;
  position: relative;
  padding: 24px 0;
  border-radius: var(--border-radius-r);
  background-color: #4b425c;
}

/* 안의 카드와 텍스트가 위에 보이도록 */
.tarotSection > * {
  position: relative;
  z-index: 1;
}

.tarotContainer,
.secondTarot {
  flex: 1;
  width: 100%;
  overflow: hidden;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex;
  flex-direction: row;
  justify-content: center;
  padding-top: 10px;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.5));
}

.tarotCard:first-child {
  margin-left: 0px !important;
}

.tarotContainer::-webkit-scrollbar {
  display: none;
}

/* 카드 고정 사이즈 */
.tarotCard {
  width: 62px;
  height: calc(62px * 1.65);
  display: inline-block;
  position: relative;
  margin-left: -46px;
  cursor: pointer;
  transform-style: preserve-3d;
  visibility: hidden;
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  will-change: transform, opacity;
}

/* 앞/뒤 공통 스타일 */
.tarotCard .front,
.tarotCard .back {
  width: 100%;
  height: 100%;
  position: absolute;
  backface-visibility: hidden;
  overflow: hidden;
}

.tarotCard .back {
  transform: rotateY(180deg);
}

.tarotCard img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tarotCard.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

/* 선택된 카드 강조 */
.tarotCard.flipped {
  transform: rotateY(180deg) translateY(0px);
  z-index: 20;
}
/* 카드 이미지 */
.tarotCard img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 뒷면은 플립 상태 */
.tarotCard .back {
  transform: rotateY(180deg);
}
.cta_button_box {
  width: 100%;
  display: flex;
  justify-content: center;
}
button.spreadBtn,
button.resultBtn,
button.nextBtn {
  background-color: #645979;
  color: #fff3cb;
  padding: 8px 16px;
  border-radius: var(--border-radius-xs);
  border: 0.3px solid #fff3cb;
  display: block;
  font-size: var(--size-sm);
  font-weight: var(--weight-large);
  cursor: pointer;
  width: 50%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.secondCard {
  width: 62px;
  height: calc(62px * 1.65);
  display: inline-block;
  margin: 0 10px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.35s ease;
}

.secondCard img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.secondCard.flipped {
  transform: rotateY(180deg);
}

.tarotSection .introText {
  color: #ffefb8;
  font-size: var(--size-sm);
  font-weight: 500;
  text-align: center;
}

.fadeOut {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.fadeIn {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.wrapEveryThing {
  width: 100%;
  aspect-ratio: 16/9;
  background: url('/img/tarot/tarot_box_bg.webp') center/cover no-repeat;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.frontimg {
  width: 80px;
  height: 137px;
  border-radius: 4px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.8);
}

.swipe_desc {
  font-size: var(--size-xs);
  color: var(--color-white);
  opacity: 0.7;
}

@media screen and (max-width: 431px) {
  .tarotCard {
    margin-left: -51px;
  }
  .frontimg {
    width: 70px;
    height: 120px;
  }
}

@media screen and (max-width: 320px) {
  .tarotSection {
    height: 220px;
    width: 100%;
  }
  .tarotContainer,
  .secondTarot {
    justify-content: flex-start;
    overflow-x: auto;
    padding: 10px 20px;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
  }
  .tarotCard {
    width: 62px;
    height: calc(62px * 1.2);
    margin-left: -60px;
    flex-shrink: 0;
  }

  .secondCard {
    width: 62px;
    height: calc(62px * 1.2);
    margin: 0;
    flex-shrink: 0;
  }
  .frontimg {
    width: 60px;
    height: 102px;
  }
  .tarotContainer::-webkit-scrollbar,
  .secondTarot::-webkit-scrollbar {
    display: none;
  }
}
