/* 果堡小子 · 软陶糖果风 UI */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%; overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #ffe9d6; color: #5b3f31;
  user-select: none; -webkit-user-select: none;
}
#app { position: relative; height: 100%; width: 100%; max-width: 560px; margin: 0 auto; overflow: hidden; }

.screen { display: none; position: absolute; inset: 0; flex-direction: column; padding: 14px; }
.screen.on { display: flex; }

/* ── 主菜单 ───────────────────────────────── */
#menu { align-items: center; justify-content: center; background:
  radial-gradient(circle at 50% 30%, #fff6e6 0%, #ffe1c4 60%, #ffd0a8 100%); }
.logo { text-align: center; margin-bottom: 34px; }
.logoicon { font-size: 74px; line-height: 1; filter: drop-shadow(0 6px 8px rgba(200,120,80,.25)); }
.logo h1 { font-size: 40px; letter-spacing: 2px; margin: 10px 0 8px; color: #e8603f;
  text-shadow: 0 3px 0 #fff, 0 5px 6px rgba(200,120,80,.2); }
.tag { font-size: 14px; color: #9c7256; }
.menubtns { display: flex; flex-direction: column; gap: 12px; width: 220px; }
.duo { display: flex; gap: 10px; }
.duo .ghost { flex: 1; padding: 12px 4px; font-size: 14px; }
button { font-family: inherit; cursor: pointer; border: none; }
.big { padding: 16px; font-size: 19px; font-weight: 700; color: #fff; border-radius: 18px;
  background: linear-gradient(180deg, #ff9a6b, #f2703c);
  box-shadow: 0 5px 0 #d1552a, 0 8px 14px rgba(210,90,50,.3); }
.big:active { transform: translateY(3px); box-shadow: 0 2px 0 #d1552a; }
.ghost { padding: 12px; font-size: 15px; color: #a4714f; background: rgba(255,255,255,.75);
  border-radius: 14px; box-shadow: 0 3px 0 rgba(190,140,110,.35); }
.dim { color: #a98a70; }
#menuProg { margin-top: 20px; font-size: 13px; color: #b08563; }

/* ── 选关 ─────────────────────────────────── */
.subhead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.subhead h2 { font-size: 20px; }
.back { padding: 7px 13px; border-radius: 12px; background: rgba(255,255,255,.8); color: #a4714f; font-size: 14px; }
.lvlist { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; align-content: start; padding-bottom: 20px; }
.lvcard { padding: 14px 10px; border-radius: 16px; background: #fff; text-align: left;
  box-shadow: 0 3px 0 rgba(190,140,110,.25); display: flex; flex-direction: column; gap: 3px; }
.lvcard b { font-size: 22px; color: #f2703c; }
.lvcard span { font-size: 15px; font-weight: 600; }
.lvcard em { font-size: 11px; color: #b79a86; font-style: normal; }
.lvcard.lock { opacity: .55; background: #f3e7db; }
.lvcard.done { background: linear-gradient(180deg, #fff, #eafbe4); }

/* ── 游戏 ─────────────────────────────────── */
#game { padding: 0; }
#hud { display: flex; align-items: center; gap: 7px; padding: 8px 10px;
  background: linear-gradient(180deg, #ffd9a8, #ffcf98);
  box-shadow: 0 2px 6px rgba(180,120,80,.25); flex: none; }
#hud .hl b { font-size: 15px; }
#hud .hs { font-size: 13px; background: rgba(255,255,255,.6); padding: 4px 9px; border-radius: 10px; }
#hud .hs b { font-size: 15px; }
#hud .sp { flex: 1; }
.mini { padding: 6px 10px; border-radius: 11px; font-size: 13px; background: #fff; color: #a4714f;
  box-shadow: 0 2px 0 rgba(190,140,110,.35); }
.mini:disabled { opacity: .45; }

#stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center;
  background: #a9dfa4; overflow: hidden; }
#cv { display: block; touch-action: none; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }

#toast { position: absolute; top: 14px; left: 50%; transform: translateX(-50%) translateY(-14px);
  padding: 8px 16px; border-radius: 14px; background: rgba(60,40,30,.78); color: #fff; font-size: 14px;
  opacity: 0; transition: .25s; pointer-events: none; white-space: nowrap; }
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

#panel { position: absolute; right: 8px; bottom: 8px; width: 200px; padding: 12px;
  background: rgba(255,255,255,.96); border-radius: 16px; box-shadow: 0 6px 16px rgba(0,0,0,.22);
  display: none; max-height: 78%; overflow-y: auto; }
#panel.on { display: block; }
#panel h4 { font-size: 15px; margin-bottom: 6px; }
#panel h4 small { color: #b08563; font-weight: 400; }
#panel .pi { font-size: 12px; color: #8d6b52; margin-bottom: 9px; line-height: 1.5; }
.act { display: block; width: 100%; text-align: left; padding: 9px 10px; margin-bottom: 7px;
  border-radius: 12px; font-size: 13px; background: #fff3e2; color: #7a5238; }
.act b { float: right; color: #f2703c; }
.act em { display: block; font-size: 11px; color: #a98a70; font-style: normal; margin-top: 3px; }
.act.up { background: #e8f7e0; }
.act.br { background: #fff0d6; }
.act.sell { background: #ffe6e6; }
.act.cancel { background: #f2ece6; text-align: center; }
.act:disabled { opacity: .45; }

#bars { flex: none; background: #ffd9a8; padding: 7px 8px 10px; box-shadow: 0 -2px 8px rgba(180,120,80,.2); }
#towerBar, #skillBar { display: flex; gap: 6px; justify-content: center; }
#skillBar { margin-top: 6px; }
.tbtn { flex: 1; padding: 7px 2px; border-radius: 13px; background: #fff; text-align: center;
  box-shadow: 0 3px 0 rgba(190,140,110,.3); position: relative; overflow: hidden; }
.tbtn i { display: block; font-size: 21px; font-style: normal; line-height: 1.1; }
.tbtn span { display: block; font-size: 10px; color: #8d6b52; }
.tbtn b { display: block; font-size: 11px; color: #f2703c; }
.tbtn.sel { background: #ffe0b8; box-shadow: 0 0 0 3px #f2703c inset, 0 3px 0 rgba(190,140,110,.3); }
.tbtn.poor { opacity: .48; }
.sbtn { flex: 1; padding: 6px 2px; border-radius: 12px; background: #fff0dd; text-align: center;
  position: relative; box-shadow: 0 3px 0 rgba(190,140,110,.3); }
.sbtn i { display: block; font-size: 18px; font-style: normal; }
.sbtn span { font-size: 10px; color: #8d6b52; }
.sbtn u { position: absolute; inset: 0; background: rgba(70,50,40,.55); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 15px; text-decoration: none;
  border-radius: 12px; display: none; }
.sbtn.cool u { display: flex; }
.sbtn.sel { box-shadow: 0 0 0 3px #f2703c inset, 0 3px 0 rgba(190,140,110,.3); }

/* ── 弹窗 ─────────────────────────────────── */
.modal { position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(60,40,30,.55); padding: 20px; z-index: 20; }
.modal.on { display: flex; }
.modal .mbox, #endModal > * { background: #fffdf8; border-radius: 20px; padding: 22px; text-align: center;
  max-width: 340px; width: 100%; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
#endModal { flex-direction: column; }
#endModal h3 { font-size: 24px; margin-bottom: 8px; }
#endModal p { font-size: 14px; margin: 4px 0; }
#endModal .stars { font-size: 30px; color: #ffc44d; margin: 6px 0; }
#endModal .btns, .mbox .btns { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
#endModal .btns button, .mbox button { padding: 12px; border-radius: 14px; font-size: 15px;
  background: #f3e7db; color: #7a5238; }
#endModal .btns .pri, .mbox .pri { background: linear-gradient(180deg, #ff9a6b, #f2703c); color: #fff;
  box-shadow: 0 4px 0 #d1552a; }
.mbox { text-align: left; }
.mbox h3 { text-align: center; font-size: 20px; margin-bottom: 12px; }
.how { padding-left: 18px; font-size: 13.5px; line-height: 1.75; color: #7a5238; }
.how li { margin-bottom: 6px; }
.tip { font-size: 12.5px; color: #a4714f; margin-top: 10px; line-height: 1.6; background: #fff3e2;
  padding: 9px 11px; border-radius: 11px; }
.dim { color: #a98a70; }
#endModal .dim { color: #a98a70; }

@media (max-height: 640px) {
  .tbtn i { font-size: 18px; }
  .tbtn span { font-size: 9px; }
  .lvcard { padding: 10px 8px; }
}
