/* ===========================================================
   Unicorn Dress-Up extras + "Nia's Unicorn Show" flying world
   =========================================================== */

/* ---- Dress-up extras ---- */
.stage svg.glow { filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 16px #ff6fb5) drop-shadow(0 0 26px #9b5de5); }
.stage .wing, .show-unicorn .wing { transform-box: fill-box; transform-origin: 85% 90%; }
.stage .near-wing { animation: wing-idle 2.4s ease-in-out infinite; }
@keyframes wing-idle { 50% { transform: rotate(-6deg); } }

/* ---- The show world (covers the whole screen) ---- */
.show-world {
  position: fixed;
  inset: 0;
  z-index: 95;               /* above the page, below confetti + sparkles */
  overflow: hidden;
  background: linear-gradient(180deg, #7fd8ff 0%, #c8eeff 45%, #ffe3f1 100%);
  font-family: "Fredoka", system-ui, sans-serif;
  color: #3d2c5c;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.show-sky-bg { position: absolute; inset: 0; opacity: .55; pointer-events: none; }

/* big rainbow arc */
.show-rainbow {
  position: absolute;
  left: 50%; top: 62%;
  width: 120vmin; height: 120vmin;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle,
    transparent 0 52%, #9b5de5 52% 55%, #4cc9f0 55% 58%, #7be07b 58% 61%,
    #ffd93d 61% 64%, #ff9f43 64% 67%, #ff6fb5 67% 70%, transparent 70%);
  opacity: .55;
  pointer-events: none;
}
.show-sun {
  position: absolute; right: 6vw; top: 9vh;
  font-size: 4.5rem;
  animation: show-spin 18s linear infinite;
  pointer-events: none;
}
@keyframes show-spin { to { transform: rotate(360deg); } }

.show-cloud {
  position: absolute;
  font-size: 5rem;
  opacity: .9;
  pointer-events: none;
  animation: show-cloud-drift linear infinite;
}
@keyframes show-cloud-drift { from { transform: translateX(-30vw); } to { transform: translateX(130vw); } }

/* title + score */
.show-title {
  position: absolute; left: 50%; top: 12px;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 999px;
  padding: 8px 22px;
  font-size: clamp(1.1rem, 3vw, 1.8rem);
  font-weight: 700;
  box-shadow: 0 6px 0 rgba(61, 44, 92, .15);
  white-space: nowrap;
  z-index: 5;
}
.show-title span { color: #ff6fb5; }
.show-score {
  position: absolute; left: 14px; top: 12px;
  background: #fff6c7;
  border: 3px solid #ffd93d;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 1.4rem;
  font-weight: 700;
  z-index: 5;
}
.show-score.bump { animation: show-bump .35s ease-out; }
@keyframes show-bump { 50% { transform: scale(1.3); } }
.show-close, .show-music {
  position: absolute; top: 12px;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 3px solid #3d2c5c;
  background: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 6;
}
.show-close { right: 14px; }
.show-music { right: 76px; }

.show-hint {
  position: absolute; left: 50%; top: 70px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, .85);
  border-radius: 16px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 1rem;
  z-index: 5;
  transition: opacity 1s;
}
.show-hint kbd {
  background: #efe4ff; border: 2px solid #9b5de5; border-radius: 6px;
  padding: 0 6px; font-family: inherit;
}

/* ---- the flying unicorn ---- */
.show-unicorn {
  position: absolute;
  left: 0; top: 0;
  width: min(32vw, 280px);
  z-index: 4;
  will-change: transform;
  pointer-events: none;
}
.show-unicorn .flipper { transition: transform .15s; }
.show-unicorn.left .flipper { transform: scaleX(-1); }
.show-unicorn .flipper > div { position: relative; }
.show-unicorn svg { width: 100%; height: auto; display: block; overflow: visible; }
.show-unicorn .accessory { position: absolute; font-size: 2.2rem; }
.show-unicorn.flap .near-wing { animation: show-flap .35s ease-out; }
.show-unicorn.flap .far-wing  { animation: show-flap .35s ease-out .05s; }
@keyframes show-flap { 40% { transform: rotate(-28deg); } }
.show-unicorn.trot svg { animation: show-trot .3s ease-in-out infinite; }
@keyframes show-trot { 50% { transform: translateY(-5px); } }
.show-unicorn .shine {
  position: absolute; inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.7), transparent 65%);
  z-index: -1;
}

/* rainbow trail */
.show-trail {
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 3;
  animation: show-trail-fade .9s ease-out forwards;
}
@keyframes show-trail-fade { to { transform: scale(.2) translateY(14px); opacity: 0; } }

/* things to collect */
.show-treat {
  position: absolute;
  font-size: 2.6rem;
  z-index: 3;
  pointer-events: none;
  animation: show-treat-bob 1.6s ease-in-out infinite alternate, show-treat-in .4s ease-out;
  filter: drop-shadow(0 0 6px #fff);
}
@keyframes show-treat-bob { to { transform: translateY(-14px) rotate(8deg); } }
@keyframes show-treat-in { from { scale: 0; } }
.show-pop {
  position: absolute;
  font-size: 1.6rem;
  font-weight: 700;
  color: #ff6fb5;
  pointer-events: none;
  z-index: 6;
  text-shadow: 0 2px 0 #fff;
  animation: show-pop-up .9s ease-out forwards;
}
@keyframes show-pop-up { to { transform: translateY(-50px); opacity: 0; } }

/* ---- the cheering crowd ---- */
.show-crowd {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 26vh;
  min-height: 150px;
  z-index: 2;
  background:
    repeating-linear-gradient(180deg, #ff9fd0 0 18px, #ff6fb5 18px 22px),
    #ff9fd0;
  border-top: 6px solid #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 4px;
}
.show-row {
  display: flex;
  justify-content: space-around;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
}
.show-row + .show-row { margin-top: -6px; }
.show-person {
  position: relative;
  display: inline-block;
  animation: show-sway 1.2s ease-in-out infinite alternate;
  animation-delay: calc(var(--d) * -0.37s);
}
@keyframes show-sway { to { transform: translateY(-6px) rotate(4deg); } }
.show-crowd.cheer .show-person { animation: show-jump .45s ease-in-out 3 alternate; animation-delay: calc(var(--d) * 0.04s); }
@keyframes show-jump { to { transform: translateY(-26px) rotate(-6deg); } }
.show-sign {
  position: absolute;
  left: 50%; bottom: 100%;
  transform: translateX(-50%) rotate(var(--tilt, -4deg));
  background: #fff;
  border: 3px solid #3d2c5c;
  border-radius: 8px;
  padding: 2px 8px;
  font-size: .9rem;
  font-weight: 700;
  white-space: nowrap;
  color: #9b5de5;
}
.show-bubble {
  position: absolute;
  bottom: calc(100% + 34px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 3px solid #3d2c5c;
  border-radius: 18px;
  padding: 6px 12px;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  z-index: 7;
  animation: show-bubble-in .3s ease-out;
}
.show-bubble::after {
  content: "";
  position: absolute; left: 50%; top: 100%;
  border: 10px solid transparent;
  border-top-color: #3d2c5c;
  transform: translateX(-50%);
}
@keyframes show-bubble-in { from { transform: translateX(-50%) scale(0); } }

/* ---- touch buttons (iPad / phone) ---- */
.show-pad {
  position: absolute;
  bottom: 12px;
  z-index: 6;
  display: flex;
  gap: 8px;
}
.show-pad.left-pad { left: 12px; }
.show-pad.right-pad { right: 12px; }
.show-pad button {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 3px solid #3d2c5c;
  background: rgba(255, 255, 255, .9);
  font-size: 1.8rem;
  cursor: pointer;
  touch-action: none;
}
.show-pad button.fly {
  width: 110px;
  border-radius: 999px;
  background: #ffd93d;
  font-size: 1.3rem;
  font-weight: 700;
}
.show-pad button:active, .show-pad button.held { transform: scale(.92); background: #ffe3f1; }
@media (hover: hover) and (pointer: fine) {
  .show-pad { opacity: .75; }
}

@media (prefers-reduced-motion: reduce) {
  .show-cloud, .show-sun, .show-person { animation: none; }
}
