/* Show Jumping: an arena seen from the side. Fans at the top, a hedge and the arena's white fence behind,
   sand below. The course (fences, stride marks, start and finish) is one long strip that slides left
   as the pony goes; everything stands on the ground line 84% of the way down. */
.game.jumping { background: #e9c78f; }
.jumping .arena { flex: 1; position: relative; min-height: 0; overflow: hidden; background: linear-gradient(180deg, #a9dcff 0%, #e8f6ff 52%); }
.jumping .jp-stands {
  position: absolute; top: 0; left: 0; right: 0; height: 60px; z-index: 2;
  background: repeating-linear-gradient(180deg, #7a5cc0 0 15px, #6f52b3 15px 30px); border-bottom: 4px solid var(--ink);
  display: flex; justify-content: center; align-items: flex-end; gap: 2px; padding-bottom: 2px; overflow: hidden;
}
.jumping .jp-stands span { display: inline-block; }
.jumping .jp-stands .critter-svg { width: 40px; height: 40px; }
.jumping .jp-back {
  position: absolute; left: 0; right: 0; top: 46%; height: 16%; z-index: 0;
  background:
    radial-gradient(circle at 50px 100%, #4caf50 46px, transparent 47px) 0 100% / 100px 100% repeat-x,
    radial-gradient(circle at 20px 100%, #5cc062 30px, transparent 31px) 30px 100% / 100px 100% repeat-x;
}
.jumping .jp-rail-fence {
  position: absolute; left: 0; right: 0; top: 56%; height: 9%; z-index: 1;
  background:
    linear-gradient(#fff, #fff) 0 22% / 100% 7px repeat-x,
    linear-gradient(#fff, #fff) 0 64% / 100% 7px repeat-x,
    repeating-linear-gradient(90deg, #fff 0 9px, transparent 9px 130px);
  filter: drop-shadow(0 2px 0 rgba(58, 42, 74, .35));
}
.jumping .jp-sand { position: absolute; left: 0; right: 0; top: 64%; bottom: 0; z-index: 1; background: repeating-linear-gradient(180deg, #ecca92 0 14px, #e5c186 14px 28px); border-top: 3px solid #d2a96b; }

/* the course */
.jumping .jp-world { position: absolute; left: 0; top: 0; bottom: 0; width: 0; z-index: 3; will-change: transform; }
.jumping .jp-fence { position: absolute; bottom: calc(16% - 4px); width: 190px; transform: translateX(-50%); }
.jumping .jp-fence-svg { display: block; width: 100%; height: auto; overflow: visible; }
.jumping .jp-top { transform-box: fill-box; transform-origin: 50% 50%; }
.jumping .jp-fence.knocked .jp-top { animation: jp-fall .7s ease-in forwards; }
.jumping .jp-sign {
  position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); display: flex; align-items: center; gap: 6px;
  background: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 0 10px 0 4px; box-shadow: var(--shadow); white-space: nowrap; transition: opacity .3s;
}
.jumping .jp-sign span { width: 24px; height: 24px; border-radius: 50%; background: var(--grape); color: #fff; font-size: 14px; font-weight: 800; text-align: center; line-height: 24px; }
.jumping .jp-sign b { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: 1px; line-height: 1.35; }
.jumping .jp-sign b span { all: unset; }
.jumping .jp-sign b span.done { color: var(--good); }
.jumping .jp-fence.ready .jp-sign { border-color: #2bb673; box-shadow: 0 0 0 3px #8be39a, var(--shadow); }
.jumping .jp-fence.ready .jp-sign > span { background: #2bb673; }
.jumping .jp-fence.cleared .jp-sign, .jumping .jp-fence.knocked .jp-sign { opacity: .45; }
.jumping .jp-stride { position: absolute; bottom: calc(16% - 12px); width: 36px; height: 14px; margin-left: -18px; border-radius: 50%; background: rgba(150, 100, 50, .18); border: 2px dashed rgba(110, 70, 30, .55); transition: background .2s; }
.jumping .jp-stride b {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 2px solid var(--ink); color: var(--ink); font-size: 13px; font-weight: 800; line-height: 18px; text-align: center; box-sizing: border-box;
}
.jumping .jp-stride.past { background: rgba(255, 210, 63, .8); border-style: solid; border-color: var(--ink); }
.jumping .jp-stride.past b { background: var(--sun); }
.jumping .jp-stride.go { width: 70px; height: 9px; margin-left: -35px; border-radius: 5px; background: #fff; border: 2px solid var(--ink); }
.jumping .jp-start, .jumping .jp-finish { position: absolute; bottom: calc(16% - 4px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.jumping .jp-start i, .jumping .jp-finish i { order: 2; width: 8px; height: 120px; background: #fff; border: 3px solid var(--ink); border-radius: 4px; }
.jumping .jp-start b, .jumping .jp-finish b { order: 1; margin-bottom: -4px; padding: 2px 12px; border: 3px solid var(--ink); border-radius: 8px; font-size: 18px; font-weight: 800; color: #fff; background: #2bb673; }
.jumping .jp-finish b { background: repeating-linear-gradient(90deg, #3a2a4a 0 10px, #fff 10px 20px); color: var(--ink); text-shadow: 0 0 3px #fff, 0 0 3px #fff; }

/* her and the pony */
.jumping .jp-pony {
  position: absolute; left: 26%; bottom: calc(16% - 14px); width: 190px; z-index: 4; transform-origin: 50% 90%;
  transform: translate(-50%, calc(-1 * var(--lift, 0%))) rotate(var(--tilt, 0deg));
}
.jumping .jp-pony-svg { display: block; width: 100%; height: auto; overflow: visible; }
.jumping .jp-pony.gallop .cr-leg-a, .jumping .jp-pony.gallop .cr-leg-b { animation-duration: .17s !important; }
.jumping .jp-pony.gallop .cr-motion { animation-duration: .22s !important; }
.jumping .jp-pony::before {
  content: ''; position: absolute; left: -30px; top: 52%; width: 60px; height: 26px; opacity: 0; transition: opacity .2s;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .95) 0 4px, transparent 4px 11px);
  border-radius: 6px; -webkit-mask: linear-gradient(90deg, transparent, #000); mask: linear-gradient(90deg, transparent, #000);
}
.jumping .jp-pony.gallop::before { opacity: 1; animation: jp-zoom .3s linear infinite; }

/* the course map and the word card */
.jumping .jp-map { position: absolute; top: 70px; left: 50%; width: min(640px, 78%); height: 28px; transform: translateX(-50%); z-index: 6; }
.jumping .jp-map-line { position: absolute; left: 0; right: 0; top: 50%; height: 8px; margin-top: -4px; background: #fff; border: 3px solid var(--ink); border-radius: 6px; box-sizing: border-box; }
.jumping .jp-map-fence { position: absolute; top: 50%; width: 10px; height: 20px; margin: -10px 0 0 -5px; background: #ef4655; border: 2.5px solid var(--ink); border-radius: 3px; box-sizing: border-box; }
.jumping .jp-map-fence.clear { background: #2bb673; }
.jumping .jp-map-fence.down { background: #b9b3c9; }
.jumping .jp-map-end { position: absolute; right: -26px; top: 0; font-style: normal; font-size: 20px; }
.jumping .jp-map-pony { position: absolute; top: -12px; transform: translateX(-50%); font-size: 32px; line-height: 0; transition: left .1s linear; }
.jumping .jp-card { position: absolute; top: 108px; left: 50%; transform: translateX(-50%); z-index: 7; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: opacity .3s; }
.jumping .jp-card.gone { opacity: 0; }
.jumping .jp-word {
  display: flex; align-items: center; background: #fff; color: var(--ink); border: 4px solid var(--ink); border-radius: 18px; padding: 0 18px 0 8px;
  font-size: 40px; font-weight: 800; letter-spacing: 3px; box-shadow: 0 0 0 4px #c9b6ff, var(--shadow); white-space: nowrap; line-height: 1.3;
}
.jumping .jp-word i { margin-right: 12px; width: 34px; height: 34px; border-radius: 50%; background: var(--grape); color: #fff; font-style: normal; font-size: 20px; line-height: 34px; text-align: center; letter-spacing: 0; flex: none; }
.jumping .jp-word span.done { color: var(--good); }
.jumping .jp-word span.now { color: var(--coral-dark); text-decoration: underline 4px var(--coral); text-underline-offset: 6px; }
.jumping .jp-card.wait .jp-word { padding: 0 18px; color: #2a8f4c; box-shadow: 0 0 0 4px #8be39a, var(--shadow); }
.jumping .jp-then { font-size: 17px; font-weight: 700; color: var(--ink); background: rgba(255, 255, 255, .8); border-radius: 10px; padding: 0 10px; white-space: nowrap; }
.jumping .jp-then:empty { display: none; }

.jumping .jp-banner { position: absolute; left: 0; right: 0; top: 40%; z-index: 8; text-align: center; pointer-events: none; opacity: 0; line-height: 1; }
.jumping .jp-banner b { display: block; font-size: 64px; font-weight: 800; color: var(--sun); text-shadow: 0 5px 0 var(--coral-dark), 0 9px 0 var(--ink); }
.jumping .jp-banner small { display: block; margin-top: 8px; font-size: 26px; font-weight: 800; color: #fff; text-shadow: 0 3px 0 var(--ink); }
.jumping .jp-banner.go b { font-size: 90px; color: #fff; text-shadow: 0 6px 0 #2bb673, 0 11px 0 var(--ink); }
.jumping .jp-banner.down b { font-size: 50px; color: #fff; text-shadow: 0 5px 0 #8a8fa8, 0 9px 0 var(--ink); }
.jumping .jp-banner.show { animation: jp-banner 1.3s ease-out forwards; }

.jumping .jp-intro {
  position: absolute; left: 50%; top: 50%; z-index: 9; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: min(440px, 90%);
  background: #fff; border: 5px solid var(--ink); border-radius: 26px; padding: 10px 24px 14px; box-shadow: var(--shadow); text-align: center;
  opacity: 0; transform: translate(-50%, -50%) scale(.5); transition: opacity .3s, transform .4s cubic-bezier(.2, 1.6, .4, 1); pointer-events: none;
}
.jumping .jp-intro.show { opacity: 1; transform: translate(-50%, -50%); }
.jumping .jp-intro .jp-pony-svg { width: 130px; height: auto; }
.jumping .jp-intro p { margin: 0; font-size: 30px; font-weight: 800; color: var(--grape); }
.jumping .jp-intro b { font-size: 18px; color: var(--ink); }
.jumping .jp-got { display: flex; gap: 10px; margin-top: 6px; }
.jumping .jp-got span { position: relative; }
.jumping .jp-got .jp-rosette { width: 40px; height: 52px; }
.jumping .jp-got i { position: absolute; right: -8px; top: -4px; font-style: normal; font-weight: 800; font-size: 13px; background: var(--ink); color: #fff; border-radius: 10px; padding: 0 6px; }
.results .jp-final { display: inline-flex; align-items: center; gap: 10px; }
.results .jp-final .jp-rosette { width: 54px; height: 70px; }

.jumping .hud span { white-space: nowrap; }
.jumping .hud em { font-style: normal; }
.jumping .hud b { font-weight: inherit; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .jumping .hud em { display: none; } .jumping .hud-faults::before { content: '❌ '; } }
@media (max-width: 560px) { .jumping .game-top h2 { font-size: 20px; } }

@media (max-height: 760px) {
  .jumping .jp-stands { height: 44px; }
  .jumping .jp-stands .critter-svg { width: 30px; height: 30px; }
  .jumping .jp-map { top: 52px; height: 24px; }
  .jumping .jp-map-pony { font-size: 26px; }
  .jumping .jp-card { top: 82px; }
  .jumping .jp-word { font-size: 30px; border-width: 3px; }
  .jumping .jp-word i { width: 28px; height: 28px; line-height: 28px; font-size: 16px; }
  .jumping .jp-then { font-size: 15px; }
  .jumping .jp-pony { width: 150px; bottom: calc(16% - 11px); }
  .jumping .jp-fence { width: 150px; }
  .jumping .jp-sign b { font-size: 18px; }
  .jumping .jp-start i, .jumping .jp-finish i { height: 90px; }
  .jumping .jp-banner b { font-size: 50px; }
}
@media (max-width: 760px) {
  .jumping .jp-map { width: 80%; }
  .jumping .jp-word { font-size: min(28px, 7vw); letter-spacing: 1px; }
  .jumping .jp-pony { width: 140px; bottom: calc(16% - 10px); }
  .jumping .jp-fence { width: 140px; }
  .jumping .jp-sign b { font-size: 17px; }
  .jumping .jp-banner b { font-size: 42px; }
  .jumping .jp-banner.go b { font-size: 64px; }
}

@keyframes jp-fall { 0% { transform: none; } 60% { transform: translate(14px, 40px) rotate(18deg); } 100% { transform: translate(22px, 66px) rotate(8deg); } }
@keyframes jp-zoom { from { transform: translateX(0); } to { transform: translateX(-14px); } }
@keyframes jp-banner { 0% { opacity: 0; transform: scale(.3) rotate(-6deg); } 20% { opacity: 1; transform: scale(1.1) rotate(-3deg); } 75% { opacity: 1; transform: scale(1) rotate(-3deg); } 100% { opacity: 0; transform: scale(1.05) translateY(-22px) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { .jumping .jp-pony.gallop::before { animation: none; } }
