/* ==========================================================================
   Spicomi Fortune Tools - タロット占い共通スタイル
   ========================================================================== */

/* カード占いコンテナ */
#fortune-tarot-aitenokimoti {
  background: #1d005b;
  overflow: hidden;
  position: relative;
}

/* シャッフル・引くボタン */
#fortune-tarot-aitenokimoti .btn {
  color: #fff;
  position: absolute;
  z-index: 99;
  width: 100%;
  text-align: center;
  font-size: 130%;
}

#fortune-tarot-aitenokimoti .btn span {
  display: inline-block;
  padding: 1em;
  border: 1px solid;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  cursor: pointer;
}

#fortune-tarot-aitenokimoti .sft-btn-start {
  top: 50%;
  margin-top: -2em;
}

#fortune-tarot-aitenokimoti .sft-btn-end {
  top: 50%;
  margin-top: -2em;
}

/* カードコンテナ */
.sft-card-container {
  position: relative;
  height: 60vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sft-card-container.ready {
  animation: sft-up-down 2s linear infinite;
}

.sft-card-container .card {
  position: absolute;
}

.sft-card-container .card .inner {
  width: 150px;
  height: 270px;
  background-size: contain;
  background-repeat: no-repeat;
}

@media (max-width: 480px) {
  .sft-card-container .card .inner {
    width: 117px;
    height: 210px;
  }
}

/* カードアニメーション */
.sft-card-container .card.active {
  animation: sft-circle 1s linear;
}

.sft-card-container .card.fetch .inner {
  transform: translateY(0);
  animation: sft-fetch linear 0.2s forwards;
}

.sft-card-container .card.result .inner {
  animation: sft-scale 1s ease-out forwards, sft-opacity 1s ease-out forwards;
}

/* ==========================================================================
   結果表示
   ========================================================================== */
.sft-result {
  text-align: center;
  margin: 20px 0;
}

.sft-result-title {
  font-size: 1.3em;
  margin-bottom: 20px;
}

.sft-result-card {
  margin-bottom: 15px;
}

.sft-result-card img {
  max-width: 200px;
  height: auto;
}

.sft-result-card img.reverse {
  transform: rotate(180deg);
}

.sft-result-name {
  font-size: 1.1em;
  font-weight: bold;
  margin-bottom: 20px;
}

.sft-result-text {
  text-align: left;
  margin-bottom: 20px;
  line-height: 1.8;
}

.sft-result-retry {
  text-align: center;
  margin-top: 20px;
}

.sft-result-retry a {
  background: #eee;
  line-height: 3em;
  display: inline-block;
  border-radius: 5px;
  padding: 0 20px;
  text-decoration: none;
  color: #333;
}

.sft-result-retry a:hover {
  background: #ddd;
}

/* ==========================================================================
   キーフレーム（名前衝突防止のためsft-プレフィックス付き）
   ========================================================================== */
@keyframes sft-circle {
  0% {
    transform: rotate(0deg) translateX(0) rotate(0deg);
    z-index: 0;
  }
  33% {
    transform: rotate(180deg) translateX(-80px) rotate(-180deg);
  }
  66% {
    transform: rotate(360deg) translateX(-80px) rotate(-360deg);
  }
  100% {
    transform: rotate(540deg) translateX(0) rotate(-540deg);
    z-index: 1;
  }
}

@keyframes sft-fetch {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-20px);
  }
}

@keyframes sft-scale {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(5);
  }
}

@keyframes sft-opacity {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes sft-up-down {
  0% {
    top: 0;
  }
  50% {
    top: 20px;
  }
  100% {
    top: 0;
  }
}
