/* 海上泼水节 · 静态布局 · 设计稿 750×1334 */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  min-height: -webkit-fill-available;
  overflow: hidden;
  background: #1a3a5c;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html.is-wechat,
html.is-wechat body {
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
}

img {
  display: block;
  max-width: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

/* 游戏页：装饰图不响应触摸，避免 iOS 长按选中/保存菜单 */
.app img:not(.share-poster) {
  pointer-events: none;
}

.app button,
.app .p0-page__tap,
.app .p2-page__btn,
.app .p1-page__btn,
.app .p3-page__btn {
  pointer-events: auto;
  touch-action: manipulation;
}

/* 分享页海报：允许点击（保存/分享），后续分享页直接使用此类名 */
.app .share-poster,
.share-page .share-poster,
[data-share-poster] {
  pointer-events: auto;
  -webkit-touch-callout: default;
  touch-action: manipulation;
}

.app .share-poster img,
.share-page .share-poster img,
[data-share-poster] img {
  pointer-events: auto;
  -webkit-touch-callout: default;
}

button {
  border: none;
  background: none;
  padding: 0;
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

/* ── 根容器：750 逻辑宽，铺满视口（iOS 6/12 无 inset / 无 right+width 冲突） ── */
.app {
  position: fixed;
  top: 0;
  left: 0;
  width: 750px;
  width: var(--app-w, 750px);
  max-width: none;
  height: 100vh;
  height: var(--app-h, 100vh);
  height: -webkit-fill-available;
  min-height: 100vh;
  min-height: var(--app-h, 100vh);
  min-height: -webkit-fill-available;
  margin: 0;
  overflow: hidden;
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.layer {
  position: absolute;
  left: 0;
  width: 100%;
  pointer-events: none;
}

/* ── 背景 ── */
.layer-bg {
  top: 0;
  height: 100%;
  z-index: 0;
}

.bg-main {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: url('../images/ui_bg.jpg') left top / 750px auto no-repeat;
}

.bg-bottom-tile {
  position: absolute;
  left: 0;
  right: 0;
  top: 1334px;
  bottom: 0;
  background: url('../images/ui_bg_bottom.jpg') left top / 750px 1px repeat-y;
}

/* ── 顶部 HUD ── */
.layer-hud-top {
  top: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top, 0px);
}

.timer {
  position: relative;
  width: 107px;
  height: 118px;
  margin: 133px auto 22px;
  background: url('../images/ui_timer.png') no-repeat center / contain;
}

.timer__value {
  display: block;
  padding: 46px 26px 0;
  font-size: 36px;
  font-weight: 700;
  color: #c41e3a;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* 对抗条：464×17.5，居中 */
.tug-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  margin-top: 6px;
  padding: 0 20px;
}

.tug-bar__icon {
  flex-shrink: 0;
  width: 135px;
  height: 51px;
}

.tug-bar__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tug-bar__track {
  position: relative;
  flex: 0 0 464px;
  width: 464px;
  height: 17.5px;
  display: flex;
  overflow: visible;
}

.tug-bar__fill {
  height: 100%;
  flex-shrink: 0;
  transition: width 0.35s ease;
}

.tug-bar.is-instant .tug-bar__fill,
.tug-bar.is-instant .tug-marker {
  transition: none;
}

.tug-bar__fill--left {
  background: linear-gradient(90deg, #fbce76 0%, #e02169 100%);
  border-radius: 8px 0 0 8px;
}

.tug-bar__fill--right {
  background: linear-gradient(90deg, #a4ebb8 0%, #4988d7 100%);
  border-radius: 0 8px 8px 0;
}

.tug-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 56px;
  z-index: 2;
  transition: left 0.35s ease;
  pointer-events: none;
}

.tug-float-layer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  pointer-events: none;
  overflow: visible;
}

.tug-float {
  position: absolute;
  top: -36px;
  transform: translateX(-50%);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
  animation: tug-float-up 0.85s ease forwards;
}

.tug-float--gain {
  color: #e02169;
}

.tug-float--loss {
  color: #2a6fd4;
}

@keyframes tug-float-up {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-28px) scale(1.08);
  }
}

.tug-bar.is-player-hit .tug-marker__fu {
  animation: tug-marker-pulse 0.4s ease;
}

.tug-bar.is-enemy-hit .tug-marker__fu {
  animation: tug-marker-shake 0.4s ease;
}

@keyframes tug-marker-pulse {
  50% {
    transform: scale(1.12);
  }
}

@keyframes tug-marker-shake {
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

.tug-marker__light {
  position: absolute;
  left: 50%;
  top: 55%;
  transform: translate(-50%, -50%);
  width: 131px;
  height: auto;
  opacity: 0.85;
  pointer-events: none;
}

.tug-marker__fu {
  position: relative;
  z-index: 1;
  width: 60px;
  height: auto;
  margin: 0 auto;
}

.timer__value--urgent {
  color: #ff3b30;
  animation: timer-blink 0.8s ease infinite;
}

@keyframes timer-blink {
  50% {
    opacity: 0.65;
  }
}

/* ── 结算：成功/失败切图（对抗条下方 · Canvas 区域） ── */
.result-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease;
}

.result-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.result-overlay.is-instant-hide {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: none !important;
}

.result-overlay.is-win {
  background: rgba(20, 12, 4, 0.46);
}

.result-overlay.is-lose {
  background: rgba(8, 16, 36, 0.52);
}

.result-badge {
  position: absolute;
  left: 50%;
  top: calc(360 / 1334 * 100%);
  width: calc(683 / 750 * 100%);
  max-width: 683px;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
}

.result-badge--lose {
  width: calc(714 / 750 * 100%);
  max-width: 714px;
}

.result-badge--draw {
  filter: saturate(0.72);
}

.result-badge__glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 130%;
  height: 140%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.result-badge--win .result-badge__glow {
  background: radial-gradient(
    circle,
    rgba(255, 210, 90, 0.55) 0%,
    rgba(255, 160, 40, 0.18) 42%,
    transparent 72%
  );
}

.result-badge--lose .result-badge__glow {
  background: radial-gradient(
    circle,
    rgba(90, 140, 255, 0.35) 0%,
    rgba(40, 70, 160, 0.12) 45%,
    transparent 72%
  );
}

.result-badge__img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.35));
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.result-badge--win.is-animate {
  animation: result-win-enter 0.88s cubic-bezier(0.22, 1.15, 0.36, 1) forwards;
}

.result-badge--win.is-animate .result-badge__glow {
  animation: result-glow-burst 1.05s ease 0.12s forwards;
}

.result-badge--lose.is-animate {
  animation: result-lose-enter 0.82s ease forwards;
}

.result-badge--lose.is-animate .result-badge__glow {
  animation: result-glow-burst 0.9s ease 0.08s forwards;
}

.result-badge--draw.is-animate {
  animation: result-draw-enter 0.78s ease forwards;
}

@keyframes result-win-enter {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-56px) scale(0.28) rotate(-8deg);
    filter: blur(8px);
  }
  52% {
    opacity: 1;
    transform: translateX(-50%) translateY(10px) scale(1.12) rotate(2deg);
    filter: blur(0);
  }
  72% {
    transform: translateX(-50%) translateY(-6px) scale(0.96) rotate(0);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1) rotate(0);
    filter: blur(0);
  }
}

@keyframes result-lose-enter {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(1.35);
  }
  12% {
    opacity: 1;
    transform: translateX(calc(-50% - 12px)) scale(1.06);
  }
  24% {
    transform: translateX(calc(-50% + 10px)) scale(1);
  }
  36% {
    transform: translateX(calc(-50% - 8px)) scale(0.99);
  }
  48% {
    transform: translateX(calc(-50% + 6px)) scale(1);
  }
  62% {
    transform: translateX(calc(-50% - 3px)) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

@keyframes result-draw-enter {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.82);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

@keyframes result-glow-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  40% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
  }
  100% {
    opacity: 0.72;
    transform: translate(-50%, -50%) scale(1);
  }
}

.result-overlay__score {
  position: absolute;
  left: 50%;
  top: calc(720 / 1334 * 100%);
  transform: translateX(-50%);
  font-size: 22px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.result-overlay.is-visible .result-overlay__score {
  animation: result-meta-in 0.45s ease 0.5s forwards;
}

.result-overlay.is-scene {
  background: transparent;
  pointer-events: none;
}

.result-overlay.is-scene.is-visible {
  pointer-events: auto;
}

.result-badge.is-phase-hidden,
.result-overlay__score.is-phase-hidden {
  display: none;
}

/* ── 锦囊结果页：渔夫 + 对话框 + 抽一抽 ── */
.result-scene {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  min-height: 0;
  padding-top: calc(290 / 1334 * var(--app-h, 100vh));
  padding-bottom: calc(
    168 / 1334 * var(--app-h, 100vh) + env(safe-area-inset-bottom, 0px)
  );
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
}

.result-scene.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.result-scene__fishman-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: calc(583 / 750 * 100%);
  max-width: 583px;
  max-height: calc(
    (736 / 1334) * var(--app-h, 100vh) - env(safe-area-inset-bottom, 0px)
  );
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.result-scene__fishman {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  height: auto;
  object-fit: contain;
  transform: scale(0.12);
  opacity: 0;
  transform-origin: center bottom;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.28));
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.result-scene__fishman.is-animate {
  animation:
    result-fishman-enter 1s cubic-bezier(0.2, 1.08, 0.34, 1) forwards,
    result-fishman-float 2.8s ease-in-out 1s infinite;
}

.result-scene__pop {
  position: absolute;
  right: calc(-28 / 583 * 100%);
  top: calc(-133 / 761 * 100%);
  width: calc(344 / 583 * 100%);
  max-width: 344px;
  height: auto;
  opacity: 0;
  transform: scale(0.88) translate(6px, -6px);
  transform-origin: left bottom;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.result-scene__pop.is-visible {
  animation:
    result-pop-enter 0.52s ease forwards,
    result-pop-pulse 2.2s ease-in-out 0.52s infinite;
}

.result-scene__btn {
  position: absolute;
  left: 50%;
  bottom: calc(
    126 / 1334 * var(--app-h, 100vh) + env(safe-area-inset-bottom, 0px)
  );
  flex-shrink: 0;
  width: calc(388 / 750 * 100%);
  max-width: 388px;
  margin-top: 0;
  padding: 0;
  border: none;
  background: transparent;
  transform: translateX(-50%) translateY(10px);
  opacity: 0;
  cursor: pointer;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 2;
}

.result-scene__btn.is-visible {
  pointer-events: auto;
  animation:
    result-jn-btn-enter 0.48s ease 0.12s forwards,
    result-jn-btn-pulse 2.4s ease-in-out 0.6s infinite;
}

.result-scene__btn img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.result-scene__btn:active {
  transform: translateX(-50%) scale(0.97);
}

@keyframes result-fishman-enter {
  0% {
    opacity: 0;
    transform: scale(0.12);
  }
  55% {
    opacity: 1;
    transform: scale(1.06);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes result-pop-enter {
  from {
    opacity: 0;
    transform: scale(0.88) translate(10px, -8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translate(0, 0);
  }
}

@keyframes result-jn-btn-enter {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(18px) scale(1);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes result-fishman-float {
  0%,
  100% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1) translateY(-12px);
  }
}

@keyframes result-pop-pulse {
  0%,
  100% {
    transform: scale(1) translate(0, 0);
  }
  50% {
    transform: scale(1.06) translate(0, 0);
  }
}

@keyframes result-jn-btn-pulse {
  0%,
  100% {
    transform: translateX(-50%) translateY(0) scale(1);
  }
  50% {
    transform: translateX(-50%) translateY(0) scale(1.06);
  }
}

/* P4 结算场景：强制显示结算层与场景背景（覆盖 P5 残留的 is-instant-hide / is-p5-page） */
.app.is-result-scene .result-overlay.is-visible,
.app.is-ended:not(.is-p5-page) .result-overlay.is-visible {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.app.is-result-scene .layer-bg,
.app.is-result-scene .layer-stage,
.app.is-result-scene.is-scene-bg .layer-bg,
.app.is-result-scene.is-scene-bg .layer-stage {
  visibility: visible !important;
}

.app.is-result-scene .result-scene.is-visible {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* P3-2 / P4 场景背景：仅 bg-main + 水面，隐藏对局 HUD */
.app.is-scene-bg .layer-hud-top,
.app.is-scene-bg .layer-hud-bottom,
.app.is-scene-bg .charge-group,
.app.is-scene-bg .splash-fx {
  visibility: hidden;
  pointer-events: none;
}

.app.is-scene-bg .layer-bg,
.app.is-scene-bg .bg-main,
.app.is-scene-bg .bg-bottom-tile {
  visibility: visible;
  pointer-events: none;
}

.app.is-scene-bg .layer-stage {
  visibility: visible;
  pointer-events: none;
  z-index: 1;
}

/* P3-2 / P4 场景：祥云置于页面内容之上，并高于 Canvas 水面 */
.app.is-scene-bg .cloud {
  z-index: 96;
}

/* Canvas 全屏会挡住天空：场景态只露出 y≥380 水面段 */
.app.is-scene-bg .game-canvas.is-ready {
  visibility: visible;
  pointer-events: none;
  clip-path: inset(calc(380 / 1334 * 100%) 0 0 0);
  -webkit-clip-path: inset(calc(380 / 1334 * 100%) 0 0 0);
}

.app.is-scene-bg .btn-charge {
  pointer-events: none;
  opacity: 0;
}

/* 对局态：完整 Canvas，不裁剪 */
.app:not(.is-scene-bg) .game-canvas.is-ready {
  clip-path: none;
  -webkit-clip-path: none;
}

/* 对局态：强制恢复游戏层（覆盖 is-intro-flow / is-scene-bg 残留） */
.app.is-gameplay .layer-bg,
.app.is-gameplay .bg-main,
.app.is-gameplay .bg-bottom-tile,
.app.is-gameplay .layer-stage,
.app.is-gameplay .layer-hud-top,
.app.is-gameplay .layer-hud-bottom,
.app.is-gameplay .charge-group,
.app.is-gameplay .splash-fx {
  visibility: visible !important;
  opacity: 1 !important;
}

.app.is-gameplay .game-canvas.is-ready,
.app.is-gameplay .game-canvas.is-suppressed {
  visibility: visible !important;
  opacity: 1 !important;
  clip-path: none !important;
  -webkit-clip-path: none !important;
}

/* 对局态：加载中也要露出 canvas（避免 is-suppressed 被提前移除后整层不可见） */
.app.is-gameplay .game-canvas {
  visibility: visible !important;
  opacity: 1 !important;
  clip-path: none !important;
  -webkit-clip-path: none !important;
}

.app.is-gameplay .btn-charge {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* P0 加载页 */
.app.is-p0-page .layer-hud-top,
.app.is-p0-page .layer-hud-bottom,
.app.is-p0-page .charge-group,
.app.is-p0-page .layer-stage,
.app.is-p0-page .layer-bg,
.app.is-p0-page .splash-fx {
  visibility: hidden;
  pointer-events: none;
}

.app.is-p0-page .btn-charge {
  pointer-events: none;
  opacity: 0;
}

/* P0～P3 引导流：仅屏蔽结算层，避免闪 P4；各 P 页自身规则负责隐藏游戏层 */
.app.is-intro-flow .result-overlay,
.app.is-intro-flow .result-scene {
  visibility: hidden;
  pointer-events: none;
}

.app.is-intro-flow:not(.is-scene-bg):not(.is-gameplay) .layer-stage,
.app.is-intro-flow:not(.is-scene-bg):not(.is-gameplay) .layer-bg {
  visibility: hidden;
  pointer-events: none;
  display: none;
}

.app.is-intro-flow:not(.is-gameplay) .layer-hud-top,
.app.is-intro-flow:not(.is-gameplay) .layer-hud-bottom,
.app.is-intro-flow:not(.is-gameplay) .charge-group,
.app.is-intro-flow:not(.is-gameplay) .splash-fx,
.app.is-intro-flow:not(.is-gameplay) .btn-charge {
  visibility: hidden;
  pointer-events: none;
}

.app.is-intro-flow:not(.is-gameplay) .btn-charge {
  opacity: 0;
}

/* 引导流切换垫层：页面半透明过渡时不露出 body 蓝底（P3-2 场景背景时不启用） */
.app.is-intro-flow:not(.is-gameplay):not(.is-scene-bg)::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 91;
  background: #f3ead8;
  pointer-events: none;
}

.p0-page,
.p1-page,
.p2-page,
.p3-page {
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  will-change: opacity;
}

.p0-page.is-visible,
.p0-page.is-leaving {
  display: flex;
}

.p1-page.is-visible,
.p1-page.is-leaving,
.p2-page.is-visible,
.p2-page.is-leaving,
.p3-page.is-visible,
.p3-page.is-leaving {
  display: block;
}

.p3-page--gift.is-visible,
.p3-page--gift.is-leaving {
  display: flex;
}

.p0-page.is-visible,
.p1-page.is-visible,
.p2-page.is-visible,
.p3-page.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.p0-page.is-leaving,
.p1-page.is-leaving,
.p2-page.is-leaving,
.p3-page.is-leaving {
  opacity: 0;
  pointer-events: none;
}

/* 全局 BGM 开关 */
.bgm-toggle {
  position: absolute;
  left: 5%;
  top: 5%;
  z-index: 99;
  width: 56px;
  height: 56px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease;
}

.bgm-toggle.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.bgm-toggle__icon {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.bgm-toggle__icon--on {
  transform-origin: center center;
}

.bgm-toggle.is-playing .bgm-toggle__icon--on {
  animation: bgm-icon-spin 2.4s linear infinite;
}

@keyframes bgm-icon-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.bgm-toggle__icon[hidden] {
  display: none;
}

.bgm-toggle:active {
  opacity: 0.82;
}

html.is-ios .bgm-toggle:active {
  transform: none;
}

.bgm-audio {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.p2-page__scroll-tips {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 98;
  width: auto;
  height: auto;
  max-width: 90%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none !important;
}

.app:not(.is-p2-page) .p2-page__scroll-tips {
  display: none;
}

.p2-page__scroll-tips.is-visible {
  visibility: visible;
  animation: scroll-tips-float 1.8s ease-in-out infinite;
}

@keyframes scroll-tips-float {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
    opacity: 0.5;
  }
  50% {
    transform: translateX(-50%) translateY(-14px);
    opacity: 1;
  }
}

.p0-page.is-ready .p0-page__text {
  animation: anim-text-invite 1.6s ease-in-out infinite;
}

/* ── 标题 / 按钮动效 ── */
.anim-title-float {
  animation: anim-title-float 2.8s ease-in-out infinite;
}

.anim-title-drop {
  animation: anim-title-drop 1s cubic-bezier(0.34, 1.35, 0.64, 1) both;
}

.anim-btn-glow {
  animation: anim-btn-glow 2.4s ease-in-out infinite;
}

.anim-btn-float {
  animation: anim-btn-float 2.6s ease-in-out infinite;
}

.anim-btn-swing {
  animation: anim-btn-swing 2.8s ease-in-out infinite;
}

.anim-btn-heartbeat {
  animation: anim-btn-heartbeat 2.2s ease-in-out infinite;
}

.anim-title-soft {
  animation: anim-title-soft 3.2s ease-in-out infinite;
}

.anim-title-rise {
  animation: anim-title-rise 3s ease-in-out infinite;
}

@keyframes anim-title-float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.02);
  }
}

@keyframes anim-title-drop {
  0% {
    opacity: 0;
    transform: translateY(-36px) scale(0.82);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes anim-btn-glow {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
    filter: drop-shadow(0 0 0 rgba(255, 220, 120, 0));
  }
  50% {
    transform: translateX(-50%) scale(1.07);
    filter: drop-shadow(0 0 10px rgba(255, 220, 120, 0.55));
  }
}

@keyframes anim-btn-float {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-8px);
  }
}

@keyframes anim-btn-swing {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-3deg) scale(1.04);
  }
  75% {
    transform: rotate(3deg) scale(1.04);
  }
}

@keyframes anim-btn-heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.08);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(1);
  }
}

@keyframes anim-text-invite {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.06);
    opacity: 0.88;
  }
}

@keyframes anim-title-soft {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.025);
  }
}

@keyframes anim-title-rise {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.p0-page {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 92;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  background: #f3ead8 url('../images/p5_bg.jpg') center top / 100% auto
    no-repeat;
  cursor: default;
  min-height: 100%;
}

.p0-page__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 750px;
  position: relative;
  top: auto;
  margin-top: 0;
  transform: translateY(-4%);
}

.p0-page:not(.is-visible):not(.is-leaving),
.p0-page.is-retired {
  display: none;
  pointer-events: none !important;
}

.p0-page.is-retired {
  visibility: hidden !important;
  opacity: 0 !important;
  z-index: -1 !important;
}

.p0-page.is-ready {
  cursor: pointer;
}

.p0-page__tap {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: none;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.p0-page.is-ready .p0-page__tap.is-active {
  display: block;
}

.p0-page__title {
  display: block;
  width: 295px;
  height: 206px;
  object-fit: contain;
  pointer-events: none;
}

.p0-page__hill {
  display: block;
  width: calc(620 / 750 * 100%);
  max-width: 620px;
  height: auto;
  margin-top: calc(24 / 1334 * 100vh);
  pointer-events: none;
}

.p0-page__bar-wrap {
  position: relative;
  width: calc(620 / 750 * 100%);
  max-width: 620px;
  margin-top: calc(12 / 1334 * 100vh);
}

.p0-page__bar-frame {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.p0-page__bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.p0-page__bar {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
  pointer-events: none;
}

.p0-page__text {
  margin: calc(20 / 1334 * 100vh) 0 0;
  color: #5c8875;
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

/* P1 封面首页 */
.app.is-p1-page .layer-hud-top,
.app.is-p1-page .layer-hud-bottom,
.app.is-p1-page .charge-group,
.app.is-p1-page .layer-stage,
.app.is-p1-page .layer-bg,
.app.is-p1-page .splash-fx {
  visibility: hidden;
  pointer-events: none;
}

.app.is-p1-page .btn-charge {
  pointer-events: none;
  opacity: 0;
}

.p1-page {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 93;
  background: #f5eed8 url('../images/p1_bg.jpg') center top / 100% auto
    no-repeat;
}

.p1-page:not(.is-visible):not(.is-leaving) {
  display: none;
}

.p1-page__head {
  position: absolute;
  left: 50%;
  top: 69px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  max-width: calc(100% - 40px);
}

.p1-page__title {
  position: static;
  margin-left: 0;
  width: auto;
  height: auto;
  max-width: 100%;
  pointer-events: none;
}

.p1-page__logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  margin-top: 26px;
  pointer-events: none;
}

.p1-page__btn {
  position: absolute;
  left: 50%;
  bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.p1-page__btn img {
  display: block;
  width: auto;
  height: auto;
  pointer-events: none;
}

.p1-page__btn:active {
  transform: translateX(-50%) scale(0.97);
}

/* P2 首页长图 */
.app.is-p2-page .layer-hud-top,
.app.is-p2-page .layer-hud-bottom,
.app.is-p2-page .charge-group,
.app.is-p2-page .layer-stage,
.app.is-p2-page .layer-bg,
.app.is-p2-page .splash-fx {
  visibility: hidden;
  pointer-events: none;
}

.app.is-p2-page .btn-charge {
  pointer-events: none;
  opacity: 0;
}

.p2-page {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 94;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.p2-page:not(.is-visible):not(.is-leaving) {
  display: none;
}

.p2-page__wrap {
  position: relative;
  width: 100%;
}

.p2-page__bg {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.p2-page__btn {
  position: absolute;
  left: 50%;
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  transform: translateX(-50%);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.p2-page__btn img {
  display: block;
  width: auto;
  height: auto;
  pointer-events: none;
}

.p2-page__btn:active {
  transform: translateX(-50%) scale(0.97);
}

/* P3-1 历史介绍：独立背景 p3_bg.jpg */
.app.is-p3-history-page .layer-hud-top,
.app.is-p3-history-page .layer-hud-bottom,
.app.is-p3-history-page .charge-group,
.app.is-p3-history-page .layer-stage,
.app.is-p3-history-page .layer-bg,
.app.is-p3-history-page .splash-fx {
  visibility: hidden;
  pointer-events: none;
}

.app.is-p3-history-page .btn-charge {
  pointer-events: none;
  opacity: 0;
}

.p3-page {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 95;
}

.p3-page:not(.is-visible):not(.is-leaving) {
  display: none;
}

.p3-page--history {
  background: #a8d4f0 url('../images/p3_bg.jpg') center top / 100% auto
    no-repeat;
}

.p3-page__history {
  position: absolute;
  left: 67px;
  top: 80px;
  width: auto;
  height: auto;
  max-width: calc(100% - 67px);
  pointer-events: none;
}

.p3-page__go-intro {
  position: absolute;
  left: 202px;
  top: 800px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.p3-page__go-intro img {
  display: block;
  width: auto;
  height: auto;
  pointer-events: none;
}

.p3-page__go-intro:active {
  transform: scale(0.97);
}

.p3-page--gift {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: calc(200 / 1334 * 100%) 0 calc(48 / 1334 * 100%);
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: none;
  pointer-events: auto;
}

.p3-page__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 750px;
  gap: calc(28 / 1334 * 100vh);
}

.p3-page__intro,
.p3-page__exchange {
  display: block;
  width: calc(694 / 750 * 100%);
  max-width: 694px;
  height: auto;
  pointer-events: none;
}

.p3-page__btn {
  margin-top: calc(8 / 1334 * 100vh);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.p3-page__btn img {
  display: block;
  width: 388px;
  height: 90px;
  object-fit: contain;
  pointer-events: none;
}

.p3-page__btn:active {
  transform: scale(0.97);
}

/* ── P5 分享页 ── */
.p5-page {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: calc(96 / 1334 * var(--app-h, 100vh));
  box-sizing: border-box;
  background: #f3ead8 url('../images/p5_bg.jpg') center top / 100% auto
    no-repeat;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease;
}

.p5-page.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.p5-page.is-visible.is-immediate {
  transition: none;
}

.p5-page.is-visible.is-immediate .p5-layer--frame.is-visible {
  animation: none;
  opacity: 1;
}

/* 对局 / 分享 / 结算态：强制隐藏引导页，避免 iOS 误触穿透到 P0 */
.app.is-p5-page .p0-page,
.app.is-p5-page .p1-page,
.app.is-p5-page .p2-page,
.app.is-p5-page .p3-page,
.app.is-gameplay .p0-page,
.app.is-gameplay .p1-page,
.app.is-gameplay .p2-page,
.app.is-gameplay .p3-page,
.app.is-ended .p0-page,
.app.is-ended .p1-page,
.app.is-ended .p2-page,
.app.is-ended .p3-page {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.app.is-p5-page::before,
.app.is-gameplay::before,
.app.is-ended::before {
  display: none !important;
}

.p5-page__composition {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  max-width: 750px;
  height: 0;
  padding-bottom: 113.333333%;
  overflow: visible;
}

@supports (aspect-ratio: 1 / 1) {
  .p5-page__composition {
    height: auto;
    padding-bottom: 0;
    aspect-ratio: 750 / 850;
  }
}

.p5-layer {
  position: absolute;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.p5-layer--e1 {
  left: calc(39 / 750 * 100%);
  top: calc(98 / 850 * 100%);
  width: calc(436 / 750 * 100%);
  z-index: 1;
  opacity: 0;
}

.p5-layer--e2 {
  right: calc(24 / 750 * 100%);
  top: calc(22 / 850 * 100%);
  width: calc(328 / 750 * 100%);
  z-index: 2;
  opacity: 0;
}

.p5-layer--jn {
  left: 50%;
  top: calc(109 / 850 * 100%);
  transform: translateX(-50%);
  width: calc(700 / 750 * 100%);
  max-width: none;
  height: auto;
  z-index: 3;
  opacity: 1;
}

.p5-layer--e3 {
  left: calc(86 / 750 * 100%);
  top: calc(378 / 850 * 100%);
  width: calc(386 / 750 * 100%);
  z-index: 4;
  opacity: 0;
}

.p5-layer--frame {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 5;
  opacity: 0;
}

.p5-layer--slogan {
  left: 50%;
  top: calc(374 / 850 * 100%);
  width: 412px;
  height: 75px;
  object-fit: contain;
  transform: translateX(-50%);
  z-index: 6;
  opacity: 0;
}

.p5-layer--e1.is-visible,
.p5-layer--e2.is-visible,
.p5-layer--e3.is-visible,
.p5-layer--frame.is-visible {
  animation: p5-layer-in 0.58s ease forwards;
}

.p5-layer--slogan.is-visible {
  animation: p5-slogan-in 0.62s ease forwards;
}

/* P5 右下角抽奖 zz + 九宫格对话框 p5_pop */
.p5-zz {
  position: absolute;
  right: calc(20 / 750 * 100%);
  bottom: calc(18 / 850 * 100%);
  z-index: 8;
  width: calc(148 / 750 * 100%);
  max-width: 148px;
  pointer-events: none;
  opacity: 0;
}

.p5-zz[aria-hidden='true'] {
  visibility: hidden;
  pointer-events: none;
}

.p5-zz.is-visible {
  animation: p5-layer-in 0.58s ease forwards;
}

.p5-zz__btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.p5-zz__img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.p5-zz__img--active {
  display: none;
}

.p5-zz.is-drawn .p5-zz__img--idle {
  display: none;
}

.p5-zz.is-drawn .p5-zz__img--active {
  display: block;
}

.p5-zz__btn:active {
  transform: scale(0.96);
}

.p5-pop {
  position: absolute;
  right: calc(100% - 62px);
  bottom: calc(100% - 8px);
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  width: auto;
  min-width: 168px;
  max-width: calc(280 / 750 * 100%);
  pointer-events: none;
}

.p5-pop__head {
  flex-shrink: 0;
  width: 100%;
  height: 36px;
  background: url('../images/p5_pop_f1.png') no-repeat center top / 100% 100%;
}

.p5-pop__body {
  width: 100%;
  min-height: 36px;
  padding: 4px 18px;
  background: url('../images/p5_pop_f2.png') repeat-y center top / 100% auto;
  box-sizing: border-box;
}

.p5-pop__foot {
  flex-shrink: 0;
  width: 100%;
  height: 28px;
  background: url('../images/p5_pop_f3.png') no-repeat center bottom / 100% 100%;
}

.p5-pop__text {
  margin: 0;
  color: #5c2f12;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  white-space: pre-line;
  word-break: break-all;
}

.p5-pop--size-1 {
  min-width: 168px;
  max-width: 220px;
}

.p5-pop--size-2 {
  min-width: 168px;
  max-width: 220px;
}

.p5-pop--size-3 {
  min-width: 220px;
  max-width: 280px;
}

.p5-pop--size-3 .p5-pop__text {
  font-size: 20px;
  line-height: 1.4;
}

.p5-pop--has-copy {
  pointer-events: auto;
}

.p5-pop__copy {
  display: none;
  width: calc(100% - 8px);
  margin: 10px auto 0;
  padding: 8px 12px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #e84b57 0%, #c41e3a 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.p5-pop__copy.is-visible {
  display: block;
}

.p5-pop__copy.is-copied {
  background: linear-gradient(180deg, #6abf7b 0%, #3d9a52 100%);
}

.p5-pop__copy:active {
  transform: scale(0.97);
}

/* P5 抽奖表单弹窗 */
.p5-lottery-modal {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease;
}

.p5-lottery-modal.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.p5-lottery-form {
  width: calc(560 / 750 * 100%);
  max-width: 560px;
  padding: 36px 32px 32px;
  border-radius: 16px;
  background: rgba(255, 252, 245, 0.96);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  box-sizing: border-box;
}

.p5-lottery-form__title {
  margin: 0 0 24px;
  font-size: 28px;
  font-weight: 700;
  color: #5c2f12;
  text-align: left;
}

.p5-lottery-form__field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 20px;
}

.p5-lottery-form__label {
  margin-bottom: 8px;
  font-size: 24px;
  font-weight: 600;
  color: #5c2f12;
  text-align: left;
}

.p5-lottery-form__input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(92, 47, 18, 0.22);
  border-radius: 8px;
  background: #fff;
  color: #333;
  font-size: 22px;
  box-sizing: border-box;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}

.p5-lottery-form__input:focus {
  border-color: rgba(196, 30, 58, 0.55);
}

.p5-lottery-form__submit {
  display: block;
  width: calc(220 / 560 * 100%);
  min-width: 160px;
  height: 56px;
  margin: 12px auto 0;
  border: none;
  border-radius: 28px;
  background: linear-gradient(180deg, #e84b57 0%, #c41e3a 100%);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.p5-lottery-form__submit:active {
  transform: scale(0.97);
}

.p5-lottery-verify__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.p5-lottery-verify__title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #5c2f12;
}

.p5-lottery-verify__back {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: rgba(92, 47, 18, 0.08);
  color: #5c2f12;
  font-size: 20px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.p5-lottery-verify__tip {
  margin: 0 0 16px;
  font-size: 20px;
  line-height: 1.5;
  color: rgba(92, 47, 18, 0.72);
  text-align: center;
}

.p5-lottery-verify__box {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 180px;
}

/* 滑块验证：覆盖 SDK 内联尺寸，reload 后仍生效 */
.p5-lottery-verify__box .DragVerification,
.p5-lottery-verify__box #DragVerification {
  width: 500px !important;
  height: 348px !important;
  box-sizing: content-box !important;
}

.p5-page__actions {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  max-width: 750px;
  margin-top: calc(24 / 1334 * var(--app-h, 100vh));
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
}

.p5-page__btn + .p5-page__btn {
  margin-left: 22px;
}

.p5-page__actions.is-visible {
  pointer-events: auto;
  animation: p5-actions-in 0.5s ease forwards;
}

.p5-page__btn {
  width: calc(285 / 750 * 100%);
  max-width: 285px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.p5-page__btn img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.p5-page__btn:active {
  transform: scale(0.97);
}

@keyframes p5-layer-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.p5-layer--e2.is-visible {
  animation-name: p5-layer-in-right;
}

@keyframes p5-layer-in-right {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.p5-layer--frame.is-visible {
  animation: p5-frame-in 0.65s ease forwards;
}

@keyframes p5-frame-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes p5-slogan-in {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

@keyframes p5-actions-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app.is-p5-page .layer-hud-top,
.app.is-p5-page .layer-hud-bottom,
.app.is-p5-page .charge-group,
.app.is-p5-page .layer-stage,
.app.is-p5-page .layer-bg,
.app.is-p5-page .result-overlay,
.app.is-p5-page .splash-fx {
  visibility: hidden;
  pointer-events: none;
}

/* ── 分享海报层 ── */
.share-poster-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.82);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease;
}

.share-poster-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.share-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: calc(620 / 750 * 100%);
  max-width: 620px;
  pointer-events: auto;
}

.share-box__poster {
  width: 100%;
}

.share-box__tips {
  position: absolute;
  top: calc(24px + env(safe-area-inset-top, 0px));
  right: calc(24px + env(safe-area-inset-right, 0px));
  margin-top: 0;
  width: auto;
  height: auto;
  flex-shrink: 0;
  z-index: 2;
  pointer-events: none !important;
  -webkit-touch-callout: none !important;
  touch-action: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.share-box__tips2 {
  margin-top: 50px;
  width: auto;
  height: auto;
  flex-shrink: 0;
  pointer-events: none !important;
  -webkit-touch-callout: none !important;
  touch-action: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.share-poster {
  width: 100%;
  pointer-events: auto;
  -webkit-touch-callout: default;
}

.share-poster__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  -webkit-touch-callout: default;
  user-select: auto;
  -webkit-user-select: auto;
}

@keyframes result-meta-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.app.is-ended .btn-charge {
  pointer-events: none;
  opacity: 0.55;
}

/* ── 首次进入指引 ── */
.guide-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 110;
  background: rgba(0, 0, 0, 0.52);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.guide-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.guide-overlay__tap {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}

.guide-overlay__img {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  height: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 0.15s ease;
}

.guide-overlay__img.is-loaded {
  opacity: 1;
  visibility: visible;
}

/* 对抗条下方居中（设计稿 y≈340，460×356） */
.guide-overlay--step1 .guide-overlay__img {
  top: calc(340 / 1334 * 100%);
  width: calc(460 / 750 * 100%);
  max-width: 460px;
}

/* 蓄力按钮下方居中（设计稿 y≈915，400×270） */
.guide-overlay--step2 .guide-overlay__img {
  top: calc(915 / 1334 * 100%);
  width: calc(400 / 750 * 100%);
  max-width: 400px;
}

.guide-overlay__text {
  display: none;
}

.guide-overlay__hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(48 / 1334 * 100%);
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.08em;
  pointer-events: none;
  animation: guide-hint-pulse 1.6s ease-in-out infinite;
}

@keyframes guide-hint-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.app.is-guide .btn-charge,
.app.is-guide .charge-bar {
  pointer-events: none;
}

.app.is-guide .layer-hud-top,
.app.is-guide .layer-stage,
.app.is-guide .layer-hud-bottom,
.app.is-guide .charge-group {
  pointer-events: none;
}

/* ── 开场倒计时 3-2-1 ── */
.opening-countdown {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 115;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.15s ease,
    visibility 0.15s ease;
}

.opening-countdown.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
}

html.is-wechat .opening-countdown,
html.is-wechat .opening-countdown.is-visible,
html.is-ios .opening-countdown,
html.is-ios .opening-countdown.is-visible {
  transition: none;
}

html.is-wechat .opening-countdown:not(.is-visible),
html.is-ios .opening-countdown:not(.is-visible) {
  display: none;
}

.opening-countdown__img {
  width: calc(280 / 750 * 100%);
  max-width: 280px;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transform: scale(0.6);
  opacity: 0;
}

.opening-countdown__img.is-pop {
  animation: opening-countdown-pop 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.opening-countdown__bgm {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

@keyframes opening-countdown-pop {
  0% {
    transform: scale(1.55);
    opacity: 0;
  }
  35% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.app.is-gameplay:not(.is-countdown):not(.is-guide) .layer-hud-top,
.app.is-gameplay:not(.is-countdown):not(.is-guide) .layer-hud-bottom,
.app.is-gameplay:not(.is-countdown):not(.is-guide) .charge-group,
.app.is-gameplay:not(.is-countdown):not(.is-guide) .btn-charge {
  pointer-events: auto !important;
}

.app.is-countdown .btn-charge,
.app.is-countdown .charge-bar,
.app.is-countdown .layer-hud-top,
.app.is-countdown .layer-stage,
.app.is-countdown .layer-hud-bottom,
.app.is-countdown .charge-group {
  pointer-events: none;
}

.app.is-ended .charge-group {
  pointer-events: none;
}

/* iOS 无震动时的视觉反馈（替代 haptic） */
.app.is-haptic-light {
  animation: app-haptic-light 0.14s ease;
}

.app.is-haptic-heavy {
  animation: app-haptic-heavy 0.22s ease;
}

@keyframes app-haptic-light {
  50% {
    filter: brightness(1.03);
  }
}

@keyframes app-haptic-heavy {
  25% {
    filter: brightness(1.05);
  }
  50% {
    filter: brightness(0.98);
  }
  75% {
    filter: brightness(1.04);
  }
}

/* ── 游戏场景 ── */
.layer-stage {
  top: 0;
  height: 100%;
  z-index: 1;
}

.cloud {
  position: absolute;
  height: auto;
  opacity: 0.95;
  pointer-events: none;
  z-index: 2;
}

.cloud--left {
  left: 25px;
  top: 226px;
  width: 261px;
  animation: cloud-drift-left 8s ease-in-out infinite alternate;
}

.cloud--right {
  left: 302px;
  top: 138px;
  width: 448px;
  animation: cloud-drift-right 10s ease-in-out infinite alternate;
}

@keyframes cloud-drift-left {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(18px);
  }
}

@keyframes cloud-drift-right {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-22px);
  }
}

.game-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  pointer-events: none;
  opacity: 1;
  visibility: hidden;
}

.app.is-intro-flow:not(.is-scene-bg):not(.is-gameplay) .game-canvas {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.game-canvas.is-ready {
  visibility: visible;
}

.game-canvas.is-suppressed {
  visibility: hidden !important;
  opacity: 0 !important;
}

.app.is-p5-page .layer-stage,
.app.is-p5-page .game-canvas {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none;
}

/* ── 底部 HUD ── */
.layer-hud-bottom {
  top: 0;
  bottom: 0;
  z-index: 20;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.crowd {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: auto;
}

.pop {
  position: absolute;
  height: auto;
  opacity: 0.92;
  pointer-events: none;
}

.pop--1 {
  left: 76px;
  bottom: 170px;
  width: 162px;
}

.pop--2 {
  left: 216px;
  bottom: 245px;
  width: 136px;
}

.pop--3 {
  left: 429px;
  bottom: 159px;
  width: 295px;
}

/* 蓄力操作组：设计稿 top=766px（1334 高），相对 .app 顶边 */
.charge-group {
  position: absolute;
  left: 0;
  top: calc(766 / 1334 * 100%);
  width: 100%;
  z-index: 21;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

/* 蓄力条 477×17 */
.charge-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 540px;
  justify-content: center;
}

.charge-bar__icon {
  flex-shrink: 0;
  height: 31px;
  width: auto;
}

.charge-bar__icon--min {
  width: 23px;
  height: 31px;
}

.charge-bar__icon--max {
  width: 45px;
  height: 31px;
}

.charge-bar__track {
  flex: 0 0 477px;
  width: 477px;
  height: 17px;
  background: #ffffff;
  border-radius: 2px;
  position: relative;
  overflow: visible;
}

.charge-bar__line-wrap {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
}

.charge-bar__line {
  display: block;
  width: 477px;
  height: 17px;
}

/* 遮罩从右侧收缩 width = 进度从左向右露出刻度线；优于 background-size，便于二期分段精灵图 */
.charge-bar__progress-cover {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  background: #ffffff;
  border-radius: 0 2px 2px 0;
  z-index: 1;
  pointer-events: none;
  transition: width 0.08s linear;
}

.charge-bar.is-charging .charge-bar__track {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.charge-bar.is-locked .charge-bar__track {
  box-shadow: 0 0 0 2px rgba(196, 30, 58, 0.45);
}

/* 当前档位箭头：随蓄力移动，默认隐藏 */
.charge-bar__arrow {
  position: absolute;
  top: 50%;
  left: 0;
  width: 16px;
  height: 55px;
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    left 0.12s ease,
    opacity 0.1s ease,
    visibility 0.1s ease;
}

.charge-bar__arrow.is-visible {
  opacity: 1;
  visibility: visible;
  transition:
    left 0.06s linear,
    opacity 0.1s ease,
    visibility 0.1s ease;
}

.charge-bar__arrow.is-snapped {
  transition: none;
}

.charge-bar__arrow img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 3px rgba(196, 30, 58, 0.45));
}

.charge-value {
  position: absolute;
  left: 50%;
  top: -28px;
  transform: translateX(-50%);
  min-width: 48px;
  padding: 2px 10px;
  font-size: 22px;
  font-weight: 800;
  color: #c41e3a;
  text-align: center;
  line-height: 1.2;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.charge-value.is-visible {
  opacity: 1;
}

.btn-charge {
  position: relative;
  width: 388px;
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
  transition: transform 0.12s ease;
  -webkit-user-select: none;
  user-select: none;
}

.btn-charge.is-pressed {
  transform: scale(0.96);
}

.btn-charge img {
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
  transition: filter 0.12s ease;
}

.btn-charge.is-pressed img {
  filter: brightness(1.08);
}

/* 泼水特效（松手时在对手船附近弹出 pop 图） */
.splash-fx {
  position: absolute;
  z-index: 12;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6);
  transition:
    opacity 0.08s ease,
    transform 0.25s ease;
}

.splash-fx.is-active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.splash-fx img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 80, 160, 0.35));
}

.splash-fx--tier1 {
  width: 162px;
}

.splash-fx--tier2 {
  width: 180px;
}

.splash-fx--tier3 {
  width: 260px;
}

/* ── 二期触摸区 ── */
.touch-zone {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 25;
  pointer-events: none;
}

/* ── 窄屏缩放：保持 750 设计比例 ── */
@media (max-width: 750px) {
  .app {
    font-size: calc(100vw / 750 * 16px);
  }

  .bg-main {
    background-size: 100vw auto;
  }

  .bg-bottom-tile {
    top: calc(100vw * 1334 / 750);
    background-size: 100vw 1px;
  }

  .cloud--left {
    left: calc(25 / 750 * 100vw);
    top: calc(226 / 750 * 100vw);
    width: calc(261 / 750 * 100vw);
  }

  .cloud--right {
    left: calc(302 / 750 * 100vw);
    top: calc(138 / 750 * 100vw);
    width: calc(448 / 750 * 100vw);
  }

  .tug-bar__track {
    flex: 1 1 auto;
    width: auto;
    max-width: 464px;
  }

  .tug-bar__icon {
    width: calc(135 / 750 * 100vw);
    height: calc(51 / 750 * 100vw);
  }

  .tug-float {
    font-size: calc(28 / 750 * 100vw);
    top: calc(-36 / 750 * 100vw);
  }

  .timer {
    width: calc(107 / 750 * 100vw);
  }

  .timer__value {
    padding: calc(46 / 750 * 100vw) calc(26 / 750 * 100vw) 0;
    font-size: calc(36 / 750 * 100vw);
  }

  .result-overlay__score {
    font-size: calc(22 / 750 * 100vw);
    top: calc(720 / 1334 * 100%);
  }

  .result-badge {
    top: calc(360 / 1334 * 100%);
    width: calc(683 / 750 * 100vw);
  }

  .result-badge--lose {
    width: calc(714 / 750 * 100vw);
  }

  .p5-page__composition {
    width: 100%;
    height: 0;
    padding-bottom: 113.333333%;
  }

  .p5-page__actions {
    margin-top: calc(24 / 1334 * var(--app-h, 100vh));
  }

  .p5-page__btn + .p5-page__btn {
    margin-left: calc(22 / 750 * 100vw);
  }

  .p5-page__btn {
    width: calc(285 / 750 * 100vw);
  }

  .p5-pop {
    max-width: calc(280 / 750 * 100vw);
  }

  .p5-lottery-form {
    width: calc(560 / 750 * 100vw);
  }

  .result-scene {
    padding-top: calc(300 / 1334 * var(--app-h, 100vh));
    padding-bottom: calc(
      168 / 1334 * var(--app-h, 100vh) + env(safe-area-inset-bottom, 0px)
    );
  }

  .result-scene__fishman-wrap {
    width: calc(583 / 750 * 100vw);
    max-height: calc(
      (736 / 1334) * var(--app-h, 100vh) - env(safe-area-inset-bottom, 0px)
    );
  }

  .result-scene__btn {
    width: calc(388 / 750 * 100vw);
    bottom: calc(
      110 / 1334 * var(--app-h, 100vh) + env(safe-area-inset-bottom, 0px)
    );
  }

  .tug-marker {
    width: calc(60 / 750 * 100vw);
  }

  .tug-marker__fu {
    width: calc(60 / 750 * 100vw);
  }

  .tug-marker__light {
    width: calc(131 / 750 * 100vw);
  }

  .pop--1 {
    left: calc(76 / 750 * 100vw);
    bottom: calc(170 / 750 * 100vw);
    width: calc(162 / 750 * 100vw);
  }

  .pop--2 {
    left: calc(216 / 750 * 100vw);
    bottom: calc(245 / 750 * 100vw);
    width: calc(136 / 750 * 100vw);
  }

  .pop--3 {
    left: calc(429 / 750 * 100vw);
    bottom: calc(159 / 750 * 100vw);
    width: calc(295 / 750 * 100vw);
  }

  .charge-bar {
    width: calc(540 / 750 * 100vw);
  }

  .charge-bar__track {
    flex: 1 1 auto;
    width: calc(477 / 750 * 100vw);
    height: calc(17 / 750 * 100vw);
  }

  .charge-bar__line {
    width: 100%;
    height: 100%;
    object-fit: fill;
  }

  .charge-bar__arrow {
    width: calc(16 / 750 * 100vw);
    height: calc(55 / 750 * 100vw);
  }

  /* 图标高度固定 31px，不随 vw 缩放 */
  .charge-bar__icon--min {
    width: 23px;
    height: 31px;
  }

  .charge-bar__icon--max {
    width: 45px;
    height: 31px;
  }

  .btn-charge {
    width: calc(388 / 750 * 100vw);
  }

  .charge-value {
    top: calc(-28 / 750 * 100vw);
    font-size: calc(22 / 750 * 100vw);
  }

  .splash-fx--tier1 {
    width: calc(162 / 750 * 100vw);
  }

  .splash-fx--tier2 {
    width: calc(180 / 750 * 100vw);
  }

  .splash-fx--tier3 {
    width: calc(260 / 750 * 100vw);
  }
}

.slide-in-elliptic-top-fwd {
  -webkit-animation: slide-in-elliptic-top-fwd 1s
    cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  animation: slide-in-elliptic-top-fwd 1s cubic-bezier(0.25, 0.46, 0.45, 0.94)
    both;
}
@-webkit-keyframes slide-in-elliptic-top-fwd {
  0% {
    -webkit-transform: translateY(-600px) rotateX(-30deg) scale(0);
    transform: translateY(-600px) rotateX(-30deg) scale(0);
    -webkit-transform-origin: 50% 100%;
    transform-origin: 50% 100%;
    opacity: 0;
  }
  100% {
    -webkit-transform: translateY(0) rotateX(0) scale(1);
    transform: translateY(0) rotateX(0) scale(1);
    -webkit-transform-origin: 50% 1400px;
    transform-origin: 50% 1400px;
    opacity: 1;
  }
}
@keyframes slide-in-elliptic-top-fwd {
  0% {
    -webkit-transform: translateY(-600px) rotateX(-30deg) scale(0);
    transform: translateY(-600px) rotateX(-30deg) scale(0);
    -webkit-transform-origin: 50% 100%;
    transform-origin: 50% 100%;
    opacity: 0;
  }
  100% {
    -webkit-transform: translateY(0) rotateX(0) scale(1);
    transform: translateY(0) rotateX(0) scale(1);
    -webkit-transform-origin: 50% 1400px;
    transform-origin: 50% 1400px;
    opacity: 1;
  }
}

/* 首页区域选择 */
.page01_area {
  width: 100%;
  height: 60px;
  position: absolute;
  left: 0;
  top: 710px;
  overflow: hidden;
}
.page01_area_bg {
  background-color: #fff;
  width: 211px;
  height: 55px;
  text-align: left;
  position: absolute;
  z-index: 99;
  box-sizing: border-box;
}
.page01_city {
  left: 136px;
  top: 0;
}
.page01_county {
  left: 411px;
  top: 0;
}
select {
  /* 清除默认的箭头样式 */
  appearance: none;
  -moz-appearance: none;
  -webkit-appearance: none;

  /* 清除默认边框 */
  border: none;
  /* 清除聚焦时的边框颜色 */
  outline: none;
  /* 右侧添加箭头的背景图  自行调整位置 */
  background: url('../images/p3_arrow.png') right center no-repeat #fff;
  background-size: auto 100%;
  width: 211px;
  height: 55px;
  font-size: 30px;
  line-height: 48px;
  color: #5c6370;
  padding-left: 20px;
  border: 2px solid #bc765d;
  box-sizing: border-box;
}
