/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Fortune Index — Card animations
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

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

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

/* ─── Variety card hover top-bar reveal ─── */
.fi-card::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--v-color), var(--v-color-end));
  opacity: 0;
  transition: opacity 0.3s;
}
.fi-card:hover::after {
  opacity: 1;
}

/* ─── Stagger card entrance ─── */
.fi-card {
  opacity: 0;
  transform: translateY(18px);
  animation: fiCardUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.fi-card:nth-child(1) { animation-delay: 0.05s; }
.fi-card:nth-child(2) { animation-delay: 0.10s; }
.fi-card:nth-child(3) { animation-delay: 0.15s; }
.fi-card:nth-child(4) { animation-delay: 0.20s; }
.fi-card:nth-child(5) { animation-delay: 0.25s; }
.fi-card:nth-child(6) { animation-delay: 0.30s; }
.fi-card:nth-child(7) { animation-delay: 0.35s; }
.fi-card:nth-child(8) { animation-delay: 0.40s; }

@keyframes fiCardUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Welcome-back banner entrance (unhidden pre-paint by inline JS) ─── */
.fi-welcome {
  opacity: 0;
  transform: translateY(18px);
  animation: fiCardUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ─── Welcome-back card: dark berry base + variety-color glow ───
   --fwb-c はインラインJSが品種色をセットする。
   color-mix 非対応ブラウザではグローが消えるだけで可読性は保たれる。 */
.fwb-card {
  background: linear-gradient(135deg, #2b0a15 0%, #4a1124 55%, #380d1c 100%);
  box-shadow:
    0 16px 40px rgba(43, 10, 21, 0.28),
    0 4px 12px rgba(43, 10, 21, 0.18);
}
.fwb-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(220px 140px at 10% -10%,
      color-mix(in srgb, var(--fwb-c, #e11d48) 50%, transparent), transparent 72%),
    radial-gradient(260px 170px at 105% 130%,
      color-mix(in srgb, var(--fwb-c, #e11d48) 28%, transparent), transparent 72%);
}
.fwb-card:hover {
  box-shadow:
    0 22px 52px rgba(43, 10, 21, 0.34),
    0 6px 16px rgba(43, 10, 21, 0.2);
}

/* ─── Gentle bounce for hero icon ─── */
.fi-bounce {
  animation: fiBounce 3s ease-in-out infinite;
}
@keyframes fiBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

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

/* ─── Reduced motion ───
   .fi-card / .fi-welcome は opacity:0 から始まるため、
   animation を止めるだけでは非表示のままになる。最終状態を直接指定する。 */
@media (prefers-reduced-motion: reduce) {
  .fi-card,
  .fi-welcome {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .fi-bounce,
  .fi-spark {
    animation: none;
  }
  .fi-spark {
    opacity: 0.4;
  }
}
