/* ============================================================
   暗洞逃生 · 移动端竖屏 H5
   主色 #FF8A3D，卡通暗黑洞穴
   ============================================================ */

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

:root {
  --orange: #FF8A3D;
  --orange-hot: #FFB45C;
  --orange-deep: #C94E12;
  --gold: #FFD479;
  --blue: #6FE1FF;
  --ink: #FFF3E2;
  --muted: #B7A18C;
  --bg: #08060D;
  --stone: #2B1B13;
  --stone-2: #1A100C;
  --font-ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Heiti SC", sans-serif;
  --font-num: "Trebuchet MS", "Arial Rounded MT Bold", "PingFang SC", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --deck-h: clamp(100px, 14vh, 138px);
  --ease-out: cubic-bezier(.22, .9, .32, 1);
  --ease-back: cubic-bezier(.2, .95, .3, 1.18);
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #07050B;
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  touch-action: none;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  width: 100%;
}

[hidden] { display: none !important; }

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

.app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
}
.screen.is-active { display: block; }

.mp-icon {
  flex: 0 0 auto;
}

/* ============================================================
   首页
   ============================================================ */

.home {
  overflow: hidden;
  background: #08060D;
}

.home-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(58% 30% at 50% 12%, rgba(43, 75, 145, .34), transparent 72%),
    radial-gradient(40% 24% at 88% 30%, rgba(255, 138, 61, .16), transparent 74%),
    radial-gradient(46% 30% at 8% 44%, rgba(65, 158, 214, .12), transparent 74%),
    radial-gradient(90% 48% at 50% 104%, rgba(89, 37, 19, .38), transparent 70%),
    linear-gradient(180deg, #07060D 0%, #0D1020 22%, #120E19 52%, #140C0C 78%, #08050A 100%);
}

.home-bg::before {
  content: "";
  position: absolute;
  top: -90px;
  left: -12%;
  width: 124%;
  height: 44%;
  background:
    radial-gradient(46% 64% at 20% 14%, rgba(44, 62, 103, .72), transparent 72%),
    radial-gradient(40% 60% at 78% 6%, rgba(23, 33, 63, .88), transparent 74%),
    linear-gradient(180deg, #0A0C18 0%, rgba(10, 12, 24, 0) 100%);
  clip-path: polygon(0 0, 100% 0, 100% 52%, 92% 58%, 86% 48%, 78% 66%, 69% 49%,
      61% 63%, 52% 46%, 44% 64%, 36% 50%, 27% 68%, 19% 51%, 11% 63%, 4% 48%, 0 58%);
  filter: blur(2px);
  opacity: .96;
}

.home-bg::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30%;
  background:
    radial-gradient(30% 80% at 8% 100%, rgba(63, 189, 235, .18), transparent 70%),
    radial-gradient(26% 80% at 92% 100%, rgba(255, 139, 61, .14), transparent 72%),
    linear-gradient(180deg, transparent 0%, rgba(6, 4, 9, .6) 72%, #060409 100%);
}

.home-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(34px);
  pointer-events: none;
  opacity: .55;
}
.glow-blue {
  width: 46vw;
  height: 46vw;
  left: -18vw;
  top: 36%;
  background: radial-gradient(circle, rgba(76, 205, 255, .38), transparent 66%);
  animation: glowDrift 9s ease-in-out infinite alternate;
}
.glow-orange {
  width: 52vw;
  height: 52vw;
  right: -22vw;
  top: 18%;
  background: radial-gradient(circle, rgba(255, 138, 61, .3), transparent 68%);
  animation: glowDrift 11s ease-in-out infinite alternate-reverse;
}

@keyframes glowDrift {
  from { transform: translate3d(0, -8px, 0) scale(1); opacity: .42; }
  to { transform: translate3d(9px, 14px, 0) scale(1.12); opacity: .68; }
}

/* 洞顶漏下来的一束冷光，让上屏不空 */
.home-shaft {
  position: absolute;
  top: -16%;
  left: 14%;
  width: 56%;
  height: 62%;
  z-index: 1;
  pointer-events: none;
  opacity: .5;
  background: linear-gradient(102deg,
    transparent 30%,
    rgba(112, 206, 255, .10) 42%,
    rgba(150, 224, 255, .17) 50%,
    rgba(112, 206, 255, .05) 60%,
    transparent 72%);
  filter: blur(12px);
  transform: rotate(-8deg);
  mix-blend-mode: screen;
  animation: shaftBreathe 8s ease-in-out infinite alternate;
}
@keyframes shaftBreathe {
  from { opacity: .32; transform: rotate(-8deg) translateX(-6px); }
  to { opacity: .6; transform: rotate(-8deg) translateX(8px); }
}

.home-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.home-tools {
  position: absolute;
  top: calc(9px + var(--safe-top));
  left: 0;
  right: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 14px;
  pointer-events: none;
  animation: toolsIn .55s .15s var(--ease-out) both;
}
@keyframes toolsIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
.home-tools .round-btn { pointer-events: auto; }

.round-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #FFE0B2;
  background:
    radial-gradient(circle at 34% 26%, #805836 0%, #4A2D19 46%, #2A170F 100%);
  border: 1.5px solid rgba(255, 172, 94, .58);
  box-shadow:
    0 3px 0 rgba(0, 0, 0, .55),
    0 6px 12px rgba(0, 0, 0, .35),
    inset 0 2px 2px rgba(255, 214, 160, .3),
    inset 0 -4px 6px rgba(0, 0, 0, .5),
    0 0 16px rgba(255, 138, 61, .16);
  transition: transform .12s var(--ease-out), box-shadow .12s;
}
.round-btn::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1px solid rgba(255, 208, 150, .12);
  pointer-events: none;
}
.round-btn .mp-icon {
  width: 21px;
  height: 21px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5));
}
.round-btn:active {
  transform: translateY(2px) scale(.94);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, .5),
    inset 0 2px 4px rgba(0, 0, 0, .45),
    0 0 10px rgba(255, 138, 61, .2);
}
.round-btn.small {
  width: 39px;
  height: 39px;
}
.round-btn.small .mp-icon { width: 19px; height: 19px; }

/* 标题：使用生成图里的原画石牌，尽量保留石牌质感 */
.home-logo {
  position: absolute;
  top: calc(53px + var(--safe-top));
  left: 50%;
  width: min(89vw, 372px);
  aspect-ratio: 808 / 322;
  transform: translateX(-50%);
  background-image: url("images/gen/gptimg_1795323033_look.png");
  background-repeat: no-repeat;
  background-size: 190.1% auto;
  background-position: 54.67% 5.13%;
  z-index: 7;
  pointer-events: none;
  filter:
    drop-shadow(0 18px 20px rgba(0, 0, 0, .66))
    drop-shadow(0 0 26px rgba(63, 185, 255, .16))
    saturate(1.14)
    contrast(1.04)
    brightness(1.05);
  -webkit-mask-image: radial-gradient(ellipse 67% 66% at 50% 52%, #000 62%, rgba(0, 0, 0, .92) 78%, rgba(0, 0, 0, .35) 91%, transparent 100%);
  mask-image: radial-gradient(ellipse 67% 66% at 50% 52%, #000 62%, rgba(0, 0, 0, .92) 78%, rgba(0, 0, 0, .35) 91%, transparent 100%);
  animation: logoFloat 6.5s 1s ease-in-out infinite, logoIn .7s .06s ease-out both;
}
@keyframes logoIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes logoFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}

/* 主视觉：地鼠 + 落石 + 木桥，取自生成原画 */
.home-hero {
  position: absolute;
  top: clamp(148px, 20vh, 176px);
  left: 0;
  right: 0;
  height: clamp(340px, 46vh, 410px);
  z-index: 2;
  background-image: url("images/gen/gptimg_1795323033_look.png");
  background-repeat: no-repeat;
  background-size: 225.88% auto;
  background-position: 35.05% 100%;
  filter: saturate(1.1) contrast(1.03) brightness(1.01);
  animation: heroBreathe 9s 1.15s ease-in-out infinite, heroIn .9s .1s var(--ease-out) both;
}
@keyframes heroIn {
  from { opacity: 0; transform: scale(1.035); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes heroBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.012); }
}
.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      #08060D 0%,
      rgba(8, 6, 13, .88) 7%,
      rgba(8, 6, 13, .2) 18%,
      rgba(8, 6, 13, 0) 30%,
      rgba(8, 6, 13, 0) 84%,
      rgba(8, 6, 13, .18) 95%,
      #08060D 100%),
    linear-gradient(90deg,
      #08060D 0%,
      rgba(8, 6, 13, .55) 6%,
      transparent 18%,
      transparent 84%,
      rgba(8, 6, 13, .6) 94%,
      #08060D 100%);
  pointer-events: none;
}
.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(42% 46% at 24% 36%, rgba(255, 150, 66, .14), transparent 72%),
    radial-gradient(48% 44% at 76% 44%, rgba(92, 198, 255, .12), transparent 74%),
    radial-gradient(70% 50% at 52% 22%, rgba(255, 209, 150, .08), transparent 76%);
  mix-blend-mode: screen;
}

/* 开始石牌 */
.start-wrap {
  position: absolute;
  right: 5%;
  bottom: -88px;
  width: clamp(146px, 41vw, 180px);
  z-index: 9;
  animation: startIn .75s .52s var(--ease-back) both;
}
@keyframes startIn {
  from { opacity: 0; transform: translateY(18px) scale(.82); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.start-aura {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 154%;
  height: 154%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 170, 66, .52) 0%, rgba(255, 138, 61, .18) 38%, transparent 70%);
  filter: blur(7px);
  animation: auraPulse 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes auraPulse {
  0%, 100% { opacity: .5; transform: translate(-50%, -50%) scale(.9); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.07); }
}
.start-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96%;
  height: 82%;
  border-radius: 50%;
  border: 2px solid rgba(255, 190, 104, .42);
  box-shadow: 0 0 18px rgba(255, 152, 58, .28), inset 0 0 14px rgba(255, 152, 58, .12);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: ringOut 3.2s 1s ease-out infinite;
}
@keyframes ringOut {
  0% { transform: translate(-50%, -50%) scale(.7); opacity: 0; }
  16% { opacity: .7; }
  100% { transform: translate(-50%, -50%) scale(1.52); opacity: 0; }
}
.start-stone {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 410 / 310;
  background-image: url("images/gen/gptimg_1795323033_look.png");
  background-repeat: no-repeat;
  background-size: 374.63% auto;
  background-position: 87.92% 72.83%;
  filter:
    drop-shadow(0 0 12px rgba(255, 174, 74, .65))
    drop-shadow(0 10px 14px rgba(0, 0, 0, .55));
  transition: transform .13s var(--ease-back), filter .13s;
  -webkit-mask-image: radial-gradient(ellipse 86% 82% at 50% 50%, #000 80%, rgba(0, 0, 0, .8) 92%, transparent 100%);
  mask-image: radial-gradient(ellipse 86% 82% at 50% 50%, #000 80%, rgba(0, 0, 0, .8) 92%, transparent 100%);
  animation: stonePulse 2.6s ease-in-out infinite;
}
@keyframes stonePulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 174, 74, .5)) drop-shadow(0 10px 14px rgba(0, 0, 0, .55)); }
  50% { filter: drop-shadow(0 0 26px rgba(255, 190, 92, .9)) drop-shadow(0 10px 14px rgba(0, 0, 0, .55)); }
}
.start-stone:active {
  transform: scale(.94);
  animation-play-state: paused;
}
.start-wrap::after {
  content: "开始逃生";
  position: absolute;
  left: 50%;
  bottom: -25px;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 4px 15px 5px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .2em;
  text-indent: .2em;
  color: #FFE1AE;
  background:
    linear-gradient(180deg, rgba(78, 47, 29, .96), rgba(32, 18, 12, .98));
  border: 1px solid rgba(255, 177, 98, .46);
  box-shadow:
    0 3px 0 rgba(14, 7, 5, .9),
    0 7px 16px rgba(0, 0, 0, .5),
    inset 0 1px 0 rgba(255, 221, 172, .24);
  text-shadow: 0 1px 0 #5D2708, 0 0 12px rgba(255, 148, 63, .55);
  pointer-events: none;
}

/* 底部木桥 / 洞穴晶簇：让下方 UI 有落脚点 */
.home-deck {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--deck-h);
  z-index: 3;
  pointer-events: none;
  background: url("images/gen/deck.png") center top / cover no-repeat;
  filter: brightness(.72) saturate(.92) contrast(1.03);
  animation: deckIn 1.1s .2s ease-out both;
}
@keyframes deckIn {
  from { opacity: 0; }
  to { opacity: .92; }
}
.home-deck::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(8, 6, 13, .96) 0%,
      rgba(8, 6, 13, .34) 16%,
      rgba(8, 6, 13, .04) 40%,
      rgba(8, 6, 13, .26) 72%,
      rgba(8, 6, 13, .6) 100%);
}
.home-deck::after {
  content: "";
  position: absolute;
  left: 9%;
  right: 9%;
  top: 9%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 186, 116, .32), transparent);
  filter: blur(1px);
}

.home-crystal {
  position: absolute;
  z-index: 4;
  width: clamp(92px, 24vw, 118px);
  aspect-ratio: 330 / 304;
  pointer-events: none;
  background: url("images/gen/crystal.png") center bottom / contain no-repeat;
  -webkit-mask-image: radial-gradient(ellipse 78% 74% at 50% 54%, #000 62%, rgba(0, 0, 0, .86) 78%, transparent 100%);
  mask-image: radial-gradient(ellipse 78% 74% at 50% 54%, #000 62%, rgba(0, 0, 0, .86) 78%, transparent 100%);
  filter:
    drop-shadow(0 0 14px rgba(74, 205, 255, .4))
    drop-shadow(0 9px 14px rgba(0, 0, 0, .5));
}
.crystal-left {
  left: -16px;
  bottom: 86px;
  opacity: .82;
  animation: crystalGlow 5.2s 1.2s ease-in-out infinite, crystalIn .85s .5s var(--ease-out) both;
}
.crystal-right {
  right: -15px;
  bottom: 108px;
  width: clamp(68px, 18vw, 86px);
  opacity: .52;
  animation: crystalGlow 6.4s 1.6s ease-in-out infinite reverse, crystalIn .85s .62s var(--ease-out) both;
}
@keyframes crystalIn {
  from { opacity: 0; transform: translateY(10px) scale(.9); }
}
@keyframes crystalGlow {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(74, 205, 255, .28))
      drop-shadow(0 9px 14px rgba(0, 0, 0, .5));
  }
  50% {
    filter: drop-shadow(0 0 22px rgba(99, 225, 255, .58))
      drop-shadow(0 9px 14px rgba(0, 0, 0, .5));
  }
}

/* 底部信息 */
.home-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  animation: footIn .8s .4s var(--ease-out) both;
}
@keyframes footIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.record-row {
  display: flex;
  gap: 9px;
  justify-content: center;
  width: 100%;
}
.stat-pill {
  position: relative;
  height: 44px;
  min-width: 128px;
  padding: 0 14px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 190, 126, .16), transparent 58%),
    linear-gradient(180deg, rgba(74, 49, 35, .95), rgba(25, 15, 12, .97));
  border: 1px solid rgba(255, 174, 102, .3);
  box-shadow:
    inset 0 1px 0 rgba(255, 224, 178, .22),
    inset 0 -4px 7px rgba(0, 0, 0, .34),
    0 3px 0 rgba(12, 6, 4, .5),
    0 7px 16px rgba(0, 0, 0, .42);
  color: #D3BCA3;
  font-size: 11px;
  letter-spacing: .05em;
}
.stat-pill::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 224, 178, .34), transparent);
  pointer-events: none;
}
.stat-pill .mp-icon {
  width: 18px;
  height: 18px;
  color: #F0B072;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5));
}
.stat-pill .gem-ic {
  color: var(--blue);
  filter: drop-shadow(0 0 6px rgba(96, 220, 255, .75));
}
.stat-pill .stat-label { opacity: .8; }
.stat-pill b {
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 800;
  color: #FFE3B5;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 #6B2E0C, 0 0 12px rgba(255, 150, 65, .34);
}
.stat-pill em {
  font-style: normal;
  color: #AE937B;
  font-size: 10px;
}

.skins-link {
  position: relative;
  height: 43px;
  width: min(74vw, 284px);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  color: #F0D8BE;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 196, 132, .13), transparent 62%),
    linear-gradient(180deg, rgba(86, 55, 36, .9), rgba(34, 20, 14, .95));
  border: 1px solid rgba(255, 184, 118, .32);
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 180, .18),
    inset 0 -3px 6px rgba(0, 0, 0, .3),
    0 3px 0 rgba(14, 7, 5, .52),
    0 6px 14px rgba(0, 0, 0, .36);
  transition: transform .12s, background .12s;
}
.skins-link::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 214, 166, .28), transparent);
  pointer-events: none;
}
.skins-link .mp-icon {
  width: 18px;
  height: 18px;
  color: #FFBE7C;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5));
}
.skins-link .skins-arrow {
  width: 15px;
  height: 15px;
  color: #A4896F;
  margin-left: auto;
  margin-right: 11px;
}
.skins-link:active {
  transform: scale(.97);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255, 210, 150, .18), transparent 62%),
    linear-gradient(180deg, rgba(104, 68, 45, .92), rgba(45, 27, 18, .96));
}
.home-tip {
  margin: 0;
  padding: 3px 13px 4px;
  border-radius: 999px;
  color: #C6A98D;
  font-size: 10.5px;
  letter-spacing: .15em;
  text-indent: .15em;
  background: rgba(7, 5, 9, .42);
  border: 1px solid rgba(255, 190, 130, .1);
  text-shadow: 0 1px 2px #000;
}
.home-vignette {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background:
    radial-gradient(ellipse 84% 74% at 50% 46%, transparent 68%, rgba(4, 3, 8, .3) 100%);
}

/* 短屏适配 */
@media (max-height: 720px) {
  .home-logo { top: calc(48px + var(--safe-top)); width: min(85vw, 336px); }
  .home-hero {
    top: 144px;
    height: 340px;
    background-size: 200% auto;
    background-position: 35.05% 100%;
  }
  .start-wrap { right: 4%; bottom: -62px; width: clamp(136px, 37vw, 158px); }
  .home-foot { bottom: calc(8px + var(--safe-bottom)); gap: 7px; }
  .stat-pill { height: 41px; }
  .skins-link { height: 39px; }
  .home-tip { font-size: 10px; }
  .crystal-left { bottom: 72px; width: 96px; }
  .crystal-right { bottom: 90px; }
}
@media (max-height: 720px) {
  .home-hero::before {
    background:
      linear-gradient(180deg,
        #08060D 0%,
        rgba(8, 6, 13, .55) 4%,
        rgba(8, 6, 13, 0) 12%,
        rgba(8, 6, 13, 0) 84%,
        rgba(8, 6, 13, .16) 95%,
        #08060D 100%),
      linear-gradient(90deg,
        #08060D 0%,
        rgba(8, 6, 13, .5) 5%,
        transparent 16%,
        transparent 86%,
        rgba(8, 6, 13, .55) 95%,
        #08060D 100%);
  }
}
@media (max-height: 620px) {
  .home-logo { width: min(77vw, 296px); top: calc(44px + var(--safe-top)); }
  .home-hero { top: 132px; height: 300px; }
  .start-wrap { bottom: -44px; width: 132px; }
  .home-foot { gap: 5px; }
  .stat-pill { height: 39px; }
  .skins-link { height: 37px; }
  .home-tip { display: none; }
  .crystal-left { bottom: 62px; width: 84px; }
  .crystal-right { bottom: 76px; width: 64px; }
}

@media (max-height: 580px) {
  .home-logo { width: min(75vw, 272px); top: calc(40px + var(--safe-top)); }
  .home-hero { top: 124px; height: 280px; }
  .start-wrap { bottom: -18px; width: 116px; }
  .start-wrap::after { bottom: -23px; font-size: 11px; padding: 3px 11px 4px; }
  .home-deck { height: 92px; }
  .home-foot { gap: 4px; }
  .stat-pill { height: 36px; min-width: 118px; }
  .skins-link { height: 34px; }
  .crystal-left { width: 72px; bottom: 50px; }
  .crystal-right { display: none; }
}

/* ============================================================
   游戏画面
   ============================================================ */

.game {
  background: #07060C;
  overflow: hidden;
}
#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hud {
  position: absolute;
  top: calc(8px + var(--safe-top));
  left: 12px;
  right: 12px;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
.hud button { pointer-events: auto; }

.hud-timer {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 19px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 210, 150, .18), transparent 46%),
    linear-gradient(180deg, #4C3222 0%, #2A1912 52%, #1B0F0B 100%);
  border: 1px solid rgba(255, 168, 88, .48);
  box-shadow:
    0 4px 0 rgba(0, 0, 0, .5),
    0 7px 18px rgba(0, 0, 0, .42),
    inset 0 2px 2px rgba(255, 214, 160, .22),
    inset 0 -4px 7px rgba(0, 0, 0, .45);
  overflow: hidden;
}
.hud-timer::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 15px;
  border: 1px solid rgba(255, 205, 145, .12);
  pointer-events: none;
}
.timer-num {
  font-family: var(--font-num);
  font-size: 29px;
  line-height: .92;
  font-weight: 900;
  color: #FFD479;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 #7E3B10, 0 0 14px rgba(255, 172, 74, .5);
  position: relative;
  z-index: 1;
}
.timer-unit {
  margin-top: 2px;
  font-size: 9px;
  letter-spacing: .28em;
  padding-left: .28em;
  color: #B29275;
  position: relative;
  z-index: 1;
}
.hud-timer.urgent {
  border-color: rgba(255, 96, 74, .8);
  box-shadow:
    0 4px 0 rgba(0, 0, 0, .5),
    0 0 22px rgba(255, 72, 48, .4),
    inset 0 2px 2px rgba(255, 190, 160, .22);
}
.hud-timer.urgent .timer-num {
  color: #FF7A5B;
  animation: urgentPulse .55s ease-in-out infinite;
}
@keyframes urgentPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding-top: 2px;
  min-width: 100px;
}
.hud-dist {
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: #D8C3AE;
  font-size: 10px;
  letter-spacing: .04em;
  text-shadow: 0 1px 3px #000, 0 2px 8px #000;
}
.hud-dist span {
  opacity: .8;
  font-size: 10px;
  padding-right: 2px;
}
.hud-dist b {
  font-family: var(--font-num);
  font-size: 23px;
  line-height: 1;
  font-weight: 900;
  color: #FFF4E2;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 #3A1E0D, 0 0 12px rgba(255, 138, 61, .35);
}
.hud-dist em {
  font-style: normal;
  font-size: 10px;
  color: #BFA68E;
}
.danger-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 7px;
}
.danger-dots i {
  display: block;
  width: 19px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .7);
  transition: background .2s, box-shadow .2s;
}
.danger-dots i.on {
  background: linear-gradient(90deg, #FFB347, #FF5B3D);
  box-shadow: 0 0 8px rgba(255, 96, 52, .85), inset 0 1px 1px rgba(255, 255, 255, .35);
}

.hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.gem-chip {
  height: 34px;
  padding: 0 11px 0 9px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(180deg, rgba(28, 48, 64, .92), rgba(11, 22, 30, .94));
  border: 1px solid rgba(105, 220, 255, .32);
  box-shadow:
    inset 0 1px 0 rgba(170, 240, 255, .2),
    0 4px 12px rgba(0, 0, 0, .35),
    0 0 14px rgba(70, 200, 255, .1);
  color: #C8F4FF;
  font-family: var(--font-num);
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.gem-chip .mp-icon {
  width: 16px;
  height: 16px;
  color: #6FE1FF;
  filter: drop-shadow(0 0 5px rgba(90, 220, 255, .8));
}
.gem-chip.pop {
  animation: gemPop .3s var(--ease-back);
}
@keyframes gemPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

.danger-vignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse 72% 66% at 50% 50%, transparent 48%, rgba(255, 46, 26, .3) 82%, rgba(255, 30, 16, .62) 100%),
    linear-gradient(90deg, rgba(255, 60, 26, .24), transparent 26%);
  mix-blend-mode: screen;
  transition: opacity .25s linear;
}

.game-hint {
  position: absolute;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  transform: translateX(-50%) translateY(8px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(10, 8, 16, .64);
  border: 1px solid rgba(255, 172, 100, .2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #E8C8A8;
  font-size: 11.5px;
  letter-spacing: .1em;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s, transform .35s;
}
.game-hint .mp-icon {
  width: 16px;
  height: 16px;
  color: #FFB168;
}
.game-hint.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.countdown {
  position: absolute;
  inset: 0;
  z-index: 14;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .16s;
}
.countdown.show { opacity: 1; }
.count-ring {
  position: absolute;
  width: 172px;
  height: 172px;
  border-radius: 50%;
  border: 1px solid rgba(255, 171, 90, .26);
  box-shadow: 0 0 60px rgba(255, 130, 46, .18), inset 0 0 60px rgba(255, 140, 50, .12);
  animation: ringPulse 1s ease-out infinite;
}
@keyframes ringPulse {
  0% { transform: scale(.72); opacity: .7; }
  100% { transform: scale(1.22); opacity: 0; }
}
#countNum {
  position: relative;
  font-family: var(--font-num);
  font-size: 96px;
  line-height: 1;
  font-weight: 900;
  color: #FFD479;
  text-shadow:
    0 4px 0 #8C3E12,
    0 8px 0 rgba(50, 18, 5, .45),
    0 0 34px rgba(255, 156, 62, .82);
  animation: countPop .7s var(--ease-out);
}
@keyframes countPop {
  0% { transform: scale(1.7); opacity: 0; }
  30% { transform: scale(.92); opacity: 1; }
  55% { transform: scale(1.04); }
  100% { transform: scale(1); opacity: 1; }
}

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(74px + var(--safe-bottom));
  transform: translateX(-50%) translateY(10px);
  z-index: 18;
  max-width: 78vw;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(15, 10, 18, .88);
  border: 1px solid rgba(255, 172, 100, .3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08);
  color: #FFE0B9;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s var(--ease-out);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   弹层
   ============================================================ */

.sheet {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px 16px calc(18px + var(--safe-bottom));
  background: rgba(5, 4, 10, .64);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: fadeIn .18s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100dvh - 36px - var(--safe-top) - var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
  border-radius: 26px;
  padding: 22px 18px calc(16px + var(--safe-bottom));
  background:
    radial-gradient(90% 50% at 50% 0%, rgba(255, 138, 61, .12), transparent 62%),
    linear-gradient(180deg, #3B271B 0%, #211410 44%, #160D0A 100%);
  border: 1px solid rgba(255, 168, 96, .28);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, .72),
    0 2px 0 rgba(255, 196, 132, .12) inset,
    inset 0 -18px 34px rgba(0, 0, 0, .28);
  animation: sheetUp .3s var(--ease-back);
}
@keyframes sheetUp {
  from { transform: translateY(34px) scale(.97); opacity: .2; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.sheet-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 208, 150, .55), transparent);
  pointer-events: none;
}
.sheet-kicker {
  font-size: 10.5px;
  letter-spacing: .24em;
  color: #C08D62;
  text-transform: uppercase;
  margin-bottom: 4px;
  padding-left: 1px;
}
.sheet-title {
  margin: 0;
  font-size: clamp(24px, 7vw, 30px);
  line-height: 1.14;
  font-weight: 900;
  letter-spacing: .03em;
  color: #FFE7C2;
  text-shadow: 0 2px 0 #6B2F12, 0 0 20px rgba(255, 138, 61, .3);
}
.sheet-sub {
  margin: 7px 0 18px;
  color: #A48B77;
  font-size: 12px;
  letter-spacing: .12em;
}
.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.close-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #C7A98C;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 197, 140, .16);
  transition: transform .12s, background .12s;
}
.close-btn:active { transform: scale(.9); background: rgba(255, 255, 255, .12); }
.close-btn .mp-icon { width: 18px; height: 18px; }

.btn-col {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 18px;
}
.btn-row {
  display: flex;
  gap: 9px;
  margin-top: 9px;
}
.btn-row .btn { flex: 1 1 0; }

.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .06em;
  transition: transform .12s var(--ease-out), box-shadow .12s, filter .12s;
  -webkit-user-select: none;
  user-select: none;
}
.btn:active { transform: scale(.975); }

.btn.primary {
  color: #2A1407;
  background: linear-gradient(180deg, #FFD47A 0%, #FFA64C 38%, #F07A2B 72%, #CE5518 100%);
  border: 1px solid rgba(255, 230, 175, .8);
  box-shadow:
    0 5px 0 #7D2F0C,
    0 12px 24px rgba(255, 112, 36, .34),
    inset 0 2px 0 rgba(255, 255, 255, .5),
    inset 0 -3px 6px rgba(120, 40, 8, .28);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .38);
}
.btn.primary:active {
  transform: translateY(3px) scale(.99);
  box-shadow:
    0 2px 0 #7D2F0C,
    0 6px 14px rgba(255, 112, 36, .28),
    inset 0 2px 0 rgba(255, 255, 255, .4);
}
.btn.ghost {
  color: #F0D8C0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03));
  border: 1px solid rgba(255, 190, 130, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 4px 10px rgba(0, 0, 0, .2);
}
.btn.text {
  min-height: 38px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  color: #A38A74;
}
.btn.text:active { color: #D6B89B; }

.ad-btn {
  flex-direction: column;
  gap: 1px;
  min-height: 62px;
  margin-top: 16px;
  color: #2A1407;
  background: linear-gradient(180deg, #C8F4FF 0%, #79D9FF 38%, #35A8E8 100%);
  border: 1px solid rgba(220, 250, 255, .8);
  box-shadow:
    0 5px 0 #155B85,
    0 12px 24px rgba(53, 168, 232, .3),
    inset 0 2px 0 rgba(255, 255, 255, .55);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}
.ad-btn .mp-icon {
  width: 22px;
  height: 22px;
  color: #0E4A6B;
  margin-right: 2px;
}
.ad-btn span {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 16px;
}
.ad-btn small {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  opacity: .7;
}
.ad-btn:disabled {
  filter: grayscale(.7) brightness(.75);
  opacity: .6;
  box-shadow: 0 3px 0 #333, inset 0 1px 0 rgba(255, 255, 255, .2);
}
.ad-btn:disabled:active { transform: none; }

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0 4px;
}
.result-stats > div {
  position: relative;
  min-height: 76px;
  padding: 12px 5px 9px;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(0, 0, 0, .28), rgba(255, 255, 255, .025));
  border: 1px solid rgba(255, 180, 112, .13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.result-stats b {
  font-family: var(--font-num);
  font-size: 25px;
  line-height: 1;
  font-weight: 900;
  color: #FFDFAF;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 #60260C, 0 0 14px rgba(255, 150, 60, .28);
}
.result-stats em {
  font-style: normal;
  font-size: 9px;
  color: #B69374;
  margin-top: 2px;
}
.result-stats span {
  margin-top: 7px;
  font-size: 9.5px;
  letter-spacing: .08em;
  color: #917762;
}
.danger-card .sheet-title { color: #FFD8B0; }
.clear-card .sheet-title { color: #FFE8A8; }

.sheet-how {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 16px;
  color: #8F7663;
  font-size: 10.5px;
  letter-spacing: .06em;
}
.sheet-how span { display: flex; align-items: center; gap: 4px; }
.sheet-how .mp-icon { width: 14px; height: 14px; color: #B98C63; }

/* 皮肤 */
.skin-card { padding-bottom: calc(18px + var(--safe-bottom)); }
.wallet-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  margin: 12px 0 14px;
  color: #9ED9EA;
}
.wallet-line .mp-icon {
  width: 18px;
  height: 18px;
  color: var(--blue);
  align-self: center;
  filter: drop-shadow(0 0 6px rgba(90, 220, 255, .7));
}
.wallet-line b {
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 900;
  color: #DFF9FF;
  font-variant-numeric: tabular-nums;
}
.wallet-line span { font-size: 10px; color: #6E97A4; letter-spacing: .1em; }

.skin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}
.skin-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 11px 8px 10px;
  border-radius: 17px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .065), rgba(0, 0, 0, .16));
  border: 1px solid rgba(255, 186, 120, .13);
  color: #E6D0B5;
  transition: transform .12s, border-color .12s, background .12s;
  overflow: hidden;
}
.skin-item:active { transform: scale(.97); }
.skin-item.equipped {
  border-color: rgba(255, 176, 85, .66);
  background:
    radial-gradient(80% 70% at 50% 20%, rgba(255, 138, 61, .18), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(0, 0, 0, .18));
  box-shadow: 0 0 18px rgba(255, 138, 61, .14), inset 0 1px 0 rgba(255, 220, 170, .2);
}
.skin-item.locked { opacity: .92; }
.skin-preview {
  width: 84px;
  height: 84px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 66%, rgba(255, 176, 90, .16), transparent 62%),
    radial-gradient(circle at 50% 45%, rgba(73, 166, 204, .1), transparent 60%);
}
.skin-preview canvas {
  width: 78px;
  height: 78px;
  display: block;
}
.skin-name {
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .06em;
  color: #F4DEC4;
}
.skin-desc {
  margin-top: 2px;
  font-size: 9px;
  color: #8D7561;
  letter-spacing: .04em;
}
.skin-state {
  margin-top: 7px;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .05em;
  color: #B9DDE5;
  background: rgba(0, 0, 0, .25);
  border: 1px solid rgba(255, 255, 255, .06);
}
.skin-state .mp-icon { width: 11px; height: 11px; }
.skin-item.equipped .skin-state {
  color: #2B1607;
  background: linear-gradient(180deg, #FFCF7A, #FF9A43);
  border-color: rgba(255, 230, 180, .55);
}
.skin-item.locked .skin-state { color: #D8B892; }
.skin-lock {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #C9A47D;
  background: rgba(0, 0, 0, .34);
}
.skin-lock .mp-icon { width: 12px; height: 12px; }
.sheet-note {
  margin: 13px 4px 0;
  text-align: center;
  color: #816B58;
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: .04em;
}

/* 玩法 */
.how-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 16px 0 18px;
}
.how-item {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 11px 12px;
  border-radius: 15px;
  background: rgba(0, 0, 0, .18);
  border: 1px solid rgba(255, 186, 120, .1);
}
.how-ic {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #FFC27A;
  background: linear-gradient(180deg, rgba(255, 170, 90, .16), rgba(255, 140, 50, .05));
  border: 1px solid rgba(255, 180, 110, .2);
}
.how-ic.gem { color: var(--blue); }
.how-ic .mp-icon { width: 20px; height: 20px; }
.how-item b {
  display: block;
  font-size: 13px;
  color: #F2DCC2;
  letter-spacing: .04em;
}
.how-item p {
  margin: 3px 0 0;
  font-size: 10.5px;
  line-height: 1.5;
  color: #927A66;
}

/* 广告加载 */
.ad-mask {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(4, 3, 8, .8);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.ad-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 24px 30px;
  border-radius: 22px;
  background: linear-gradient(180deg, #2B1C14, #150D0A);
  border: 1px solid rgba(120, 220, 255, .28);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6), 0 0 30px rgba(80, 200, 255, .08);
  color: #E6D7C6;
}
.ad-card b { font-size: 14px; letter-spacing: .1em; }
.ad-card small { font-size: 10px; color: #8B7561; letter-spacing: .06em; }
.ad-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(120, 220, 255, .18);
  border-top-color: #6FE1FF;
  animation: spin .8s linear infinite;
  margin-bottom: 4px;
  box-shadow: 0 0 16px rgba(80, 210, 255, .2);
}
@keyframes spin { to { transform: rotate(360deg); } }

.global-toast {
  position: fixed;
  z-index: 60;
}

/* 桌面预览 / 平板：保持手机竖屏画幅居中 */
@media (min-width: 520px) {
  body { background: #05030A; }
  .app {
    left: 50%;
    right: auto;
    width: 480px;
    max-width: 100vw;
    transform: translateX(-50%);
    box-shadow: 0 0 80px rgba(0, 0, 0, .8);
  }
  .home-logo { width: min(88%, 372px); }
  .home-hero { background-size: 225.88% auto; }
  .start-wrap { right: 5%; }
}

@media (prefers-reduced-motion: reduce) {
  .home-logo,
  .start-wrap,
  .start-aura,
  .start-ring,
  .start-stone,
  .home-hero,
  .home-deck,
  .home-crystal,
  .home-foot,
  .home-tools,
  .home-shaft,
  .glow-blue,
  .glow-orange { animation: none; }
  .count-ring { animation: none; opacity: .35; }
}


/* ============================================================
   道具栏（加速 / 护盾）
   ============================================================ */
.power-bar {
  position: absolute;
  left: 12px;
  bottom: calc(14px + var(--safe-bottom));
  z-index: 14;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}
.power-btn {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 118px;
  padding: 7px 12px 7px 7px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(58, 38, 28, .92), rgba(26, 16, 14, .94));
  border: 1.5px solid rgba(255, 178, 102, .5);
  box-shadow:
    0 4px 0 rgba(0, 0, 0, .45),
    0 8px 16px rgba(0, 0, 0, .35),
    inset 0 1px 1px rgba(255, 214, 160, .28),
    inset 0 -3px 5px rgba(0, 0, 0, .42);
  color: #FFE6C4;
  overflow: hidden;
  transition: transform .12s var(--ease-out), opacity .2s, border-color .2s;
}
.power-btn:active { transform: translateY(2px) scale(.96); }
.power-btn .power-ic {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #2A1408;
  background:
    radial-gradient(circle at 34% 28%, #FFD89A 0%, #FF9A45 48%, #E0641B 100%);
  box-shadow:
    inset 0 2px 2px rgba(255, 240, 210, .6),
    inset 0 -3px 5px rgba(140, 52, 10, .55),
    0 0 12px rgba(255, 148, 58, .45);
}
.power-btn.shield .power-ic {
  color: #06233a;
  background:
    radial-gradient(circle at 34% 28%, #CFF4FF 0%, #6FD6FF 48%, #2E86C9 100%);
  box-shadow:
    inset 0 2px 2px rgba(230, 250, 255, .7),
    inset 0 -3px 5px rgba(16, 70, 120, .55),
    0 0 12px rgba(95, 205, 255, .45);
}
.power-btn .power-ic .mp-icon { width: 22px; height: 22px; }
.power-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}
.power-meta b {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .04em;
}
.power-meta small {
  margin-top: 2px;
  font-size: 10.5px;
  color: #E8B988;
  font-weight: 700;
}
.power-btn.shield .power-meta small { color: #9FD8F2; }

/* 生效中：倒计时遮罩 + 高亮 */
.power-btn.active {
  border-color: #FFD479;
  box-shadow:
    0 4px 0 rgba(0, 0, 0, .45),
    0 0 18px rgba(255, 178, 80, .65),
    inset 0 1px 1px rgba(255, 230, 180, .4);
}
.power-btn.shield.active {
  border-color: #9FE4FF;
  box-shadow:
    0 4px 0 rgba(0, 0, 0, .45),
    0 0 18px rgba(95, 205, 255, .65),
    inset 0 1px 1px rgba(220, 245, 255, .4);
}
.power-cd {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 6, 8, .72);
  font-family: var(--font-num);
  font-size: 17px;
  font-weight: 800;
  color: #FFE0A8;
  letter-spacing: .04em;
}
.power-btn.shield .power-cd { color: #BFEAFF; }

/* 用完待广告：弱化 + 广告角标 */
.power-btn.spent {
  opacity: .72;
  border-color: rgba(255, 178, 102, .32);
}
.power-btn.spent .power-meta small::before {
  content: "看广告 ";
  color: #FFD479;
}
.power-btn.shield.spent .power-meta small::before { color: #9FE4FF; }
.power-btn.locked {
  opacity: .45;
}

/* 道具触发时的全屏闪光 */
.power-flash {
  position: absolute;
  inset: 0;
  z-index: 13;
  pointer-events: none;
  opacity: 0;
}
.power-flash.speed {
  background: radial-gradient(60% 60% at 18% 70%, rgba(255, 168, 70, .55), transparent 70%);
  animation: flashSpeed .55s ease-out;
}
.power-flash.shield-flash {
  background: radial-gradient(60% 60% at 18% 70%, rgba(110, 214, 255, .55), transparent 70%);
  animation: flashShield .55s ease-out;
}
@keyframes flashSpeed {
  0% { opacity: 0; }
  22% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes flashShield {
  0% { opacity: 0; }
  22% { opacity: 1; }
  100% { opacity: 0; }
}

/* 玩法说明里的道具图标 */
.how-ic.power {
  background: linear-gradient(180deg, #3A261C, #1A100E);
  border-color: rgba(255, 178, 102, .5);
  color: #FFB45C;
}


/* ============================================================
   加速速度线
   ============================================================ */
.speed-lines {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  transition: opacity .25s ease;
}
.speed-lines.on { opacity: 1; }
.speed-lines::before,
.speed-lines::after {
  content: "";
  position: absolute;
  inset: -20% 0;
  background-image:
    linear-gradient(90deg, transparent 0%, rgba(255, 200, 120, .0) 20%, rgba(255, 200, 120, .55) 50%, transparent 80%),
    linear-gradient(90deg, transparent 0%, rgba(255, 200, 120, .0) 30%, rgba(255, 160, 80, .4) 60%, transparent 90%);
  background-size: 220px 2px, 320px 2px;
  background-repeat: repeat-y;
  background-position: 12% 18%, 78% 64%;
  animation: speedLineMove .28s linear infinite;
}
.speed-lines::after {
  background-image:
    linear-gradient(90deg, transparent 0%, rgba(140, 220, 255, .0) 25%, rgba(140, 220, 255, .4) 55%, transparent 85%);
  background-size: 260px 2px;
  background-position: 45% 42%;
  animation-duration: .22s;
}
@keyframes speedLineMove {
  from { transform: translateX(0); }
  to { transform: translateX(-260px); }
}

/* 加速时画布轻微暖色脉冲 */
#gameCanvas.speed-boost {
  animation: canvasBoost .5s ease-in-out infinite alternate;
}
@keyframes canvasBoost {
  from { filter: saturate(1.1) brightness(1.02); }
  to { filter: saturate(1.35) brightness(1.08); }
}
