/* ===== 全局 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #12121a;
  color: #eee;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}

.step {
  display: none;
  height: 100dvh;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
  text-align: center;
}
.step.active { display: flex; }

.hidden { display: none !important; }

.subtitle { color: #ccc; max-width: 320px; line-height: 1.6; }
.hint { font-size: 1.2rem; }
.status { color: #aaa; }
.error { color: #ff6b6b; max-width: 320px; }

.btn {
  font-size: 1.1rem;
  padding: 14px 40px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: bold;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: #ffd400; color: #000; }
.btn-secondary { background: rgba(40, 40, 50, 0.85); color: #eee; }

.btn-big {
  font-size: 1.25rem;
  line-height: 1.5;
  padding: 16px 36px;
}

.btn-row { display: flex; gap: 16px; }

.video {
  width: 100%;
  max-width: 480px;
  max-height: 60dvh;
  border-radius: 12px;
  background: #000;
}

/* ===== 入场页 ===== */
.intro-bg {
  background:
    linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.35) 40%, rgba(0, 0, 0, 0.7)),
    #4a8f85 url("assets/tree-frame.webp") center / cover no-repeat;
}

.intro-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.title {
  font-size: 2.4rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}

.intro-bg .subtitle {
  color: #eee;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

.big-copy {
  font-size: 1.9rem;
  font-weight: 900;
  color: #ffd400;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.06em;
}

/* ===== 音量条 ===== */
#volume-bar-wrap {
  width: 80%;
  max-width: 320px;
  height: 14px;
  background: #2a2a35;
  border-radius: 7px;
  overflow: hidden;
}
#volume-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffd400, #ff6b6b);
  transition: width 60ms linear;
}

/* ===== 结束页背景 ===== */
.end-bg {
  background:
    linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.25) 40%, rgba(0, 0, 0, 0.6)),
    #4a8f85 url("assets/tree-frame.webp") center / cover no-repeat;
}

/* 手机端加载小图，秒开 */
@media (max-width: 768px) {
  .intro-bg {
    background-image:
      linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.35) 40%, rgba(0, 0, 0, 0.7)),
      url("assets/tree-frame-sm.webp");
  }
  .end-bg {
    background-image:
      linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.25) 40%, rgba(0, 0, 0, 0.6)),
      url("assets/tree-frame-sm.webp");
  }
}

#end-lose, #end-win {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* ===== 未中奖 ===== */
.lose-title {
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.85);
}

.download-link {
  color: #ffd400;
  text-decoration: underline;
  font-size: 1rem;
}

/* ===== 中奖：克制的大字设计 ===== */
.win-title {
  font-size: 2.4rem;
  font-weight: 900;
  color: #f5eeda;
  letter-spacing: 0.06em;
  text-shadow:
    0 0 24px rgba(255, 214, 90, 0.45),
    0 2px 18px rgba(0, 0, 0, 0.8);
  animation: win-in 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.win-sub {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.55em;
  color: rgba(255, 214, 90, 0.75);
  text-indent: 0.55em; /* 抵消末字 letter-spacing 造成的视觉偏移 */
  animation: win-in 0.9s 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

@keyframes win-in {
  0% { opacity: 0; transform: translateY(18px) scale(0.96); filter: blur(6px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* ===== 领取结果 ===== */
#claim-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 92vw;
  background: rgba(0, 0, 0, 0.68);
  border-radius: 12px;
  padding: 22px;
}

#key-box, #curl-box {
  background: #000;
  color: #7ee787;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.75rem;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-all;
  max-width: 100%;
  max-height: 26dvh;
  overflow: auto;
}

.again-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.tiny-note {
  font-size: 0.75rem;
  color: #999;
  max-width: 300px;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .title { font-size: 3rem; }
  .video { max-width: 560px; }
}
