/* ============================================================
 * 她的游戏屋 · 游戏外框（wrapper）
 * 统一顶栏 / 返回 / 情境化「测一测」/ 关于抽屉 / 结束卡
 * 只作用于 wrapper 页面，不侵入游戏本体
 * ============================================================ */

:root {
  --gp-pink: #e07b96;
  --gp-pink-deep: #c95f7c;
  --gp-ink: #5c4a50;
  --gp-sub: #a1737f;
  --gp-line: rgba(248, 180, 196, 0.42);
  --gp-bg: #fdf6f7;
  --gp-card: #ffffff;
  --gp-bar-h: 54px;
  --gp-safe-top: env(safe-area-inset-top, 0px);
  --gp-safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--gp-bg);
  color: var(--gp-ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  overscroll-behavior: none;
}

body { overflow: hidden; }

.gp-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 100vh;
}

/* ---------------- 顶栏 ---------------- */
.gp-bar {
  flex: 0 0 auto;
  height: calc(var(--gp-bar-h) + var(--gp-safe-top));
  padding: var(--gp-safe-top) 12px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 252, 253, 0.92);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--gp-line);
  position: relative;
  z-index: 20;
}

.gp-back {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--gp-line);
  color: var(--gp-pink-deep);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(200, 140, 155, 0.12);
}
.gp-back:active { transform: scale(0.94); }
.gp-back svg { width: 18px; height: 18px; }

.gp-head { flex: 1 1 auto; min-width: 0; line-height: 1.15; }
.gp-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gp-sub {
  font-size: 10.5px;
  color: var(--gp-sub);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gp-cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef9cb2, #e07b96);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(224, 123, 150, 0.32);
}
.gp-cta:active { transform: scale(0.96); }
.gp-cta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28);
  animation: gp-pulse 2.4s ease-in-out infinite;
}
@keyframes gp-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

.gp-info {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--gp-line);
  background: #fff;
  color: var(--gp-sub);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* ---------------- 游戏区 ---------------- */
.gp-stage {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  background: #fff;
  overflow: hidden;
}
.gp-stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

/* ---------------- 关于抽屉 ---------------- */
.gp-sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(60, 40, 46, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  z-index: 40;
}
.gp-sheet-mask.is-open { opacity: 1; pointer-events: auto; }

.gp-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  max-height: 76dvh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, #fffdfd 0%, #fdf4f6 100%);
  border-radius: 22px 22px 0 0;
  padding: 8px 20px calc(24px + var(--gp-safe-bottom));
  transform: translateY(104%);
  transition: transform 0.32s cubic-bezier(0.22, 0.9, 0.24, 1);
  box-shadow: 0 -12px 40px rgba(120, 70, 84, 0.18);
}
.gp-sheet.is-open { transform: translateY(0); }
.gp-sheet::before {
  content: "";
  display: block;
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: rgba(160, 120, 132, 0.28);
  margin: 4px auto 14px;
}
.gp-sheet h1 {
  margin: 0 0 4px;
  font-size: 20px;
  letter-spacing: 0.1em;
  color: #8c4a5b;
}
.gp-sheet .gp-kicker {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gp-sub);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.gp-sheet p {
  font-size: 13.5px;
  line-height: 1.9;
  color: #6b4a54;
  margin: 0 0 14px;
}
.gp-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 16px; }
.gp-tag {
  font-size: 11.5px;
  padding: 4px 11px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--gp-line);
  color: var(--gp-pink-deep);
}
.gp-card {
  background: #fff;
  border: 1px solid var(--gp-line);
  border-radius: 16px;
  padding: 16px;
  margin: 0 0 14px;
  box-shadow: 0 4px 16px rgba(200, 140, 155, 0.08);
}
.gp-card h2 { margin: 0 0 6px; font-size: 14px; color: #8c4a5b; }
.gp-card p { margin: 0 0 12px; font-size: 12.5px; color: #8a6570; line-height: 1.85; }
.gp-card .gp-btn { display: flex; }
.gp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef9cb2, #e07b96);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(224, 123, 150, 0.3);
}
.gp-btn:active { transform: scale(0.98); }
.gp-credit {
  font-size: 11px;
  color: #b08a95;
  line-height: 1.8;
  margin-top: 10px;
}
.gp-credit a { color: #b08a95; }

/* ---------------- 结束卡 ---------------- */
.gp-endcard {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(60, 40, 46, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.gp-endcard.is-open { opacity: 1; pointer-events: auto; }
.gp-endcard-inner {
  width: 100%;
  max-width: 340px;
  background: linear-gradient(180deg, #fffdfd, #fdf3f5);
  border-radius: 22px;
  padding: 26px 22px 22px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(90, 50, 62, 0.3);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.22, 0.9, 0.24, 1);
}
.gp-endcard.is-open .gp-endcard-inner { transform: none; }
.gp-endcard .gp-heart {
  width: 46px; height: 46px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 18px rgba(224, 123, 150, 0.2);
  font-size: 22px;
}
.gp-endcard h2 { margin: 0 0 8px; font-size: 18px; color: #8c4a5b; letter-spacing: 0.04em; }
.gp-endcard p { margin: 0 0 18px; font-size: 13px; line-height: 1.85; color: #7b5a64; }
.gp-endcard .gp-btn { width: 100%; }
.gp-endcard .gp-later {
  margin-top: 12px;
  border: 0;
  background: none;
  color: #a1737f;
  font-size: 12.5px;
  padding: 8px;
  cursor: pointer;
}
.gp-endcard .gp-note { margin-top: 10px; font-size: 10.5px; color: #b08a95; }

@media (min-width: 720px) {
  .gp-bar { padding-left: 18px; padding-right: 18px; }
  .gp-endcard-inner { max-width: 380px; }
}
