/* ===== 糖果消消乐 · 全局样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #2a1b3d;
  font-family: "PingFang SC", "Segoe UI", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  touch-action: none;
}

/* 舞台：以 1170x2532 设计基准，靠 JS 缩放居中 */
#stage {
  position: absolute;
  left: 50%; top: 50%;
  width: 1170px; height: 2532px;
  transform-origin: center center;
  background:
    radial-gradient(120% 80% at 50% 0%, #ffd7ec 0%, #ffc4e3 30%, #f7a8d8 60%, #e98fc9 100%);
  overflow: hidden;
}

/* 顶部柔和装饰光晕 */
#stage::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 30% at 20% 12%, rgba(255,255,255,.55), transparent 70%),
    radial-gradient(50% 25% at 85% 8%, rgba(255,255,255,.4), transparent 70%);
  pointer-events: none;
}

#game {
  position: absolute;
  left: 0; top: 0;
  width: 1170px; height: 2532px;
}

/* ===== UI 层 ===== */
.ui-layer { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; }

#hud { padding: 90px 70px 0; }

.hud-row { display: flex; gap: 34px; justify-content: space-between; }

.hud-card {
  flex: 1;
  background: linear-gradient(180deg, #ffffff, #fff2f9);
  border-radius: 40px;
  padding: 26px 20px 30px;
  text-align: center;
  box-shadow: 0 14px 0 #e48cbf, 0 22px 34px rgba(150,40,110,.28), inset 0 3px 6px rgba(255,255,255,.9);
  border: 4px solid #ffffff;
}
.hud-card.goal { background: linear-gradient(180deg, #fff7d6, #ffe9a8); box-shadow: 0 14px 0 #e0a94a, 0 22px 34px rgba(150,90,20,.28), inset 0 3px 6px rgba(255,255,255,.9); }

.hud-label { font-size: 34px; color: #b5698f; font-weight: 700; letter-spacing: 2px; }
.hud-card.goal .hud-label { color: #b98a2c; }
.hud-value { font-size: 74px; font-weight: 900; color: #8a3d68; line-height: 1.1; margin-top: 4px; text-shadow: 0 2px 0 rgba(255,255,255,.7); }
.hud-card.goal .hud-value { color: #a56f16; }

.progress-wrap {
  margin: 40px 6px 0;
  height: 44px;
  background: rgba(160,60,120,.28);
  border-radius: 30px;
  overflow: hidden;
  box-shadow: inset 0 4px 8px rgba(120,30,90,.4);
  border: 4px solid rgba(255,255,255,.7);
}
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ffe36b, #ffb347, #ff7ac0, #b06bff);
  border-radius: 30px;
  transition: width .4s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 0 20px rgba(255,220,120,.8);
}

/* combo 横幅 */
.combo-banner {
  position: absolute;
  left: 0; right: 0;
  top: 640px;
  text-align: center;
  font-size: 120px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 6px 0 #ff5fa8, 0 12px 24px rgba(140,20,90,.5);
  opacity: 0;
  transform: scale(.4);
  pointer-events: none;
}
.combo-banner.show { animation: comboPop .9s cubic-bezier(.2,1.4,.5,1) forwards; }
@keyframes comboPop {
  0% { opacity: 0; transform: scale(.3) rotate(-8deg); }
  30% { opacity: 1; transform: scale(1.15) rotate(3deg); }
  70% { opacity: 1; transform: scale(1) rotate(0); }
  100% { opacity: 0; transform: scale(1.1); }
}

/* ===== 遮罩弹窗 ===== */
.overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(70,20,60,.55);
  backdrop-filter: blur(8px);
  z-index: 10;
  pointer-events: auto;
}
.overlay.hidden { display: none; }

.panel {
  width: 820px;
  background: linear-gradient(180deg, #ffffff, #fff0f8);
  border-radius: 70px;
  padding: 90px 70px 80px;
  text-align: center;
  box-shadow: 0 30px 0 #d878ae, 0 50px 80px rgba(90,20,70,.5), inset 0 6px 12px rgba(255,255,255,.9);
  border: 8px solid #ffffff;
  animation: panelIn .5s cubic-bezier(.2,1.4,.5,1);
}
@keyframes panelIn { from { transform: scale(.7) translateY(40px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

.logo { font-size: 200px; line-height: 1; filter: drop-shadow(0 12px 20px rgba(160,40,110,.35)); animation: floaty 3s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-20px) rotate(3deg); } }

.title { font-size: 110px; font-weight: 900; color: #d14a91; text-shadow: 0 4px 0 #fff, 0 8px 12px rgba(160,40,110,.25); margin-top: 10px; }
.subtitle { font-size: 44px; color: #e19bc4; font-weight: 700; letter-spacing: 6px; margin-top: -6px; }
.desc { font-size: 40px; color: #9c6285; line-height: 1.5; margin: 46px 0; }
.hint { font-size: 34px; color: #b98cae; margin-top: 40px; }

.score-line { font-size: 52px; color: #9c6285; margin: 40px 0 10px; font-weight: 700; }
.score-line span { font-size: 90px; font-weight: 900; color: #d14a91; display: block; margin-top: 10px; }

.stars { font-size: 100px; color: #ffcf3f; margin: 20px 0 30px; letter-spacing: 20px; text-shadow: 0 4px 8px rgba(180,120,0,.3); }
.stars .star { opacity: .25; display: inline-block; transition: all .4s cubic-bezier(.2,1.6,.5,1); }
.stars .star.on { opacity: 1; animation: starPop .5s cubic-bezier(.2,1.8,.5,1); }
@keyframes starPop { 0% { transform: scale(0) rotate(-40deg); } 100% { transform: scale(1) rotate(0); } }

.btn-primary {
  margin-top: 30px;
  font-size: 60px;
  font-weight: 900;
  color: #fff;
  padding: 40px 90px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(180deg, #ff92c9, #ff5fa8);
  box-shadow: 0 14px 0 #d63d84, 0 24px 30px rgba(200,40,120,.4), inset 0 4px 8px rgba(255,255,255,.6);
  cursor: pointer;
  letter-spacing: 4px;
  transition: transform .08s, box-shadow .08s;
}
.btn-primary:active { transform: translateY(10px); box-shadow: 0 4px 0 #d63d84, 0 8px 14px rgba(200,40,120,.4), inset 0 4px 8px rgba(255,255,255,.6); }
