/* ============ 糖果色温馨背景 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --candy-pink: #FFD6E0;
  --candy-mint: #C9F2E4;
  --candy-peach: #FFE3C9;
  --candy-lilac: #E4D9FF;
  --candy-lemon: #FFF3B0;
  --wood: #A9714B;
  --wood-dark: #83402B;
  --ink: #5C3A2E;
}

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg,
      var(--candy-pink) 0%,
      var(--candy-lemon) 28%,
      var(--candy-peach) 55%,
      var(--candy-mint) 82%,
      var(--candy-lilac) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 背景漂浮装饰 */
.bg-deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.cloud {
  position: absolute; width: 110px; height: 38px; border-radius: 40px;
  background: rgba(255,255,255,.75); filter: blur(1px);
  animation: drift 26s linear infinite;
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: inherit; border-radius: 50%;
}
.cloud::before { width: 46px; height: 46px; top: -22px; left: 18px; }
.cloud::after  { width: 34px; height: 34px; top: -14px; left: 58px; }
.c1 { top: 8%; animation-delay: -4s; }
.c2 { top: 20%; transform: scale(.7); animation-delay: -15s; }
@keyframes drift { from { left: -140px; } to { left: 105vw; } }

.blob { position: absolute; border-radius: 50%; opacity: .55; animation: floaty 7s ease-in-out infinite; }
.b1 { width: 180px; height: 180px; background: #FFC2D1; top: 6%; left: -60px; }
.b2 { width: 140px; height: 140px; background: #BDE9FF; bottom: 10%; right: -40px; animation-delay: -2s; }
.b3 { width: 90px; height: 90px; background: #D8C7FF; top: 45%; right: 6%; animation-delay: -4s; }
@keyframes floaty { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-18px);} }

/* ============ 动态音符：从冬不拉/唱机飘出 ============ */
.music-notes {
  position: absolute; top: 40%; left: 50%;
  width: 0; height: 0; z-index: 6; pointer-events: none;
}
.music-notes .note {
  position: absolute; font-size: clamp(22px, 4.5vw, 34px);
  text-shadow: 0 2px 0 rgba(255,255,255,.7);
  opacity: 0; animation: note-rise 3.2s ease-in-out infinite;
  will-change: transform, opacity;
}
.music-notes .n1 { left: 0px;   animation-delay: 0s;   color: #F76C8A; }
.music-notes .n2 { left: 30px;  animation-delay: .5s;  color: #3FBFBF; }
.music-notes .n3 { left: -34px; animation-delay: 1.1s; color: #F6A21E; }
.music-notes .n4 { left: 52px;  animation-delay: 1.6s; color: #7B68EE; }
.music-notes .n5 { left: -56px; animation-delay: 2.1s; color: #E85D9E; }
.music-notes .n6 { left: 12px;  animation-delay: 2.6s; color: #3FBFBF; }
@keyframes note-rise {
  0%   { transform: translate(0, 0) scale(.6) rotate(-10deg); opacity: 0; }
  15%  { opacity: 1; }
  50%  { transform: translate(24px, -70px) scale(1) rotate(8deg); opacity: .95; }
  100% { transform: translate(-12px, -150px) scale(1.15) rotate(-6deg); opacity: 0; }
}

/* ============ 主舞台 ============ */
.stage {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  padding: 4vh 16px 26vh; width: min(560px, 100%);
}
.title {
  font-size: clamp(24px, 5vw, 34px); letter-spacing: 2px;
  color: var(--wood-dark); text-align: center;
  text-shadow: 0 3px 0 #fff, 0 6px 12px rgba(131,64,43,.18);
}
.title small {
  display: block; font-size: .45em; font-weight: 500;
  color: #B07B5B; letter-spacing: 4px; margin-top: 6px;
}

/* ============ 留声机 ============ */
.gramophone {
  position: relative; width: min(420px, 88vw); margin-top: 3vh;
  display: flex; flex-direction: column; align-items: center;
}
.horn {
  position: absolute; top: -64px; left: -12px;
  width: clamp(120px, 34vw, 180px); z-index: 3;
  transform: rotate(-8deg);
  filter: drop-shadow(0 8px 10px rgba(131,64,43,.25));
  animation: horn-gentle 3.5s ease-in-out infinite;
}
@keyframes horn-gentle { 0%,100% { transform: rotate(-8deg);} 50% { transform: rotate(-5deg);} }

/* 唱臂 */
.tonearm {
  position: absolute; top: -26px; right: 4px; z-index: 4;
  width: 12px; height: 150px;
  background: linear-gradient(#e8c27a, #b9822f);
  border: 3px solid var(--wood-dark); border-radius: 8px;
  transform-origin: 50% 14px;
  transform: rotate(-30deg);
  transition: transform .9s cubic-bezier(.34,1.4,.5,1);
  box-shadow: 0 4px 8px rgba(0,0,0,.15);
}
.tonearm::before {
  content: ""; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe1a1, #b9822f);
  border: 3px solid var(--wood-dark);
}
.arm-head {
  position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 22px; border-radius: 6px;
  background: var(--wood-dark);
}
.playing .tonearm { transform: rotate(16deg); }

/* 唱盘 */
.turntable { position: relative; z-index: 2; margin-top: 10px; }
.platter {
  position: relative; width: min(340px, 80vw); aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle, #2b2b33 0 18%, transparent 18.5%),
    repeating-radial-gradient(circle, #26262d 0 6px, #1d1d24 6px 12px);
  border: 10px solid #3a2a22;
  box-shadow:
    0 0 0 6px #E8B04B,
    0 18px 40px rgba(131,64,43,.35),
    inset 0 0 30px rgba(0,0,0,.6);
  animation: spin 4.2s linear infinite;
  animation-play-state: paused;
}
.playing .platter { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }

.grooves {
  position: absolute; inset: 12%; border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 10px, rgba(255,255,255,.045) 10px 12px);
}
.label {
  position: absolute; inset: 22%; border-radius: 50%; overflow: hidden;
  border: 6px solid #F6D77A;
  box-shadow: 0 0 0 3px var(--wood-dark), inset 0 0 12px rgba(131,64,43,.3);
  background: #FDEBD3;
}
.label img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spindle {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe1a1, #8a5a1c);
  border: 2px solid var(--wood-dark); z-index: 2;
}
.base-shadow {
  width: 86%; height: 22px; margin: 14px auto 0; border-radius: 50%;
  background: rgba(131,64,43,.25); filter: blur(6px);
}
.cabinet {
  width: min(400px, 84vw); height: 46px; margin-top: -8px;
  background: linear-gradient(#C08552, #9A6238);
  border: 4px solid var(--wood-dark); border-radius: 16px;
  box-shadow: 0 10px 20px rgba(131,64,43,.3), inset 0 4px 0 rgba(255,255,255,.25);
}

/* ============ 倒计时卡片 ============ */
.timer-card {
  margin-top: 26px; width: min(400px, 88vw);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(6px);
  border: 3px solid #fff; border-radius: 26px;
  box-shadow: 0 14px 34px rgba(232,93,158,.18);
  padding: 20px 22px 24px; text-align: center;
}
.track-name { font-size: 15px; color: #9a7a66; min-height: 22px; }
.countdown {
  font-size: clamp(44px, 11vw, 60px); font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--wood-dark); letter-spacing: 2px;
  text-shadow: 0 3px 0 #FFE9A8;
  margin: 4px 0 10px;
}
.progress {
  height: 12px; border-radius: 8px; overflow: hidden;
  background: #F3E3D3; margin-bottom: 18px;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #F76C8A, #F6A21E, #3FBFBF);
  border-radius: 8px; transition: width .5s linear;
}

.controls { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  font-size: 17px; font-weight: 700; color: var(--wood-dark);
  border: 3px solid var(--wood-dark); border-radius: 999px;
  padding: 12px 26px; cursor: pointer; user-select: none;
  box-shadow: 0 5px 0 var(--wood-dark);
  transition: transform .12s, box-shadow .12s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--wood-dark); }
.btn-mint  { background: var(--candy-mint); }
.btn-peach { background: var(--candy-peach); }
.btn-stop  { background: #FFD6E0; }
.btn.active { outline: 4px dashed rgba(131,64,43,.4); outline-offset: 3px; }

.tip {
  position: fixed; bottom: 8px; left: 0; right: 0; z-index: 3;
  text-align: center; font-size: 12px; color: rgba(92,58,46,.55);
}

/* 手机上小人缩小、贴边 */
@media (max-width: 640px) {
  .dancers { padding: 0 1vw; bottom: 4vh; }
  .dancer { width: clamp(70px, 20vw, 110px); }
  .notes { margin-bottom: 10vh; }
}
