@font-face {
  font-family: "Noto Sans SC";
  src: url("fonts/NotoSansSC-subset.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --orange: #FF8A3D;
  --orange-deep: #F26A1B;
  --orange-light: #FFB15E;
  --ink: #1E4A6B;
  --ink-soft: #4D7794;
  --sky: #6FC8F4;
  --glass: rgba(255, 255, 255, 0.72);
  --shadow: 0 10px 26px rgba(16, 66, 104, 0.18);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #12547f;
  color: var(--ink);
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
  background:
    radial-gradient(120% 80% at 50% 0%, #3CA7DD 0%, #17628E 52%, #0B3C5C 100%);
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: linear-gradient(#4DB4EC, #BEEBFF 62%, #FFE3C6);
  isolation: isolate;
  box-shadow: 0 0 80px rgba(4, 37, 60, 0.35);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.game-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(130% 86% at 50% 42%, transparent 55%, rgba(24, 88, 132, 0.16) 100%),
    linear-gradient(180deg, rgba(9, 70, 112, 0.12) 0%, transparent 14%, transparent 78%, rgba(20, 86, 130, 0.13) 100%);
}

/* ---------- 顶部 HUD ---------- */
.hud {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 20;
  padding: calc(var(--safe-top) + 12px) 16px 0;
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.hud-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud button { pointer-events: auto; }

.score-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 45px;
  padding: 0 15px 0 6px;
  border-radius: 23px;
  color: #fff;
  background: linear-gradient(135deg, #FFA34F 0%, #FF7A2F 58%, #F0601A 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.62);
  box-shadow: 0 8px 20px rgba(232, 96, 26, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  flex: none;
}

.score-star {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
  color: #FFE27A;
}

.score-star .mp-icon { width: 21px; height: 21px; }
.score-label { font-size: 11.5px; font-weight: 600; opacity: 0.86; letter-spacing: 0.02em; }
.score-pill b { font-size: 20px; font-weight: 900; line-height: 1; letter-spacing: 0.01em; min-width: 12px; }

.level-pill {
  margin: 0 auto;
  height: 37px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 18px rgba(18, 76, 114, 0.18), inset 0 1px 0 #fff;
  color: #275F82;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
}
.level-pill b { font-size: 14px; font-weight: 800; letter-spacing: 0.02em; }

.round-btn {
  flex: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #2C6A8C;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 7px 18px rgba(18, 76, 114, 0.2), inset 0 1px 0 #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.12s ease, background 0.2s ease;
}
.round-btn .mp-icon { width: 22px; height: 22px; }
.round-btn:active { transform: scale(0.9); background: rgba(255, 255, 255, 0.95); }

.progress-wrap {
  position: relative;
  margin: 11px 20px 0 20px;
  padding-right: 3px;
}

.progress-track {
  height: 11px;
  border-radius: 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 2px 5px rgba(17, 75, 112, 0.18);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 7px;
  background: linear-gradient(90deg, #FFD05E 0%, #FF9C3F 55%, #FF7A2F 100%);
  box-shadow: 0 0 10px rgba(255, 170, 62, 0.75);
  transition: width 0.55s cubic-bezier(0.22, 0.8, 0.3, 1);
}

.progress-flag {
  position: absolute;
  right: -11px;
  top: 50%;
  width: 25px;
  height: 25px;
  margin-top: -12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: #FF7C30;
  box-shadow: 0 4px 10px rgba(202, 84, 24, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.progress-flag .mp-icon { width: 14px; height: 14px; }

.goal-chip {
  margin: 9px auto 0;
  width: max-content;
  max-width: 100%;
  height: 26px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 14px;
  color: #2B6385;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 12px rgba(18, 76, 114, 0.13);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}
.goal-chip .mp-icon { width: 13px; height: 13px; color: var(--orange-deep); }

/* ---------- 蓄力按钮 ---------- */
.jump-wrap {
  position: absolute;
  right: 20px;
  bottom: calc(26px + var(--safe-bottom));
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.jump-hint {
  height: 25px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border-radius: 13px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(24, 83, 121, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 4px 12px rgba(15, 63, 94, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.jump-btn {
  position: relative;
  width: clamp(86px, 23vw, 100px);
  height: clamp(86px, 23vw, 100px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  --p: 0;
  color: #fff;
  background:
    radial-gradient(72% 72% at 34% 26%, #FFC078 0%, #FF9847 34%, #FF7B2E 66%, #EF5F16 100%);
  border: 4px solid rgba(255, 255, 255, 0.94);
  box-shadow:
    0 16px 30px rgba(210, 83, 19, 0.38),
    0 4px 10px rgba(210, 83, 19, 0.25),
    inset 0 6px 14px rgba(255, 255, 255, 0.4),
    inset 0 -8px 18px rgba(176, 57, 8, 0.22);
  transition: transform 0.12s ease, box-shadow 0.18s ease;
  -webkit-user-select: none;
  user-select: none;
}

.jump-btn::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: radial-gradient(65% 55% at 50% 30%, rgba(255, 255, 255, 0.24), transparent 70%);
  pointer-events: none;
}

.jump-inner {
  position: relative;
  z-index: 2;
  width: 60%;
  height: 60%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.22);
}

.jump-inner .mp-icon {
  width: 46px;
  height: 46px;
  color: #fff;
  filter: drop-shadow(0 3px 4px rgba(157, 58, 8, 0.28));
}

.jump-btn:active,
.jump-btn.is-charging {
  transform: scale(0.92);
  box-shadow:
    0 8px 16px rgba(210, 83, 19, 0.32),
    inset 0 8px 18px rgba(176, 57, 8, 0.26),
    inset 0 6px 14px rgba(255, 255, 255, 0.3);
}

.jump-btn.idle {
  animation: btnPulse 2.4s ease-in-out infinite;
}

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 16px 30px rgba(210, 83, 19, 0.38), 0 4px 10px rgba(210, 83, 19, 0.25), inset 0 6px 14px rgba(255, 255, 255, 0.4), inset 0 -8px 18px rgba(176, 57, 8, 0.22), 0 0 0 0 rgba(255, 154, 70, 0.35); }
  55% { box-shadow: 0 16px 30px rgba(210, 83, 19, 0.38), 0 4px 10px rgba(210, 83, 19, 0.25), inset 0 6px 14px rgba(255, 255, 255, 0.4), inset 0 -8px 18px rgba(176, 57, 8, 0.22), 0 0 0 12px rgba(255, 154, 70, 0); }
}

.jump-ring {
  position: absolute;
  inset: -11px;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(from -90deg, #FFE073 calc(var(--p, 0) * 360deg), rgba(255, 255, 255, 0.22) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  filter: drop-shadow(0 0 7px rgba(255, 205, 90, 0.55));
  transition: background 0.05s linear;
}

.jump-wrap.charging .jump-hint {
  background: linear-gradient(135deg, #FFA24D, #FF7A2F);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(232, 96, 26, 0.35);
}

.jump-wrap.busy .jump-btn { opacity: 0.82; }
.jump-wrap.hidden { opacity: 0; transform: translateY(14px) scale(0.9); pointer-events: none; }

/* ---------- 提示条 ---------- */
.hint {
  position: absolute;
  left: 50%;
  bottom: calc(150px + var(--safe-bottom));
  z-index: 25;
  transform: translate(-50%, 10px);
  opacity: 0;
  padding: 10px 18px;
  border-radius: 20px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(21, 78, 115, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: 0 8px 24px rgba(12, 56, 86, 0.24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.hint.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 首页 ---------- */
.intro {
  position: absolute;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  background-color: #6CC6F1;
  background-image: url("images/gen/gptimg_1795321777_look.png");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: cover;
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 66, 105, 0.06) 0%, transparent 32%, rgba(8, 55, 90, 0.12) 62%, rgba(9, 52, 84, 0.6) 100%);
  pointer-events: none;
}

.intro::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 50% at 50% 0%, rgba(255, 255, 255, 0.2), transparent 60%);
  pointer-events: none;
}

.intro.is-hidden {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

.intro-best {
  position: absolute;
  top: calc(var(--safe-top) + 16px);
  right: 16px;
  z-index: 3;
  height: 34px;
  padding: 0 13px 0 9px;
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 17px;
  color: #2A6285;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(15, 67, 100, 0.22), inset 0 1px 0 #fff;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.intro-best .mp-icon { width: 15px; height: 15px; color: #FFA21F; }
.intro-best b { font-size: 14px; font-weight: 900; color: #FF7A2F; margin-left: 1px; }

.intro-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 0 16px calc(16px + var(--safe-bottom));
}

.intro-card {
  padding: 18px 18px 15px;
  border-radius: 26px;
  background: rgba(255, 252, 247, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 22px 48px rgba(8, 45, 74, 0.34), inset 0 1px 0 #fff;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: cardUp 0.65s cubic-bezier(0.18, 0.82, 0.28, 1) both;
}

@keyframes cardUp {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

.intro-kicker {
  margin: 0 0 7px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #F07A2C;
}

.intro-card h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.34;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #1F4C6B;
}

.intro-desc {
  margin: 7px 0 14px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #66869A;
}

.cta {
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 17px;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #FFA34F 0%, #FF8939 45%, #F36B1D 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 22px rgba(227, 96, 25, 0.34), inset 0 2px 0 rgba(255, 255, 255, 0.36);
  transition: transform 0.12s ease, box-shadow 0.18s ease;
}
.cta .mp-icon { width: 20px; height: 20px; color: #fff; }
.cta:active { transform: scale(0.965); box-shadow: 0 6px 14px rgba(227, 96, 25, 0.3), inset 0 2px 6px rgba(160, 55, 10, 0.18); }

.intro-meta {
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 600;
  color: #7E97A7;
}
.intro-meta span { display: inline-flex; align-items: center; gap: 4px; }
.intro-meta .mp-icon { width: 12px; height: 12px; color: #F58A3B; }
.intro-meta b { color: #F07A2C; font-weight: 900; }
.intro-meta .meta-sep { width: 1px; height: 10px; background: #D7E3EA; margin: 0 3px; }

/* ---------- 结算 / 暂停弹层 ---------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 20px) 20px calc(var(--safe-bottom) + 20px);
  background: rgba(9, 48, 76, 0.44);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  animation: fadeIn 0.25s ease both;
}
.overlay[hidden] { display: none !important; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.panel {
  width: 100%;
  max-width: 330px;
  padding: 24px 22px 20px;
  border-radius: 28px;
  text-align: center;
  background: rgba(255, 253, 249, 0.97);
  border: 1px solid #fff;
  box-shadow: 0 28px 60px rgba(5, 38, 62, 0.38), inset 0 1px 0 #fff;
  animation: panelUp 0.38s cubic-bezier(0.17, 0.85, 0.3, 1.05) both;
}

@keyframes panelUp {
  from { opacity: 0; transform: translateY(22px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.panel-icon {
  width: 58px;
  height: 58px;
  margin: -50px auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #FFA24D, #F26B1D);
  border: 4px solid #FFFDF9;
  box-shadow: 0 10px 24px rgba(206, 84, 20, 0.34);
}
.panel-icon .mp-icon { width: 28px; height: 28px; }
.panel-icon.fail { background: linear-gradient(135deg, #86C6E8, #4B96C4); box-shadow: 0 10px 24px rgba(48, 116, 156, 0.3); }
.panel-icon.win { background: linear-gradient(135deg, #FFD264, #FF922F); }

.panel-kicker {
  margin: 0 0 3px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: #F08033;
}

.panel h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #1F4C6B;
}

.panel-desc {
  margin: 7px 0 15px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #6C8899;
}

.panel-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.panel-stats > div {
  flex: 1;
  padding: 11px 8px 9px;
  border-radius: 15px;
  background: #F6F1E8;
  border: 1px solid #EDE4D6;
}
.panel-stats span { display: block; font-size: 10.5px; font-weight: 700; color: #8A9BA7; }
.panel-stats b { display: block; margin-top: 2px; font-size: 22px; font-weight: 900; color: #F0782C; line-height: 1.2; }
.panel-stats.single { max-width: 180px; margin-left: auto; margin-right: auto; }

.ghost-btn {
  width: 100%;
  height: 44px;
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 14px;
  color: #5B7A8D;
  font-size: 13.5px;
  font-weight: 700;
  background: rgba(235, 242, 246, 0.7);
  border: 1px solid #DFE9EF;
  transition: transform 0.12s ease, background 0.2s ease;
}
.ghost-btn .mp-icon { width: 17px; height: 17px; }
.ghost-btn:active { transform: scale(0.97); background: #E8F0F5; }

/* ---------- 首页时隐藏游戏 HUD ---------- */
.stage.intro-on .hud,
.stage.intro-on .jump-wrap,
.stage.intro-on .hint {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

/* ---------- 大屏适配 ---------- */
@media (min-width: 600px) {
  .stage {
    height: 100vh;
    height: 100dvh;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 0 90px rgba(3, 29, 48, 0.45);
  }
  body { padding: 0; }
}

@media (max-height: 680px) {
  .intro-card { padding: 15px 16px 13px; }
  .intro-card h1 { font-size: 19px; }
  .intro-desc { margin-bottom: 11px; font-size: 12px; }
  .intro-best { top: calc(var(--safe-top) + 10px); }
  .jump-wrap { bottom: calc(18px + var(--safe-bottom)); }
  .jump-btn { width: clamp(78px, 21vw, 92px); height: clamp(78px, 21vw, 92px); }
  .jump-inner .mp-icon { width: 40px; height: 40px; }
  .hint { bottom: calc(132px + var(--safe-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .jump-btn.idle, .intro-card, .panel { animation: none !important; }
}
