* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: #12202e;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#cam { display: none; }

/* —— 顶部：分数 + 声音 —— */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 5;
}
#score {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 800;
  text-shadow: 0 3px 10px rgba(0,0,0,.45);
  letter-spacing: 2px;
}
#score.pop { animation: pop .35s ease; }
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
#hud-btns {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#mute, #restart {
  background: rgba(0,0,0,.35);
  border: none;
  border-radius: 999px;
  color: #fff;
  font-size: 26px;
  width: 56px;
  height: 56px;
  cursor: pointer;
}
#mute:hover, #restart:hover { background: rgba(0,0,0,.55); }

/* —— 提示：手不见了 —— */
#hint {
  position: fixed;
  left: 50%;
  bottom: 9vh;
  transform: translateX(-50%);
  z-index: 5;
  color: #fff;
  background: rgba(0,0,0,.45);
  padding: 14px 30px;
  border-radius: 999px;
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 700;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
#hint.show {
  opacity: 1;
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-10px); }
}

/* —— 每 10 个的庆祝 —— */
#celeb {
  position: fixed;
  left: 50%;
  top: 16vh;
  transform: translateX(-50%) scale(0);
  z-index: 6;
  font-size: clamp(40px, 8vw, 72px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 4px 18px rgba(0,0,0,.5), 0 0 30px rgba(255,200,80,.8);
  pointer-events: none;
  white-space: nowrap;
}
#celeb.show { animation: celeb .5s cubic-bezier(.2,1.6,.4,1) forwards; }
@keyframes celeb {
  0% { transform: translateX(-50%) scale(0); }
  70% { transform: translateX(-50%) scale(1.15); }
  100% { transform: translateX(-50%) scale(1); }
}

/* —— 开始画面 —— */
#start-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: linear-gradient(160deg, #7ec8ff 0%, #b6e3ff 40%, #d8f3e3 70%, #fff7c9 100%);
  transition: opacity .5s;
}
#start-screen.hidden { opacity: 0; pointer-events: none; }
#title {
  margin: 0;
  font-size: clamp(52px, 10vw, 88px);
  font-weight: 900;
  color: #ff5f74;
  text-shadow: 0 4px 0 #fff, 0 8px 24px rgba(0,0,0,.15);
}
#subtitle {
  margin: 0;
  font-size: clamp(20px, 3.5vw, 30px);
  color: #4a5c72;
  font-weight: 600;
  text-align: center;
  padding: 0 20px;
}
#btn-start {
  width: clamp(180px, 26vw, 240px);
  height: clamp(180px, 26vw, 240px);
  border-radius: 50%;
  border: 8px solid #fff;
  background: linear-gradient(180deg, #ffb03a, #ff7a3c);
  color: #fff;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(255,122,60,.45);
  animation: pulse 1.6s ease-in-out infinite;
}
#btn-start:disabled { filter: grayscale(.6); animation: none; cursor: wait; }
#btn-start:hover { transform: scale(1.05); }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
#start-msg {
  margin: 0;
  min-height: 48px;
  max-width: 90vw;
  font-size: clamp(16px, 2.6vw, 22px);
  color: #a33;
  font-weight: 700;
  text-align: center;
  padding: 0 24px;
}

/* 开始画面里飘着的水果 */
.floaties span {
  position: absolute;
  font-size: clamp(40px, 7vw, 72px);
  animation: floaty 5s ease-in-out infinite;
  opacity: .85;
}
.floaties span:nth-child(1) { left: 8%; top: 14%; }
.floaties span:nth-child(2) { right: 10%; top: 20%; animation-delay: .8s; }
.floaties span:nth-child(3) { left: 16%; bottom: 18%; animation-delay: 1.6s; }
.floaties span:nth-child(4) { right: 18%; bottom: 14%; animation-delay: 2.4s; }
.floaties span:nth-child(5) { left: 45%; top: 8%; animation-delay: 3.2s; }
.floaties span:nth-child(6) { right: 40%; bottom: 8%; animation-delay: 4s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-26px) rotate(10deg); }
}
