* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0d0518; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; }
body { display: flex; justify-content: center; align-items: center; }
#app-container { width: 100%; max-width: 640px; height: 100%; position: relative; overflow: hidden; background: #1a0b2e; box-shadow: 0 0 40px rgba(0,0,0,0.5); }

/* ===== 星空背景 ===== */
.stars-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.star { position: absolute; background: white; border-radius: 50%; animation: twinkle 2s infinite ease-in-out; }
@keyframes twinkle { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ===== 页面容器 ===== */
.page { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; flex-direction: column; align-items: center; z-index: 1; overflow: hidden; }
.page.active { display: flex; }

/* ===== 通用标题 ===== */
.page-title { margin-top: 6vh; font-size: 28px; font-weight: bold; color: #fff; letter-spacing: 6px; position: relative; z-index: 2; }
.page-title .sparkle { color: #ffd700; animation: sparkle 1.5s infinite; }
@keyframes sparkle { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(0.8); } }

/* ===== 首页 ===== */
#home {
  background: #1a0b2e url('../img/home-bg2-BXW3R7ZW.jpg') no-repeat center top;
  background-size: 100% auto;
  justify-content: flex-start;
}

/* 顶部滚动提示 */
.notice-bar { position: absolute; top: 0; left: 0; width: 100%; padding: 6px 0; background: rgba(0,0,0,0.4); color: #aaa; font-size: 11px; z-index: 10; overflow: hidden; white-space: nowrap; }
.notice-bar .marquee-wrap { display: inline-block; padding-left: 100%; animation: marquee 12s linear infinite; }
.notice-bar .marquee-text { display: inline-block; }
.notice-bar .marquee-text a { color: #aaa; text-decoration: none; margin-left: 30px; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* 开始区域 - 放在背景图提示框下方 */
.start-section { margin-top: auto; padding-bottom: 6vh; text-align: center; width: 100%; position: relative; z-index: 2; }

/* 开始按钮 - 使用图片 + 呼吸动画 */
.start-btn-wrap { display: inline-block; animation: breathe 1s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.1); filter: brightness(1.2); }
}
.start-btn { width: 240px; height: 64px; border: none; background: transparent url('../img/btn-BC3R6w_l.png') no-repeat center; background-size: contain; cursor: pointer; position: relative; }

.agreement { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 6px; color: #a78bfa; font-size: 12px; }
.agreement input { width: 14px; height: 14px; accent-color: #8b5cf6; }
.agreement a { color: #c4b5fd; text-decoration: underline; }

.footer-info { margin-top: 12px; color: #6b5b8a; font-size: 11px; line-height: 1.8; }

/* 在线客服 */
.history-entry { position: absolute; right: 0; bottom: 5%; transform: translateY(-50%); width: 30px; height: 80px; background: rgba(139,92,246,0.3); border-radius: 8px 0 0 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #fff; font-size: 12px; writing-mode: vertical-rl; cursor: pointer; z-index: 100; border: 1px solid rgba(196,181,253,0.2); }

/* ===== 塔罗牌样式 ===== */
.card { width: 60px; height: 110px; border-radius: 8px; position: relative; cursor: pointer; transition: transform 0.3s; }
.card-face { position: absolute; width: 100%; height: 100%; overflow: hidden; transition: transform 0.5s ease-in-out, opacity 0.25s ease-in-out; }
.card-face.back { background: url('../img/card-erld_LHB.png') no-repeat center; background-size: contain; transform: rotateY(0deg); opacity: 1; }
.card-face.front { background-size: cover; background-position: center; background-repeat: no-repeat; transform: rotateY(180deg); opacity: 0; }
.card.flipped .card-face.back { transform: rotateY(180deg); opacity: 0; }
.card.flipped .card-face.front { transform: rotateY(360deg); opacity: 1; }

/* ===== 洗牌页 ===== */
#shuffle {
  background: #1a0b2e url('../img/pay-bg-DgjsjpXk.png') no-repeat center top;
  background-size: 100% auto;
  justify-content: center;
  align-items: center;
}
.shuffle-area { position: relative; width: 300px; height: 300px; }
.shuffle-card { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); }

/* ===== 选牌页 ===== */
#select {
  background: #1a0b2e url('../img/pay-bg-DgjsjpXk.png') no-repeat center top;
  background-size: 100% auto;
  justify-content: flex-start;
  padding-top: 20vh;
}
.select-slots { display: flex; gap: 40px; margin-bottom: 4vh; }
.slot-wrap { display: flex; flex-direction: column; align-items: center; }
.slot { width: 80px; height: 130px; border-radius: 8px; background: rgba(20, 10, 40, 0.7); display: flex; align-items: center; justify-content: center; position: relative; }
.slot.filled { background: transparent; }
.slot-label { color: #d4c4f7; font-size: 13px; margin-top: 8px; font-weight: bold; text-align: center; min-height: 18px; opacity: 0; transition: opacity 0.3s; }
.slot-label span { color: #fee789; margin-left: 4px; }
.select-hint { color: #c186e4; font-size: 20px; text-align: center; line-height: 2.0; margin-bottom: 2vh;font-weight: bold; }
.select-area { position: absolute; bottom: 60px; left: 0; width: 100%; height: 160px; pointer-events: none; }
.select-card { position: absolute; left: 50%; bottom: 0; transform-origin: 50% 1010%; transition: all 0.8s; pointer-events: auto; }
.select-card.fly-to-slot { transition: all 0.6s ease-in-out; }

/* ===== 结果页 ===== */
#result { justify-content: center; align-items: center; text-align: center; padding: 40px; overflow-y: auto; }
.result-title { font-size: 24px; color: #fff; margin-bottom: 20px; }
.result-cards { display: flex; gap: 32px; justify-content: center; margin-bottom: 20px; }
.result-card { width: 100px; text-align: center; }
.result-card img { width: 100%; height: auto; border: 2px solid rgba(255,255,255,0.9); border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); display: block; }
.result-card-name { color: #d4c4f7; font-size: 14px; margin-top: 12px; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 6px; letter-spacing: 1px; }
.card-status { color: #fee789; font-size: 13px; font-weight: normal; }
.result-content { color: #c4b5fd; font-size: 16px; line-height: 2; }
.restart-btn { margin-top: 40px; width: 180px; height: 48px; border: none; border-radius: 24px; background: linear-gradient(90deg, #8b5cf6, #7c3aed); color: #fff; font-size: 16px; cursor: pointer; }

/* 动画 */
@keyframes dealIn { from { opacity: 0; transform: translate(-50%,-50%) scale(0.5) rotate(0deg); } to { opacity: 1; transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(1); } }
@keyframes scatter { 0% { transform: translate(-50%,-50%) rotate(0deg); } 100% { transform: translate(var(--tx), var(--ty)) rotate(var(--rot)); } }

/* ===== 表单 ===== */
#submit1 { display: none; }