/* ============================================
   RAINBOW MODE STYLES 🌈
   Full site transformation when unlocked
   ============================================ */

/* ===== Rainbow Background ===== */
body.rainbow-mode {
  background: linear-gradient(
    135deg,
    #ED2B2A 0%,
    #F37934 16%,
    #FCEF50 33%,
    #54B345 50%,
    #1388D3 66%,
    #642D91 83%,
    #A90A5F 100%
  ) !important;
  background-size: 400% 400% !important;
  animation: rainbow-bg-shift 8s ease infinite !important;
}

@keyframes rainbow-bg-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== Speed up all animations ===== */
body.rainbow-mode .animate-float-slow,
body.rainbow-mode .animate-float-fast,
body.rainbow-mode .animate-float {
  animation-duration: 1.5s !important;
}

body.rainbow-mode .animate-spin-slow {
  animation-duration: 3s !important;
}

body.rainbow-mode .animate-wiggle {
  animation-duration: 0.4s !important;
}

body.rainbow-mode .banner-wiggle {
  /* Combine BOTH the rainbow border animation AND the fast wiggle animation! */
  animation: 
    border-rainbow 3s linear infinite,
    wiggle-anim 0.4s ease-in-out infinite !important;
  /* Keep the border rainbow running, but pause the wiggle! */
  animation-play-state: running, paused !important;
}

body.rainbow-mode .group:hover .banner-wiggle {
  /* When hovered, let BOTH animations run! */
  animation-play-state: running, running !important;
}

/* ===== Rainbow text glow ===== */
body.rainbow-mode h1,
body.rainbow-mode h2,
body.rainbow-mode h3 {
  text-shadow: 
    0 0 10px rgba(255, 255, 255, 0.8),
    0 0 20px rgba(255, 255, 255, 0.6),
    0 0 40px rgba(255, 255, 255, 0.4) !important;
}

/* ===== Extra sparkle on cards ===== */
body.rainbow-mode .group {
  position: relative;
  overflow: visible !important;
}

body.rainbow-mode .group::after {
  content: '✨';
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 1.5rem;
  animation: sparkle-bounce 1s ease-in-out infinite;
}

@keyframes sparkle-bounce {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.3) rotate(20deg); }
}

/* ===== Rainbow border pulse ===== */
body.rainbow-mode .border-8 {
  border-color: rgba(255, 255, 255, 0.9) !important;
  animation: border-rainbow 3s linear infinite;
}

@keyframes border-rainbow {
  0% { border-color: #ED2B2A; }
  16% { border-color: #F37934; }
  33% { border-color: #FCEF50; }
  50% { border-color: #54B345; }
  66% { border-color: #1388D3; }
  83% { border-color: #642D91; }
  100% { border-color: #ED2B2A; }
}

/* ===== Secret Rainbow Message ===== */
.rainbow-secret-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: white;
  border: 8px solid;
  border-image: linear-gradient(90deg, #ED2B2A, #F37934, #FCEF50, #54B345, #1388D3, #642D91) 1;
  border-radius: 2rem;
  padding: 2.5rem;
  max-width: 500px;
  text-align: center;
  z-index: 10001;
  box-shadow: 0 0 80px rgba(255, 255, 255, 0.8);
  transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.rainbow-secret-message.show {
  transform: translate(-50%, -50%) scale(1);
}

.rainbow-secret-message h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 2rem;
  background: linear-gradient(90deg, #ED2B2A, #F37934, #FCEF50, #54B345, #1388D3, #642D91);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.rainbow-secret-message p {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.2rem;
  color: #1388D3;
}

/* ===== Confetti burst ===== */
@keyframes confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.confetti-piece {
  position: fixed;
  width: 12px;
  height: 12px;
  z-index: 9999;
  pointer-events: none;
  animation: confetti-fall 3s ease-in forwards;
}
