/* Chibi mascots (pose sprites): running lane, thank-you scene, ending scene */
.mascot { position: absolute; bottom: 0; left: 0; width: max-content; }
.mascot-flip { height: 100%; }
.mascot.mirrored .mascot-flip { transform: scaleX(-1); }
.mascot-img { display: block; height: 100%; width: auto; max-width: none; user-select: none; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .16)); }
.mascot.running .mascot-img { animation: mascot-run .3s ease-in-out infinite; }
@keyframes mascot-run { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes mascot-bounce { 0%, 100% { transform: translateY(0) scale(1, 1); } 40% { transform: translateY(-10px) scale(.98, 1.03); } 60% { transform: translateY(0) scale(1.03, .97); } }
@keyframes mascot-pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }

/* 1. lane just above the bottom toolbar */
.mascot-lane { position: absolute; left: 0; right: 0; bottom: 64px; height: 124px; z-index: 998; pointer-events: none; overflow: hidden; }
.mascot-lane .mascot { height: 96px; }
.mascot-lane .pair.pop .mascot-img { animation: mascot-pop .45s ease-out, mascot-bounce 1s ease-in-out .45s infinite; transform-origin: 50% 100%; }
.mascot-meet-heart { position: absolute; left: 50%; top: 2px; font-size: 26px; color: #ff4969; transform: translateX(-50%); text-shadow: 0 2px 6px rgba(255, 73, 105, .45); }
.mascot-meet-heart.pop { animation: mascot-heart-pop 1.8s ease-out both; }
@keyframes mascot-heart-pop { 0% { opacity: 0; transform: translate(-50%, 12px) scale(.3); } 25% { opacity: 1; transform: translate(-50%, -2px) scale(1.25); }
  75% { opacity: 1; transform: translate(-50%, -8px) scale(1); } 100% { opacity: 0; transform: translate(-50%, -24px) scale(.8); } }

/* 2. thank-you scene */
.mascot-thanks { position: fixed; inset: 0; z-index: 3500; display: none; align-items: center; justify-content: center; background: rgba(40, 20, 26, .78);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); cursor: pointer; }
.mascot-thanks.show { display: flex; animation: mascot-fade .35s ease-out; }
@keyframes mascot-fade { from { opacity: 0; } }
.mascot-thanks-stage { position: relative; width: min(420px, 92vw); height: 320px; }
.mascot-thanks .mascot { height: 200px; bottom: 6px; }
.mascot-thanks-text { position: absolute; left: 0; right: 0; top: 0; margin: 0; text-align: center; color: #fff; font: 400 34px/1.15 'Aquarelle', 'HoaTay1', cursive;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .45); opacity: 0; }
.mascot-thanks.met .mascot-thanks-text { animation: mascot-text-in .8s ease-out both; }
@keyframes mascot-text-in { from { opacity: 0; transform: translateY(12px) scale(.95); } to { opacity: 1; transform: none; } }
.mascot-thanks-hearts { position: absolute; inset: 0; pointer-events: none; }
.mascot-heart { position: absolute; bottom: 130px; color: #ff6f91; opacity: 0; animation: mascot-heart-up 2.6s ease-out both; }
@keyframes mascot-heart-up { 0% { opacity: 0; transform: translateY(0) scale(.4); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-190px) scale(1.1); } }

/* runners come in from both sides to the centre, then the pair pose takes over */
.mascot.in-left { left: 50%; transform: translateX(-100%); }
.mascot.in-right { left: 50%; transform: translateX(0); }
.mascot.together { left: 50%; transform: translateX(-50%); opacity: 0; }
.mascot-thanks.show .in-left, .mascot-ending.play .in-left { animation: mascot-enter-left 1s cubic-bezier(.25, .7, .35, 1) both; }
.mascot-thanks.show .in-right, .mascot-ending.play .in-right { animation: mascot-enter-right 1s cubic-bezier(.25, .7, .35, 1) both; }
@keyframes mascot-enter-left { from { transform: translateX(-100%) translateX(-60vw); } to { transform: translateX(-100%); } }
@keyframes mascot-enter-right { from { transform: translateX(60vw); } to { transform: translateX(0); } }
.mascot-thanks.met .in-left, .mascot-thanks.met .in-right, .mascot-ending.met .in-left, .mascot-ending.met .in-right { opacity: 0; }
.mascot-thanks.met .together { opacity: 1; }
.mascot-thanks.met .together .mascot-img { animation: mascot-pop .45s ease-out, mascot-bounce .9s ease-in-out .45s 4; transform-origin: 50% 100%; }

/* 3. ending scene after the album */
.mascot-ending { position: relative; padding: 34px 16px 96px; background: linear-gradient(#fff, #fdf2f4); text-align: center; overflow: hidden; }
.mascot-ending-kicker { margin: 0; font: 400 40px 'Aquarelle', 'HoaTay1', cursive; color: #b5485a; }
.mascot-ending-text { margin: 4px 0 0; font: 14px/1.6 'OpenSans', 'Quicksand', sans-serif; color: #6b5d59; }
.mascot-ending-stage { position: relative; height: 200px; margin-top: 10px; }
.mascot-ending .mascot { height: 176px; }
.mascot-ending .in-left, .mascot-ending .in-right { opacity: 0; }
.mascot-ending.play .in-left, .mascot-ending.play .in-right { opacity: 1; }
.mascot-ending.play.met .in-left, .mascot-ending.play.met .in-right { opacity: 0; }
.mascot-ending.met .together { transition: opacity .35s; }
.mascot-ending.met:not(.wave) .together.jump, .mascot-ending.met.wave .together.waving { opacity: 1; }
.mascot-ending.met .together .mascot-img { animation: mascot-bounce 1.2s ease-in-out infinite; transform-origin: 50% 100%; }
.mascot-ending-float { position: absolute; inset: 0; pointer-events: none; }
.mascot-floater { position: absolute; bottom: 10px; font-size: 18px; color: #ff6f91; opacity: 0; }
.mascot-ending.play .mascot-floater { animation-name: mascot-float-up; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
@keyframes mascot-float-up { 0% { opacity: 0; transform: translateY(0) rotate(0); } 15% { opacity: .9; } 100% { opacity: 0; transform: translateY(-200px) rotate(40deg); } }

@media (prefers-reduced-motion: reduce) {
  .mascot-lane { display: none; }
  .mascot-img { animation: none !important; }
  .mascot-thanks .in-left, .mascot-thanks .in-right, .mascot-ending .in-left, .mascot-ending .in-right { animation: none !important; opacity: 0 !important; }
  .mascot-thanks.show .together, .mascot-ending .together.jump { opacity: 1 !important; }
}
