/* Loop Flip Card Styles */

.loop-flip-scene {
  perspective: 1200px;
  margin: 3rem auto;
  width: 100%;
  /* max-width: 600px; /* カードがあまり大きくならないように */
  height: 300px; /* 高さ指定 */
  padding: 0 1rem;
}

.loop-card {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bounce-like flip */
  transform-style: preserve-3d;
  cursor: pointer;
}

/* Flipped state */
.loop-card.is-flipped {
  transform: rotateY(180deg);
}

.loop-card-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

/* Front Face */
.loop-card-front {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
}

.loop-anim-container {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.spinning-arrows {
  position: absolute;
  width: 100%;
  height: 100%;
  font-size: 5rem;
  color: var(--praise-secondary);
  animation: spin-cw 8s linear infinite;
  opacity: 0.3;
}

.center-icon {
  font-size: 3rem;
  color: var(--praise-primary);
  z-index: 2;
  animation: pulse-q 2s infinite ease-in-out;
}

.loop-card-front h4 {
  color: var(--praise-text);
  font-size: 1.3rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.tap-hint {
  font-weight: 700;
  color: var(--praise-text-light);
  font-size: 0.9rem;
  padding: 5px 15px;
  border: 1px dashed var(--praise-text-light);
  border-radius: 20px;
  margin-top: 1rem;
  animation: bounce-hint 2s infinite;
}

/* Back Face - True Premium Gold */
.loop-card-back {
  /* リッチなゴールドグラデーション：全体的に明るく、上品に */
  background: radial-gradient(
    circle at 50% 30%,
    #ffffff 0%,
    #fffbeb 40%,
    #fde68a 100%
  );
  
  /* ボーダーを廃止し、シャドウで金属的な縁取りと厚みを表現 */
  border: none;
  box-shadow: 
    inset 0 0 0 2px rgba(255, 255, 255, 0.9), /* エッジのハイライト */
    inset 0 0 20px rgba(253, 230, 138, 0.3),  /* 内側のさらに柔らかな影 */
    0 0 0 2px #fcd34d,                        /* 外側の枠を少し細く、明るく */
    0 0 0 6px rgba(251, 191, 36, 0.2),        /* 外側の光の拡散も控えめに */
    0 20px 50px rgba(180, 83, 9, 0.15);       /* ドロップシャドウも少し薄く */

  transform: rotateY(180deg);
  color: #78350f; 
  position: relative;
  overflow: hidden;
}

/* 光のエフェクト（シマー） */
.loop-card-back::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.5) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0.5;
}

.loop-card-back h4 {
  font-family: "Kaisei Opti", serif;
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
  z-index: 2;
  border-bottom: 2px solid rgba(146, 64, 14, 0.1);
  padding-bottom: 0.5rem;
}

.loop-card-back p {
  font-family: "Kaisei Opti", serif; /* 優美な明朝体系 */
  font-size: 1.05rem !important;
  line-height: 2 !important;
  max-width: 95%;
  font-weight: 600;
  color: #451a03;
  text-shadow: 0 1px 0 rgba(255,255,255,0.5); /* 刻印風 */
  z-index: 2;
  text-align: left;
}

/* Remove old strong style if not used, or update it */
.loop-card-back strong {
  background: transparent;
  color: #b45309;
  font-weight: 800;
  border-bottom: 2px dotted #b45309;
}

/* Animations */
@keyframes spin-cw {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-q {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

@keyframes bounce-hint {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .loop-flip-scene {
    height: 350px; /* モバイルではテキスト折り返し分高さを確保 */
  }
  .spinning-arrows {
    font-size: 4rem;
  }
  .center-icon {
    font-size: 2.2rem;
  }
}
