* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #1a1020; font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif; user-select: none; }

#app { position: relative; width: 100%; height: 100%; max-width: 430px; margin: 0 auto; overflow: hidden; background: #000; }

:root { --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --pink: #FF8FAB; --purple: #B794F6; --text: #5D4E6D; }

/* ===== 翻页 ===== */
.page { position: absolute; inset: 0; opacity: 0; visibility: hidden; transform: translateX(100%); transition: transform .35s cubic-bezier(.4, 0, .2, 1), opacity .35s, visibility .35s; z-index: 1; }
.page.active { opacity: 1; visibility: visible; transform: translateX(0); z-index: 2; }
.page.out-left { transform: translateX(-100%); opacity: 0; }
.page.out-right { transform: translateX(100%); opacity: 0; }
.page.in-left { transform: translateX(0); opacity: 1; visibility: visible; z-index: 3; }

.page-stage { position: relative; width: 100%; height: 100%; overflow: hidden; padding-top: var(--safe-t); padding-bottom: var(--safe-b); }
.page-bg-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; pointer-events: none; }

/* ===== 引导提示（居中空白位置，不挡标题） ===== */
.guide-hint {
  position: absolute; left: 50%; transform: translateX(-50%);
  z-index: 20; background: rgba(255,255,255,.85); border-radius: 14px;
  padding: 5px 14px; font-size: 11px; font-weight: 600; color: var(--purple);
  box-shadow: 0 2px 10px rgba(0,0,0,.08); border: 1px solid rgba(183,148,246,.18);
  white-space: nowrap; opacity: 0; transition: opacity .5s; pointer-events: none;
}
.guide-hint.show { opacity: 1; }

#guide3 { top: 16%; }
#guide4 { top: 52%; }
#guide5 { top: 22%; }
#guide6 { top: 16%; }
#guide7Monster { top: 12%; }

/* ===== 左上角返回箭头 ===== */
.nav-back {
  position: absolute; top: calc(var(--safe-t) + 10px); left: 10px; z-index: 50;
  width: 32px; height: 32px; border: 2px solid rgba(255,255,255,.5);
  border-radius: 50%; background: rgba(255,255,255,.2); cursor: pointer;
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  transition: transform .15s, background .3s; opacity: 0; visibility: hidden;
}
.nav-back::before {
  content: ''; display: block; width: 8px; height: 8px;
  border-left: 2px solid rgba(255,255,255,.9); border-bottom: 2px solid rgba(255,255,255,.9);
  transform: rotate(45deg); margin-left: 3px;
}
.nav-back.show { opacity: 1; visibility: visible; }
.nav-back:active { transform: scale(.85); background: rgba(255,255,255,.4); }

/* ===== 底部白色跳跃箭头 ===== */
.nav-arrow {
  position: absolute; left: 50%; bottom: calc(var(--safe-b) + 14px);
  transform: translateX(-50%); z-index: 50;
  width: 50px; height: 32px; border: none; border-radius: 16px;
  background: rgba(255,255,255,.35); backdrop-filter: blur(4px);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity .4s, transform .2s;
}
.nav-arrow.show { opacity: 1; visibility: visible; }
.nav-arrow.bounce { animation: arrBounce 1.6s ease-in-out infinite; }
.nav-arrow:active { transform: translateX(-50%) scale(.85); animation: none; }
.nav-arrow::after {
  content: ''; display: block; width: 10px; height: 10px;
  border-right: 2.5px solid rgba(255,255,255,.9);
  border-bottom: 2.5px solid rgba(255,255,255,.9);
  transform: rotate(45deg); margin-top: -3px;
}
.nav-arrow.hidden { display: none; }
@keyframes arrBounce { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(6px); } }

/* ===== 热区（透明点击层） ===== */
.hit-btn {
  position: absolute; border: none; background: transparent; cursor: pointer; padding: 0; transition: transform .15s;
}
.hit-btn:active { transform: scale(.92); }

/* ===== 粉色区域按钮（直接点原图） ===== */
.btn-next-overlay { z-index: 30; pointer-events: auto; }

/* ===== 分区小手 ===== */
.zone-hit-indicator {
  position: absolute; z-index: 11; font-size: 18px; pointer-events: none;
  display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.8);
  background: none; border: none;
  opacity: 0; transition: opacity .5s;
  animation: handBounce 1.2s ease-in-out infinite;
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.zone-hit-indicator.show { opacity: 1; }
@keyframes handBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ===== 区域引导文字（中间空白处） ===== */
.zone-guide {
  position: absolute; left: 50%; transform: translateX(-50%); top: 14%;
  z-index: 13; background: rgba(255,255,255,.85); border-radius: 12px;
  padding: 4px 12px; font-size: 11px; font-weight: 600; color: var(--purple);
  box-shadow: 0 2px 8px rgba(0,0,0,.07); white-space: nowrap;
  opacity: 0; transition: opacity .5s; pointer-events: none;
}
.zone-guide.show { opacity: 1; }

/* ===== 气泡 ===== */
.soft-bubble {
  position: absolute; background: rgba(255,255,255,.93);
  border-radius: 16px; padding: 10px 14px; font-size: 12px; font-weight: 600;
  color: var(--text); line-height: 1.5; box-shadow: 0 4px 18px rgba(0,0,0,.1);
  opacity: 0; transition: opacity .6s ease; pointer-events: none; z-index: 12;
}
.soft-bubble.show { opacity: 1; }

.p2-bubble { left: 8%; top: 56%; max-width: 130px; border-left: 3px solid var(--pink); }
.p4-tip { left: 5%; top: 38%; max-width: 170px; border-left: 3px solid var(--purple); }
.p6-tip { left: 5%; top: 38%; max-width: 170px; border-left: 3px solid var(--purple); }

/* ===== 小手指示（第3页茶壶 / 第4页长颈鹿） ===== */
.hand-pointer {
  position: absolute; z-index: 13; font-size: 24px; pointer-events: none;
  opacity: 0;
  animation: handPointer 1.4s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}
.hand-pointer.show { opacity: 1; }
#handPointer3 { left: 48%; top: 42%; }
#handPointer4 { left: 48%; top: 28%; }
#handPointer6 { left: 48%; top: 42%; }
@keyframes handPointer { 0%,100% { transform: translate(0,0); } 25% { transform: translate(4px,4px); } 50% { transform: translate(0,8px); } 75% { transform: translate(-4px,4px); } }

/* ===== 答题选项 ===== */
.quiz-container {
  position: absolute; left: 10%; top: 30%; width: 80%; z-index: 10;
  display: flex; flex-direction: column; gap: 8px;
}
.quiz-opt {
  width: 100%; padding: 13px 16px; border-radius: 12px;
  background: rgba(255,255,255,.5); backdrop-filter: blur(4px);
  border: 2px solid rgba(255,143,171,.2);
  font-size: 14px; font-weight: 600; color: var(--text); text-align: left;
  transition: all .3s; cursor: pointer;
}
.quiz-opt.locked { opacity: .3; pointer-events: none; border-color: rgba(0,0,0,.06); }
.quiz-opt:not(.locked) { background: rgba(255,255,255,.85); border-color: rgba(255,143,171,.35); }
.quiz-opt:not(.locked):active { transform: scale(.96); }
.quiz-opt.picked { background: rgba(255,143,171,.25); border-color: var(--pink); }

/* ===== 第5页结果按钮（缩小不挡文字） ===== */
.p5-result-btn {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 8px);
  opacity: 0; transition: opacity .5s; pointer-events: none; z-index: 15;
}
.p5-result-btn.show { opacity: 1; pointer-events: auto; }

.btn-wanted {
  display: block; padding: 8px 18px; border-radius: 50px; font-size: 12px; font-weight: 700;
  border: none; color: #fff; cursor: pointer; white-space: nowrap;
  background: linear-gradient(180deg,#FFB6C1,var(--pink));
  box-shadow: 0 3px 12px rgba(255,143,171,.35);
}
.btn-wanted:active { transform: scale(.93); }

/* ===== 第8页 ===== */
.restart-btn {
  width: auto; padding: 10px 24px; border: none; border-radius: 50px; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: transform .15s; color: #fff;
  background: linear-gradient(180deg,#E8D5FF,var(--purple));
}
.restart-btn:active { transform: scale(.93); }

.p8-slogan {
  position: absolute; left: 50%; bottom: calc(var(--safe-b) + 12px);
  transform: translateX(-50%); z-index: 6;
  color: rgba(255,255,255,.65); font-size: 11px; font-weight: 500;
  letter-spacing: 2px; white-space: nowrap;
  opacity: 0; transition: opacity .8s; text-shadow: 0 1px 6px rgba(0,0,0,.3);
}
.p8-slogan.show { opacity: 1; }

/* ===== 弹窗系统 ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(80,70,90,.4); backdrop-filter: blur(2px); z-index: 100; transition: opacity .25s; }
.modal-overlay.hidden { opacity: 0; pointer-events: none; visibility: hidden; }
.modal-container { position: fixed; inset: 0; z-index: 101; pointer-events: none; }

.modal-box {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(.9);
  width: min(280px,calc(100vw - 36px));
  background: rgba(255,255,255,.96); border-radius: 18px;
  padding: 20px 16px; text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
  border: 2px solid rgba(255,182,193,.3);
  opacity: 0; pointer-events: none; transition: all .3s; z-index: 101;
}
.modal-box.on { opacity: 1; transform: translate(-50%,-50%) scale(1); pointer-events: auto; }

/* 右上角关闭叉叉 */
.modal-close-x {
  position: absolute; top: 8px; right: 10px; width: 26px; height: 26px;
  border: none; background: rgba(0,0,0,.06); border-radius: 50%;
  font-size: 14px; line-height: 26px; text-align: center; color: #999;
  cursor: pointer; transition: background .2s;
}
.modal-close-x:active { background: rgba(0,0,0,.12); }

.modal-box h3 { font-size: 16px; color: var(--purple); margin-bottom: 10px; }
.modal-box p { font-size: 13px; line-height: 1.6; color: var(--text); margin-bottom: 8px; }
.modal-box .big-num { font-size: 36px; font-weight: 900; color: var(--pink); margin: 6px 0; }
.modal-box .emoji-big { font-size: 34px; margin-bottom: 6px; }

.modal-btn {
  display: inline-block; padding: 10px 30px; border: none; border-radius: 50px;
  background: linear-gradient(180deg,#FFB6C1,var(--pink));
  color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 6px; transition: transform .15s;
}
.modal-btn:active { transform: scale(.92); }

/* Toast */
.toast-container { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 200; pointer-events: none; }
.toast {
  background: rgba(50,40,60,.88); color: #fff; border-radius: 14px;
  padding: 12px 22px; font-size: 13px; font-weight: 500;
  box-shadow: 0 6px 25px rgba(0,0,0,.2); backdrop-filter: blur(8px);
  opacity: 0; transform: scale(.85); transition: all .35s; text-align: center;
}
.toast.show { opacity: 1; transform: scale(1); }

/* ===== 分区弹窗 ===== */
.zone-popup {
  position: fixed; z-index: 101; max-width: 230px;
  background: rgba(255,255,255,.96); border-radius: 14px;
  padding: 12px 14px; font-size: 12px; font-weight: 600; line-height: 1.6;
  color: var(--text); box-shadow: 0 6px 24px rgba(0,0,0,.12);
  border-left: 3.5px solid var(--pink); pointer-events: none;
  opacity: 0; transform: translateY(10px) scale(.95);
  transition: opacity .3s, transform .3s;
}
.zone-popup.on { opacity: 1; transform: translateY(0) scale(1); }

/* ===== 动效 ===== */
.fx-particles { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; opacity: 0; transition: opacity .6s; }
.fx-particles.on { opacity: 1; }
.fx-particles .particle { position: absolute; font-size: 12px; animation: particleDrift linear infinite; opacity: .5; }
@keyframes particleDrift { 0% { transform: translateY(-20px) rotate(0deg); opacity: .5; } 100% { transform: translateY(110vh) rotate(360deg); opacity: 0; } }

.fx-steam { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.fx-steam i { position: absolute; width: 10px; height: 16px; background: rgba(255,255,255,.4); border-radius: 50%; animation: steamRise 2.8s ease-in-out infinite; }
.fx-steam i:nth-child(2) { animation-delay: .7s; left: 46%; }
.fx-steam i:nth-child(3) { animation-delay: 1.4s; left: 50%; }
.fx-steam i:nth-child(4) { animation-delay: 2.1s; left: 54%; }
@keyframes steamRise { 0% { opacity: .4; transform: translateY(0) scale(1); } 50% { opacity: .6; transform: translateY(-24px) scale(1.25); } 100% { opacity: 0; transform: translateY(-50px) scale(.8); } }

.poster-hand {
  position: absolute; z-index: 22; font-size: 20px; pointer-events: none;
  opacity: 0; animation: handBounce 1.2s ease-in-out infinite;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.35));
  transition: opacity .5s;
}
.poster-hand.show { opacity: 1; }

.poster-btn { border-radius: 10px; animation: posterFloat 3s ease-in-out infinite; cursor: pointer; background: transparent; border: none; }
.poster-btn:nth-child(2) { animation-delay: .4s; }
.poster-btn:nth-child(3) { animation-delay: .8s; }
.poster-btn:nth-child(4) { animation-delay: 1.2s; }
@keyframes posterFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.poster-btn.active { transform: scale(1.05); z-index: 11; }

#confettiCanvas { position: fixed; inset: 0; pointer-events: none; z-index: 102; }

.star-popup { position: fixed; pointer-events: none; z-index: 99; font-size: 14px; animation: starFly .8s ease forwards; }
@keyframes starFly { 0% { opacity: 1; transform: translate(0,0) scale(1); } 100% { opacity: 0; transform: translate(var(--sx),var(--sy)) scale(.3); } }

/* ===== 锁状态 ===== */
body.locked .nav-arrow.show { pointer-events: none; }
body.locked .hit-btn { pointer-events: none !important; }
body.locked .btn-wanted, body.locked .restart-btn { pointer-events: none !important; }
body.locked .modal-box.on { pointer-events: auto; }
body.locked .modal-btn, body.locked .modal-close-x { pointer-events: auto; }
