* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  height: 100vh;
  font-family: "Julius Sans One", "Segoe UI", sans-serif;
  text-align: center;
  color: #4a90a4;
  background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.animation-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  opacity: 0;
  animation: fadeIn 0.8s ease-in forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.cat {
  display: flex;
  align-items: center;
  position: relative;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Redesigned cat body to match reference - smooth oval shape */
.cat-body {
  width: 150px;
  height: 90px;
  background: #000;
  border-radius: 45% 70% 70% 45%;
  position: relative;
  animation: breathe 2s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

/* Redesigned ears to be more integrated and natural, not hat-like */
.ear-left,
.ear-right {
  position: absolute;
  width: 20px;
  height: 20px;
  background: #000;
  top: 5px;
}

.ear-left {
  right: 30px;
  border-radius: 40% 80% 0 0;
  transform: rotate(-20deg);
}

.ear-right {
  right: 10px;
  border-radius: 80% 40% 0 0;
  transform: rotate(20deg);
}

.eye {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  top: 30px;
  animation: blink 4s ease-in-out infinite;
}

@keyframes blink {
  0%,
  96%,
  100% {
    transform: scaleY(1);
  }
  98% {
    transform: scaleY(0.1);
  }
}

.eye-left {
  right: 55px;
}

.eye-right {
  right: 28px;
}

.cat-tail {
  position: absolute;
  left: -20px;
  bottom: 12px;
  width: 45px;
  height: 18px;
  background: #000;
  border-radius: 20px 0 0 20px;
  animation: wagTail 1.5s ease-in-out infinite;
  transform-origin: right center;
}

@keyframes wagTail {
  0%,
  100% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

/* Repositioned paw to start completely inside the cat body */
.paw {
  position: absolute;
  right: 15px;
  bottom: 18px;
  width: 0px;
  height: 20px;
  background: #000;
  border-radius: 0 8px 8px 0;
  animation: pushPaw 4s ease-in-out 1s infinite;
  transform-origin: left center;
  z-index: 10;
}

@keyframes pushPaw {
  0%,
  100% {
    width: 0px;
    right: 15px;
  }
  20%,
  25% {
    width: 60px;
    right: -45px;
  }
  45% {
    width: 0px;
    right: 15px;
  }
}

.text {
  font-size: 48px;
  font-weight: 300;
  color: #4a90a4;
  animation: slideIn 1s ease-out 0.5s both, textPush 4s ease-in-out 1s infinite;
  letter-spacing: 2px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Added falling animation to text after being pushed */
@keyframes textPush {
  0%,
  100% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  20%,
  25% {
    transform: translateX(50px) translateY(0) rotate(0deg);
  }
  30% {
    transform: translateX(50px) translateY(5px) rotate(3deg);
  }
  35% {
    transform: translateX(50px) translateY(80px) rotate(8deg);
    opacity: 0.3;
  }
  45% {
    transform: translateX(0) translateY(0) rotate(0deg);
    opacity: 1;
  }
}

.restart {
  padding: 12px 30px;
  font-size: 16px;
  font-family: "Segoe UI", sans-serif;
  background: #4a90a4;
  color: #fff;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(74, 144, 164, 0.3);
  opacity: 0;
  animation: fadeInButton 0.5s ease-in 1.5s forwards;
}

@keyframes fadeInButton {
  to {
    opacity: 1;
  }
}

.restart:hover {
  background: #3a7a8a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 144, 164, 0.4);
}

.restart:active {
  transform: translateY(0);
}

/* Invisible class for restart animation */
.animation-wrapper.invisible {
  animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}
