/* ===== 没有鸭梨 · 多巴胺糖果风 ===== */
:root {
  --bg: #FFF8EA;
  --card: #FFFFFF;
  --pink: #FF7BA9;   --pink-d: #E8568C;
  --orange: #FF9F5A; --orange-d: #F07E2E;
  --yellow: #FFD93D; --yellow-d: #E8B400;
  --green: #6FD96F;  --green-d: #3FBF63;
  --blue: #5EC8F8;   --blue-d: #2FA6E0;
  --purple: #A88BFF; --purple-d: #8463E8;
  --ink: #463A32;
  --ink-soft: #8A7A6E;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #FFD93D;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  user-select: none; -webkit-user-select: none;
  touch-action: none; overscroll-behavior: none;
}
#wrap { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#stage {
  position: relative; width: 720px; height: 1280px;
  flex: none;
  transform-origin: center center;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 0 80px rgba(70, 58, 50, .25);
}
#cv { position: absolute; inset: 0; width: 720px; height: 1280px; display: block; }

.screen { position: absolute; inset: 0; pointer-events: none; }
.screen > * { pointer-events: auto; }
.hidden { display: none !important; }

/* ---- 首页 ---- */
.topbar {
  position: absolute; top: 34px; left: 30px; right: 30px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar > * { flex: none; }
.coin-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--yellow); border-radius: 999px;
  padding: 12px 24px 12px 16px; font-size: 30px; font-weight: 800;
  box-shadow: 0 5px 0 var(--yellow-d); color: #6B4A00;
}
.ic-coin { width: 34px; height: 34px; }
.title-box { text-align: center; }
.title-main { font-size: 44px; font-weight: 900; letter-spacing: 6px; text-indent: 6px; white-space: nowrap; }
.title-main .c1 { color: var(--pink); }
.title-main .c2 { color: var(--orange); }
.title-main .c3 { color: var(--blue); }
.title-main .c4 { color: var(--green); }
.title-sub {
  font-size: 19px; letter-spacing: 8px; text-indent: 8px; color: #FFF;
  margin-top: 6px; white-space: nowrap;
  display: inline-block; background: linear-gradient(90deg, var(--pink), var(--orange), var(--purple));
  padding: 4px 18px; border-radius: 999px;
}
.icon-btn {
  width: 68px; height: 68px; border: none; border-radius: 24px;
  background: var(--card); box-shadow: 0 5px 0 #EBDFC8;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform .1s, box-shadow .1s;
}
.icon-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #EBDFC8; }
.icon-btn svg { width: 34px; height: 34px; }

.quote-bubble {
  position: absolute; top: 158px; left: 50%; transform: translateX(-50%);
  background: var(--card); border-radius: 26px; padding: 16px 32px;
  font-size: 25px; color: var(--ink); letter-spacing: 2px;
  box-shadow: 0 5px 0 #FFC9D9; max-width: 520px; text-align: center; white-space: nowrap;
}
.quote-bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -12px;
  width: 24px; height: 24px; background: var(--card);
  transform: translateX(-50%) rotate(45deg); border-radius: 4px;
}
.pet-dock { position: absolute; top: 300px; left: 0; right: 0; height: 560px; }

.bars { position: absolute; left: 60px; right: 60px; top: 892px; }
.bar-row { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.bar-label { width: 178px; font-size: 22px; color: var(--ink-soft); font-weight: 700; flex: none; white-space: nowrap; }
.bar-track {
  flex: 1; height: 24px; background: rgba(70, 58, 50, .1);
  border-radius: 999px; overflow: hidden;
}
.bar-fill { height: 100%; border-radius: 999px; transition: width .5s cubic-bezier(.4,1.4,.6,1); }
.bar-fill.mood { background: linear-gradient(90deg, var(--pink), #FF6B81); }
.bar-fill.xp { background: linear-gradient(90deg, var(--green), #7ED957); }

.btn-dock { position: absolute; left: 46px; right: 46px; bottom: 44px; }
.btn-row { display: flex; gap: 22px; margin-top: 22px; }
.btn-row.center { justify-content: center; margin-top: 30px; }
.btn-row .btn-ghost, .btn-row .btn-primary { flex: 1; }
button {
  font-family: inherit; border: none; cursor: pointer;
  transition: transform .1s, box-shadow .1s;
}
button:active { transform: translateY(4px); }
.btn-primary {
  width: 100%; padding: 26px 0; font-size: 38px; font-weight: 900; letter-spacing: 10px; text-indent: 10px;
  color: #FFF; background: linear-gradient(135deg, var(--pink), var(--orange));
  border-radius: 999px; box-shadow: 0 7px 0 var(--pink-d);
}
.btn-primary:active { box-shadow: 0 3px 0 var(--pink-d); }
.btn-ghost {
  width: 100%; padding: 20px 0; font-size: 28px; font-weight: 800; letter-spacing: 6px; text-indent: 6px;
  color: var(--ink); background: var(--card);
  border-radius: 999px; box-shadow: 0 5px 0 #EBDFC8;
}
.btn-ghost:active { box-shadow: 0 1px 0 #EBDFC8; }
.btn-primary.slim, .btn-ghost.slim { width: auto; flex: 1; padding: 22px 0; font-size: 28px; }
.btn-ghost.danger { color: #FF4D4D; }

/* ---- 游戏页 ---- */
.pause-pos { position: absolute; top: 34px; right: 30px; width: 60px; height: 60px; border-radius: 20px; }
.pause-pos svg { width: 28px; height: 28px; }

/* ---- 模态 ---- */
.modal-mask {
  position: absolute; inset: 0; background: rgba(70, 58, 50, .32);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: fadein .25s;
}
.modal {
  position: absolute; left: 0; right: 0;
  display: flex; justify-content: center;
  animation: popin .3s cubic-bezier(.34, 1.56, .64, 1);
}
.modal:not(.sheet) { top: 280px; }
.modal-card {
  width: 560px; background: var(--card); border-radius: 44px;
  padding: 44px 40px 40px; box-shadow: 0 12px 0 rgba(70, 58, 50, .12);
  text-align: center;
}
.modal-title { font-size: 40px; font-weight: 900; letter-spacing: 4px; margin-bottom: 8px; }
.result-game {
  font-size: 22px; font-weight: 700; color: #FFF; display: inline-block;
  background: var(--purple); border-radius: 999px; padding: 6px 22px; margin-bottom: 22px;
}
.result-grid { display: flex; gap: 20px; margin-bottom: 24px; }
.result-cell { flex: 1; border-radius: 28px; padding: 26px 0 20px; }
.result-cell:first-child { background: #FFE9EE; }
.result-cell:last-child { background: #E9F9E9; }
.result-num { font-size: 64px; font-weight: 900; color: var(--pink-d); }
.result-num.small { font-size: 44px; padding-top: 10px; color: var(--green-d); }
.result-cap { font-size: 22px; color: var(--ink-soft); margin-top: 6px; letter-spacing: 4px; }
.result-gains { display: flex; justify-content: center; gap: 18px; margin-bottom: 10px; flex-wrap: wrap; }
.gain-chip {
  background: #FFF3C4; color: #6B4A00;
  border-radius: 999px; padding: 10px 24px; font-size: 24px; font-weight: 700;
}
.newbest { font-size: 26px; color: var(--pink-d); font-weight: 800; margin: 8px 0 4px; letter-spacing: 2px; }
.pause-hint { font-size: 26px; color: var(--ink-soft); margin-bottom: 28px; }
.btn-col { display: flex; flex-direction: column; gap: 18px; }
.full { width: 100%; margin-top: 14px; }

.sheet { align-items: flex-end; top: 0; bottom: 0; position: absolute; display: flex; }
.sheet-card {
  width: 720px; background: var(--bg);
  border-radius: 48px 48px 0 0; padding: 44px 44px 48px;
  box-shadow: 0 -12px 0 rgba(70, 58, 50, .1);
  max-height: 960px; overflow-y: auto;
}
.sheet-title { font-size: 38px; font-weight: 900; letter-spacing: 8px; text-align: center; margin-bottom: 30px; }

/* ---- 游戏选择中心 ---- */
.game-list { display: flex; flex-direction: column; gap: 20px; margin-bottom: 26px; }
.game-item {
  display: flex; align-items: center; gap: 24px;
  background: var(--card); border-radius: 32px; padding: 20px 26px;
  cursor: pointer; box-shadow: 0 6px 0 rgba(70, 58, 50, .1);
  transition: transform .1s, box-shadow .1s;
}
.game-item:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(70, 58, 50, .1); }
.game-item canvas { width: 92px; height: 92px; flex: none; border-radius: 24px; }
.game-info { flex: 1; text-align: left; }
.game-name { font-size: 32px; font-weight: 900; }
.game-desc { font-size: 22px; color: var(--ink-soft); margin-top: 6px; }
.game-best { font-size: 20px; font-weight: 700; color: #FFF; background: var(--blue); border-radius: 999px; padding: 4px 16px; margin-top: 10px; display: inline-block; }

.food-list { display: flex; flex-direction: column; gap: 20px; margin-bottom: 26px; }
.food-item {
  display: flex; align-items: center; gap: 24px;
  background: var(--card); border-radius: 30px; padding: 20px 26px;
  box-shadow: 0 5px 0 rgba(70, 58, 50, .08);
}
.food-item canvas { width: 84px; height: 84px; flex: none; }
.food-info { flex: 1; text-align: left; }
.food-name { font-size: 30px; font-weight: 800; }
.food-desc { font-size: 22px; color: var(--ink-soft); margin-top: 4px; }
.food-buy {
  flex: none; border: none; background: var(--orange); color: #FFF;
  font-size: 26px; font-weight: 800; border-radius: 999px; padding: 16px 30px;
  box-shadow: 0 4px 0 var(--orange-d);
}
.food-buy:active { box-shadow: 0 1px 0 var(--orange-d); }
.food-buy:disabled { background: #E4DAC9; color: #B8AB99; box-shadow: none; }

.shop-tabs { display: flex; gap: 16px; margin-bottom: 26px; }
.shop-tab {
  flex: 1; padding: 18px 0; border-radius: 999px; font-size: 28px; font-weight: 800;
  background: rgba(70, 58, 50, .08); color: var(--ink-soft);
}
.shop-tab.active { background: var(--green); color: #FFF; box-shadow: 0 4px 0 var(--green-d); }
.shop-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 26px; }
.shop-item {
  background: var(--card); border-radius: 28px; padding: 20px 12px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  box-shadow: 0 5px 0 rgba(70, 58, 50, .08);
}
.shop-item canvas { width: 96px; height: 96px; }
.shop-item .wall-swatch { width: 96px; height: 96px; border-radius: 24px; }
.shop-name { font-size: 24px; font-weight: 800; }
.shop-btn {
  border: none; border-radius: 999px; padding: 12px 26px;
  font-size: 22px; font-weight: 800; background: var(--orange); color: #FFF;
  box-shadow: 0 4px 0 var(--orange-d);
}
.shop-btn:active { box-shadow: 0 1px 0 var(--orange-d); }
.shop-btn.owned { background: var(--green); box-shadow: 0 4px 0 var(--green-d); }
.shop-btn.wearing { background: #E4DAC9; color: var(--ink-soft); box-shadow: none; }
.shop-btn:disabled { opacity: .8; }

.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 30px; font-weight: 700; padding: 6px 10px 26px;
}
.switch { position: relative; display: inline-block; width: 92px; height: 48px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0; background: rgba(70, 58, 50, .2); border-radius: 999px;
  transition: background .2s;
}
.switch i::after {
  content: ""; position: absolute; top: 5px; left: 5px; width: 38px; height: 38px;
  background: #FFF; border-radius: 50%; transition: transform .2s;
  box-shadow: 0 3px 8px rgba(0,0,0,.15);
}
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(44px); }
.about-text {
  font-size: 24px; color: var(--ink-soft); line-height: 1.8;
  margin-bottom: 26px; letter-spacing: 1px;
}

.toast {
  position: absolute; top: 150px; left: 50%; transform: translateX(-50%);
  background: var(--purple); color: #FFF;
  font-size: 27px; font-weight: 700; padding: 18px 40px; border-radius: 999px;
  letter-spacing: 2px; white-space: nowrap; z-index: 60;
  animation: toastin .3s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 5px 0 var(--purple-d);
  pointer-events: none;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, -24px); } }
@keyframes fadein { from { opacity: 0; } }
@keyframes popin { from { opacity: 0; transform: scale(.86); } }
