* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: linear-gradient(160deg, #ffe3ec 0%, #e6dcff 100%);
  color: #5a4a6b;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

.top {
  text-align: center;
  padding: 24px 16px 8px;
}

.top h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: #d6457f;
  letter-spacing: 2px;
}

.top p {
  margin-top: 6px;
  font-size: 0.9rem;
  opacity: 0.75;
}

.stage-wrap {
  width: 100%;
  max-width: 520px;
  padding: 12px;
}

/* 场景 */
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(140, 90, 180, 0.25);
  background: linear-gradient(#bfe6ff, #ffe9f3);
  transition: background 0.8s ease;
}

.stage.time-night {
  background: linear-gradient(#2b2d5e, #6b5b95);
}

.stage.time-sunset {
  background: linear-gradient(#ffb199, #ff7eb3);
}

.sun,
.moon {
  position: absolute;
  top: 8%;
  left: 12%;
  width: 16%;
  aspect-ratio: 1;
  border-radius: 50%;
  transition: opacity 0.8s ease;
}

.sun {
  background: radial-gradient(circle, #fff7b0 40%, rgba(255, 240, 150, 0.2) 70%);
  box-shadow: 0 0 30px #fff3a0;
}

.moon {
  background: #fffbe8;
  box-shadow: 0 0 24px #fffbe8;
  opacity: 0;
}

.stage.time-night .sun {
  opacity: 0;
}

.stage.time-night .moon {
  opacity: 1;
}

.stars {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  background-image:
    radial-gradient(2px 2px at 20% 25%, #fff, transparent),
    radial-gradient(2px 2px at 65% 15%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 80% 40%, #fff, transparent),
    radial-gradient(2px 2px at 40% 55%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 12% 65%, #fff, transparent);
  animation: twinkle 3s ease-in-out infinite;
}

.stage.time-night .stars {
  opacity: 1;
}

@keyframes twinkle {
  50% {
    opacity: 0.4;
  }
}

.hills {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 0;
  height: 26%;
  border-radius: 50% 50% 0 0 / 60% 60% 0 0;
  background: linear-gradient(#ffd1e3, #f7a8c8);
  transition: background 0.8s ease;
}

.stage.time-night .hills {
  background: linear-gradient(#3d3570, #2a2550);
}

.stage.time-sunset .hills {
  background: linear-gradient(#d9608f, #b0467a);
}

/* 花瓣 */
.petals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.petals.off {
  display: none;
}

.petal {
  position: absolute;
  top: -10%;
  width: 12px;
  height: 9px;
  background: radial-gradient(circle at 30% 30%, #ffffff, #ffc2dc 70%);
  border-radius: 80% 0 80% 0;
  opacity: 0.9;
  animation-name: fall, sway;
  animation-timing-function: linear, ease-in-out;
  animation-iteration-count: infinite, infinite;
  animation-direction: normal, alternate;
}

@keyframes fall {
  to {
    transform: translateY(130%);
  }
}

@keyframes sway {
  from {
    margin-left: -20px;
  }
  to {
    margin-left: 20px;
  }
}

/* 角色 */
.girl {
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: 62%;
  height: auto;
  transform: translateX(-50%);
  cursor: pointer;
  animation: breathe 3.2s ease-in-out infinite;
  transform-origin: 50% 100%;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease;
}

.girl:active {
  transform: translateX(-50%) scale(0.97);
}

@keyframes breathe {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-4px);
  }
}

.hair-back {
  fill: #8c6bd6;
}

.hair-front,
.hair-side {
  fill: #9d7ce6;
}

.body {
  fill: #fff;
  stroke: #d6457f;
  stroke-width: 2;
}

.collar {
  fill: #ff8fb8;
}

.skin {
  fill: #ffe6dc;
}

.pin {
  fill: #ffd34d;
}

.eye-white {
  fill: #fff;
}

.iris {
  fill: #5a8dea;
}

.shine {
  fill: #fff;
}

.blush {
  fill: #ff9ec0;
  opacity: 0.6;
}

.mouth {
  fill: none;
  stroke: #d6457f;
  stroke-width: 2.5;
  stroke-linecap: round;
  transform-origin: 100px 158px;
}

.eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 4s infinite;
}

.eye.right {
  animation-delay: 0.05s;
}

@keyframes blink {
  0%, 92%, 100% {
    transform: scaleY(1);
  }
  95% {
    transform: scaleY(0.1);
  }
}

/* 表情：害羞，腮红变明显 */
.girl.mood-shy .blush {
  opacity: 1;
}

/* 表情：开心，眼睛微微眯起 */
.girl.mood-happy .eye {
  animation: none;
  transform: scaleY(0.7);
}

.sparkle {
  position: absolute;
  top: 20%;
  right: 14%;
  color: #fff;
  font-size: 1.6rem;
  animation: sparkle 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sparkle {
  0%, 100% {
    opacity: 0.2;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* 按钮 */
.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px 16px;
}

.controls button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(135deg, #ff7eb3, #a78bfa);
  box-shadow: 0 6px 14px rgba(167, 139, 250, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.controls button:hover {
  transform: translateY(-2px);
}

.controls button:active {
  transform: translateY(1px);
}

.foot {
  padding: 8px 16px 24px;
  font-size: 0.8rem;
  opacity: 0.6;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
