.screen.is-entering {
  animation: screen-enter 360ms ease both;
}

.petals {
  position: fixed;
  z-index: 95;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.petals i {
  position: absolute;
  top: -5%;
  width: 9px;
  height: 15px;
  border-radius: 80% 0 80% 0;
  background: rgba(241, 142, 155, 0.45);
  animation: petal-fall linear infinite;
}

.petals i:nth-child(1) { left: 7%; animation-duration: 13s; animation-delay: -4s; }
.petals i:nth-child(2) { left: 19%; animation-duration: 17s; animation-delay: -10s; transform: scale(0.7); }
.petals i:nth-child(3) { left: 37%; animation-duration: 12s; animation-delay: -2s; }
.petals i:nth-child(4) { left: 55%; animation-duration: 19s; animation-delay: -12s; transform: scale(0.6); }
.petals i:nth-child(5) { left: 68%; animation-duration: 14s; animation-delay: -7s; }
.petals i:nth-child(6) { left: 79%; animation-duration: 16s; animation-delay: -13s; transform: scale(0.75); }
.petals i:nth-child(7) { left: 89%; animation-duration: 11s; animation-delay: -3s; }
.petals i:nth-child(8) { left: 96%; animation-duration: 18s; animation-delay: -9s; transform: scale(0.55); }

.character-speaker.is-speaking:not(.is-enemy-hit) img {
  animation: character-speaking 430ms ease-in-out infinite alternate;
}

.character-single-slot.is-enemy-hit img,
.character-single-slot img.is-enemy-hit,
.character-dual-slot.is-right.is-enemy-hit img,
.character-dual-slot.is-right img.is-enemy-hit,
.battle-character-wrap img.is-enemy-hit {
  animation: enemy-hit-inplace 480ms ease-in-out !important;
}

.character-dual-slot.is-left.is-enemy-hit img,
.character-dual-slot.is-left img.is-enemy-hit {
  animation: enemy-hit-mirror 480ms ease-in-out !important;
}

.damage-number.is-active,
.is-enemy-hit .damage-number {
  animation: damage-pop 760ms ease-out;
}

.app-shell.is-player-hit,
.battle-arena.is-player-hit,
.screen-stack.is-player-hit,
.qte-overlay.is-player-hit,
.player-hud.is-player-hit {
  animation: screen-shake 620ms cubic-bezier(0.36, 0.07, 0.19, 0.97) !important;
}

.battle-arena.is-player-hit::after {
  content: "";
  position: absolute;
  z-index: 62;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(239, 83, 101, 0.35), rgba(123, 9, 25, 0.12) 45%, transparent 72%);
  animation: player-hit-flash 470ms ease-out both;
}

.battle-arena.is-morphing::after {
  content: "";
  position: absolute;
  z-index: 58;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 27% 54%, rgba(105, 200, 238, 0.56), transparent 34%);
  animation: morph-flash 430ms ease-out both;
}

.battle-arena.is-healing::after {
  content: "";
  position: absolute;
  z-index: 58;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 78% 78%, rgba(97, 169, 133, 0.3), transparent 30%);
  animation: morph-flash 600ms ease-out both;
}

.round-oracle.is-revealing {
  animation: reveal-card 320ms ease;
}

.hand-versus strong.is-fist-shaking {
  animation: fist-shake 420ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.round-countdown.is-beat {
  animation: countdown-beat 400ms ease-out;
}

@keyframes fist-shake {
  0% { transform: scale(1) translateY(0) rotate(0deg); }
  20% { transform: scale(1.35) translateY(-14px) rotate(-14deg); filter: drop-shadow(0 0 14px rgba(239, 83, 101, 0.8)); }
  45% { transform: scale(1.22) translateY(8px) rotate(10deg); }
  65% { transform: scale(1.18) translateY(-5px) rotate(-5deg); }
  85% { transform: scale(1.06) translateY(2px) rotate(2deg); }
  100% { transform: scale(1) translateY(0) rotate(0deg); }
}

@keyframes countdown-beat {
  0% { transform: translateY(-50%) scale(1); }
  30% { transform: translateY(-50%) scale(1.22); box-shadow: 0 0 0 2px var(--gold), 0 0 26px rgba(239, 83, 101, 0.6); }
  100% { transform: translateY(-50%) scale(1); }
}

@keyframes screen-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes petal-fall {
  0% { translate: 0 -10vh; rotate: 0deg; opacity: 0; }
  8% { opacity: 0.65; }
  45% { translate: 45px 48vh; rotate: 270deg; }
  100% { translate: -22px 108vh; rotate: 620deg; opacity: 0; }
}

@keyframes character-speaking {
  from { transform: translateY(0) rotate(-0.15deg); }
  to { transform: translateY(-5px) rotate(0.18deg); }
}

@keyframes enemy-hit-inplace {
  0%, 100% { transform: none; filter: drop-shadow(-10px 19px 27px rgba(0, 0, 0, 0.58)); }
  12% { transform: translate3d(-7px, -2px, 0); filter: brightness(2.2) drop-shadow(0 0 25px rgba(239, 83, 101, 0.95)); }
  25% { transform: translate3d(7px, 2px, 0); filter: brightness(1.8) drop-shadow(0 0 18px rgba(239, 83, 101, 0.8)); }
  45% { transform: translate3d(-5px, 0, 0); filter: brightness(1.5); }
  65% { transform: translate3d(5px, 0, 0); filter: brightness(1.2); }
  85% { transform: translate3d(-2px, 0, 0); filter: brightness(1.1); }
}

@keyframes enemy-hit-mirror {
  0%, 100% { transform: scaleX(-1); filter: drop-shadow(-10px 19px 27px rgba(0, 0, 0, 0.58)); }
  12% { transform: scaleX(-1) translate3d(-7px, -2px, 0); filter: brightness(2.2) drop-shadow(0 0 25px rgba(239, 83, 101, 0.95)); }
  25% { transform: scaleX(-1) translate3d(7px, 2px, 0); filter: brightness(1.8) drop-shadow(0 0 18px rgba(239, 83, 101, 0.8)); }
  45% { transform: scaleX(-1) translate3d(-5px, 0, 0); filter: brightness(1.5); }
  65% { transform: scaleX(-1) translate3d(5px, 0, 0); filter: brightness(1.2); }
  85% { transform: scaleX(-1) translate3d(-2px, 0, 0); filter: brightness(1.1); }
}

@keyframes damage-pop {
  0% { opacity: 0; transform: translateY(20px) scale(0.6); }
  18% { opacity: 1; transform: translateY(0) scale(1.2); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-52px) scale(0.9); }
}

@keyframes screen-shake {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  10% { transform: translate3d(-32px, 16px, 0) rotate(-1.8deg); }
  22% { transform: translate3d(30px, -18px, 0) rotate(1.6deg); }
  34% { transform: translate3d(-24px, -12px, 0) rotate(-1.2deg); }
  47% { transform: translate3d(20px, 14px, 0) rotate(0.9deg); }
  61% { transform: translate3d(-15px, 8px, 0) rotate(-0.6deg); }
  76% { transform: translate3d(10px, -5px, 0) rotate(0.3deg); }
  88% { transform: translate3d(-5px, 2px, 0) rotate(-0.1deg); }
}

@keyframes player-hit-flash {
  0% { opacity: 0; }
  22% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes morph-flash {
  from { opacity: 0; transform: scale(0.86); }
  28% { opacity: 1; }
  to { opacity: 0; transform: scale(1.12); }
}

@keyframes reveal-card {
  0% { filter: brightness(1); }
  40% { filter: brightness(1.9); transform: scale(1.025); }
  100% { filter: brightness(1); transform: scale(1); }
}

@keyframes skill-ready {
  from { box-shadow: 0 0 8px rgba(105, 200, 238, 0.28); }
  to { box-shadow: 0 0 25px rgba(105, 200, 238, 0.72); }
}

@keyframes dialogue-caret {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(3px); }
}

@keyframes qte-wrong {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  50% { transform: translateX(9px); }
  75% { transform: translateX(-5px); }
}

@keyframes warning-emoji-pulse {
  0% { transform: translate(-50%, -50%) scale(1); filter: drop-shadow(0 0 35px rgba(239, 83, 101, 0.85)) drop-shadow(0 10px 20px rgba(0, 0, 0, 0.8)); }
  100% { transform: translate(-50%, -50%) scale(1.15); filter: drop-shadow(0 0 55px rgba(239, 83, 101, 1)) drop-shadow(0 14px 28px rgba(0, 0, 0, 0.9)); }
}

@keyframes strike-marker {
  0% { left: 0; }
  50% { left: calc(100% - 3px); }
  100% { left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .petals i {
    animation: none !important;
  }
}
