#death-overlay.transformed {
  background: radial-gradient(circle at 50% 46%, #29452c 0, #14251bdc 26%, #050b0af5 70%);
  animation: transform-flash 1.6s ease-out both;
}
#death-overlay.deceased {
  background: radial-gradient(circle at 50% 46%, #3f2825 0, #1c1715e8 30%, #050b0af5 72%);
}
#death-overlay.deceased #death-title { color: #e8b79e; }
#death-overlay.deceased #death-continue { background: #d7b299; border-color: #f0d4bc; }
#death-overlay.transformed .death-message {
  position: relative;
  animation: transform-arrive .65s ease-out both;
}
#death-overlay.transformed #death-title {
  color: #c7e48f;
  text-shadow: 0 0 24px #5fba50a6;
}
.transformation-figure { display: none; }
#death-continue {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 20px;
  color: #101911;
  background: #c4d78f;
  border: 1px solid #e0edb1;
  border-radius: 6px;
  font-weight: 700;
}
#death-continue.hidden { display: none; }
#death-overlay.transformed .transformation-figure {
  display: block;
  width: 192px;
  height: 192px;
  max-width: 100%;
  margin: 0 auto 8px;
  background: url('/assets/player-transformation-v1/male-sheet.png') no-repeat 0 0;
  background-size: 2496px 192px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 18px #8cca63);
  animation: pixel-transform 2.5s steps(12,end) forwards;
}
#death-overlay.deceased .transformation-figure {
  display: block;
  width: 192px;
  height: 192px;
  max-width: 100%;
  margin: 0 auto 8px;
  background: url('/assets/player-death-v1/male-sheet.png') no-repeat 0 0;
  background-size: 2496px 192px;
  image-rendering: pixelated;
  animation: pixel-transform 2.5s steps(12,end) forwards;
}
#death-overlay.deceased.female .transformation-figure {
  background-image: url('/assets/player-death-v1/female-sheet.png');
}
#death-overlay.transformed.female .transformation-figure {
  background-image: url('/assets/player-transformation-v1/female-sheet.png');
}
@keyframes transform-flash { 0% { filter: brightness(2.3) saturate(.3); } 35% { filter: brightness(1.35) saturate(1.6); } 100% { filter: none; } }
@keyframes transform-arrive { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: scale(1); } }
@keyframes pixel-transform { from { background-position: 0 0; } to { background-position: -2304px 0; } }
@media(max-height:650px) { #death-overlay.transformed .transformation-figure { margin-bottom: -15px; } }
@media (prefers-reduced-motion: reduce) {
  #death-overlay.transformed, #death-overlay.transformed .death-message { animation: none; }
  #death-overlay.transformed .transformation-figure, #death-overlay.deceased .transformation-figure { animation: none; background-position: -2304px 0; }
}
#death-overlay { padding: 16px; }
#death-overlay .death-message { max-width: 520px; width: 100%; max-height: calc(100dvh - 32px); overflow-y: auto; overflow-wrap: anywhere; }
#death-reason { margin-bottom: 10px; color: #e1d0b5; }
#death-continue { min-height: 44px; max-width: 100%; }

#death-overlay .death-message { max-width: 620px; padding: 8px; scrollbar-gutter: stable; text-align: center; }
#death-overlay .death-message .death-facts { display: grid; grid-template-columns: minmax(100px,.7fr) minmax(0,1.7fr); gap: 7px 12px; margin: 16px 0; padding: 14px; border: 1px solid #57634c; border-radius: 8px; text-align: left; background: #0b110e99; font-size: 13px; line-height: 1.65; }
.death-facts dt { color: #ada98f; }
.death-facts dd { margin: 0; color: #eee5cc; overflow-wrap: anywhere; }
.death-loss-list { margin: 12px 0; padding: 12px; border: 1px solid #57634c; border-radius: 8px; text-align: left; font-size: 13px; }
.death-loss-list summary { min-height: 44px; cursor: pointer; display: flex; align-items: center; }
.death-loss-list ul { margin: 4px 0 8px; padding-left: 22px; line-height: 1.8; }
.death-loss-list button { min-height: 44px; padding: 8px 12px; border: 1px solid #9b9e76; border-radius: 5px; }
#death-overlay .death-recovery-status { color: #cbb487; font-size: 12px; line-height: 1.7; }
#death-overlay #death-detail { font-size: 12px; line-height: 1.8; }
@media(max-width:420px) { #death-overlay .death-message .death-facts { grid-template-columns: 1fr; gap: 2px; padding: 10px; font-size: 12px; } .death-facts dd { margin-bottom: 9px; } }
