/* Game page - 3-2-1 countdown + main game UI */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #0e1217;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ========== 3-2-1-GO countdown overlay ========== */
.countdown {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0e1217;
  z-index: 10;
}

.countdown-value {
  position: relative;
  z-index: 2;
  font-size: clamp(8rem, 40vw, 18rem);
  font-weight: 700;
  line-height: 1;
  color: #f0e6bd;
  text-shadow:
    0 0 20px #fdf0b0,
    0 0 40px rgba(253, 240, 176, 0.6),
    0 0 60px rgba(253, 240, 176, 0.4);
  user-select: none;
}

.countdown.go .countdown-value {
  font-size: clamp(4rem, 25vw, 10rem);
  letter-spacing: 0.02em;
  color: #fdf0b0;
}

.countdown.hidden {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease-out;
}

/* ========== Game main (after countdown) ========== */
.game-main {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #1a2036;
  overflow: hidden;
}

.game-main.hidden {
  display: none;
}

/* Sparkle / star background - 底层，在水印之下 */
.game-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* 背景小点：像下雪一样往下飘 */
.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  animation: snowFall linear infinite;
}

.sparkle:nth-child(odd) {
  background: rgba(253, 240, 176, 0.6);
}

.s1 { left: 10%; top: -10%; animation-duration: 8s; animation-delay: 0s; }
.s2 { left: 25%; top: -10%; animation-duration: 12s; animation-delay: 0s; width: 3px; height: 3px; }
.s3 { left: 60%; top: -10%; animation-duration: 10s; animation-delay: 0s; }
.s4 { left: 80%; top: -10%; animation-duration: 14s; animation-delay: 0s; width: 3px; height: 3px; }
.s5 { left: 15%; top: -10%; animation-duration: 9s; animation-delay: 0s; }
.s6 { left: 70%; top: -10%; animation-duration: 11s; animation-delay: 0s; }
.s7 { left: 50%; top: -10%; animation-duration: 13s; animation-delay: 0s; width: 3px; height: 3px; }
.s8 { left: 85%; top: -10%; animation-duration: 7s; animation-delay: 0s; }
.s9 { left: 5%; top: -10%; animation-duration: 10.5s; animation-delay: 0s; width: 3px; height: 3px; }
.s10 { left: 35%; top: -10%; animation-duration: 9.5s; animation-delay: 0s; }
.s11 { left: 45%; top: -10%; animation-duration: 11.5s; animation-delay: 0s; }
.s12 { left: 55%; top: -10%; animation-duration: 8.5s; animation-delay: 0s; width: 3px; height: 3px; }
.s13 { left: 65%; top: -10%; animation-duration: 12.5s; animation-delay: 0s; }
.s14 { left: 75%; top: -10%; animation-duration: 7.5s; animation-delay: 0s; }
.s15 { left: 92%; top: -10%; animation-duration: 13.5s; animation-delay: 0s; width: 3px; height: 3px; }
.s16 { left: 20%; top: -10%; animation-duration: 6.5s; animation-delay: 0s; }

@keyframes snowFall {
  0% { transform: translateY(0); opacity: 0.6; }
  10% { opacity: 0.9; }
  90% { opacity: 0.8; }
  100% { transform: translateY(110vh); opacity: 0.5; }
}

/* Header - 图一：深色横幅、细线、小点、上白下金 */
.game-header {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1.5rem 1rem;
  background: #16202c;
  width: 100%;
}

.game-header-line {
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.15) 30%, rgba(255, 255, 255, 0.15) 70%, transparent 100%);
  margin: 0 auto;
}

.game-header-line--top { margin-bottom: 0.6rem; }
.game-header-line--mid { margin: 0.5rem auto; }
.game-header-line--bot { margin-top: 0.5rem; }

.game-header-dot {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.game-header-dot--1 { left: 12%; top: 22%; }
.game-header-dot--2 { left: 78%; top: 35%; }
.game-header-dot--3 { right: 15%; top: 55%; }

.game-offer-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #e8e8e8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

.game-offer-title {
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  font-weight: 700;
  color: #f4c430;
  text-shadow: 0 0 24px rgba(244, 196, 48, 0.5), 0 1px 2px rgba(0, 0, 0, 0.2);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Timer pill - 图二：深蓝底、金图标与数字、轻微立体 */
.game-timer-pill {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: 999px;
  background: #3b4a6c;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.game-timer-icon {
  font-size: 1.15rem;
  color: #f4d06f;
}

.game-timer-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f4d06f;
}

/* Center circle + number */
.game-center-wrap {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 1rem;
}

/* 水印在 game-main 内底层：在背景之上、主内容之下，保证可见 */
.game-watermark {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  font-size: clamp(6rem, 30vw, 14rem);
  font-weight: 800;
  color: rgba(42, 52, 80, 0.5);
  line-height: 1;
  user-select: none;
  pointer-events: none;
  z-index: 1;
}

/* Center circle - 图三：大圆、金边发光、内填深蓝、数字与 GB 金色发光 */
.game-center-circle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: clamp(220px, 65vw, 320px);
  height: clamp(220px, 65vw, 320px);
  border: 3px solid #f4d06f;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 20px rgba(244, 208, 111, 0.25);
}

.game-center-num {
  font-size: clamp(4rem, 22vw, 8rem);
  font-weight: 700;
  color: #f4d06f;
  line-height: 1;
  text-shadow: 0 0 24px rgba(244, 208, 111, 0.5), 0 0 48px rgba(244, 208, 111, 0.25);
}

.game-center-unit {
  font-size: clamp(1.1rem, 4.5vw, 1.6rem);
  font-weight: 700;
  color: #f4d06f;
  margin-top: 0.25rem;
  text-shadow: 0 0 12px rgba(244, 208, 111, 0.4);
}

/* Floating +0.6 ~ +1.5 text */
.game-float-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.game-float-num {
  position: absolute;
  font-size: clamp(1.2rem, 5vw, 1.8rem);
  font-weight: 700;
  color: #fdf0b0;
  text-shadow: 0 0 10px rgba(253, 240, 176, 0.6);
  animation: floatUp 1.2s ease-out forwards;
  white-space: nowrap;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-80px) scale(1.1);
  }
}

/* Swipe CTA */
.game-swipe-cta {
  position: relative;
  z-index: 2;
  text-align: center;
  padding-bottom: 2rem;
}

.game-swipe-arrow {
  display: block;
  font-size: 1.5rem;
  color: #f4c430;
  margin-bottom: 0.25rem;
  animation: swipeArrowBounce 1.2s ease-in-out infinite;
}

@keyframes swipeArrowBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.game-swipe-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.12em;
}

/* ========== 图一/图二：游戏结束弹层 ========== */
.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.6);
}

.popup-overlay.hidden {
  display: none;
}

.popup-result-box {
  width: 100%;
  max-width: 320px;
  padding: 1.75rem 1.5rem;
  background: #1f243b;
  border: 2px solid #f4d03f;
  border-radius: 20px;
  text-align: center;
}

.popup-result-title {
  font-size: 1rem;
  font-weight: 600;
  color: #f4d03f;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.popup-result-value {
  font-size: clamp(2.5rem, 12vw, 3.5rem);
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.popup-result-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.popup-btn {
  display: block;
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

.popup-btn-primary {
  background: #f0c27b;
  color: #1a1a2e;
}

.popup-btn-secondary {
  background: transparent;
  color: #f4d03f;
  border: 2px solid #f4d03f;
}

/* 图二无重试时隐藏 TRY AGAIN */
.popup-result-actions.hide-try-again .popup-btn-secondary {
  display: none;
}

/* ========== 图三：领取页 ========== */
.popup-claim-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  overflow-y: auto;
  background: #0b1120;
  padding: 1rem;
}

.popup-claim-overlay.hidden {
  display: none;
}

.popup-claim-inner {
  max-width: 400px;
  margin: 0 auto 2rem;
}

.popup-claim-reward {
  padding: 1.5rem;
  background: #1f243b;
  border: 2px solid #f4d03f;
  border-radius: 16px;
  text-align: center;
  margin-bottom: 1rem;
}

.popup-claim-head {
  font-size: 0.85rem;
  color: #f4d03f;
  margin-bottom: 0.25rem;
}

.popup-claim-sub {
  font-size: 0.9rem;
  color: #f4d03f;
  margin-bottom: 0.75rem;
}

.popup-claim-value {
  font-size: clamp(2.25rem, 10vw, 3rem);
  font-weight: 700;
  color: #f4d03f;
  text-shadow: 0 0 20px rgba(244, 208, 63, 0.4);
  margin-bottom: 0.35rem;
}

.popup-claim-reserved {
  font-size: 0.75rem;
  color: #b8b8b8;
}

.popup-claim-winners {
  margin-bottom: 1.25rem;
}

.popup-claim-winners-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #e53935;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.popup-claim-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e53935;
}

/* 列表外层：固定高度、隐藏溢出，用于无缝滚动 */
.popup-claim-list-wrap {
  height: 520px;
  overflow: hidden;
  background: #1a1e2e;
  border-radius: 12px;
}

.popup-claim-list-scroll {
  animation: popupClaimScrollUp 35s linear infinite;
}

@keyframes popupClaimScrollUp {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.popup-claim-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
}

.popup-claim-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.6rem;
  border-radius: 8px;
}

.popup-claim-list li + li {
  margin-top: 1px;
}

.winner-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #2d3548;
  flex-shrink: 0;
  display: block;
  object-fit: cover;
}

/* 姓名与 "Just claimed reward" 同一行 */
.winner-info {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  line-height: 1.35;
}

.winner-name {
  font-weight: 700;
  color: #e8e8e8;
}

.winner-status {
  font-weight: 400;
  color: #9e9e9e;
  margin-left: 0.25em;
}

.winner-gb {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f4d03f;
  flex-shrink: 0;
}

.popup-claim-btn {
  display: block;
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #1a1a2e;
  background: #f4d03f;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(244, 208, 63, 0.3);
}

.popup-claim-disclaimer {
  font-size: 0.7rem;
  color: #9e9e9e;
  text-align: center;
  margin-top: 0.75rem;
}
