@keyframes fadeIn {
  from { opacity: 0; transform: translateY(var(--fade-slide, 20px)); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

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

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Confetti */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall 2.5s ease-out forwards;
}

/* Caught overlay */
.caught-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn .3s;
}

.caught-msg {
  text-align: center;
  animation: bounceIn .5s ease;
}

.caught-msg .poke-sprite {
  width: 160px;
  height: 160px;
  image-rendering: pixelated;
  animation: bounce 1s infinite;
}

.caught-msg h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--accent);
  margin-top: 12px;
}

.caught-stars {
  font-size: var(--text-md);
  font-weight: var(--weight-light);
  color: var(--accent);
  margin-top: 8px;
  opacity: .9;
}

.flying-star {
  position: fixed;
  font-size: var(--text-lg);
  z-index: 1000;
  pointer-events: none;
  transition: transform .6s cubic-bezier(.2,.8,.3,1), opacity .6s ease;
  filter: drop-shadow(0 0 6px rgba(var(--accent-rgb),.8));
  will-change: transform, opacity;
}

@keyframes starBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.6); }
  100% { transform: scale(1); }
}

.star-bump {
  animation: starBump .35s ease;
}

/* Evolution animation */
@keyframes evoPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.15); filter: brightness(2); }
}

@keyframes evoGlow {
  0% { opacity: 0; }
  30% { opacity: .6; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes evoSlideUp {
  0% { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes evoSparkle {
  0% { transform: scale(0) rotate(0deg); opacity: 1; }
  100% { transform: scale(1.5) rotate(180deg); opacity: 0; }
}

.evo-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: radial-gradient(ellipse at center, var(--bg-deep) 0%, #000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .5s ease;
}

.evo-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.evo-sprites {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.evo-from,
.evo-to {
  position: absolute;
  width: 180px;
  height: 180px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 20px rgba(255,255,255,.3));
}

.evo-from {
  opacity: 1;
  animation: evoPulse 1.2s ease infinite;
  transition: opacity .6s ease, filter .6s ease;
}

.evo-to {
  opacity: 0;
  transform: scale(1);
  transition: opacity .8s ease, transform .8s cubic-bezier(.17,.67,.29,1.3);
}

.evo-flash {
  position: fixed;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}

.evo-overlay.evo-phase2 .evo-from {
  animation: evoPulse .4s ease infinite;
  filter: brightness(3) drop-shadow(0 0 40px rgba(255,255,255,.8));
}

.evo-overlay.evo-phase3 .evo-flash {
  animation: evoGlow .8s ease forwards;
}

.evo-overlay.evo-phase3 .evo-from {
  opacity: 0;
  filter: brightness(5);
}

.evo-overlay.evo-phase3 .evo-to {
  opacity: 1;
  transform: scale(1);
  animation: bounce 1.5s ease infinite;
  filter: drop-shadow(0 0 30px rgba(var(--accent-rgb),.6));
}

.evo-skip {
  margin-top: 2rem;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .7);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 2rem;
  padding: .5rem 1.25rem;
  font-size: .85rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background .2s, color .2s;
  z-index: 1001;
}

.evo-skip:hover {
  background: rgba(255, 255, 255, .25);
  color: #fff;
}

