/* Seasonal dynamic FX layer — pointer-events: none, does not block clicks */

.xtw-season-fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}

/* ── Shared particles ── */
.xtw-fx-petal,
.xtw-fx-confetti,
.xtw-fx-star-particle,
.xtw-fx-firework-dot {
  position: absolute;
  top: -20px;
  pointer-events: none;
}

@keyframes xtw-fall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 0.85; }
  100% { transform: translateY(105vh) rotate(360deg); opacity: 0; }
}

@keyframes xtw-twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes xtw-swing {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}

@keyframes xtw-wave-flag {
  0%, 100% { transform: skewY(-3deg) scaleX(1); }
  50% { transform: skewY(3deg) scaleX(1.02); }
}

@keyframes xtw-moon-glow {
  0%, 100% { box-shadow: 0 0 30px 12px rgba(255, 193, 7, 0.45), 0 0 60px 24px rgba(255, 193, 7, 0.15); }
  50% { box-shadow: 0 0 45px 18px rgba(255, 213, 79, 0.65), 0 0 80px 30px rgba(255, 193, 7, 0.25); }
}

@keyframes xtw-cloud-drift {
  0% { transform: translateX(-120%); opacity: 0.5; }
  100% { transform: translateX(120vw); opacity: 0.7; }
}

@keyframes xtw-lantern-rise {
  0% { transform: translateY(20vh) translateX(0); opacity: 0; }
  15% { opacity: 0.9; }
  100% { transform: translateY(-110vh) translateX(20px); opacity: 0; }
}

@keyframes xtw-firework-burst {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

@keyframes xtw-ribbon-shine {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ── Spring Festival 春节 ── */
.xtw-fx-spring .xtw-fx-banner {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #ffd700;
  background: linear-gradient(90deg, #8b0000, #c62828, #8b0000);
  background-size: 200% 100%;
  animation: xtw-ribbon-shine 3s linear infinite;
  border: 1px solid #ffd700;
  box-shadow: 0 4px 16px rgba(139, 0, 0, 0.35);
  white-space: nowrap;
  font-family: "Microsoft YaHei", serif;
}

.xtw-fx-spring .xtw-fx-fu {
  position: absolute;
  font-size: 42px;
  color: #ffd700;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.8), 2px 2px 0 #c62828;
  font-family: "KaiTi", "STKaiti", serif;
  font-weight: 700;
  opacity: 0.35;
  animation: xtw-swing 4s ease-in-out infinite;
}

.xtw-fx-spring .xtw-fx-fu--1 { top: 18%; left: 8%; animation-delay: 0s; }
.xtw-fx-spring .xtw-fx-fu--2 { top: 22%; right: 10%; animation-delay: 1.2s; font-size: 36px; }

.xtw-fx-spring .xtw-fx-lantern {
  position: absolute;
  bottom: -60px;
  font-size: 36px;
  filter: drop-shadow(0 0 8px rgba(255, 100, 50, 0.6));
  animation: xtw-lantern-rise 12s linear infinite;
}

.xtw-fx-spring .xtw-fx-confetti {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: xtw-fall linear infinite;
}

.xtw-fx-spring .xtw-fx-firework {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffd700;
  animation: xtw-firework-burst 1.8s ease-out infinite;
}

/* ── Mid-Autumn 中秋 ── */
.xtw-fx-mid-autumn .xtw-fx-moon {
  position: absolute;
  top: 56px;
  right: 12%;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffde7 0%, #ffc107 45%, #ff8f00 100%);
  animation: xtw-moon-glow 4s ease-in-out infinite;
}

.xtw-fx-mid-autumn .xtw-fx-moon::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 143, 0, 0.25);
  top: 18px;
  left: 22px;
  box-shadow: 18px 8px 0 -2px rgba(255, 143, 0, 0.2), 8px 22px 0 -3px rgba(255, 143, 0, 0.15);
}

.xtw-fx-mid-autumn .xtw-fx-banner {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #ffc107;
  background: linear-gradient(90deg, #1a237e, #3949ab, #1a237e);
  background-size: 200% 100%;
  animation: xtw-ribbon-shine 4s linear infinite;
  border: 1px solid rgba(255, 193, 7, 0.6);
  font-family: "Microsoft YaHei", serif;
}

.xtw-fx-mid-autumn .xtw-fx-rabbit {
  position: absolute;
  top: 130px;
  right: 11%;
  font-size: 28px;
  animation: xtw-swing 5s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(255, 193, 7, 0.5));
}

.xtw-fx-mid-autumn .xtw-fx-cloud {
  position: absolute;
  top: 80px;
  width: 80px;
  height: 28px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 50px;
  filter: blur(1px);
  animation: xtw-cloud-drift 25s linear infinite;
}

.xtw-fx-mid-autumn .xtw-fx-cloud::before,
.xtw-fx-mid-autumn .xtw-fx-cloud::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 50%;
}

.xtw-fx-mid-autumn .xtw-fx-cloud::before { width: 36px; height: 36px; top: -16px; left: 12px; }
.xtw-fx-mid-autumn .xtw-fx-cloud::after { width: 28px; height: 28px; top: -10px; left: 40px; }

.xtw-fx-mid-autumn .xtw-fx-cloud--2 {
  top: 120px;
  width: 60px;
  opacity: 0.6;
  animation-duration: 35s;
  animation-delay: -10s;
}

.xtw-fx-mid-autumn .xtw-fx-star {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px #ffc107;
  animation: xtw-twinkle 2s ease-in-out infinite;
}

.xtw-fx-mid-autumn .xtw-fx-petal {
  width: 10px;
  height: 10px;
  background: radial-gradient(circle, #ffc107 30%, #ffb300 100%);
  border-radius: 50% 0 50% 50%;
  animation: xtw-fall linear infinite;
  opacity: 0.75;
}

/* ── National Day 国庆 ── */
.xtw-fx-national .xtw-fx-banner {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #ffcc00;
  background: linear-gradient(90deg, #de2910, #e53935, #de2910);
  background-size: 200% 100%;
  animation: xtw-ribbon-shine 2.5s linear infinite;
  border: 1px solid #ffcc00;
  font-family: "Microsoft YaHei", serif;
  box-shadow: 0 4px 14px rgba(222, 41, 16, 0.35);
}

.xtw-fx-national .xtw-fx-flag {
  position: absolute;
  top: 70px;
  width: 48px;
  height: 32px;
  animation: xtw-wave-flag 2s ease-in-out infinite;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.25);
}

.xtw-fx-national .xtw-fx-flag::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #de2910;
}

.xtw-fx-national .xtw-fx-flag::after {
  content: "★";
  position: absolute;
  top: 2px;
  left: 4px;
  color: #ffcc00;
  font-size: 14px;
  line-height: 1;
  text-shadow: 0 0 4px rgba(255, 204, 0, 0.8);
}

.xtw-fx-national .xtw-fx-flag--left { left: 6%; transform-origin: left center; }
.xtw-fx-national .xtw-fx-flag--right { right: 6%; transform-origin: right center; animation-delay: 0.5s; }

.xtw-fx-national .xtw-fx-star-big {
  position: absolute;
  color: #ffcc00;
  font-size: 22px;
  opacity: 0.5;
  animation: xtw-twinkle 2.5s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(255, 204, 0, 0.8);
}

.xtw-fx-national .xtw-fx-star-big--1 { top: 15%; left: 20%; }
.xtw-fx-national .xtw-fx-star-big--2 { top: 12%; right: 22%; animation-delay: 0.8s; font-size: 16px; }
.xtw-fx-national .xtw-fx-star-big--3 { top: 25%; left: 45%; animation-delay: 1.5s; font-size: 14px; }

.xtw-fx-national .xtw-fx-confetti {
  width: 7px;
  height: 7px;
  animation: xtw-fall linear infinite;
}

.xtw-fx-national .xtw-fx-confetti--red { background: #de2910; border-radius: 1px; }
.xtw-fx-national .xtw-fx-confetti--gold { background: #ffcc00; border-radius: 50%; }

.xtw-fx-national .xtw-fx-pigeon {
  position: absolute;
  top: 100px;
  font-size: 24px;
  animation: xtw-cloud-drift 18s linear infinite;
  opacity: 0.7;
}

@media (max-width: 500px) {
  .xtw-fx-mid-autumn .xtw-fx-moon {
    width: 48px;
    height: 48px;
    top: 52px;
    right: 8%;
  }
  .xtw-fx-spring .xtw-fx-fu { font-size: 28px; }
  .xtw-fx-national .xtw-fx-flag { width: 36px; height: 24px; top: 58px; }
  .xtw-fx-spring .xtw-fx-banner,
  .xtw-fx-mid-autumn .xtw-fx-banner,
  .xtw-fx-national .xtw-fx-banner {
    font-size: 11px;
    padding: 5px 14px;
    top: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xtw-season-fx * {
    animation: none !important;
  }
}
