/* 落地页样式:刻意不走 Tailwind —— 它的输出包在 @layer 里、颜色是 oklch/color-mix,
   老安卓 WebView(Chrome < 99)会整块忽略。这里只用老内核也认的写法:不分层、十六进制颜色、
   flex 而非 gap、vh 兜底再叠 dvh。动画全是 CSS 关键帧:不等 JS 就播;JS 挂了页面照样完整。 */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: #c8161d;
}

.page {
  min-height: 100vh;
  min-height: 100dvh; /* 地址栏收起时跟着长高,底部不露白;不认 dvh 的老内核用上一行 */
  background: #c8161d;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
}

.main {
  position: relative;
  max-width: 28rem;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 8vh 1rem 1.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #1a1a1a;
  background: #c8161d url('../images/home/bg.jpg') no-repeat center bottom;
  background-size: cover;
}

/* ── 三个玩法图标:外层弹入,内层浮动(同一元素上两个 transform 动画会互相覆盖) ── */
.games {
  display: flex;
  width: 100%;
}

.game {
  width: 33.333%;
  padding: 0 0.25rem;
  animation: pop 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.game img {
  display: block;
  width: 100%;
  -webkit-filter: drop-shadow(0 6px 10px rgba(90, 0, 0, 0.45));
  filter: drop-shadow(0 6px 10px rgba(90, 0, 0, 0.45));
  animation: float 2.6s ease-in-out infinite;
}

/* ── 下载按钮:外层上浮入场,内层呼吸 ── */
.downloadWrap {
  width: 78%;
  margin-top: 7vh;
  animation: fade-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.7s both;
}

.download {
  display: block;
  padding: 1rem 0;
  border-radius: 9999px;
  /* 金黄渐变 + 底部深色厚边(立体感) + 顶部内高光;不认渐变的内核落到第一行纯色 */
  background: #ffcf3f;
  background: linear-gradient(180deg, #fff2a8 0%, #ffd23f 45%, #f6a914 100%);
  box-shadow: 0 5px 0 #c26a00, 0 10px 18px rgba(110, 0, 0, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.75);
  color: #a3170c;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: pulse 1.8s ease-in-out 1.4s infinite;
}

/* 按下:厚边变薄。transform 被 pulse 动画占着,只能改 box-shadow 做下压感 */
.download:active {
  box-shadow: 0 2px 0 #c26a00, 0 4px 8px rgba(110, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.75);
}

/* ── 提示文字 ── */
.title {
  margin: 1.5rem 0 0;
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #ffe9a8;
  text-shadow: 0 2px 6px rgba(110, 0, 0, 0.55);
  animation: pop-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 1s both;
}

.desc {
  margin: 0.75rem 0 0;
  padding: 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.625;
  font-weight: 500;
  color: #fff3d6;
  text-shadow: 0 2px 6px rgba(110, 0, 0, 0.55);
}

/* 逐字模糊浮现;每个字的 animation-delay 由 js 内联给出 */
.char {
  display: inline-block;
  animation: blur-in 0.7s ease-out both;
}

/* ── 二维码:弹入 + 外圈光环扩散(首尾都透明,循环无跳变) ── */
.qr {
  position: relative;
  margin-top: 1.5rem;
  animation: pop-qr 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1.4s both;
}

.qr img {
  position: relative;
  display: block;
  width: 11rem;
  height: 11rem;
  padding: 0.25rem;
  border-radius: 0.375rem;
  background: #fefefe;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

.ring {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  bottom: -0.5rem;
  left: -0.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 0 0 3px #ffd75e;
  animation: ring 2s ease-in-out infinite;
}

.footer {
  margin: auto 0 0;
  padding-top: 2.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  animation: fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) 1.8s both;
}

/* ── 流光文字:不支持 background-clip:text 的内核退化成纯色字(不会变透明) ── */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  /* 不用 CSS 变量:Chrome < 49 认 @supports 却不认 var(),会落成透明字。 */
  .shineDark,
  .shineRed,
  .shineGold {
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
  }

  .shineDark {
    background-image: linear-gradient(120deg, #1a1a1a 40%, #ffffff 50%, #1a1a1a 60%);
  }

  .shineRed {
    background-image: linear-gradient(120deg, #a3170c 40%, #fff7d6 50%, #a3170c 60%);
  }

  .shineGold {
    background-image: linear-gradient(120deg, #ffe9a8 40%, #fefefe 50%, #ffe9a8 60%);
  }
}

/* ── 微信引导层 ── */
.guide {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 100%;
  padding: 0.75rem 1.5rem 0;
  border: 0;
  background: rgba(10, 10, 10, 0.85);
  color: #fefefe;
  text-align: right;
  font: inherit;
  animation: fade-in 0.25s ease-out both;
}

.guide[hidden] {
  display: none;
}

.guide svg {
  width: 4.5rem;
  height: 4.5rem;
  margin-right: 0.5rem;
  color: #ffd75e;
  animation: nudge 1.2s ease-in-out infinite;
}

.guideTitle {
  margin: 1rem 0 0;
  font-size: 1.5rem;
  line-height: 1.625;
  font-weight: 600;
}

.guideDesc {
  margin: 0.5rem 0 0;
  font-size: 1rem;
  line-height: 1.625;
  color: rgba(254, 254, 254, 0.75);
}

@keyframes pop {
  0% { opacity: 0; transform: translateY(40px) scale(0.3) rotate(-12deg); }
  60% { opacity: 1; transform: translateY(-4px) scale(1.08) rotate(2deg); }
  80% { transform: translateY(1px) scale(0.97) rotate(-1deg); }
  100% { opacity: 1; transform: none; }
}

@keyframes pop-in {
  0% { opacity: 0; transform: scale(0.6); }
  100% { opacity: 1; transform: none; }
}

@keyframes pop-qr {
  0% { opacity: 0; transform: scale(0.5) rotate(8deg); }
  100% { opacity: 1; transform: none; }
}

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

@keyframes fade-up {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: none; }
}

@keyframes fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes blur-in {
  0% { opacity: 0; filter: blur(10px); transform: translateY(-50px); }
  50% { opacity: 0.5; filter: blur(5px); transform: translateY(5px); }
  100% { opacity: 1; filter: blur(0); transform: none; }
}

@keyframes ring {
  0% { opacity: 0; transform: scale(1); }
  35% { opacity: 0.9; transform: scale(1.08); }
  100% { opacity: 0; transform: scale(1.16); }
}

@keyframes shine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@keyframes nudge {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(6px, -6px); }
}

@media (prefers-reduced-motion: reduce) {
  .page *,
  .guide,
  .guide * {
    animation: none !important;
  }
}
