/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Fortune Result — Dynamic & animation
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ─── Twilight berry hero ─── */
.fr-hero {
  background: linear-gradient(165deg, #2b0a15 0%, #451022 55%, #5b1630 100%);
}

/* ─── Twinkling sparkles ─── */
.fr-spark {
  position: absolute;
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
  animation: frTwinkle 3.2s ease-in-out infinite;
}
@keyframes frTwinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.8); }
  50%      { opacity: 0.8;  transform: scale(1.1); }
}

/* ─── Dark berry card + variety glow (開運アクション等) ───
   --fr-c はテンプレートが品種色をセットする。 */
.fr-dark-card {
  background: linear-gradient(135deg, #4a1124, #2b0a15);
}
.fr-dark-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(200px 130px at 8% -10%,
    color-mix(in srgb, var(--fr-c, #e11d48) 45%, transparent), transparent 72%);
}

/* ─── Stagger fade-in ───
   登場の動きは、キーフレームの from (始まりの状態) だけを決め、backwards で
   animation-delay の間も from の状態にする。終わったあとは要素自身のスタイルに戻る。
   要素に opacity:0 を置いて forwards で最後の opacity:1 / transform を保つ書き方だと、
   同じ要素の opacity-* や hover:-translate-* が打ち消される (総合運の足りない分の星が
   薄くならず、どの点数でも 5 つとも満ちて見えていた。#272)。fortune-index.css も同じ。 */
.fr-fade {
  animation: frSlideIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.fr-d1 { animation-delay: 0.08s; }
.fr-d2 { animation-delay: 0.16s; }
.fr-d3 { animation-delay: 0.24s; }
.fr-d4 { animation-delay: 0.32s; }
.fr-d5 { animation-delay: 0.40s; }
.fr-d6 { animation-delay: 0.48s; }
.fr-d7 { animation-delay: 0.56s; }
.fr-d8 { animation-delay: 0.64s; }
.fr-d9 { animation-delay: 0.72s; }

@keyframes frSlideIn {
  from { opacity: 0; transform: translateY(16px); }
}

/* ─── Star pulse ─── */
.fr-star-pulse {
  animation: starPop 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.fr-star-pulse:nth-child(1) { animation-delay: 0.3s; }
.fr-star-pulse:nth-child(2) { animation-delay: 0.4s; }
.fr-star-pulse:nth-child(3) { animation-delay: 0.5s; }
.fr-star-pulse:nth-child(4) { animation-delay: 0.6s; }
.fr-star-pulse:nth-child(5) { animation-delay: 0.7s; }

@keyframes starPop {
  0%   { opacity: 0; transform: scale(0.3); }
  60%  { transform: scale(1.15); }
}

/* ─── Gentle float for hero image ─── */
.fr-float {
  animation: frFloat 4s ease-in-out infinite;
}
@keyframes frFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* ─── Glass card ─── */
.fr-glass {
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
}

/* ─── Reduced motion ───
   登場の動きは要素自身のスタイルを変えないので、止めるだけで表示される。 */
@media (prefers-reduced-motion: reduce) {
  .fr-fade,
  .fr-star-pulse,
  .fr-float,
  .fr-spark {
    animation: none;
  }
  .fr-spark {
    opacity: 0.4;
  }
}
