.life-game {
  position: relative; width: min(100%,34rem); margin-block-start: clamp(1.35rem,2.4vw,2.1rem);
  container-type: inline-size;
  padding: clamp(.85rem,2vw,1.3rem); color: #e7e1ed;
  border: 1px solid #665476; border-radius: .7rem;
  background: linear-gradient(122deg,#241e2a 0%,#1b1921 40%,#18161d 100%);
}
.life-game [hidden] { display: none !important }
.life-top { display: flex; align-items: baseline; justify-content: space-between; gap: .55rem; flex-wrap: wrap }
.life-top h3 { margin: 0; color: #f3eff8; font: 650 clamp(1rem, 4cqi, 1.18rem)/1.3 Inter,Arial,sans-serif; letter-spacing: -.025em; text-wrap: balance }
.life-counter { color: #c9bdd4; font: 500 .81rem/1.45 ui-monospace,monospace }
.life-modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem }
.life-game[data-state="setup"] .life-actions {
  display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: center; margin-top: .65rem;
}
.life-game[data-state="setup"] .life-actions button { margin-top: 0 }
.life-modes .life-decoy button { width: 100%; padding-inline: .2rem; pointer-events: none }
.life-status {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.life-actions { display: flex; gap: .5rem; flex-wrap: wrap }
.life-slow[aria-pressed="true"] { border-color: #c9a8eb; background: #40304a }
.life-actions button {
  min-height: 44px; margin-top: .65rem; padding: .45rem .95rem; border: 1px solid #79648c;
  border-radius: .3rem; background: #241e2b; color: #eee5f5; font: 600 .94rem/1.35 Inter,Arial,sans-serif; cursor: pointer;
}
.life-actions .life-go { background: #d7bfeb; border-color: #d7bfeb; color: #201525 }
.life-actions button:disabled {
  color: #aaa1b1; background: transparent; border-color: #524856; cursor: default;
}
.life-actions button:enabled:not([aria-disabled="true"]):hover { background: #40304a; color: white }
.life-actions button:focus-visible { outline: 2px solid #ead3ff; outline-offset: 3px }
.life-go[aria-disabled="true"] { cursor: default }
@media (max-width: 25rem) {
  .life-actions { gap: .35rem }
  .life-actions button { padding-inline: .6rem }
}
@container (max-width: 23rem) {
  .life-modes { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
@media (any-hover: none) {
  .life-modes { display: contents }
  .life-vacancy { display: none }
  .life-game[data-state="setup"] .life-actions { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .life-game[data-state="setup"] .life-go { order: 4 }
}

.life-screen { position: relative; margin-top: .75rem }
.life-cheat summary {
  position: absolute; inset: 0 0 auto auto; width: 44px; height: 44px;
  display: grid; place-items: center; list-style: none; cursor: pointer; color: #a48bba;
}
.life-cheat summary::-webkit-details-marker { display: none }
.life-cheat summary:is(:hover, :focus-visible), .life-cheat[open] summary { color: #e2c8fa }
.life-cheat summary:is(:hover, :focus-visible) svg { filter: drop-shadow(0 0 4px #c39af0) }
.life-cheat summary:focus-visible, .life-prayer:focus-visible {
  outline: 2px solid #e6d1fb; outline-offset: -3px; border-radius: .3rem;
}
.life-prayer {
  display: flex; align-items: center; gap: .6rem; width: fit-content; max-width: 100%; min-height: 44px;
  margin: .25rem 0 0 auto; padding: .3rem .6rem; border: 0; background: transparent;
  color: #e3c9f8; font: 500 .85rem/1.35 ui-monospace, monospace; text-align: start;
  text-decoration: underline; text-decoration-color: #887199; text-underline-offset: .25em; cursor: pointer;
}
.life-prayer::before {
  content: ""; flex: 0 0 .45rem; height: .45rem; border: 1px solid currentColor; box-sizing: border-box;
}
.life-prayer[data-state="playing"]::before { background: currentColor }
.runner-scene {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 480 / 116;
  overflow: hidden;
  border-radius: .35rem;
}
.runner-scene [data-runner="hero"] {
  --runner-shoe: #f0e2f5;
  color: #b6a1c8;
}
.runner-scene .runner-rival-one {
  --runner-shoe: #a7b6bf;
  --stride-phase: -.14s;
  color: #637985;
}
.runner-scene .runner-rival-two {
  --runner-shoe: #aaaabc;
  --stride-phase: -.27s;
  color: #6d6c84;
}
.runner-scene .runner-rival-three {
  --runner-shoe: #a5afb8;
  --stride-phase: -.07s;
  color: #64707c;
}
.runner-scene [data-runner] { shape-rendering: crispEdges }
.runner-scene .runner-sole { fill: var(--runner-shoe, currentColor) }

#hardcore .folio-art { z-index: 0 }
.portrait-burst-trigger {
  position: absolute; inset: 0; z-index: 1; pointer-events: auto;
  appearance: none; width: 100%; height: 100%; padding: 0; border: 0;
  background: transparent; touch-action: manipulation;
}
.portrait-burst-trigger:focus-visible { outline: 2px dashed #b6a1c8; outline-offset: -1.6rem }
.portrait-burst, .portrait-burst > span { position: absolute; pointer-events: none }
.portrait-burst > span {
  left: -2px; top: -2px; width: 4px; height: 4px; background: #b6a1c8;
  animation: hardcore-pixel-burst .44s steps(6, end) both;
}
.portrait-burst > span:nth-child(3n + 1) { width: 6px; height: 6px; background: #f0e2f5 }
.portrait-burst > span:nth-child(3n + 2) { background: #9070aa }
@keyframes hardcore-pixel-burst {
  0% { transform: translate(0,0) }
  60% { transform: translate(calc(var(--dx) * .75), calc(var(--dy) * .75 - 6px)); opacity: 1 }
  100% { transform: translate(var(--dx), calc(var(--dy) + 8px)); opacity: 0 }
}
@media (prefers-reduced-motion: reduce) {
  .portrait-burst > span {
    animation: none; transform: translate(calc(var(--dx) * .32), calc(var(--dy) * .32));
  }
}

.runner-scene .runner-body {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
.runner-scene .is-ducking .runner-body {
  transform: translateX(1px) scale(1.09,.37);
}
.runner-scene .is-out .runner-body { opacity: .6 }

@media (prefers-reduced-motion: no-preference) {
  .life-game.is-running .runner-scene [data-runner]:not(.is-out,.is-airborne) .stride {
    transform-box: fill-box;
    transform-origin: 50% 0;
    animation: runner-stride .38s steps(2,end) var(--stride-phase,0s) infinite;
  }
  .life-game.is-running .runner-scene [data-runner]:not(.is-out,.is-airborne) .stride-back {
    animation-direction: reverse;
  }
  .life-game.is-running .runner-scene [data-runner].is-ducking:not(.is-out) .stride { animation-play-state: paused }
}
@keyframes runner-stride {
  0%, 100% { transform: translateX(-1px) rotate(12deg) }
  50% { transform: translateX(1px) rotate(-23deg) }
}
