/* 滑雪大冒险 — 移动端竖屏游戏界面 */
:root {
  --orange: #FF8A3D;
  --orange-deep: #F26B1E;
  --orange-soft: #FFE3CE;
  --ink: #1B2E45;
  --ink-2: #48627C;
  --muted: #8296AB;
  --paper: #FFFDF8;
  --paper-warm: #FFF6EC;
  --line: #F1E2D3;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 90% at 50% -10%, #1E557F 0%, #0C2439 55%, #071624 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

#app { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

#stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #BFE4F7;
  touch-action: none;
}

@media (min-width: 620px) and (min-height: 700px) {
  #stage {
    height: min(94vh, 920px);
    border-radius: 34px;
    box-shadow: 0 40px 110px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .1);
  }
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#game:active { cursor: grabbing; }

/* 屏幕氛围光 */
.atmosphere {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(130% 70% at 50% -8%, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 58%),
    linear-gradient(180deg, rgba(8, 38, 64, .12) 0%, rgba(8, 38, 64, 0) 18%,
      rgba(8, 38, 64, 0) 78%, rgba(8, 38, 64, .16) 100%);
}

/* ---------------- HUD ---------------- */
.hud {
  position: absolute;
  z-index: 12;
  top: calc(var(--safe-top) + 12px);
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.hud.is-live { opacity: 1; visibility: visible; transform: none; }

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

.hud-pill {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border-radius: 17px;
  color: #22384F;
  font-size: 19px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 253, 248, .82));
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: 0 9px 22px rgba(16, 52, 85, .18), inset 0 1px 0 #FFF;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.hud-pill .mp-icon { width: 21px; height: 21px; color: var(--orange); }
.hud-dist em {
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin-left: -2px;
}
.hud-coin { padding-left: 8px; padding-right: 16px; }

.coin-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #B6770A;
  background: linear-gradient(180deg, #FFE79C, #FFC23D 70%, #F3A81F);
  box-shadow: inset 0 1px 0 #FFF8DA, 0 2px 5px rgba(185, 117, 8, .35), 0 0 0 1px rgba(197, 128, 15, .18);
}
.coin-badge .mp-icon { width: 19px; height: 19px; color: #B6770A; }
.hud-coin.bump { animation: coinBump .26s ease; }
@keyframes coinBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.icon-btn {
  pointer-events: auto;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .95);
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #3A5A78;
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 253, 248, .82));
  box-shadow: 0 9px 22px rgba(16, 52, 85, .18), inset 0 1px 0 #FFF;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: transform .12s ease;
}
.icon-btn .mp-icon { width: 23px; height: 23px; }
.icon-btn:active { transform: scale(.93); }

/* 游戏提示 */
.coach {
  position: absolute;
  z-index: 11;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 22px);
  transform: translate(-50%, 12px);
  padding: 10px 18px;
  border-radius: 999px;
  color: #2C4763;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  white-space: nowrap;
  background: rgba(255, 253, 248, .82);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 10px 26px rgba(14, 47, 79, .2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, transform .35s ease, visibility .35s;
  pointer-events: none;
}
.coach.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* 广告结果提示 */
.toast {
  position: absolute;
  z-index: 60;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 84px);
  max-width: calc(100% - 36px);
  padding: 10px 17px;
  border-radius: 999px;
  color: #FFFDF8;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: .02em;
  text-align: center;
  background: rgba(18, 42, 66, .93);
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 14px 32px rgba(4, 20, 36, .38), inset 0 1px 0 rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 10px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  pointer-events: none;
}
.toast.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast.is-ok { background: rgba(24, 104, 82, .94); border-color: rgba(162, 236, 210, .3); }
.toast.is-warn { background: rgba(123, 58, 22, .94); border-color: rgba(255, 202, 156, .28); }

/* ---------------- 通用屏幕 ---------------- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  transition: opacity .28s ease, visibility .28s;
}
.screen.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.screen > * { position: relative; z-index: 1; }

/* ---------------- 起始页 ---------------- */
.start-screen {
  justify-content: space-between;
  padding: calc(var(--safe-top) + 16px) 16px calc(var(--safe-bottom) + 16px);
}
.start-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(9, 40, 70, .36) 0%,
    rgba(9, 40, 70, .12) 26%,
    rgba(9, 40, 70, 0) 44%,
    rgba(9, 36, 62, .06) 62%,
    rgba(8, 32, 56, .52) 100%);
}

.start-top { padding: max(1.5vh, 4px) 0 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1.3 / 1;
  max-height: min(40vh, 360px);
  min-height: 212px;
  overflow: hidden;
  border-radius: 26px;
  background: #9FD6F1;
  border: 1px solid rgba(255, 255, 255, .78);
  box-shadow:
    0 22px 44px rgba(7, 32, 58, .36),
    0 0 0 1px rgba(255, 255, 255, .16),
    inset 0 1px 0 rgba(255, 255, 255, .4);
}
.hero-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 44%;
  user-select: none;
  -webkit-user-drag: none;
}
.hero-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 30, 52, .42) 0%, rgba(7, 30, 52, .05) 30%, rgba(7, 30, 52, 0) 54%, rgba(7, 30, 52, .4) 100%);
}
.hero-kicker {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}
.hero-best {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  margin-top: 0;
  background: rgba(10, 38, 64, .46);
  border-color: rgba(255, 255, 255, .46);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px 0 9px;
  border-radius: 999px;
  color: #F4FBFF;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .24em;
  text-shadow: 0 1px 4px rgba(7, 32, 56, .35);
  background: rgba(14, 52, 86, .26);
  border: 1px solid rgba(255, 255, 255, .42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.kicker .mp-icon { width: 16px; height: 16px; color: #FFE0C4; letter-spacing: 0; }

.brand-sub {
  margin: 11px 4px 0;
  max-width: 320px;
  color: #F3FAFF;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.55;
  text-shadow: 0 1px 10px rgba(8, 34, 60, .5);
}

.best-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  height: 34px;
  padding: 0 13px 0 10px;
  border-radius: 999px;
  color: rgba(255, 255, 255, .9);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  background: rgba(11, 44, 74, .3);
  border: 1px solid rgba(255, 255, 255, .38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.best-chip .mp-icon { width: 17px; height: 17px; color: #FFD27A; }
.best-chip b {
  margin-left: 1px;
  color: #FFE4C2;
  font-size: 15px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.start-bottom { padding-bottom: 2px; }

.start-panel {
  position: relative;
  padding: 18px 16px 14px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 254, 250, .97), rgba(255, 245, 234, .96));
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow:
    0 26px 55px rgba(7, 32, 58, .38),
    inset 0 1px 0 #FFF,
    inset 0 -1px 0 rgba(217, 177, 138, .18);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.hints {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  color: #6E7F92;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
}
.hint-ico {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #EF7524;
  background: linear-gradient(180deg, #FFF6EC, #FFE5D1);
  border: 1px solid #FFDCC1;
  box-shadow: inset 0 1px 0 #FFF, 0 3px 8px rgba(219, 132, 65, .12);
}
.hint-ico .mp-icon { width: 21px; height: 21px; }

.btn {
  appearance: none;
  border: 0;
  width: 100%;
  height: 58px;
  border-radius: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: inherit;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: .06em;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.965); filter: brightness(.98); }
.btn .mp-icon { width: 24px; height: 24px; }

.btn-primary {
  position: relative;
  overflow: hidden;
  color: #FFF;
  background: linear-gradient(180deg, #FFA65F 0%, #FF8A3D 44%, #F26B1E 100%);
  box-shadow:
    0 12px 24px rgba(224, 98, 20, .34),
    inset 0 1px 0 rgba(255, 255, 255, .5),
    inset 0 -3px 0 rgba(166, 69, 9, .26);
  text-shadow: 0 1px 2px rgba(145, 58, 6, .32);
}
.btn-primary::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 5px;
  height: 38%;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .32), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.btn-primary > * { position: relative; z-index: 1; }

.btn-ghost {
  height: 50px;
  margin-top: 10px;
  color: #91603A;
  font-size: 16px;
  background: rgba(255, 252, 246, .72);
  border: 1.5px solid #F0DDC9;
  box-shadow: inset 0 1px 0 #FFF;
}

.note {
  margin: 11px 0 0;
  text-align: center;
  color: #A08D7B;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}

/* ---------------- 弹层 ---------------- */
.modal-screen {
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 22px) 20px calc(var(--safe-bottom) + 22px);
  background: rgba(8, 31, 54, .44);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.result-panel {
  position: relative;
  width: 100%;
  max-width: 348px;
  margin: auto;
  padding: 26px 22px 18px;
  text-align: center;
  border-radius: 30px;
  background: linear-gradient(180deg, #FFFEFA 0%, #FFF7EE 68%, #FFF2E5 100%);
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow:
    0 32px 70px rgba(3, 20, 38, .5),
    inset 0 1px 0 #FFF,
    inset 0 -2px 0 rgba(226, 185, 143, .2);
}
.modal-screen:not(.is-hidden) .result-panel {
  animation: panelIn .32s cubic-bezier(.22, 1.2, .36, 1);
}
@keyframes panelIn {
  0% { opacity: 0; transform: translateY(18px) scale(.96); }
  100% { opacity: 1; transform: none; }
}

.result-ico {
  width: 66px;
  height: 66px;
  margin: -52px auto 12px;
  border-radius: 23px;
  display: grid;
  place-items: center;
  color: #FFF;
  background: linear-gradient(180deg, #FFAE6A 0%, #FF8A3D 48%, #EE651A 100%);
  border: 3px solid #FFF9F2;
  box-shadow: 0 12px 26px rgba(221, 96, 22, .38), inset 0 1px 0 rgba(255, 255, 255, .5);
  transform: rotate(-3deg);
}
.result-ico .mp-icon { width: 34px; height: 34px; filter: drop-shadow(0 2px 2px rgba(150, 62, 6, .3)); }
.pause-ico { transform: rotate(0); }
.pause-ico .mp-icon { width: 30px; height: 30px; }

.panel-kicker {
  margin: 0 0 5px;
  color: #B08D70;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.panel-title {
  margin: 0;
  color: #22384F;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .04em;
}
.panel-sub {
  margin: 10px 0 18px;
  color: #8D9AA8;
  font-size: 13px;
  line-height: 1.6;
}

.result-distance {
  margin: 14px 0 16px;
  color: #1E3A56;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -.02em;
}
.result-distance span {
  font-size: 60px;
  background: linear-gradient(180deg, #344F6B 0%, #16324E 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.result-distance small {
  margin-left: 3px;
  font-size: 18px;
  font-weight: 800;
  color: #94A6B8;
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.stat {
  padding: 11px 8px 9px;
  border-radius: 17px;
  background: #FFF8F0;
  border: 1px solid #F3E4D4;
  box-shadow: inset 0 1px 0 #FFF;
}
.stat > span {
  display: block;
  color: #A38E7B;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
}
.stat b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
  color: #2A435E;
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.stat b small { font-size: 11px; color: #9AACBE; font-weight: 800; margin-left: 1px; }
.stat b .mp-icon { width: 18px; height: 18px; color: #F2A21C; }

/* 激励视频复活 */
.ad-revive-wrap { margin: 0 0 14px; }
.ad-revive-wrap[hidden] { display: none; }
.ad-revive {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  text-align: left;
  border-radius: 19px;
  font-family: inherit;
  cursor: pointer;
  background: linear-gradient(180deg, #FFF9E8 0%, #FFEDC8 60%, #FFE2AD 100%);
  border: 1.5px solid #FFD58B;
  box-shadow:
    0 9px 20px rgba(201, 141, 20, .16),
    inset 0 1px 0 #FFFEF8,
    inset 0 -1px 0 rgba(214, 160, 46, .16);
  transition: transform .12s ease, filter .12s ease, opacity .18s ease;
}
.ad-revive:active { transform: scale(.975); filter: brightness(.99); }
.ad-revive.is-loading { opacity: .68; pointer-events: none; }
.ad-revive-ico {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #FFF;
  background: linear-gradient(180deg, #FFB566 0%, #FF8A3D 52%, #EE6418 100%);
  box-shadow: 0 5px 12px rgba(214, 96, 21, .32), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.ad-revive-ico .mp-icon { width: 23px; height: 23px; }
.ad-revive-copy { flex: 1 1 auto; min-width: 0; }
.ad-revive-copy b {
  display: block;
  color: #7C4711;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .02em;
  line-height: 1.3;
}
.ad-revive-copy small {
  display: block;
  margin-top: 2px;
  color: #A57E4E;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.35;
}
.ad-tag {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 5px;
  color: #B2731F;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: .08em;
  border: 1px solid #E4BC72;
  background: rgba(255, 251, 235, .72);
}
.ad-note {
  margin: 6px 0 0;
  color: #B29A7D;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .03em;
}

.panel-foot {
  margin: 12px 0 0;
  color: #B5A390;
  font-size: 10.5px;
  letter-spacing: .04em;
}

.record-badge {
  position: absolute;
  top: -12px;
  right: 18px;
  padding: 7px 13px;
  border-radius: 999px;
  color: #9B5A12;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  background: linear-gradient(180deg, #FFF0BE, #FFD45E);
  border: 1px solid #FFE9A6;
  box-shadow: 0 8px 18px rgba(203, 141, 20, .34), inset 0 1px 0 #FFF9DC;
  transform: rotate(5deg) scale(.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.record-badge.is-on { opacity: 1; visibility: visible; transform: rotate(5deg) scale(1); }

/* 小屏适配 */
@media (max-height: 700px) {
  .start-top { padding-top: 0; }
  .hero-card { max-height: 35vh; min-height: 190px; }
  .brand-sub { margin-top: 8px; font-size: 13px; }
  .best-chip { height: 31px; }
  .start-panel { padding: 14px 14px 12px; border-radius: 24px; }
  .hints { margin-bottom: 12px; }
  .hint-ico { width: 35px; height: 35px; border-radius: 12px; }
  .btn { height: 54px; }
  .note { margin-top: 8px; }
  .result-panel { padding-top: 22px; }
  .result-distance span { font-size: 52px; }
  .result-distance { margin: 10px 0 12px; }
  .ad-revive-wrap { margin-bottom: 12px; }
}
@media (max-height: 610px) {
  .hero-card { max-height: 31vh; min-height: 158px; aspect-ratio: 1.7 / 1; border-radius: 20px; }
  .hero-art { object-position: center 40%; }
  .brand-sub { display: none; }
  .hints { display: none; }
  .start-panel { padding-top: 12px; }
  .ad-revive { padding: 8px 10px; }
  .ad-revive-ico { width: 36px; height: 36px; border-radius: 12px; }
  .ad-note { display: none; }
}
