.game-toast {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.55rem);
  transition: opacity 420ms ease, transform 420ms ease;
}

.game-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.combat-stage {
  position: relative;
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: space-between;
  margin: 1.25rem 0 0.45rem;
  padding: 0.8rem 2.2rem;
  overflow: hidden;
  border: 1px solid rgba(101, 64, 25, 0.25);
  background: radial-gradient(circle at center, rgba(174, 102, 45, 0.11), rgba(74, 46, 21, 0.04));
}

.combatant {
  position: relative;
  display: grid;
  width: 95px;
  place-items: center;
  color: #67431e;
  font-family: var(--display);
  font-size: 0.51rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.unit-mark {
  position: relative;
  display: block;
  width: 42px;
  height: 56px;
  margin-bottom: 0.42rem;
}

.player-unit .unit-mark::before,
.enemy-unit .unit-mark::before {
  position: absolute;
  top: 4px;
  left: 12px;
  width: 19px;
  height: 19px;
  content: "";
  border-radius: 50% 50% 42% 42%;
  background: #655141;
}

.player-unit .unit-mark::after,
.enemy-unit .unit-mark::after {
  position: absolute;
  bottom: 0;
  left: 5px;
  width: 34px;
  height: 33px;
  content: "";
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #345476;
}

.enemy-unit .unit-mark::before {
  background: #4b241f;
}

.enemy-unit .unit-mark::after {
  background: #7e372d;
}

.clash-flash {
  position: absolute;
  top: 48%;
  left: 50%;
  width: 46px;
  height: 46px;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(45deg) scale(0);
  background: radial-gradient(circle, #f7dc8b 0 17%, rgba(233, 148, 53, 0.8) 18% 36%, transparent 38%);
}

.combat-stage.player-attacks .player-unit {
  animation: unit-lunge 330ms ease-out;
}

.combat-stage.enemy-attacks .enemy-unit {
  animation: enemy-lunge 330ms ease-out;
}

.combat-stage.player-attacks .clash-flash,
.combat-stage.enemy-attacks .clash-flash {
  animation: clash 350ms ease-out;
}

.combat-stage.guard-action .player-unit .unit-mark {
  filter: drop-shadow(0 0 9px rgba(218, 180, 82, 0.9));
  animation: shield-brace 360ms ease-out;
}

.combatant.is-hit {
  animation: hit-shake 360ms ease-out;
}

.combatant.is-hit .unit-mark {
  filter: brightness(1.55) sepia(1) hue-rotate(-35deg) saturate(3);
}

.combat-stage.victory .enemy-unit {
  opacity: 0.32;
  filter: grayscale(1);
  transform: translateY(12px);
  transition: opacity 420ms ease, transform 420ms ease, filter 420ms ease;
}

.combat-stage.defeat .player-unit {
  opacity: 0.34;
  filter: grayscale(1);
  transform: translateY(12px);
  transition: opacity 420ms ease, transform 420ms ease, filter 420ms ease;
}

.damage-float {
  position: absolute;
  top: -0.6rem;
  left: 50%;
  z-index: 2;
  color: #a53225;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
  transform: translateX(-50%);
  animation: float-damage 680ms ease-out forwards;
}

.damage-float.blocked {
  color: #806226;
}

@keyframes unit-lunge {
  0% { transform: translateX(0); }
  38% { transform: translateX(32px) scale(1.08); }
  100% { transform: translateX(0); }
}

@keyframes enemy-lunge {
  0% { transform: translateX(0); }
  38% { transform: translateX(-32px) scale(1.08); }
  100% { transform: translateX(0); }
}

@keyframes clash {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(45deg) scale(0); }
  35% { opacity: 1; transform: translate(-50%, -50%) rotate(45deg) scale(1.4); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(105deg) scale(1.9); }
}

@keyframes hit-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  45% { transform: translateX(7px); }
  68% { transform: translateX(-4px); }
}

@keyframes shield-brace {
  0% { transform: scale(1); }
  45% { transform: scale(1.13); }
  100% { transform: scale(1); }
}

@keyframes float-damage {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.86); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -30px) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  .game-toast {
    transition-duration: 0.01ms;
  }

  .combat-stage.player-attacks .player-unit,
  .combat-stage.enemy-attacks .enemy-unit,
  .combat-stage.player-attacks .clash-flash,
  .combat-stage.enemy-attacks .clash-flash,
  .combat-stage.guard-action .player-unit .unit-mark,
  .combatant.is-hit,
  .damage-float {
    animation-duration: 0.01ms;
  }
}
