:root {
  color-scheme: dark;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, #3e1d6f 0%, #140828 70%);
  color: #ffeefc;
}

.stage-shell {
  width: min(94vw, 860px);
  padding: 1.25rem;
  border-radius: 18px;
  border: 1px solid #9b79df;
  background: linear-gradient(180deg, #2a1347ee, #1a0b2fee);
  box-shadow: 0 18px 30px #0008;
}

h1,
h2,
p {
  margin: 0.4rem 0;
}

.hud {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.15rem;
  margin-bottom: 0.8rem;
  color: #ffd6f5;
}

.scene {
  position: relative;
  height: 380px;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 10%, #ffffff33 0 28%, transparent 40%),
    linear-gradient(180deg, #3f1f67 0 55%, #2a1746 55% 70%, #170b2d 70%);
  perspective: 900px;
  transform-style: preserve-3d;
}

.lights {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    105deg,
    #fff1 0 25px,
    #ff9af322 26px 46px,
    transparent 48px 76px
  );
  animation: lightsMove 5s linear infinite;
}

.princess {
  position: absolute;
  left: 50%;
  bottom: 56px;
  width: 130px;
  height: 260px;
  transform: translateX(-50%) rotateY(-12deg);
  transform-style: preserve-3d;
  filter: drop-shadow(0 10px 12px #0008);
}

.princess.performing {
  animation: danceSpin 1.4s ease-in-out infinite;
}

.crown {
  position: absolute;
  left: 50%;
  top: 12px;
  width: 44px;
  height: 24px;
  transform: translateX(-50%) translateZ(12px);
  clip-path: polygon(0% 100%, 18% 26%, 34% 80%, 50% 18%, 66% 80%, 82% 26%, 100% 100%);
  background: linear-gradient(180deg, #fff7a8, #e8ba42);
}

.head {
  position: absolute;
  top: 24px;
  left: 50%;
  width: 70px;
  height: 74px;
  transform: translateX(-50%) translateZ(14px);
  border-radius: 45% 45% 48% 48%;
  background: linear-gradient(160deg, #ffd8c7, #f4b196);
}

.eye {
  position: absolute;
  top: 30px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2c1742;
}

.eye.left {
  left: 16px;
}

.eye.right {
  right: 16px;
}

.mouth {
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: 20px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 0 0 12px 12px;
  border: 2px solid #b84561;
  border-top: none;
}

.mouth.singing {
  height: 14px;
  border-radius: 50%;
  background: #5a1c30;
}

.torso {
  position: absolute;
  top: 95px;
  left: 50%;
  width: 58px;
  height: 72px;
  transform: translateX(-50%) translateZ(10px);
  border-radius: 14px;
  background: linear-gradient(165deg, #ffbef1 0%, #ff90d1 42%, #cc3f9f 100%);
  box-shadow: inset -8px -6px 10px #87296e66, inset 8px 6px 10px #ffd9f766;
}

.torso::before,
.torso::after {
  content: "";
  position: absolute;
  top: 7px;
  width: 10px;
  height: 58px;
  border-radius: 9px;
  background: linear-gradient(180deg, #7d2e63, #571744);
  opacity: 0.45;
}

.torso::before {
  left: -5px;
  transform: skewY(14deg) translateZ(-3px);
}

.torso::after {
  right: -5px;
  transform: skewY(-14deg) translateZ(-3px);
}

.cloth-number {
  position: absolute;
  inset: 16px 0 auto;
  text-align: center;
  font-size: 1.8rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #fff8ff;
  text-shadow: 0 2px 0 #a13883, 0 6px 8px #651949cc;
  transform: translateZ(12px);
}

.arm,
.leg {
  position: absolute;
  background: linear-gradient(180deg, #ffd8c7, #edab95);
  transform-origin: top center;
}

.arm {
  top: 106px;
  width: 16px;
  height: 78px;
  border-radius: 14px;
}

.left-arm {
  left: 20px;
  transform: rotateZ(20deg);
}

.right-arm {
  right: 20px;
  transform: rotateZ(-20deg);
}

.princess.performing .left-arm {
  animation: waveLeft 0.7s ease-in-out infinite;
}

.princess.performing .right-arm {
  animation: waveRight 0.7s ease-in-out infinite;
}

.skirt {
  position: absolute;
  left: 50%;
  top: 145px;
  width: 112px;
  height: 100px;
  transform: translateX(-50%) translateZ(4px);
  clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, #ffb5eb, #ff87db 38%, #c83798 100%);
  box-shadow: inset 0 -12px 18px #6b1a5088, inset 14px 0 16px #ffdbf677, inset -14px 0 16px #9f2f7e88;
}

.skirt::before,
.skirt::after {
  content: "";
  position: absolute;
  top: 10px;
  width: 24px;
  height: 82px;
  background: linear-gradient(180deg, #ffcff4, #cf4da4);
  opacity: 0.55;
}

.skirt::before {
  left: 14px;
  transform: skewY(8deg);
}

.skirt::after {
  right: 14px;
  transform: skewY(-8deg);
}

.leg {
  top: 230px;
  width: 18px;
  height: 56px;
  border-radius: 12px;
}

.left-leg {
  left: 44px;
}

.right-leg {
  right: 44px;
}

.princess.performing .left-leg {
  animation: kickLeft 0.7s ease-in-out infinite;
}

.princess.performing .right-leg {
  animation: kickRight 0.7s ease-in-out infinite;
}

.music-notes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.note {
  position: absolute;
  font-size: 1.8rem;
  color: #fff6a2;
  opacity: 0;
  animation: floatNote 2s ease-out forwards;
}

.lyrics-panel {
  margin-top: 0.9rem;
  border: 1px solid #7b54c0;
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  background: #210f3acc;
}

#lyricsList {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

#lyricsList li {
  margin: 0.2rem 0;
  color: #f0d8ff;
}

#lyricsList li.active {
  color: #fff8bf;
  font-weight: 700;
}

.controls {
  margin-top: 1rem;
  display: flex;
  gap: 0.7rem;
}

button {
  font: inherit;
  border: 1px solid #f6b9ff;
  border-radius: 10px;
  background: #ffcaef;
  color: #31134f;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@keyframes danceSpin {
  0%,
  100% {
    transform: translateX(-50%) rotateY(-12deg) rotateZ(-2deg);
  }
  50% {
    transform: translateX(-50%) rotateY(14deg) rotateZ(2deg);
  }
}

@keyframes waveLeft {
  0%,
  100% {
    transform: rotateZ(35deg) rotateX(15deg);
  }
  50% {
    transform: rotateZ(-20deg) rotateX(-15deg);
  }
}

@keyframes waveRight {
  0%,
  100% {
    transform: rotateZ(-35deg) rotateX(15deg);
  }
  50% {
    transform: rotateZ(20deg) rotateX(-15deg);
  }
}

@keyframes kickLeft {
  0%,
  100% {
    transform: rotateX(0deg);
  }
  50% {
    transform: rotateX(-25deg);
  }
}

@keyframes kickRight {
  0%,
  100% {
    transform: rotateX(-25deg);
  }
  50% {
    transform: rotateX(0deg);
  }
}

@keyframes floatNote {
  0% {
    transform: translateY(0) scale(0.8);
    opacity: 0;
  }
  20% {
    opacity: 0.95;
  }
  100% {
    transform: translateY(-110px) translateX(18px) scale(1.1);
    opacity: 0;
  }
}

@keyframes lightsMove {
  from {
    transform: translateX(-30px);
  }
  to {
    transform: translateX(30px);
  }
}
