/* 云端跳跃 Cloud Hopper — 页面层样式 */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { height:100%; overflow:hidden; }
body {
  height:100vh; height:100dvh;
  background: linear-gradient(180deg, #3FA9F5 0%, #8FD3FF 55%, #D9F1FF 100%);
  display:flex; align-items:center; justify-content:center;
  font-family:"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  user-select:none; -webkit-user-select:none; touch-action:none;
  overscroll-behavior:none;
}
#stage { position:relative; }
#game { display:block; touch-action:none; }

/* HUD 层：480×854 设计稿坐标，整体等比缩放 */
#hudLayer {
  position:absolute; left:0; top:0;
  width:480px; height:854px;
  transform-origin:0 0;
  pointer-events:none;
}
#hudLayer .screen { position:absolute; inset:0; pointer-events:auto; }
.hidden { display:none !important; }
button { font-family:inherit; cursor:pointer; }

/* ---------- 游戏内 HUD ---------- */
#hud { pointer-events:none; }
#hud .score-box { position:absolute; left:16px; top:12px; color:#1B3A57; text-shadow:0 1px 0 rgba(255,255,255,.65); pointer-events:none; }
#score { font-size:38px; font-weight:800; line-height:1; font-variant-numeric:tabular-nums; transition:transform .15s ease; display:inline-block; }
#score.pop { transform:scale(1.25); }
#bestLine { font-size:13px; opacity:.75; margin-top:2px; font-variant-numeric:tabular-nums; }

#rightBox { position:absolute; right:58px; top:14px; text-align:right; }
#hearts { display:flex; gap:5px; justify-content:flex-end; }
#hearts .heart { width:27px; height:27px; display:inline-block; }
#hearts .heart svg { width:100%; height:100%; }
#hearts .heart path { fill:#FF5A6E; filter:drop-shadow(0 1px 1px rgba(0,0,0,.18)); transition:fill .2s; }
#hearts .heart.lost path { fill:#C9D4E2; }
#hearts .heart.breaking { animation:heartBreak .5s ease; }
@keyframes heartBreak {
  0% { transform:scale(1); } 30% { transform:scale(1.55) rotate(-16deg); }
  60% { transform:scale(.6) rotate(10deg); } 100% { transform:scale(1); }
}
#buff {
  margin-top:8px; font-size:12px; font-weight:700;
  background:rgba(27,58,87,.78); color:#fff;
  padding:4px 12px; border-radius:999px; display:inline-block;
}
#pauseBtn {
  position:absolute; right:12px; top:12px; width:36px; height:36px;
  border:none; border-radius:50%; background:rgba(255,255,255,.72);
  color:#1B3A57; font-size:13px; line-height:1;
  box-shadow:0 2px 6px rgba(30,90,150,.25);
  pointer-events:auto;   /* 父级 hud 为 none，需单独恢复可点击 */
}

/* 连击提示 */
#combo {
  position:absolute; left:50%; top:70px; transform:translateX(-50%);
  font-size:22px; font-weight:800; color:#FF7A59;
  text-shadow:0 2px 0 rgba(255,255,255,.8), 0 4px 10px rgba(255,122,89,.4);
  pointer-events:none; transition:transform .12s ease;
}
#combo.pop { transform:translateX(-50%) scale(1.3); }
#combo.big { color:#FF5A6E; }

/* ---------- 通用按钮 ---------- */
.btn {
  display:block; width:230px; margin:10px auto; padding:14px 0;
  border:none; border-radius:999px; font-size:18px; font-weight:700;
  color:#fff; background:#FF7A59;
  box-shadow:0 4px 0 rgba(200,80,40,.35);
  text-shadow:0 1px 1px rgba(0,0,0,.12);
}
.btn:active { transform:translateY(2px); box-shadow:0 2px 0 rgba(200,80,40,.35); }
.btn.primary { animation:breathe 2.2s ease-in-out infinite; }
.btn.ghost { background:#fff; color:#1B3A57; box-shadow:0 3px 0 rgba(27,58,87,.18); text-shadow:none; }
@keyframes breathe {
  0%,100% { box-shadow:0 4px 0 rgba(200,80,40,.35), 0 0 0 0 rgba(255,122,89,.5); }
  50%     { box-shadow:0 4px 0 rgba(200,80,40,.35), 0 0 0 12px rgba(255,122,89,0); }
}

/* ---------- 开始页 ---------- */
#menu { display:flex; flex-direction:column; align-items:center; }
.title {
  margin-top:118px; font-size:54px; font-weight:800; color:#fff;
  letter-spacing:6px; text-align:center;
  text-shadow:0 3px 0 rgba(59,130,180,.4), 0 10px 26px rgba(30,90,150,.4);
  animation:floatY 2.6s ease-in-out infinite;
}
.title .en { display:block; font-size:15px; font-weight:600; letter-spacing:5px; opacity:.92; margin-top:8px; }
@keyframes floatY { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-9px); } }
.best-star {
  margin-top:20px; background:rgba(255,255,255,.88); color:#C98A00;
  padding:7px 20px; border-radius:999px; font-weight:700; font-size:15px;
  box-shadow:0 3px 10px rgba(30,90,150,.22); font-variant-numeric:tabular-nums;
}
.how {
  margin-top:28px; list-style:none; color:#1B3A57; font-size:14px;
  background:rgba(255,255,255,.78); padding:14px 26px; border-radius:16px;
  line-height:2; box-shadow:0 4px 14px rgba(30,90,150,.18); text-align:center;
}
.how .key { background:#1B3A57; color:#fff; border-radius:6px; padding:1px 9px; font-size:12px; margin-right:4px; }
.how .hl { color:#FF7A59; font-weight:800; }
#startBtn { margin-top:32px; }

#muteBtn {
  position:absolute; right:12px; bottom:14px; width:38px; height:38px;
  border:none; border-radius:50%; background:rgba(255,255,255,.72);
  font-size:16px; line-height:1; box-shadow:0 2px 6px rgba(30,90,150,.25);
  pointer-events:auto;   /* hudLayer 为 none，需单独恢复可点击 */
  z-index:30;
}

/* ---------- 横屏提示 ---------- */
#rotateHint {
  display:none;
  position:fixed; left:50%; top:14px; transform:translateX(-50%);
  z-index:99; pointer-events:none;
  background:rgba(27,58,87,.85); color:#fff;
  font-size:13px; font-weight:600;
  padding:8px 18px; border-radius:999px;
  box-shadow:0 4px 14px rgba(8,28,58,.35);
  white-space:nowrap;
}
@media (orientation: landscape) and (max-height: 480px) {
  #rotateHint { display:block; }
}

/* ---------- 遮罩页（暂停 / 结算） ---------- */
.overlay {
  background:rgba(18,42,74,.46);
  backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
}
.panel {
  width:322px; background:rgba(255,255,255,.95); border-radius:26px;
  padding:26px 20px 20px; text-align:center;
  box-shadow:0 14px 44px rgba(8,28,58,.4);
  position:relative; z-index:1;
}
.panel h2 { color:#1B3A57; font-size:24px; margin-bottom:8px; }
#finalScore { font-size:58px; font-weight:800; color:#FF7A59; line-height:1.1; font-variant-numeric:tabular-nums; }
#goBest { color:#C98A00; font-weight:700; font-size:14px; margin:6px 0 14px; font-variant-numeric:tabular-nums; }
#goBest.record { color:#FF9E0D; animation:blink .8s steps(2) infinite; }
@keyframes blink { 50% { opacity:.35; } }
.stats { display:flex; justify-content:space-between; margin:4px 8px 18px; }
.stats > div { flex:1; }
.stats span { display:block; font-size:19px; font-weight:800; color:#1B3A57; font-variant-numeric:tabular-nums; }
.stats label { font-size:11px; color:#7189a0; }
.hint { font-size:11px; color:#8aa0b5; margin-top:10px; }

/* 破纪录彩纸 */
.confetti span {
  position:absolute; width:9px; height:15px; top:-24px; z-index:0;
  border-radius:2px; animation:confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform:translateY(920px) rotate(720deg); opacity:.7; }
}
