/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Comic Sans MS', cursive, sans-serif;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-x: hidden;
}

/* Animated background */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Main heading styles */
h1 {
  font-size: 4rem;
  color: #ff4757;
  text-align: center;
  text-shadow:
    3px 3px 0 #ffa502,
    6px 6px 0 #2ed573,
    9px 9px 0 #3742fa;
  margin-bottom: 2rem;
  animation: bounce 2s infinite, colorChange 3s infinite;
  transform-style: preserve-3d;
  perspective: 1000px;
}

/* Div text styles */
div {
  font-size: 2.5rem;
  color: #2f3542;
  background: linear-gradient(135deg, #fffa65, #ff9ff3);
  padding: 1.5rem 3rem;
  border-radius: 50px;
  text-align: center;
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.3),
    inset 0 -5px 15px rgba(255, 255, 255, 0.6),
    inset 0 5px 15px rgba(0, 0, 0, 0.1);
  animation: wiggle 3s ease-in-out infinite, glow 2s ease-in-out infinite alternate;
  border: 8px dashed #ff6b81;
  position: relative;
  overflow: hidden;
}

/* Pseudo-element for extra sparkle */
div::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shine 4s infinite;
}

/* Animations */
@keyframes bounce {

  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }

  50% {
    transform: translateY(-20px) rotate(2deg);
  }
}

@keyframes wiggle {

  0%,
  100% {
    transform: rotate(-3deg) scale(1);
  }

  25% {
    transform: rotate(3deg) scale(1.05);
  }

  50% {
    transform: rotate(-3deg) scale(1);
  }

  75% {
    transform: rotate(3deg) scale(1.05);
  }
}

@keyframes colorChange {
  0% {
    color: #ff4757;
  }

  25% {
    color: #ffa502;
  }

  50% {
    color: #2ed573;
  }

  75% {
    color: #3742fa;
  }

  100% {
    color: #ff4757;
  }
}

@keyframes glow {
  from {
    box-shadow:
      0 10px 20px rgba(0, 0, 0, 0.3),
      inset 0 -5px 15px rgba(255, 255, 255, 0.6),
      inset 0 5px 15px rgba(0, 0, 0, 0.1),
      0 0 20px #ff9ff3;
  }

  to {
    box-shadow:
      0 10px 20px rgba(0, 0, 0, 0.3),
      inset 0 -5px 15px rgba(255, 255, 255, 0.6),
      inset 0 5px 15px rgba(0, 0, 0, 0.1),
      0 0 40px #ff9ff3,
      0 0 60px #ff6b81;
  }
}

@keyframes shine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }

  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

/* Floating elements */
body::before,
body::after {
  content: '✨';
  position: fixed;
  font-size: 2rem;
  animation: float 6s ease-in-out infinite;
  z-index: -1;
}

body::before {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

body::after {
  bottom: 10%;
  right: 10%;
  animation-delay: 3s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

/* Responsive design */
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
    text-shadow:
      2px 2px 0 #ffa502,
      4px 4px 0 #2ed573;
  }

  div {
    font-size: 1.5rem;
    padding: 1rem 2rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  div {
    font-size: 1.2rem;
    padding: 0.8rem 1.5rem;
  }
}
