/* Local to the number: the splash and crack rotate with the seat. */
.pp-table .pp-life-value.pp-life-flash {
  position: relative;
  isolation: isolate;
  color: var(--pp-life-cue) !important;
}
.pp-life-flash-gain { --pp-life-cue: #a2ffb4; }
.pp-life-flash-loss { --pp-life-cue: #ff9096; }

.pp-life-decoration {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inline-size: clamp(5.3rem, 2.7em, 13rem);
  block-size: 150%;
  inset-inline-start: 50%;
  inset-block-start: 50%;
  translate: -50% -50%;
  overflow: visible;
  color: var(--pp-life-cue);
}
.pp-life-decoration > * {
  transform-box: view-box;
  transform-origin: center;
  animation-delay: var(--pp-life-flash-offset, 0ms);
}
.pp-life-aura {
  fill: currentColor;
  filter: blur(9px);
  animation: pp-life-aura-fade 490ms ease-out both;
  animation-delay: var(--pp-life-flash-offset, 0ms);
}
.pp-life-trace, .pp-life-fracture, .pp-life-fracture-secondary {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.pp-life-trace, .pp-life-sparks {
  animation: pp-life-splash-open 490ms ease-out both;
  animation-delay: var(--pp-life-flash-offset, 0ms);
}
.pp-life-trace { stroke-width: 1.45; }
path.pp-life-sparks { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
circle.pp-life-sparks { fill: currentColor; }
.pp-life-fracture, .pp-life-fracture-secondary {
  animation: pp-life-fracture-appear 490ms ease-out both;
  animation-delay: var(--pp-life-flash-offset, 0ms);
}
.pp-life-fracture { stroke-width: 1.6; }
.pp-life-fracture-secondary { stroke-width: .85; }

@keyframes pp-life-aura-fade {
  0% { opacity: .06; scale: .88; }
  24% { opacity: .28; }
  100% { opacity: 0; scale: 1.42; }
}
@keyframes pp-life-splash-open {
  0% { opacity: .5; scale: .72; }
  22% { opacity: .69; }
  100% { opacity: 0; scale: 1.25; }
}
@keyframes pp-life-fracture-appear {
  0% { opacity: .65; scale: .96; }
  60% { opacity: .29; }
  100% { opacity: 0; scale: 1.08; }
}
@media (prefers-reduced-motion: reduce) {
  .pp-life-decoration { display: none; }
}

/* A sibling of the number, outside normal flow: no tap moves any control. */
.pp-seat-center > .pp-life-line {
  position: relative;
  min-width: 0;
  justify-self: stretch;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  grid-template-rows: auto;
}
.pp-life-line > .pp-life-value {
  grid-area: 1 / 2;
}
.pp-life-delta {
  position: absolute;
  grid-area: 1 / 3 / 2 / 4;
  z-index: 1;
  pointer-events: none;
  inset-inline-start: 3px;
  inset-block-start: 48%;
  translate: 0 -50%;
  white-space: nowrap;
  inline-size: max-content;
  padding: .14em .35em;
  border: 1px solid var(--pp-delta-border);
  border-radius: 999px;
  background: var(--pp-delta-bg);
  color: var(--pp-delta-ink);
  font: 800 clamp(.62rem, 1.38vh, .9rem)/1.06 system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  box-shadow: 0 2px 8px #0007;
}
.pp-life-delta[data-placement="corner"] {
  grid-area: 1 / 1 / 2 / 4;
  inset-inline-start: auto;
  inset-inline-end: 0;
  inset-block-start: 0;
  translate: 0 -38%;
}
.pp-life-delta[data-direction="gain"] {--pp-delta-ink:#bbffca;--pp-delta-border:#518061;--pp-delta-bg:#183524}
.pp-life-delta[data-direction="loss"] {--pp-delta-ink:#ffd1d7;--pp-delta-border:#a05d67;--pp-delta-bg:#42232f}

/* Keep the shared green/red sign convention. Each design draws a different shape. */
.pp-table[data-board-theme=lair] .pp-life-flash-gain{--pp-life-cue:#c3ff80}
.pp-table[data-board-theme=lair] .pp-life-flash-loss{--pp-life-cue:#ff85a8}
.pp-table[data-board-theme=pixel] .pp-life-flash-gain{--pp-life-cue:#a1ffb2}
.pp-table[data-board-theme=pixel] .pp-life-flash-loss{--pp-life-cue:#ffa189}
.pp-table[data-board-theme=cyberpunk] .pp-life-flash-gain{--pp-life-cue:#a3ffcd}
.pp-table[data-board-theme=cyberpunk] .pp-life-flash-loss{--pp-life-cue:#ff8bb5}
.pp-table[data-board-theme=surreal] .pp-life-flash-gain{--pp-life-cue:#d0ffd4}
.pp-table[data-board-theme=surreal] .pp-life-flash-loss{--pp-life-cue:#ffb4b5}
.pp-life-decoration[data-fx-theme=lair] :is(.pp-life-trace,.pp-life-fracture){fill:color-mix(in srgb,currentColor 24%,transparent);stroke-width:2;stroke-linejoin:bevel}
.pp-life-decoration[data-fx-theme=pixel] :is(.pp-life-trace,.pp-life-fracture,.pp-life-sparks,.pp-life-fracture-secondary){shape-rendering:crispEdges;stroke-linejoin:miter;stroke-linecap:square}
.pp-life-decoration[data-fx-theme=pixel] .pp-life-aura{filter:none;opacity:0;display:none}
.pp-life-decoration[data-fx-theme=cyberpunk] .pp-life-fracture-secondary{stroke-dasharray:4 2;stroke-width:1.1}
.pp-life-decoration[data-fx-theme=cyberpunk] .pp-life-trace{stroke-width:1.8;stroke-linecap:square}
.pp-life-decoration[data-fx-theme=surreal] :is(.pp-life-trace,.pp-life-fracture){stroke-width:1.2}
.pp-life-decoration[data-fx-theme=surreal] .pp-life-aura{filter:blur(5px)}
