:root {
  --bg1: #ffe8f0;
  --bg2: #e0f7fa;
  --bg3: #fff9db;
  --pink: #ff8fa3;
  --peach: #ffb996;
  --mint: #a8e6cf;
  --purple: #b39ddb;
  --text: #5c4033;
  --card-bg: #ffffffee;
  --shadow: 0 8px 24px rgba(92, 64, 51, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, var(--bg1), var(--bg2) 55%, var(--bg3));
  overflow: hidden;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

.mobile-hint {
  display: none;
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  z-index: 20;
  text-align: center;
  font-size: 12px;
  color: var(--text);
  background: #fff8;
  margin: 0;
  padding: 4px 10px;
}

@media (max-width: 640px) {
  .mobile-hint { display: block; }
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
}
.screen.active { display: flex; }

/* ---------- 主界面 ---------- */
#screen-start.active {
  align-items: center;
  justify-content: center;
}
.start-bg {
  text-align: center;
  padding: 40px;
}
.title {
  font-size: clamp(28px, 6vw, 48px);
  margin: 0 0 32px;
  text-shadow: 2px 2px 0 #fff, 4px 4px 8px rgba(92, 64, 51, 0.25);
  color: var(--pink);
  letter-spacing: 2px;
}
.fruit-btn {
  font-size: 20px;
  font-weight: bold;
  padding: 16px 36px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pink), var(--peach));
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease;
}
.fruit-btn:hover { transform: translateY(-2px) scale(1.03); }
.fruit-btn:active { transform: translateY(1px) scale(0.98); }

/* ---------- 游戏界面 ---------- */
#screen-play.active {
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.play-layout {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
}
.board-wrap {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #fffef7;
  border: 6px solid var(--mint);
}
#board { display: block; }

.info-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  min-width: 130px;
}
.icon-btn {
  font-size: 22px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--purple);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}
.score-box, .next-box {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 12px 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.label { font-size: 13px; color: #9c7c6b; margin-bottom: 4px; }
.score-value {
  font-size: 32px;
  font-weight: bold;
  color: var(--pink);
  transition: transform 0.15s ease;
}
.score-value.bump { animation: bump 0.28s ease; }
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
#next { display: block; }

/* ---------- 遮罩层 ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(92, 64, 51, 0.45);
  backdrop-filter: blur(2px);
  color: #fff;
  z-index: 10;
}
.overlay.hidden { display: none; }
.overlay-title { font-size: 26px; font-weight: bold; }

.card {
  background: var(--card-bg);
  color: var(--text);
  border-radius: 20px;
  padding: 28px 36px;
  text-align: center;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 8px; color: var(--pink); }
.final-score {
  font-size: 40px;
  font-weight: bold;
  color: var(--peach);
  margin: 4px 0 20px;
}

/* ---------- 移动端：信息面板折叠到下方 ---------- */
@media (max-width: 640px) {
  .play-layout {
    flex-direction: column;
  }
  .info-panel {
    flex-direction: row;
    min-width: 0;
    width: 100%;
    justify-content: center;
  }
}
