/* ===========================================================
   Doll dress-up + "Nia's Fashion Show" runway
   =========================================================== */

/* ---- dress-up stage ---- */
.doll-stage { display: flex; justify-content: center; padding: 14px; }
.doll-box { position: relative; width: 100%; max-width: 250px; }
.doll-box svg { width: 100%; height: auto; display: block; }
.doll-box .accessory { font-size: 2.2rem; }
.doll-svg.glow { filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 14px #ff6fb5) drop-shadow(0 0 24px #9b5de5); }

/* ---- the runway world ---- */
.rw-world {
  position: fixed;
  inset: 0;
  z-index: 95;                 /* above the page, below confetti + sparkles */
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, #6b3fa0 0%, #2a1748 55%, #170c2c 100%);
  font-family: "Fredoka", system-ui, sans-serif;
  color: #3d2c5c;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
/* back wall: curtains + marquee */
.rw-curtain {
  position: absolute; left: 0; right: 0; top: 0; height: 30%;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 14px, rgba(255,255,255,.06) 14px 40px),
    linear-gradient(180deg, #ff4fa3, #b0247a);
  box-shadow: inset 0 -30px 40px rgba(0,0,0,.35);
}
.rw-marquee {
  position: absolute; left: 50%; top: 5%;
  transform: translateX(-50%);
  padding: 10px 26px;
  border-radius: 18px;
  background: #2a1748;
  color: #fff;
  font-size: clamp(1.2rem, 3.4vw, 2.2rem);
  font-weight: 700;
  white-space: nowrap;
  border: 6px dotted #ffd93d;
  box-shadow: 0 0 22px #ffd93d88;
  animation: rw-bulbs 1s steps(2) infinite;
  z-index: 3;
}
.rw-marquee span { color: #ff9fd0; }
@keyframes rw-bulbs { 50% { border-color: #fff6c7; box-shadow: 0 0 30px #ffd93dcc; } }

/* the runway itself (a trapezoid going back into the stage) */
.rw-runway {
  position: absolute; left: 0; right: 0; top: 28%; bottom: 0;
  clip-path: polygon(39% 0, 61% 0, 86% 100%, 14% 100%);
  background:
    linear-gradient(90deg, transparent 49.4%, rgba(255, 217, 61, .85) 49.4% 50.6%, transparent 50.6%),
    linear-gradient(180deg, #ffe3f1, #ffffff 60%, #ffd1e8);
  z-index: 1;
}
.rw-runway::after {              /* shiny floor reflection */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.7) 45%, transparent 60%);
  animation: rw-shine 4s linear infinite;
}
@keyframes rw-shine { from { transform: translateX(-60%); } to { transform: translateX(60%); } }
.rw-edge-lights {
  position: absolute; left: 0; right: 0; top: 28%; bottom: 0;
  clip-path: polygon(38.4% 0, 39.4% 0, 14.8% 100%, 13% 100%, 13% 100%, 13% 100%);
  z-index: 1;
}

/* spotlights */
.rw-spot {
  position: absolute; top: -5%;
  width: 34vmin; height: 120vh;
  transform-origin: 50% 0;
  background: linear-gradient(180deg, rgba(255, 246, 199, .55), rgba(255, 246, 199, 0) 85%);
  clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 4;
}
.rw-spot.left { left: 4%; }
.rw-spot.right { right: 4%; }

/* audience on both sides */
.rw-fan {
  position: absolute;
  line-height: 1;
  z-index: 2;
  animation: rw-sway 1.1s ease-in-out infinite alternate;
  animation-delay: calc(var(--d) * -0.29s);
}
@keyframes rw-sway { to { transform: translateY(-5px) rotate(4deg); } }
.rw-world.cheer .rw-fan { animation: rw-jump .4s ease-in-out 3 alternate; animation-delay: calc(var(--d) * 0.03s); }
@keyframes rw-jump { to { transform: translateY(-22px) rotate(-6deg); } }
.rw-sign {
  position: absolute; left: 50%; bottom: 100%;
  transform: translateX(-50%) rotate(var(--tilt, -4deg));
  background: #fff; color: #ff3f9e;
  border: 3px solid #3d2c5c; border-radius: 8px;
  padding: 1px 7px;
  font-size: .8rem; font-weight: 700; white-space: nowrap;
}
.rw-bubble {
  position: absolute; left: 50%; bottom: calc(100% + 30px);
  transform: translateX(-50%);
  background: #fff; color: #3d2c5c;
  border: 3px solid #3d2c5c; border-radius: 18px;
  padding: 6px 12px;
  font-size: 1rem; font-weight: 700; white-space: nowrap;
  z-index: 8;
  animation: rw-pop-in .3s ease-out;
}
.rw-bubble::after {
  content: ""; position: absolute; left: 50%; top: 100%;
  border: 10px solid transparent; border-top-color: #3d2c5c;
  transform: translateX(-50%);
}
@keyframes rw-pop-in { from { transform: translateX(-50%) scale(0); } }

/* photographers + flashes */
.rw-photog { position: absolute; bottom: 8px; font-size: 2.6rem; z-index: 6; }
.rw-photog.snap { animation: rw-snap .25s ease-out; }
@keyframes rw-snap { 50% { transform: scale(1.25) rotate(-8deg); } }
.rw-flash {
  position: absolute;
  width: 220px; height: 220px;
  margin: -110px 0 0 -110px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 12%, rgba(255,255,255,.6) 30%, transparent 65%);
  pointer-events: none;
  z-index: 7;
  animation: rw-flash .35s ease-out forwards;
}
@keyframes rw-flash { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.rw-white { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 7; }
.rw-white.go { animation: rw-white .3s ease-out; }
@keyframes rw-white { 20% { opacity: .5; } }

/* the doll walking the runway */
.rw-doll {
  position: absolute; left: 0; top: 0;
  width: 200px;
  transform-origin: 50% 100%;
  z-index: 5;
  pointer-events: none;
  will-change: transform;
}
.rw-doll .inner { position: relative; transform-origin: 50% 100%; }
.rw-doll .doll-box { max-width: none; }
.rw-doll.walking .inner { animation: rw-walk .32s ease-in-out infinite alternate; }
@keyframes rw-walk { from { transform: translateY(0) rotate(-2.5deg); } to { transform: translateY(-7px) rotate(2.5deg); } }
.rw-doll.pose .inner { animation: rw-twirl .9s cubic-bezier(.3, 1.2, .5, 1); }
@keyframes rw-twirl {
  0% { transform: scaleX(1); }
  25% { transform: scaleX(-1) translateY(-14px); }
  50% { transform: scaleX(1) translateY(-20px); }
  75% { transform: scaleX(-1) translateY(-8px); }
  100% { transform: scaleX(1); }
}
.rw-shadow {
  position: absolute; left: 50%; bottom: -6px;
  width: 60%; height: 16px; margin-left: -30%;
  border-radius: 50%;
  background: rgba(61, 44, 92, .25);
}

/* things the crowd throws */
.rw-throw {
  position: absolute;
  font-size: 1.8rem;
  pointer-events: none;
  z-index: 6;
  transition: transform .9s cubic-bezier(.3, .6, .4, 1), opacity .4s .8s;
}

/* HUD */
.rw-score {
  position: absolute; left: 14px; top: 12px;
  background: #fff6c7; border: 3px solid #ffd93d; border-radius: 999px;
  padding: 6px 16px; font-size: 1.3rem; font-weight: 700; z-index: 9;
}
.rw-score.bump { animation: rw-bump .35s ease-out; }
@keyframes rw-bump { 50% { transform: scale(1.3); } }
.rw-close, .rw-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: 9;
}
.rw-close { right: 14px; }
.rw-music { right: 76px; }
.rw-hint {
  position: absolute; left: 50%; top: calc(5% + 70px);
  transform: translateX(-50%);
  background: rgba(255, 255, 255, .9); border-radius: 16px;
  padding: 6px 14px; font-weight: 600; z-index: 9;
  white-space: nowrap; transition: opacity 1s;
}
.rw-hint kbd { background: #efe4ff; border: 2px solid #9b5de5; border-radius: 6px; padding: 0 6px; font-family: inherit; }
.rw-big {
  position: absolute; left: 50%; top: 40%;
  transform: translate(-50%, -50%);
  font-size: clamp(2rem, 7vw, 4rem); font-weight: 700;
  color: #fff; text-shadow: 0 4px 0 #ff3f9e, 0 0 20px #ff6fb5;
  white-space: nowrap; pointer-events: none; z-index: 9;
  animation: rw-big 1.2s ease-out forwards;
}
@keyframes rw-big { 0% { transform: translate(-50%, -50%) scale(0); } 25% { transform: translate(-50%, -50%) scale(1.2); } 80% { opacity: 1; } 100% { transform: translate(-50%, -80%) scale(1); opacity: 0; } }

/* touch buttons */
.rw-pad { position: absolute; bottom: 70px; z-index: 9; display: grid; gap: 6px; }
.rw-pad.left-pad { left: 12px; grid-template-columns: repeat(3, 58px); }
.rw-pad.right-pad { right: 12px; }
.rw-pad button {
  width: 58px; height: 58px; border-radius: 50%;
  border: 3px solid #3d2c5c; background: rgba(255, 255, 255, .9);
  font-size: 1.6rem; cursor: pointer; touch-action: none;
}
.rw-pad button.pose { width: 120px; border-radius: 999px; background: #ff9fd0; font-size: 1.2rem; font-weight: 700; }
.rw-pad button.held, .rw-pad button:active { transform: scale(.92); background: #ffe3f1; }
.rw-pad .gap { visibility: hidden; }
@media (hover: hover) and (pointer: fine) { .rw-pad { opacity: .7; } }

@media (prefers-reduced-motion: reduce) {
  .rw-fan, .rw-marquee, .rw-runway::after { animation: none; }
}
