/* ================= 切水果2 · 移动端竖屏 ================= */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden; background: #2A1206;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  color: #3A1E0C;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
}

#stage {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  background: #2A1206;
}

/* 背景成品图：铺满整屏，从屏幕顶端开始，不重画场景 */
#bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  pointer-events: none;
}

#cv {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
}

/* ---------- HUD ---------- */
#hud {
  position: absolute; top: 0; left: 0; right: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  pointer-events: none;
  z-index: 5;
}

.hud-score {
  display: flex; flex-direction: column;
  padding: 8px 16px 9px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 138, 61, 0.35);
  box-shadow: 0 6px 16px rgba(120, 52, 10, 0.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.hud-label {
  font-size: 11px; letter-spacing: 0.14em;
  color: #B4703A; font-weight: 600;
}
#score {
  font-size: 26px; font-weight: 800; line-height: 1.05;
  color: #FF6A1A;
  font-variant-numeric: tabular-nums;
}

.hud-btn {
  pointer-events: auto;
  width: 46px; height: 46px;
  border-radius: 16px;
  border: 1px solid rgba(255, 138, 61, 0.35);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 16px rgba(120, 52, 10, 0.22);
  display: flex; align-items: center; justify-content: center;
  color: #FF6A1A; font-size: 24px;
  transition: transform 0.12s ease, background 0.12s ease;
}
.hud-btn:active { transform: scale(0.92); background: #FFE7D6; }
.hud-btn .mp-icon { font-size: 24px; }

/* ---------- 连击提示 ---------- */
.combo {
  position: absolute; left: 50%; top: 22%;
  transform: translate(-50%, 0) scale(0.8);
  font-size: 22px; font-weight: 800;
  color: #FFF3E2;
  text-shadow: 0 2px 0 #E85A0C, 0 6px 18px rgba(120, 40, 0, 0.5);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 6;
}
.combo.show { opacity: 1; transform: translate(-50%, -10px) scale(1); }

/* ---------- 弹层 ---------- */
.layer {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 40%, rgba(60, 20, 0, 0.35), rgba(30, 10, 0, 0.72));
  z-index: 8;
  animation: fadeIn 0.22s ease both;
}
.layer.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.panel {
  width: 100%; max-width: 320px;
  padding: 26px 22px 22px;
  border-radius: 26px;
  background: linear-gradient(180deg, #FFFDF8 0%, #FFF1E2 100%);
  border: 1px solid rgba(255, 138, 61, 0.45);
  box-shadow: 0 18px 44px rgba(70, 24, 0, 0.45), inset 0 1px 0 #FFFFFF;
  text-align: center;
  animation: pop 0.28s cubic-bezier(0.2, 1.3, 0.5, 1) both;
}
@keyframes pop { from { transform: scale(0.86); opacity: 0 } to { transform: scale(1); opacity: 1 } }

.panel-title {
  margin: 0 0 8px;
  font-size: 30px; font-weight: 900; letter-spacing: 0.02em;
  color: #FF6A1A;
  text-shadow: 0 2px 0 #FFD9BE;
}
.panel-title.sm { font-size: 22px; }

.panel-sub {
  margin: 0 0 20px;
  font-size: 14px; line-height: 1.6; color: #8A6242;
}

.panel-tip {
  margin: 14px 0 0;
  font-size: 13px; color: #A87B57;
}
.panel-tip span { font-weight: 800; color: #FF6A1A; }

.btn-primary {
  width: 100%;
  min-height: 52px;
  border: none; border-radius: 16px;
  background: linear-gradient(180deg, #FFA45C 0%, #FF7A22 100%);
  color: #FFFFFF; font-size: 17px; font-weight: 800; letter-spacing: 0.04em;
  box-shadow: 0 8px 18px rgba(255, 122, 34, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-primary:active {
  transform: translateY(2px) scale(0.985);
  box-shadow: 0 3px 10px rgba(255, 122, 34, 0.36);
}

.btn-ghost {
  width: 100%; min-height: 46px; margin-top: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 138, 61, 0.5);
  background: rgba(255, 255, 255, 0.7);
  color: #C25A16; font-size: 15px; font-weight: 700;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn-ghost:active { transform: scale(0.97); background: #FFE7D6; }

.over-score {
  display: flex; align-items: baseline; justify-content: center; gap: 6px;
  margin: 4px 0 2px;
}
.over-num {
  font-size: 46px; font-weight: 900; color: #FF6A1A;
  line-height: 1; font-variant-numeric: tabular-nums;
  text-shadow: 0 3px 0 #FFD9BE;
}
.over-unit { font-size: 14px; font-weight: 700; color: #B4703A; }
#cv { z-index: 2; pointer-events: auto; }
#bg { z-index: 1; }
.btn-primary, .btn-ghost, .panel { pointer-events: auto; cursor: pointer; }
.layer { pointer-events: auto; }
