/* ========================================
   並木イズムカード 結果表示アニメーション
======================================== */

/* 結果表示ボックス */
.namikiQuoteBox {
  background: linear-gradient(180deg, #5bc4b6 0%, #77d9c9 50%, #5bc4b6 100%);
  padding: 0;
  overflow: hidden;
  position: relative;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.8s ease, opacity 0.6s ease, padding 0.8s ease;
}

.namikiQuoteBox.is-visible {
  max-height: 500px;
  opacity: 1;
  padding: 50px 20px;
}

/* 背景の神秘的なエフェクト */
.namikiQuoteBox::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 40%);
  pointer-events: none;
}

/* 光のパーティクル */
.namikiQuoteBox::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(2px 2px at 10% 20%, rgba(255, 255, 255, 0.8) 50%, transparent 100%),
    radial-gradient(2px 2px at 30% 60%, rgba(255, 255, 255, 0.6) 50%, transparent 100%),
    radial-gradient(2px 2px at 50% 30%, rgba(255, 255, 255, 0.7) 50%, transparent 100%),
    radial-gradient(2px 2px at 70% 80%, rgba(255, 255, 255, 0.5) 50%, transparent 100%),
    radial-gradient(2px 2px at 90% 40%, rgba(255, 255, 255, 0.6) 50%, transparent 100%),
    radial-gradient(1px 1px at 15% 70%, rgba(255, 255, 255, 0.4) 50%, transparent 100%),
    radial-gradient(1px 1px at 85% 20%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
  animation: twinkle 4s ease-in-out infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease 0.5s;
}

.namikiQuoteBox.is-visible::after {
  opacity: 1;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* メッセージ出力テキスト */
.namiki-quote-output {
  font-family: "Noto Serif JP", serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.8;
  text-align: center;
  color: #1a1a1a;
  position: relative;
  z-index: 1;
  padding: 30px 20px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.1),
    0 0 60px rgba(119, 217, 201, 0.3),
    inset 0 0 30px rgba(255, 255, 255, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.8);
  
  /* 初期状態 */
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.namikiQuoteBox.is-visible .namiki-quote-output {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 装飾ライン（上） */
.namiki-quote-output::before {
  content: '✦';
  display: block;
  font-size: 16px;
  color: #77d9c9;
  margin-bottom: 15px;
  letter-spacing: 20px;
  text-indent: 20px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.6s ease 0.3s;
}

.namikiQuoteBox.is-visible .namiki-quote-output::before {
  opacity: 1;
  transform: translateY(0);
}

/* 装飾ライン（下） */
.namiki-quote-output::after {
  content: '✦';
  display: block;
  font-size: 16px;
  color: #77d9c9;
  margin-top: 15px;
  letter-spacing: 20px;
  text-indent: 20px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.6s ease 0.3s;
}

.namikiQuoteBox.is-visible .namiki-quote-output::after {
  opacity: 1;
  transform: translateY(0);
}

/* ローディング状態 */
.namiki-quote-output.is-loading {
  color: #666;
  font-size: 16px;
  font-weight: 400;
}

.namiki-quote-output.is-loading::before,
.namiki-quote-output.is-loading::after {
  content: '';
  display: none;
}

/* カード回転アニメーション用クラス */
.card-image.is-drawing {
  animation: cardFlip 1.2s ease-in-out;
}

@keyframes cardFlip {
  0% { 
    transform: rotateY(0deg) scale(1); 
  }
  25% { 
    transform: rotateY(90deg) scale(1.05); 
  }
  50% { 
    transform: rotateY(180deg) scale(1.1); 
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(119, 217, 201, 0.5);
  }
  75% { 
    transform: rotateY(270deg) scale(1.05); 
  }
  100% { 
    transform: rotateY(360deg) scale(1); 
  }
}

/* ボタン押下時のフィードバック */
.btn-card.is-active {
  pointer-events: none;
  background: linear-gradient(135deg, #77d9c9, #5bc4b6);
  color: #fff;
  animation: buttonPulse 0.6s ease;
}

@keyframes buttonPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.95); }
}

/* 光の波紋エフェクト */
.namikiQuoteBox .ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: rippleExpand 2s ease-out forwards;
  pointer-events: none;
}

@keyframes rippleExpand {
  0% {
    width: 10px;
    height: 10px;
    opacity: 1;
  }
  100% {
    width: 400px;
    height: 400px;
    opacity: 0;
  }
}

/* グロー効果 */
.namikiQuoteBox.is-visible {
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(119, 217, 201, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(119, 217, 201, 0.5);
  }
}

/* ========================================
   スマホ対応
======================================== */
@media (max-width: 768px) {
  .namikiQuoteBox.is-visible {
    padding: 40px 15px;
  }

  .namiki-quote-output {
    font-size: 18px;
    padding: 25px 15px;
  }

  .namiki-quote-output::before,
  .namiki-quote-output::after {
    font-size: 14px;
    letter-spacing: 15px;
    text-indent: 15px;
  }
}
