/* =====================================================================================
   Sprint Track world (12-worlds-a Part 4, Track.dc.html). Everything is prefixed trk- except the bean pose rules, which are scoped to .trk-scene.
   ===================================================================================== */
@keyframes trk-drain { from { width: 100%; } to { width: 0%; } }
.trk-scene-wrap { width: 100%; max-width: 1200px; margin: 0 auto; overflow: hidden; border-radius: 28px; }
.trk-scene { position: relative; width: 1200px; margin: 0 auto; background: #3B7F4A; border: 3px solid #1E1B2E; border-radius: 28px; box-sizing: border-box; overflow: hidden; transform-origin: 0 0; }

/* Track runners are faster and lean forward (Track.dc.html lines 17-27, 12-worlds-a §4.3 item 9). The global idle/cheer poses are reused. */
@keyframes trk-bob { 0%,100% { transform: translateY(0) rotate(4deg); } 50% { transform: translateY(-6px) rotate(10deg); } }
@keyframes trk-step { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes trk-swing { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.trk-scene .walk .bean { animation: trk-bob .26s ease-in-out infinite; transform-origin: 50% 100%; }
.trk-scene .walk .fl { animation: trk-step .26s ease-in-out infinite; }
.trk-scene .walk .fr { animation: trk-step .26s ease-in-out -.13s infinite; }
.trk-scene .walk .al { animation: trk-swing .26s ease-in-out infinite; }
.trk-scene .walk .ar { animation: trk-swing .26s ease-in-out -.13s infinite; }

/* Replay sprint: translateX(0 -> --dx) on the runner anchor, one animation per runner (delay back-dated by the server). */
@keyframes trk-run { from { transform: translateX(0); } to { transform: translateX(var(--dx)); } }

/* Crowd bobs once the gun has gone */
@keyframes trk-fan { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.trk-fans span { animation: trk-fan .5s ease-in-out infinite; }
.trk-fans span:nth-child(3n) { animation-delay: -.2s; }
.trk-fans span:nth-child(3n+1) { animation-delay: -.35s; }

/* "FIRE THE STARTER" ready pulse (red) */
@keyframes trk-pulse { 0%,100% { box-shadow: 0 6px 0 #0B0A14, 0 0 0 0 rgba(255,92,92,.7); } 50% { box-shadow: 0 6px 0 #0B0A14, 0 0 0 12px rgba(255,92,92,0); } }
.trk-ready { animation: trk-pulse 1.4s ease-out infinite; }

.trk-flag { transition: transform .15s ease; }
.trk-flag:hover { transform: translateX(-50%) translateY(-4px) !important; }
.trk-target:hover { background: rgba(255,255,255,.45) !important; }

.trk-quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.trk-quick button { min-width: 44px; height: 44px; padding: 0 10px; border: 3px solid #1E1B2E; border-radius: 12px; box-shadow: 0 3px 0 #1E1B2E; font-family: 'Lilita One', sans-serif; font-size: 18px; color: #1E1B2E; cursor: pointer; }

/* Reduced motion: session flag (.rm on <html>) or OS preference. Runners sit at their final x, shutters drop without a transition. */
@media (prefers-reduced-motion: reduce) {
  .trk-scene .walk .bean, .trk-scene .walk .fl, .trk-scene .walk .fr, .trk-scene .walk .al, .trk-scene .walk .ar, .trk-fans span, .trk-ready { animation: none; }
  .trk-run { animation: none !important; transform: translateX(var(--dx)) !important; }
  .trk-shutter { transition: none !important; }
}
.rm .trk-scene .walk .bean, .rm .trk-scene .walk .fl, .rm .trk-scene .walk .fr, .rm .trk-scene .walk .al, .rm .trk-scene .walk .ar, .rm .trk-fans span, .rm .trk-ready { animation: none; }
.rm .trk-run { animation: none !important; transform: translateX(var(--dx)) !important; }
.rm .trk-shutter { transition: none !important; }
