/* ============================================================
 * 她的游戏屋 · 统一主题
 * 面向女性用户的柔和视觉体系（樱花粉 + 奶白 + 薄荷点缀）
 * 所有游戏共用，通过 CSS 变量控制，便于整体换肤
 * ============================================================ */

:root {
  /* 主色阶 */
  --mh-pink-50:  #fdf6f7;
  --mh-pink-100: #fbe9ee;
  --mh-pink-200: #f8d4de;
  --mh-pink-300: #f8b4c4;
  --mh-pink-400: #ef97ae;
  --mh-pink-500: #e07b96;

  /* 辅助色 */
  --mh-mint:     #a8d8d8;
  --mh-lavender: #c7ceea;
  --mh-cream:    #fffaf5;
  --mh-butter:   #ffe8c9;

  /* 文字 */
  --mh-ink:      #5c4a50;
  --mh-ink-soft: #8a757c;
  --mh-ink-mute: #b3a2a8;

  /* 结构 */
  --mh-radius:   16px;
  --mh-radius-sm:10px;
  --mh-shadow:   0 6px 24px rgba(224, 123, 150, .14);
  --mh-shadow-lg:0 12px 40px rgba(224, 123, 150, .22);
  --mh-border:   1px solid rgba(248, 180, 196, .45);

  /* 字体（国内环境，只用系统字体，不引外链） */
  --mh-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
             "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
}

/* ---------- 基础重置（仅作用于游戏屋自有元素，避免污染原游戏样式） ---------- */
.mh-reset,
.mh-reset * {
  box-sizing: border-box;
  font-family: var(--mh-font);
}

/* ---------- 顶部返回条 ---------- */
#mh-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: linear-gradient(180deg, rgba(253,246,247,.97), rgba(253,246,247,.82));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(248,180,196,.35);
  z-index: 2147483000;
  font-family: var(--mh-font);
  transition: transform .28s ease, opacity .28s ease;
}
#mh-topbar.mh-hide {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}
#mh-topbar a.mh-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--mh-ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(224,123,150,.16);
  border: var(--mh-border);
  transition: transform .18s ease, box-shadow .18s ease;
}
#mh-topbar a.mh-back:active { transform: scale(.95); }
#mh-topbar .mh-title {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--mh-ink);
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#mh-topbar .mh-spacer { width: 76px; flex: 0 0 76px; }

/* 给页面让出顶部空间 */
body.mh-with-topbar { padding-top: 46px !important; }

/* ---------- 右下角礼物入口 ---------- */
#mh-gift-fab {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 2147483001;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px 0 14px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--mh-font);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--mh-pink-400), var(--mh-pink-500));
  box-shadow: var(--mh-shadow-lg);
  transform: translateY(90px);
  opacity: 0;
  transition: transform .45s cubic-bezier(.34,1.56,.64,1), opacity .35s ease;
}
#mh-gift-fab.mh-show { transform: translateY(0); opacity: 1; }
#mh-gift-fab:active { transform: scale(.94); }
#mh-gift-fab .mh-fab-ico {
  font-size: 17px;
  animation: mh-wiggle 2.6s ease-in-out infinite;
}
@keyframes mh-wiggle {
  0%, 88%, 100% { transform: rotate(0); }
  91% { transform: rotate(-14deg); }
  94% { transform: rotate(12deg); }
  97% { transform: rotate(-6deg); }
}

/* ---------- 礼物引导气泡 ---------- */
#mh-toast {
  position: fixed;
  right: 16px;
  bottom: 78px;
  z-index: 2147483001;
  max-width: 250px;
  padding: 12px 14px;
  border-radius: var(--mh-radius);
  background: #fff;
  border: var(--mh-border);
  box-shadow: var(--mh-shadow);
  font-family: var(--mh-font);
  font-size: 13px;
  line-height: 1.6;
  color: var(--mh-ink);
  opacity: 0;
  transform: translateY(10px) scale(.96);
  transition: all .32s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
#mh-toast.mh-show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
#mh-toast::after {
  content: "";
  position: absolute;
  right: 30px; bottom: -7px;
  width: 14px; height: 14px;
  background: #fff;
  border-right: var(--mh-border);
  border-bottom: var(--mh-border);
  transform: rotate(45deg);
}
#mh-toast .mh-toast-close {
  position: absolute;
  top: 6px; right: 8px;
  border: none;
  background: none;
  font-size: 16px;
  line-height: 1;
  color: var(--mh-ink-mute);
  cursor: pointer;
  padding: 2px;
}

/* ---------- 礼物弹窗 ---------- */
#mh-giftmask {
  position: fixed;
  inset: 0;
  z-index: 2147483002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(92, 74, 80, .42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  font-family: var(--mh-font);
}
#mh-giftmask.mh-show { opacity: 1; pointer-events: auto; }

#mh-giftcard {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 26px 22px 22px;
  border-radius: 22px;
  background: linear-gradient(170deg, #fffdfc 0%, var(--mh-pink-50) 55%, var(--mh-pink-100) 100%);
  box-shadow: 0 24px 64px rgba(92,74,80,.26);
  text-align: center;
  transform: translateY(18px) scale(.95);
  transition: transform .38s cubic-bezier(.34,1.56,.64,1);
  overflow: hidden;
}
#mh-giftmask.mh-show #mh-giftcard { transform: translateY(0) scale(1); }
#mh-giftcard::before {
  content: "";
  position: absolute;
  top: -46px; right: -46px;
  width: 132px; height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(248,180,196,.5), transparent 70%);
}
#mh-giftcard .mh-gift-emoji {
  font-size: 44px;
  line-height: 1;
  display: block;
  margin-bottom: 12px;
  animation: mh-float 3s ease-in-out infinite;
}
@keyframes mh-float {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-7px); }
}
#mh-giftcard h2 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 800;
  color: var(--mh-ink);
  letter-spacing: .3px;
}
#mh-giftcard p {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--mh-ink-soft);
}
#mh-giftcard .mh-btn-main {
  display: block;
  width: 100%;
  height: 46px;
  line-height: 46px;
  border: none;
  border-radius: 999px;
  font-family: var(--mh-font);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--mh-pink-400), var(--mh-pink-500));
  box-shadow: 0 8px 20px rgba(224,123,150,.34);
  transition: transform .16s ease;
}
#mh-giftcard .mh-btn-main:active { transform: scale(.97); }
#mh-giftcard .mh-btn-sub {
  display: inline-block;
  margin-top: 12px;
  border: none;
  background: none;
  font-family: var(--mh-font);
  font-size: 12.5px;
  color: var(--mh-ink-mute);
  cursor: pointer;
  padding: 6px 10px;
}
#mh-giftcard .mh-tip {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--mh-ink-mute);
  line-height: 1.6;
}

/* ---------- 若游戏本身全屏 canvas，避免被顶栏压住 ---------- */
body.mh-with-topbar > canvas,
body.mh-with-topbar > .container { margin-top: 0; }
