/* css/animations.css - Scale tilt animations, points pop, screen transitions */

/* Screen Transitions */
.screen {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.screen.active {
  opacity: 1;
  transform: scale(1);
}

/* Scale Tilt Animations */
.scale-image.tilt-left {
  animation: tilt-left-slight var(--transition-slow) ease-out forwards;
}

.scale-image.tilt-right {
  animation: tilt-right-slight var(--transition-slow) ease-out forwards;
}

.scale-image.tilt-heavy-left {
  animation: tilt-left-moderate var(--transition-slow) ease-out forwards;
}

.scale-image.tilt-heavy-right {
  animation: tilt-right-moderate var(--transition-slow) ease-out forwards;
}

.scale-image.tilt-extreme-left {
  animation: tilt-left-extreme var(--transition-slow) ease-out forwards;
}

.scale-image.tilt-extreme-right {
  animation: tilt-right-extreme var(--transition-slow) ease-out forwards;
}

@keyframes tilt-left-slight {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(-5deg);
  }
}

@keyframes tilt-right-slight {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(5deg);
  }
}

@keyframes tilt-left-moderate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(-15deg);
  }
}

@keyframes tilt-right-moderate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(15deg);
  }
}

@keyframes tilt-left-extreme {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(-45deg);
  }
}

@keyframes tilt-right-extreme {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(45deg);
  }
}

/* Points Pop Animation */
.points-pop {
  animation: points-pop var(--transition-slow) ease-out;
}

@keyframes points-pop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Button Hover Animations */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

/* Game Title Bounce */
@keyframes title-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.game-title {
  animation: title-bounce 3s ease-in-out infinite;
}

/* Fade In Animation */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fade-in var(--transition-base) ease-out;
}

/* Slide In From Bottom */
@keyframes slide-up {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-up {
  animation: slide-up var(--transition-base) ease-out;
}

/* Parchment Scroll Appear */
.parchment-scroll {
  animation: parchment-appear var(--transition-slow) ease-out;
}

@keyframes parchment-appear {
  0% {
    transform: scale(0.8) rotate(-5deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.05) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Modal Appear */
.modal-content {
  animation: modal-appear var(--transition-base) ease-out;
}

@keyframes modal-appear {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Ad Countdown Pulse */
#ad-countdown-number {
  animation: countdown-pulse 1s ease-in-out infinite;
}

@keyframes countdown-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

/* Item Icon Appear */
.item-icon {
  animation: icon-appear var(--transition-base) ease-out;
}

@keyframes icon-appear {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Shake Animation (for errors) */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

.input-error:not(:empty) {
  animation: shake 0.5s ease-in-out;
}

.guess-input:invalid {
  animation: shake 0.5s ease-in-out;
}

/* Streak Indicator Pulse */
.streak-indicator {
  animation: streak-pulse 2s ease-in-out infinite;
}

@keyframes streak-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Loading Spinner */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

