/* style.css — 《水滴消消》演示版样式（设计系统：GDD 10.1 / PRD 4.1） */
:root {
  --sky: #7EC8F2; --cyan: #5AD2C9; --yellow: #FFD98E; --cream: #FFF8E8;
  --mint: #A8E6A0; --coral: #FF8A6B; --deep: #2B3A4A; --gold: #FFC94D;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: linear-gradient(180deg, #7EC8F2 0%, #A8E6F5 45%, #D8F1FB 100%) fixed;
  background-size: cover;
  color: var(--deep); min-height: 100vh;
  user-select: none; overflow-x: hidden;
}
.hidden { display: none !important; }
.btn {
  border: none; border-radius: 22px; padding: 10px 18px; font-size: 14px;
  cursor: pointer; color: #fff; font-weight: 600; transition: .15s;
}
.btn:active { transform: scale(0.95); }
.btn-sky { background: var(--sky); }
.btn-cyan { background: var(--cyan); }
.btn-gold { background: linear-gradient(135deg, #FFC94D, #FF9E4D); color: #fff; }
.btn-gray { background: rgba(255, 255, 255, 0.75); color: var(--deep); }

/* ---------- 主界面 ---------- */
.scene { min-height: 100vh; }
.menu-inner { max-width: 520px; margin: 0 auto; padding: 20px 16px 40px; }
.topbar {
  display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.82);
  border-radius: 30px; padding: 10px 16px; margin-bottom: 18px; box-shadow: 0 4px 16px rgba(43,58,74,.12);
}
.tb-energy { font-weight: 700; color: #D48806; }
.tb-money { display: flex; align-items: center; gap: 5px; font-weight: 700; margin-left: auto; }
.tb-money img { width: 22px; height: 22px; }
.tb-set { margin-left: 6px; padding: 6px 12px; }
.menu-title { font-size: 34px; font-weight: 800; text-align: center; margin-top: 8px; text-shadow: 0 3px 0 rgba(255,255,255,.6); }
.menu-sub { text-align: center; color: rgba(43,58,74,.65); margin: 6px 0 20px; font-size: 13px; }
.level-map { display: flex; flex-direction: column; gap: 12px; }
.level-node {
  background: rgba(255,255,255,0.9); border-radius: 16px; padding: 14px 18px;
  display: flex; align-items: center; gap: 14px; box-shadow: 0 4px 14px rgba(43,58,74,.1);
  cursor: pointer; transition: .15s;
}
.level-node:active { transform: scale(0.98); }
.level-node.locked { opacity: 0.55; cursor: not-allowed; }
.node-icon { font-size: 30px; }
.node-name { font-weight: 700; flex: 1; }
.node-stars { color: var(--gold); letter-spacing: 2px; }
.node-go { color: var(--sky); font-weight: 700; font-size: 13px; }
.node-lock { font-size: 11px; color: #999; }
.menu-btns { display: flex; gap: 10px; margin-top: 20px; justify-content: center; }
.menu-btns .btn { flex: 1; max-width: 150px; padding: 12px; }

/* ---------- 关卡页 ---------- */
#levelPage { max-width: 520px; margin: 0 auto; padding: 12px 12px 30px; display: flex; flex-direction: column; align-items: center; }
.lv-top { width: 100%; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.lv-name { flex: 1; font-weight: 800; font-size: 17px; text-align: center; }
.lv-info { font-size: 14px; }
.lv-info b { color: var(--coral); font-size: 17px; }
.lv-target { width: 100%; background: rgba(255,255,255,0.85); border-radius: 14px; padding: 10px 14px; margin-bottom: 8px; font-size: 13px; }
.lv-target-text { text-align: center; margin-bottom: 6px; }
.lv-score { text-align: center; font-size: 13px; margin-bottom: 6px; }
.lv-score b { color: var(--coral); font-size: 18px; }
.lv-progress { height: 8px; background: #E3ECF2; border-radius: 4px; overflow: hidden; }
.lv-progress div { height: 100%; background: linear-gradient(90deg, var(--mint), var(--cyan)); border-radius: 4px; transition: width .4s; }
#gameCanvas { border-radius: 16px; box-shadow: 0 8px 24px rgba(43,58,74,.18); touch-action: none; }
.lv-boosters { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.boost-btn { background: rgba(255,255,255,0.85); color: var(--deep); border: 2px solid transparent; }
.boost-btn.active { border-color: var(--gold); background: #FFF4D6; }
.boost-tip { font-size: 11px; color: rgba(43,58,74,.6); max-width: 140px; }

/* ---------- 弹窗 ---------- */
.mask { position: fixed; inset: 0; background: rgba(43,58,74,.5); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.panel { background: #fff; border-radius: 20px; padding: 22px; width: 100%; max-width: 420px; max-height: 86vh; overflow: auto; box-shadow: 0 16px 48px rgba(0,0,0,.25); }
.panel-head { font-size: 18px; font-weight: 800; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.close-x { cursor: pointer; color: #999; font-size: 16px; padding: 4px 8px; }

/* 结算 */
.result { text-align: center; }
.result.win { background: linear-gradient(180deg, #FFF8E8, #fff); }
.result-title { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.result-stars { font-size: 34px; color: var(--gold); margin-bottom: 8px; }
.result-sub { color: #888; margin-bottom: 8px; }
.result-score { font-size: 15px; margin-bottom: 6px; }
.result-score b { color: var(--coral); font-size: 22px; }
.result-reward { color: #D48806; margin-bottom: 16px; font-size: 13px; }
.result-btns { display: flex; flex-direction: column; gap: 10px; }
.result-btns .btn { padding: 13px; font-size: 15px; }

/* 商店 */
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shop-item { position: relative; background: #F7FAFC; border-radius: 14px; padding: 14px; text-align: center; }
.shop-icon { font-size: 30px; margin-bottom: 6px; }
.shop-name { font-size: 12px; color: var(--deep); margin-bottom: 4px; min-height: 32px; }
.shop-price { color: var(--coral); font-weight: 700; margin-bottom: 8px; }
.shop-badge { position: absolute; top: 6px; right: 6px; background: var(--gold); color: #fff; font-size: 10px; border-radius: 8px; padding: 2px 7px; }

/* 小镇 */
.town-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.town-item { background: #F7FAFC; border-radius: 14px; padding: 12px; text-align: center; }
.town-img { width: 76px; height: 76px; object-fit: contain; }
.town-name { font-size: 13px; margin: 6px 0; }
.town-max { color: var(--gold); font-size: 12px; margin-top: 6px; }
.town-stars { text-align: center; margin-top: 14px; color: #888; font-size: 12px; }

/* 设置 */
.set-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #F0F4F8; font-size: 14px; }
.set-row input[type=checkbox] { width: 40px; height: 22px; accent-color: var(--sky); }
.set-row select { padding: 6px; border: 1px solid #E3ECF2; border-radius: 8px; }

/* 广告模拟 */
.ad-mask { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 99; display: flex; align-items: center; justify-content: center; }
.ad-box { text-align: center; color: #fff; }
.ad-title { font-size: 18px; margin-bottom: 16px; }
.ad-count { font-size: 64px; font-weight: 800; color: var(--gold); margin-bottom: 10px; }
.ad-tip { color: #aaa; margin-bottom: 20px; font-size: 13px; }
.ad-skip { border: none; background: var(--gold); color: #fff; font-size: 16px; font-weight: 700; border-radius: 30px; padding: 12px 36px; cursor: pointer; }
