/**
 * ============================================
 * Module: community-sprite-engine.css
 * Area:   社區動態幀動畫引擎樣式 v2.0
 * ============================================
 */

/* ===== 呼吸動畫（加載海豹） ===== */
.mc-seal-anim-breathing {
  animation: mc-breathe 2.5s ease-in-out infinite;
}
.mc-seal-anim-breathing img {
  animation: mc-breathe-img 2.5s ease-in-out infinite;
}
@keyframes mc-breathe {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.06) translateY(-4px); }
}
@keyframes mc-breathe-img {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.05); }
}

/* ===== 跳躍動畫（簽到海豹） ===== */
.mc-seal-anim-bounce {
  animation: mc-bounce 1.2s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
}
@keyframes mc-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-20px) scale(1.05, 0.95); }
  50% { transform: translateY(0) scale(0.95, 1.05); }
  70% { transform: translateY(-8px) scale(1.02, 0.98); }
}

/* ===== 慶祝動畫（成功海豹） ===== */
.mc-seal-anim-celebrate {
  animation: mc-celebrate 1.5s ease-in-out infinite;
}
@keyframes mc-celebrate {
  0%, 100% { transform: rotate(0deg) scale(1); }
  15% { transform: rotate(-8deg) scale(1.1); }
  30% { transform: rotate(8deg) scale(1.1); }
  45% { transform: rotate(-5deg) scale(1.05); }
  60% { transform: rotate(5deg) scale(1.05); }
  75% { transform: rotate(-2deg) scale(1); }
}

/* ===== 搖頭動畫（空狀態海豹） ===== */
.mc-seal-anim-wobble {
  animation: mc-wobble 3s ease-in-out infinite;
}
@keyframes mc-wobble {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  20% { transform: rotate(-5deg) translateY(-2px); }
  40% { transform: rotate(5deg) translateY(-2px); }
  60% { transform: rotate(-3deg) translateY(0); }
  80% { transform: rotate(3deg) translateY(0); }
}

/* ===== 粒子效果 ===== */

/* 氣泡粒子 */
.mc-seal-particle-bubbles {
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, rgba(173, 216, 230, 0.8) 0%, rgba(173, 216, 230, 0) 70%);
  border-radius: 50%;
  animation: mc-bubble-float 2.5s ease-in-out infinite;
}
.mc-seal-particle-bubbles:nth-child(2) { animation-delay: 0.4s; width: 8px; height: 8px; }
.mc-seal-particle-bubbles:nth-child(3) { animation-delay: 0.8s; width: 5px; height: 5px; }
.mc-seal-particle-bubbles:nth-child(4) { animation-delay: 1.2s; width: 7px; height: 7px; }
.mc-seal-particle-bubbles:nth-child(5) { animation-delay: 1.6s; }

@keyframes mc-bubble-float {
  0% { transform: translateY(0) scale(0); opacity: 0; }
  20% { transform: translateY(-10px) scale(1); opacity: 0.8; }
  80% { transform: translateY(-40px) scale(0.8); opacity: 0.4; }
  100% { transform: translateY(-50px) scale(0.5); opacity: 0; }
}

/* 閃光粒子 */
.mc-seal-particle-sparkle {
  width: 8px;
  height: 8px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.9) 0%, rgba(255, 215, 0, 0) 70%);
  border-radius: 50%;
  animation: mc-sparkle 1.5s ease-in-out infinite;
}
.mc-seal-particle-sparkle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 10px;
  background: rgba(255, 215, 0, 0.6);
  transform: translate(-50%, -50%);
}
.mc-seal-particle-sparkle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 2px;
  background: rgba(255, 215, 0, 0.6);
  transform: translate(-50%, -50%);
}

@keyframes mc-sparkle {
  0%, 100% { transform: scale(0) rotate(0deg); opacity: 0; }
  50% { transform: scale(1) rotate(180deg); opacity: 1; }
}

/* 愛心粒子 */
.mc-seal-particle-hearts {
  width: 10px;
  height: 10px;
  animation: mc-heart-float 2s ease-in-out infinite;
}
.mc-seal-particle-hearts::before {
  content: '\2665';
  font-size: 12px;
  color: #ff6b9d;
  position: absolute;
}

@keyframes mc-heart-float {
  0% { transform: translateY(0) scale(0); opacity: 0; }
  30% { transform: translateY(-15px) scale(1); opacity: 1; }
  100% { transform: translateY(-40px) scale(0.5); opacity: 0; }
}

/* ===== 海洋動物容器 ===== */
#mc-ocean-creatures {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

#mc-ocean-creatures canvas[data-creature="jellyfish"] {
  filter: drop-shadow(0 0 8px rgba(200, 150, 255, 0.4));
  opacity: 0.7;
}

#mc-ocean-creatures canvas[data-creature="fish"] {
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.15));
}

/* 海洋動物搖擺動畫 */
.mc-creature-wobble {
  animation: mc-creature-swim 2s ease-in-out infinite;
}
@keyframes mc-creature-swim {
  0%, 100% { transform: rotate(-3deg) scaleY(1); }
  50% { transform: rotate(3deg) scaleY(0.95); }
}

/* ===== 加載動畫升級 — 覆蓋舊的 CSS ===== */
.mc-loading-seal.mc-css-seal-animator {
  background: transparent !important;
}

/* 社區帖子中的海豹圖片 — 透明背景 */
.mc-post-card img,
.mc-post-image img {
  background: transparent;
  object-fit: contain;
}

/* ===== 響應式 ===== */
@media (max-width: 768px) {
  .mc-css-seal-animator {
    max-width: 100px !important;
    max-height: 100px !important;
  }
  #mc-ocean-creatures canvas,
  #mc-ocean-creatures img {
    transform: scale(0.7);
  }
}

@media (max-width: 480px) {
  .mc-css-seal-animator {
    max-width: 80px !important;
    max-height: 80px !important;
  }
  #mc-ocean-creatures canvas,
  #mc-ocean-creatures img {
    transform: scale(0.5);
  }
}

/* The shared seal remains still when requested, including CSS-only widgets. */
.mc-motion-paused .mc-frame-animator,
.mc-motion-paused .mc-frame-animator img,
.mc-motion-paused .mc-css-seal,
.mc-motion-paused .mc-css-seal img { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .mc-frame-animator,
  .mc-frame-animator img,
  .mc-css-seal,
  .mc-css-seal img { animation: none !important; }
  #mc-ocean-creatures { display: none; }
}
