.damage-feed {
  position: fixed;
  z-index: 1450;
  inset: max(68px, env(safe-area-inset-top)) auto auto max(12px, env(safe-area-inset-left));
  display: grid;
  gap: 5px;
  width: min(330px, calc(100vw - 24px));
  pointer-events: none;
}

.damage-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1px 9px;
  align-items: center;
  padding: 6px 9px 6px 10px;
  border: 1px solid #e57969;
  border-inline-start: 3px solid #ff977e;
  border-radius: 8px;
  color: #fff1df;
  background: #351c30;
  box-shadow: 0 3px 12px #10061399;
  animation: damage-notice-in 170ms ease-out both;
}

.damage-notice-people {
  align-self: center;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.damage-notice-source { color: #ffe3aa; }
.damage-notice-target { color: #ffd2c9; }

.damage-notice-amount {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: #ffb39e;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.damage-notice-cause {
  grid-column: 1;
  color: #ecb8b2;
  font-size: 11px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.damage-hit {
  position: absolute;
  z-index: 5;
  inset: -3px;
  border: 3px solid #ff735c;
  border-radius: inherit;
  background: radial-gradient(ellipse at 68% 42%, #ff784038, #c5212440 76%);
  box-shadow: 0 0 6px #ffbc83, 0 0 22px #ff4538df, inset 0 0 14px #ff472eac;
  pointer-events: none;
  animation: damage-hit-fade 1.7s ease-out var(--damage-hit-delay, 0ms) both;
}

.is-damage-source .avatar-box {
  outline: 2px solid #ffe29a;
  outline-offset: 2px;
  box-shadow: 0 0 13px #ffbf557a;
}

.damage-visuals {
  position: fixed;
  z-index: 1440;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.damage-visuals [hidden] { display: none; }

.damage-impact {
  display: grid;
  place-items: center;
  position: absolute;
  z-index: 1;
  min-width: 1.65em;
  padding: .08em .24em .13em;
  border: 2px solid #ffbea1;
  border-radius: 11px;
  color: #fff4d8;
  background: linear-gradient(165deg, #9d2928, #571220 63%, #330a18);
  box-shadow: 0 0 0 2px #4e0a1a, 0 0 20px #ff502eac, 0 5px 8px #170514b3;
  font: 950 clamp(28px, 5vw, 46px)/1 system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 2px #53101c;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  animation: damage-impact-pop 1.7s cubic-bezier(.15,.55,.3,1) both;
}

.damage-flight {
  position: absolute;
  height: 4px;
  margin-top: -2px;
  border-radius: 999px;
  transform-origin: left center;
  background: linear-gradient(90deg, #ffc35f, #ffeac0 55%, #ffaf7b);
  box-shadow: 0 0 4px #fff2bf, 0 0 12px #f98447;
  animation: damage-flight-fade 1.08s ease-out both;
}

.damage-flight::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  width: min(36px, 28%);
  height: 6px;
  border-radius: 999px;
  background: #fff5cf;
  box-shadow: 0 0 8px #fff1ad;
  animation: damage-flight-spark .32s ease-out both;
}

.damage-flight::after {
  content: '';
  position: absolute;
  top: -5px;
  right: -3px;
  border-block: 7px solid transparent;
  border-left: 12px solid #ffe0aa;
  border-right: 0;
  filter: drop-shadow(0 0 4px #ff8e64);
}

@keyframes damage-notice-in {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes damage-hit-fade {
  0%, 22% { opacity: 1; }
  65% { opacity: .73; }
  to { opacity: 0; }
}

@keyframes damage-impact-pop {
  0% { opacity: 0; transform: translate(-50%, -36%) scale(.68); }
  14% { opacity: 1; transform: translate(-50%, -61%) scale(1.13); }
  28%, 72% { opacity: 1; transform: translate(-50%, -58%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -91%) scale(.98); }
}

@keyframes damage-flight-fade {
  0%, 47% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes damage-flight-spark {
  0% { left: 0; opacity: 1; }
  90% { left: calc(100% - min(36px, 28%)); opacity: 1; }
  100% { left: calc(100% - min(36px, 28%)); opacity: 0; }
}

@media (max-width: 700px) {
  .damage-feed {
    inset-block-start: max(108px, env(safe-area-inset-top));
    width: min(285px, calc(100vw - 24px));
  }
  .damage-impact { font-size: clamp(29px, 7vw, 37px); }
}

@media (prefers-reduced-motion: reduce) {
  .damage-notice, .damage-hit, .damage-impact, .damage-flight { animation: none; }
  .damage-hit { box-shadow: 0 0 9px #ff6459a3; }
  .damage-flight::before { display: none; }
}
