/* File: assets/effects-love/effects-love.css */
/* Version: v1.4 - 2025-05-10 - Hoan thien hieu ung Don va hieu ung Moc

/* ======================= HIỆU ỨNG ĐƠN (A–Z) ======================= */
.tw-heart {
  position: absolute;
  font-size: 20px;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, 0);
}

@keyframes bezierFly {
  0% { transform: translate(-50%, 0); opacity: 1; }
  50% { transform: translate(-30px, -90px); opacity: 0.9; }
  100% { transform: translate(-50%, -250px); opacity: 0; }
}
@keyframes popFloatUp {
  0% { transform: translate(-50%, 0) scale(0.5); opacity: 0; }
  50% { transform: translate(-50%, -90px) scale(1.5); opacity: 1; }
  100% { transform: translate(-50%, -250px) scale(2); opacity: 0; }
}
@keyframes sparkleRise {
  0% { transform: translate(-50%, 0) scale(1); opacity: 1; }
  50% { transform: translate(-50%, -120px) scale(1.5); opacity: 0.8; }
  100% { transform: translate(-50%, -300px) scale(2); opacity: 0; }
}
@keyframes heartBurst {
  0% { transform: scale(0.2); opacity: 0; }
  50% { transform: scale(2.5); opacity: 1; }
  100% { transform: scale(0.6); opacity: 0; }
}
@keyframes wobble {
  0%, 100% { transform: translate(-50%, 0) rotate(0deg); }
  25% { transform: rotate(6deg); }
  50% { transform: rotate(-6deg); }
  75% { transform: rotate(3deg); }
}

.tw-heart-bezier { animation: bezierFly 2s ease-out forwards; }
.tw-heart-bounce-in { animation: popFloatUp 1.6s ease-in-out forwards; }
.tw-heart-burst { animation: heartBurst 1s ease-out forwards; }
.tw-heart-circle-pop { animation: heartBurst 1.2s ease-in-out forwards; }
.tw-heart-color-bloom { animation: sparkleRise 2.2s ease-in-out forwards; }
.tw-heart-confetti-mini { animation: popFloatUp 1.5s ease-in-out forwards; }
.tw-heart-float { animation: bezierFly 2.4s ease-in-out forwards; }
.tw-heart-glow-pulse { animation: heartBurst 1.5s ease-in-out forwards; }
.tw-heart-beat { animation: wobble 1.4s ease-in-out forwards; }
.tw-heart-mini-bounce { animation: popFloatUp 1.2s ease-out forwards; }
.tw-heart-orbit { animation: wobble 2s ease-in-out forwards; }
.tw-heart-popfloat { animation: popFloatUp 2s ease-out forwards; }
.tw-heart-random { animation: sparkleRise 2s ease-in-out forwards; }
.tw-heart-rotate { animation: wobble 2s ease-in-out forwards; }
.tw-heart-shake { animation: wobble 1.2s ease-in-out forwards; }
.tw-heart-sparkle { animation: sparkleRise 2s ease-in-out forwards; }
.tw-heart-spiral-rise { animation: bezierFly 2.4s ease-out forwards; }
.tw-heart-star { animation: wobble 1.8s ease-in-out forwards; }
.tw-heart-starfly { animation: sparkleRise 2s ease-in-out forwards; }
.tw-heart-trail { animation: sparkleRise 2s ease-out forwards; }

#todayword-effect-root {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20; /* cao hơn .todayword-container nếu bị che */
}

.todayword-wrapper {
  position: relative;
  display: inline-block; /* hoặc block nếu cần */
}

/* ========== Hiệu ứng Mốc ========== */
.tw-confetti-emoji {
  position: absolute;
  font-size: 24px;
  animation: confettiFall 1.2s ease-out forwards;
}

.tw-star-merge.from-top,
.tw-star-merge.from-bottom,
.tw-star-merge.from-left,
.tw-star-merge.from-right {
  position: absolute;
  font-size: 20px;
  animation: starMergeFlash 1s ease-out forwards;
}

.tw-star-chop-sang {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 48px;
  transform: translate(-50%, -50%);
  animation: starMergeFlash 0.6s ease-out 3;
}

.tw-diamond-flash-full {
  position: absolute;
  top: 30%;
  left: 50%;
  font-size: 64px;
  transform: translateX(-50%);
  animation: flashDiamond 1s ease-out;
}

.tw-love-explosion {
  position: absolute;
  top: 45%;
  left: 50%;
  font-size: 48px;
  transform: translate(-50%, -50%);
  animation: explodeBoom 0.5s ease-out forwards;
}

.tw-heart-rain-line {
  position: absolute;
  top: 0;
  left: calc(10% * var(--i));
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: loveRainDrop 2s ease-out;
}

/* ========== Hiệu ứng Liên tục ========== */
.tw-heart-loop {
  position: absolute;
  left: calc(3% * var(--i));
  top: -5%;
  font-size: 20px;
  animation: heartRainLoop 2.4s ease-in forwards;
}

.tw-money-fly {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 22px;
  transform: translate(-50%, -50%) scale(0.8);
  animation: moneyConfettiFly 1s ease-out forwards;
}

/* ========== Hiệu ứng phụ (chớp/rung/lắc) ========== */
.tw-flash-full {
  animation: flashScreen 0.6s ease-in-out;
}
.tw-flash-soft {
  animation: flashSoft 0.6s ease-in-out;
}
.tw-flash-wide {
  animation: flashScreenWide 0.6s ease-in-out;
}
.tw-flash-right {
  animation: flashRightSide 0.6s ease-in-out;
}
.tw-flash-grid {
  animation: flashGrid 0.6s ease-in-out;
}
.tw-shake-vertical {
  animation: shakeVertical 0.4s ease-in-out;
}
.tw-shake-pulse {
  animation: shakePulse 0.6s ease-in-out;
}
.tw-shake-strong {
  animation: shakeStrong 0.8s ease-in-out;
}

/* ========== Animations ========== */
@keyframes confettiFall {
  0% { transform: scale(0.2) translateY(-20px); opacity: 0; }
  100% { transform: scale(1) translateY(60px); opacity: 1; }
}
@keyframes starMergeFlash {
  0% { opacity: 0; transform: scale(0.2); }
  100% { opacity: 1; transform: scale(1.1); }
}
@keyframes flashDiamond {
  0% { opacity: 0; transform: scale(0.2); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes explodeBoom {
  0% { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1.2); opacity: 1; }
}
@keyframes loveRainDrop {
  0% { transform: translateY(-100px); opacity: 0; }
  100% { transform: translateY(300px); opacity: 1; }
}
@keyframes heartRainLoop {
  0% { transform: translateY(-10%); opacity: 0; }
  100% { transform: translateY(100vh); opacity: 1; }
}
@keyframes moneyConfettiFly {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  100% { transform: translate(calc(-50% + 100px), calc(-50% - 100px)) scale(1); opacity: 1; }
}
@keyframes flashScreen {
  0% { background: rgba(255,255,255,0.5); }
  100% { background: transparent; }
}
@keyframes flashSoft {
  0% { background: rgba(255,200,255,0.2); }
  100% { background: transparent; }
}
@keyframes flashScreenWide {
  0% { background: rgba(255,255,255,0.8); }
  100% { background: transparent; }
}
@keyframes flashRightSide {
  0% { box-shadow: 0 0 20px rgba(255,255,0,0.6); }
  100% { box-shadow: none; }
}
@keyframes flashGrid {
  0% { background: repeating-linear-gradient(45deg, #fff, #fff 10px, #ccc 10px, #ccc 20px); }
  100% { background: transparent; }
}
@keyframes shakeVertical {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes shakePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
@keyframes shakeStrong {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-12px); }
  75% { transform: translateX(12px); }
}

/* ===== Bổ sung cho hiệu ứng Mốc 5 + 10 ===== */
/* === Mốc 5: confettiPop - pháo giấy từ 4 góc === */
.tw-confetti-real {
  position: absolute;
  border-radius: 1px;
  animation: confettiRealFall 1.8s ease-out forwards;
  z-index: 9999;
}
@keyframes confettiRealFall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(720deg); opacity: 0; }
}

/* === Mốc 10: diamondFlash - kim cương chớp sáng === */
.tw-diamond-center {
  position: absolute;
  font-size: 48px;
  transform: translate(-50%, -50%);
  animation: diamondFlashGlow 1.2s ease-in-out infinite alternate;
  color: #00f0ff;
  z-index: 1000;
}
.tw-diamond-piece {
  position: absolute;
  font-size: 14px;
  animation: diamondFlashGlow 1.6s ease-in-out infinite alternate;
  opacity: 0.85;
  color: #00eaff;
}
@keyframes diamondFlashGlow {
  0% { opacity: 0.3; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.4); }
}

/* ===== Bổ sung Mốc 15 + 20 ===== */
/* === Hiệu ứng Mốc 15 – starMergeFlash (Sao tụ về giữa) === */
.tw-star-piece {
  position: absolute;
  font-size: 20px;
  opacity: 0.9;
  animation: starToCenter 1.6s ease-in-out forwards;
  color: gold;
  z-index: 9998;
}
@keyframes starToCenter {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.3); opacity: 0; }
}

.tw-star-merge-center {
  position: absolute;
  font-size: 42px;
  transform: translate(-50%, -50%);
  animation: starMergeFlashPulse 0.6s ease-in-out 3, floatStar 2s ease-in-out infinite alternate;
  text-shadow: 0 0 10px gold, 0 0 14px #ff0;
  z-index: 10000;
  color: gold;
}
@keyframes starMergeFlashPulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; transform: scale(2); }
  100% { opacity: 0.7; transform: scale(1.5); }
}
@keyframes floatStar {
  0% { transform: translate(-50%, -50%) scale(1.5); }
  100% { transform: translate(-50%, -55%) scale(1.5); }
}
/* === Bổ sung loveExplosionRain – tim bay và mưa toàn khung === */
.tw-heart-center-float {
  position: absolute;
  font-size: 30px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: crimson;
  z-index: 10000;
}
.tw-heart-rain {
  position: absolute;
  animation: heartRainDrop 2.8s ease-in forwards;
  z-index: 9998;
  color: hotpink;
}
@keyframes heartRainDrop {
  0% { transform: translateY(-40px); opacity: 1; }
  100% { transform: translateY(320px); opacity: 0; }
}

/* =================== HIỆU ỨNG LIÊN TỤC =================== */

/* ⭐ Ngôi sao bay từ avatar */
.star-zoom-fly {
  position: fixed;
  font-size: 36px;
  z-index: 9999;
  transition: all 1.2s ease-out;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: none;
}

/* 💵💰 Tiền rơi tầng tầng lớp lớp */
.money-drop-piece {
  position: absolute;
  animation: moneyFallDrop 2.5s ease-in forwards;
  pointer-events: none;
  z-index: 9998;
}

@keyframes moneyFallDrop {
  0% { transform: translateY(0) rotate(0); opacity: 0.9; }
  100% { transform: translateY(420px) rotate(180deg); opacity: 0; }
}

/* 🌈 Cầu vồng phía trên */
.tw-money-rainbow {
  position: absolute;             /* ✅ theo container */
  top: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: linear-gradient(to right,
    rgba(255,0,0,0.22),
    rgba(255,165,0,0.22),
    rgba(255,255,0,0.22),
    rgba(0,255,0,0.22),
    rgba(0,191,255,0.22),
    rgba(138,43,226,0.22));
  backdrop-filter: blur(4px);
  z-index: 10;
  animation: rainbowFade 3s ease-in-out infinite alternate;
  pointer-events: none;
}


/* 💎 Diamond fly từ 4 góc */
.tw-diamond-fly {
  position: absolute;
  animation: diamondFly 2.5s ease-out forwards;
  pointer-events: none;
  z-index: 9999;
  color: #00f0ff;
  text-shadow: 0 0 4px rgba(0,255,255,0.6);
}

@keyframes diamondFly {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(1.2);
    opacity: 0;
  }
}

/* Rung khung */
.tw-effect-shake {
  animation: shakeBoom 0.6s ease-in-out;
}
@keyframes shakeBoom {
  0%, 100% { transform: translate(0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, 1px); }
}

/* Hiệu ứng khung: Rung, Lắc, Nhịp */

.tw-effect-shake {
  animation: shakeBoom 0.6s ease-in-out;
}
@keyframes shakeBoom {
  0%, 100% { transform: translate(0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, 1px); }
}

.tw-effect-tilt {
  animation: tiltSide 0.6s ease-in-out;
}
@keyframes tiltSide {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
  75% { transform: rotate(-1deg); }
  100% { transform: rotate(0deg); }
}

.tw-effect-pulse {
  animation: pulseFrame 1s ease-in-out;
}
@keyframes pulseFrame {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* === RUNG KHUNG CHO MỐC 20 (loveExplosionRain) === */
.tw-effect-bomb {
  animation: shakeBoom 0.6s ease-in-out;
}
/* CSS cho iconLove nhip nhip moi 5s */
.tw-love-button {
  transition: transform 0.4s ease-in-out;
}

