/* Save Animation */
.save-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(98, 0, 238, 0.1);
  pointer-events: none;
  opacity: 0;
  z-index: 999;
  animation: save-flash 0.7s ease-out forwards;
}

@keyframes save-flash {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 0.5;
  }
  100% {
    opacity: 0;
  }
}

/* Reshuffle Animation */
.reshuffle-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}

.reshuffle-container.show {
  opacity: 1;
  pointer-events: auto;
}

.reshuffle-animation {
  width: 100px;
  height: 100px;
  margin-bottom: 20px;
  position: relative;
}

.reshuffle-card {
  position: absolute;
  width: 60px;
  height: 80px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transform-origin: center bottom;
}

.reshuffle-card:nth-child(1) {
  animation: card-shuffle-1 2s infinite;
  z-index: 3;
}

.reshuffle-card:nth-child(2) {
  animation: card-shuffle-2 2s infinite;
  z-index: 2;
}

.reshuffle-card:nth-child(3) {
  animation: card-shuffle-3 2s infinite;
  z-index: 1;
}

@keyframes card-shuffle-1 {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  25% {
    transform: translateX(-30px) rotate(-15deg);
  }
  50% {
    transform: translateX(0) rotate(0deg);
  }
  75% {
    transform: translateX(30px) rotate(15deg);
  }
}

@keyframes card-shuffle-2 {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  25% {
    transform: translateX(30px) rotate(15deg);
  }
  50% {
    transform: translateX(0) rotate(0deg);
  }
  75% {
    transform: translateX(-30px) rotate(-15deg);
  }
}

@keyframes card-shuffle-3 {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

.reshuffle-text {
  font-size: 18px;
  color: var(--accent-color);
  margin-bottom: 10px;
  user-select: none;
}

/* App Logo Animation */
.app-logo {
  position: absolute;
  opacity: 0.2;
  transform: translate(-7px, -130px);
  animation: fadeIn 0.7s ease forwards, rotateInitial 0.7s ease-out forwards,
    rotate 23s linear infinite 0.7s;
}

/* Fade in animation */
@keyframes fadeIn {
  0% {
    opacity: 0.01;
  }
  100% {
    opacity: 0.2;
  }
}

/* Initial faster rotation */
@keyframes rotateInitial {
  0% {
    transform: translate(-7px, -170px) rotate(0deg);
  }
  100% {
    transform: translate(-7px, -130px) rotate(90deg);
  }
}

/* Continuous rotation animation */
@keyframes rotate {
  0% {
    transform: translate(-7px, -130px) rotate(90deg);
  }
  100% {
    transform: translate(-7px, -130px) rotate(450deg);
  }
}
