/* battle-damage.css — attack impact overlay (.bi-*) and persistent smoke/scorch on damaged village plots.
   Loaded after battles.css / village.css. Never transforms .village-plot itself. */

/* ---------- impact overlay ---------- */
.bi-layer { position: absolute; inset: 0; z-index: 260; pointer-events: none; overflow: visible; }
.bi-layer > * { position: absolute; pointer-events: none; }
.bi-dim { inset: 0; left: 0; top: 0; border-radius: 26px;
  background: radial-gradient(circle at var(--bi-x, 50%) var(--bi-y, 50%), transparent 0 70px, rgba(74, 40, 66, .32) 190px); }
.bi-ring { border-radius: 50%; border: 3px dashed rgba(255, 248, 232, .95);
  box-shadow: 0 0 0 3px rgba(224, 54, 143, .55), inset 0 0 0 3px rgba(224, 54, 143, .35); }
.bi-axe { left: 0; top: 0; filter: drop-shadow(0 8px 6px rgba(74, 40, 66, .4)); }
.bi-axe.is-ghost { filter: none; }
.bi-shield { border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, rgba(228, 255, 246, .92) 0 38%, rgba(94, 226, 196, .5) 62%, rgba(94, 226, 196, 0) 74%);
  border: 4px solid rgba(255, 255, 255, .95); }
.bi-shield-icon { width: 46%; height: 46%; }
.bi-flash { border-radius: 50%; background: radial-gradient(circle, rgba(255, 246, 214, .85) 0 22%, rgba(255, 212, 71, .35) 45%, transparent 68%); }
.bi-flash.is-blocked { background: radial-gradient(circle, rgba(228, 255, 246, .85) 0 22%, rgba(94, 226, 196, .35) 45%, transparent 68%); }
.bi-wave { border-radius: 50%; border: 4px solid rgba(255, 212, 71, .9); }
.bi-wave.is-blocked { border-color: rgba(94, 226, 196, .95); }
.bi-chunk { width: 11px; height: 11px; border-radius: 3px; border: 1.5px solid rgba(74, 40, 66, .45); }
.bi-star-spark { width: 14px; height: 14px; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.bi-crack { background:
  linear-gradient(35deg, transparent 47%, rgba(74, 40, 66, .7) 48% 52%, transparent 53%),
  linear-gradient(-60deg, transparent 47%, rgba(74, 40, 66, .6) 48% 51%, transparent 52%),
  linear-gradient(100deg, transparent 48%, rgba(74, 40, 66, .5) 49% 51%, transparent 52%);
  clip-path: circle(46%); }
.bi-puff { border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f6eef4 0 30%, #b9a6b6 65%, rgba(140, 120, 140, 0) 72%); }
.bi-caption { display: grid; justify-items: center; gap: 1px; padding: 6px 16px 7px; border-radius: 14px; white-space: nowrap;
  background: #fff8e8; border: 3px solid #fff; color: #4a2842; font-family: var(--v-font, system-ui, sans-serif);
  box-shadow: 0 4px 0 #c9246a, 0 10px 18px rgba(74, 40, 66, .3); }
.bi-caption strong { font-size: clamp(1.05rem, 4.6vw, 1.5rem); font-weight: 800; line-height: 1; letter-spacing: .02em; text-transform: uppercase; color: #c9246a; }
.bi-caption small { font-size: .72rem; font-weight: 800; color: #7b5a73; }
.bi-caption.is-blocked { box-shadow: 0 4px 0 #0b6f63, 0 10px 18px rgba(74, 40, 66, .3); }
.bi-caption.is-blocked strong { color: #0b6f63; }
.bi-caption.is-damage { box-shadow: 0 4px 0 #b97a06, 0 10px 18px rgba(74, 40, 66, .3); }
.bi-caption.is-damage strong { color: #9a4a06; }

/* ---------- persistent smoke + scorch ---------- */
.village-plot .village-plot-smoke, .village-plot .village-scorch-mark { display: none; }
.village-plot.is-scorched .village-scorch-mark {
  display: block; position: absolute; left: 16%; right: 16%; bottom: 2%; height: 20%; z-index: 0; pointer-events: none; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(60, 30, 50, .5) 0 35%, rgba(90, 50, 70, .25) 60%, transparent 72%);
}
.village-plot.is-scorched .village-plot-art { filter: saturate(.7) brightness(.92) sepia(.12); }
.village-plot.is-scorched .village-plot-smoke {
  display: block; position: absolute; left: 22%; right: 22%; bottom: 30%; height: 85%; z-index: 2; pointer-events: none; overflow: visible;
}
.village-plot-smoke .smoke-puff {
  position: absolute; left: 50%; bottom: 0; width: 34%; aspect-ratio: 1; margin-left: -17%; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle at 40% 35%, rgba(250, 242, 248, .95) 0 25%, rgba(180, 162, 178, .8) 60%, rgba(150, 130, 150, 0) 72%);
  animation: biSmoke 3.6s ease-out infinite;
}
.village-plot-smoke .smoke-puff:nth-child(1) { left: 38%; }
.village-plot-smoke .smoke-puff:nth-child(2) { left: 58%; animation-delay: -.7s; width: 40%; margin-left: -20%; }
.village-plot-smoke .smoke-puff:nth-child(3) { left: 46%; animation-delay: -1.4s; }
.village-plot-smoke .smoke-puff:nth-child(4) { left: 64%; animation-delay: -2.1s; width: 28%; margin-left: -14%; }
.village-plot-smoke .smoke-puff:nth-child(5) { left: 34%; animation-delay: -2.8s; width: 30%; margin-left: -15%; }
.village-plot-smoke .smoke-ember {
  position: absolute; bottom: 4%; width: 6%; aspect-ratio: 1; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #fff3c0 0 30%, #ff9f43 60%, transparent 72%);
  animation: biEmber 2.4s ease-out infinite;
}
.village-plot-smoke .smoke-ember:nth-child(6) { left: 40%; }
.village-plot-smoke .smoke-ember:nth-child(7) { left: 56%; animation-delay: -.8s; }
.village-plot-smoke .smoke-ember:nth-child(8) { left: 48%; animation-delay: -1.6s; }
@keyframes biSmoke {
  0% { transform: translate(0, 0) scale(.4); opacity: 0; }
  20% { opacity: .85; }
  100% { transform: translate(12px, -110%) scale(1.5); opacity: 0; }
}
@keyframes biEmber {
  0% { transform: translate(0, 0); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate(-6px, -260%); opacity: 0; }
}
/* keep axe/hammer controls and plaques above smoke */
.village-plot.is-scorched :is(.village-battleaxe, .village-hammer, .village-plaque) { z-index: 4; }

/* pause */
.candy-village.is-paused .village-plot-smoke *, body.fx-paused .village-plot-smoke * { animation-play-state: paused !important; }

/* reduced motion: static smoke wisps, not nothing */
@media (prefers-reduced-motion: reduce) {
  .village-plot.is-scorched .village-plot-smoke .smoke-puff,
  .village-plot.is-scorched .village-plot-smoke .smoke-ember { animation: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .village-plot.is-scorched .village-plot-smoke .smoke-puff:nth-child(1) { opacity: .75; transform: translateY(-10%) scale(.9); }
  .village-plot.is-scorched .village-plot-smoke .smoke-puff:nth-child(2) { opacity: .6; transform: translate(6px, -45%) scale(1.15); }
  .village-plot.is-scorched .village-plot-smoke .smoke-puff:nth-child(3) { opacity: .45; transform: translate(10px, -80%) scale(1.35); }
  .village-plot.is-scorched .village-plot-smoke .smoke-ember:nth-child(6) { opacity: .9; }
}
.candy-village.is-motion-reduced .village-plot.is-scorched .village-plot-smoke * { animation: none !important; }
.candy-village.is-motion-reduced .village-plot.is-scorched .village-plot-smoke .smoke-puff:nth-child(1) { opacity: .75; transform: translateY(-10%) scale(.9); }
.candy-village.is-motion-reduced .village-plot.is-scorched .village-plot-smoke .smoke-puff:nth-child(2) { opacity: .6; transform: translate(6px, -45%) scale(1.15); }
.candy-village.is-motion-reduced .village-plot.is-scorched .village-plot-smoke .smoke-puff:nth-child(3) { opacity: .45; transform: translate(10px, -80%) scale(1.35); }
.candy-village.is-motion-reduced .village-plot.is-scorched .village-plot-smoke .smoke-ember:nth-child(6) { opacity: .9; }

/* forced colors: visible outline cues */
@media (forced-colors: active) {
  .village-plot.is-scorched .village-plot-smoke .smoke-puff { forced-color-adjust: none; background: none; border: 2px dotted CanvasText; }
  .village-plot.is-scorched .village-plot-smoke .smoke-ember { forced-color-adjust: none; background: Highlight; }
  .village-plot.is-scorched .village-scorch-mark { forced-color-adjust: none; background: none; border: 2px dashed CanvasText; }
  .bi-caption { forced-color-adjust: none; background: Canvas; color: CanvasText; border-color: CanvasText; }
  .bi-caption strong, .bi-caption small { color: CanvasText; }
  .bi-ring, .bi-wave { border-color: Highlight; }
}
