/* Station: both actors run to the right without moving their home anchors.
   Paint, travel, win and retrigger states retain their existing choreography. */
#bonusRival:not([hidden]) { display: block; }
#bonusRival .rival-run { display: none; position: absolute; inset: 0; }
#bonusRival[data-theme='base'][data-mood='idle'] .rival-body { visibility: hidden; }
#bonusRival[data-theme='base'][data-mood='idle'] .rival-run {
  display: block;
  background: url('../assets/subway-rush/scene/police-run.webp') 0 0 / 400% 100% no-repeat;
  animation: subway-run .60s steps(4) infinite;
}
/* The dog runs with him: same beat, the strip at assets/subway-rush/scene/police-dog-run.webp. */
#bonusRival[data-theme='base'][data-dog='idle'] .rival-dog .dog-pose { visibility: hidden; }
#bonusRival[data-theme='base'][data-dog='idle'] .rival-dog .dog-run {
  display: block;
  background: url('../assets/subway-rush/scene/police-dog-run.webp') 0 0 / 400% 100% no-repeat;
  animation: subway-run .52s steps(4) infinite;
}
body.page-hidden #bonusRival .rival-dog .dog-run { animation-play-state: paused !important; }
body:not(.free-spins):not(.mascot-cheer):not(.mascot-spray):not(.mascot-spray-big)
#stage #mascot:not(.mascot-on-board) > .strip {
  background: url('../assets/subway-rush/scene/runner-run.webp') 0 0 / 400% 100% no-repeat;
  background-image: url('../assets/subway-rush/scene/runner-run.webp');
  background-size: 400% 100%;
  animation: subway-run .48s steps(4) infinite;
  scale: 1 1;
}
/* The bonus cell: a rendered gate (assets/subway-rush/scene/jail-gate.webp,
   cut from art/subway-rush/characters/hoverboard-v1/jail-frame-source.png)
   painted over the officer, a little wider than his box so he stands
   behind the bars rather than on them. The reaction mark stays above it. */
#bonusRival .rival-bars { display: none; }
#bonusRival[data-theme='free'] .rival-bars {
  display: block; position: absolute; left: -8%; right: -8%; top: -6%; bottom: -1.5%;
  background: url('../assets/subway-rush/scene/jail-gate.webp') center bottom / contain no-repeat;
  filter: drop-shadow(0 6px 6px #04081ca0);
  pointer-events: none;
}
body.free-spins #stage #mascot { overflow: visible; }
/* Full body at home as well as during paint: both shoes stay on the deck.
   Keep the existing can coordinates and flight translations intact. */
body.free-spins #stage #mascot > .strip,
body.free-spins #stage.portrait #mascot.mascot-on-board > .strip {
  background: url('../assets/subway-rush/scene/runner-hover-idle.webp') center bottom / contain no-repeat;
  background-image: url('../assets/subway-rush/scene/runner-hover-idle.webp');
  background-size: contain;
  animation: none; scale: none;
}
body.free-spins.mascot-spray #stage #mascot > .strip,
body.free-spins.mascot-spray-big #stage #mascot > .strip,
body.free-spins.mascot-spray #stage.portrait #mascot.mascot-on-board > .strip,
body.free-spins.mascot-spray-big #stage.portrait #mascot.mascot-on-board > .strip {
  background-image: url('../assets/subway-rush/scene/runner-hover-spray.webp');
}
body.free-spins:not(.mascot-cheer):not(.mascot-spray):not(.mascot-spray-big):not(.rival-taunt)
#stage #mascot:not(.mascot-on-board) { animation: hoverboard-cruise 1.8s ease-in-out infinite; }
@keyframes hoverboard-cruise {
  0%, 100% { transform: translateY(-3px) rotate(-1deg); }
  50% { transform: translateY(3px) rotate(1deg); }
}
body.page-hidden #stage #mascot,
body.page-hidden #stage #mascot > .strip,
body.page-hidden #bonusRival .rival-run { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  #stage #mascot, #stage #mascot > .strip, #bonusRival .rival-run { animation: none !important; }
}
