/* === Cristalyn Crystal Cup Challenge — Ultimate Animated Version === */

/* === 字体系统定义 === */
:root {
  /* 英文字体 */
  --font-family-en: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  
  /* 中文字体 */
  --font-family-zh: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  
  /* 数字字体 - 使用等宽字体突出显示 */
  --font-family-num: 'DIN Alternate', 'SF Mono', Monaco, 'Courier New', monospace;
  
  /* 标题字体 - 稍粗的字体 */
  --font-family-title: var(--font-family-en), var(--font-family-zh);
  
  /* 字体大小层级 */
  --text-display: 32px;     /* 大标题 */
  --text-h1: 24px;          /* 主标题 */
  --text-h2: 20px;          /* 副标题 */
  --text-h3: 18px;          /* 区域标题 */
  
  /* 内容层级 */
  --text-body-large: 16px;  /* 正文大 */
  --text-body: 14px;        /* 正文标准 */
  --text-body-small: 12px;  /* 正文小/辅助文字 */
  
  /* 转盘专用 */
  --text-wheel: 16px;       /* 转盘上文字 */
  --text-wheel-min: 14px;   /* 转盘最小文字 */
  --text-button: 18px;      /* 按钮文字 */
  --text-number: 20px;      /* 数字强调 */
  
  /* 字重定义 */
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
}

/* 全局 */
body {
  font-family: var(--font-family-zh), var(--font-family-en);
  text-align: center;
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #faf5ff 0%, #e8e4ff 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #222;
}

/* 主容器 */
.challenge-container {
  background: #fff;
  border-radius: 18px;
  padding: 40px;
  width: 90%;
  max-width: 460px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* 标题 */
h1 {
  font-size: var(--text-h1);
  font-family: var(--font-family-title);
  font-weight: var(--font-weight-bold);
  color: #4a35c1;
  text-shadow: 0 0 10px rgba(127, 106, 255, 0.2);
  margin-bottom: 20px;
  line-height: 1.3;
}

/* === 动态进度条与奖励点 === */
.progress-section {
  margin: 20px 0;
  position: relative;
}

.progress-bar-bg {
  width: 100%;
  height: 14px;
  background: #e1e0f5;
  border-radius: 7px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 14px;
  width: 0%;
  background: linear-gradient(90deg, #7f6aff, #00c3ff);
  border-radius: 7px;
  transition: width 0.6s cubic-bezier(.4,0,.2,1);
  animation: pulseGlow 1.5s infinite alternate;
  will-change: width;
}

/* 奖励闪光点 */
.reward-points {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 14px;
  pointer-events: none;
}
.reward-point {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #ffc700;
  box-shadow: 0 0 10px 2px #ffd70099;
  animation: pointPulse 1.2s infinite alternate;
  z-index: 2;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
@keyframes pointPulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.6); }
}
.reward-point.achieved {
  background: linear-gradient(135deg,#ffe066,#ffd700 80%);
  border-color: #ffd700;
  box-shadow: 0 0 16px 4px #ffd700cc;
}

/* 进度条本身闪光动画 */
@keyframes pulseGlow {
  from { filter: brightness(1); }
  to { filter: brightness(1.4); }
}

.progress-info {
  margin-top: 8px;
  font-size: var(--text-body);
  color: #555;
  font-family: var(--font-family-zh), var(--font-family-en);
  font-weight: var(--font-weight-regular);
}

.rewards-list {
  margin-top: 12px;
  font-size: var(--text-body);
  line-height: 1.6;
  font-family: var(--font-family-zh), var(--font-family-en);
  font-weight: var(--font-weight-regular);
}

/* === 转盘区域 === */
.wheel-section {
  margin: 30px 0;
  padding: 20px;
  background: linear-gradient(135deg, rgba(127, 106, 255, 0.1), rgba(0, 195, 255, 0.1));
  border-radius: 16px;
  border: 1px solid rgba(127, 106, 255, 0.2);
}

.wheel-section h2 {
  color: #7f6aff;
  margin-bottom: 8px;
  font-size: 1.5em;
}

.wheel-section p {
  color: #666;
  margin-bottom: 20px;
  font-size: 0.95em;
}

#wheel-container {
  margin: 20px auto;
  position: relative;
  min-height: 420px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.wheel-controls {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin: 20px 0;
}

.spin-button, .daily-reward-button, .game-button {
  background: linear-gradient(90deg, #7f6aff, #00c3ff);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: var(--text-button);
  font-family: var(--font-family-title);
  font-weight: var(--font-weight-bold);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(127, 106, 255, 0.4);
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.spin-button:hover, .daily-reward-button:hover, .game-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(127, 106, 255, 0.5);
}

.spin-button:disabled, .daily-reward-button:disabled, .game-button:disabled {
  filter: grayscale(0.35) brightness(0.93);
  cursor: not-allowed;
  transform: none !important;
}

.daily-reward-button {
  background: linear-gradient(90deg, #ff6b6b, #ffd166);
}

.game-button {
  background: linear-gradient(90deg, #06D6A0, #118AB2);
}

.wheel-info {
  margin-top: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  font-size: 0.9em;
  color: #555;
}

.wheel-info p {
  margin: 5px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* === 游戏区域 === */
.game-section {
  margin: 25px 0;
  padding: 20px;
  background: linear-gradient(135deg, rgba(6, 214, 160, 0.1), rgba(17, 138, 178, 0.1));
  border-radius: 16px;
  border: 1px solid rgba(6, 214, 160, 0.2);
}

.game-section h2 {
  color: #06D6A0;
  margin-bottom: 8px;
  font-size: 1.5em;
}

.game-section p {
  color: #666;
  margin-bottom: 20px;
  font-size: 0.95em;
}

/* === Play 按钮 === */
#play-btn {
  background: linear-gradient(90deg, #7f6aff, #00c3ff);
  color: white;
  padding: 12px 30px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(127, 106, 255, 0.4);
  transition: all 0.2s;
}
#play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(127, 106, 255, 0.5);
}
#play-btn:disabled {
  filter: grayscale(0.35) brightness(0.93);
  cursor: not-allowed;
}

/* === 结果文本 === */
#result {
  margin-top: 18px;
  font-size: 18px;
  color: #333;
  min-height: 32px;
}

/* === 社交分享按钮（品牌色） === */
.share-block, .share-buttons {
  margin-top: 25px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.share-block button,
.share-buttons button {
  color: white;
  border: none;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 90px;
}
.share-block .whatsapp, .share-buttons .whatsapp { background: #25D366; }
.share-block .facebook, .share-buttons .facebook { background: #4267B2; }
.share-block .twitter, .share-buttons .twitter { background: #1DA1F2; }
.share-block .messenger, .share-buttons .messenger { background: #0084FF; }
.share-block .telegram, .share-buttons .telegram { background: #229ED9; }
.share-block .copylink, .share-buttons .copylink { background: #7f6aff; }
.share-block button:hover, .share-buttons button:hover {
  filter: brightness(1.08);
  box-shadow: 0 2px 8px rgba(127, 106, 255, 0.18);
  transform: scale(1.07);
}

/* === 奖励弹窗 === */
.reward-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}
.reward-modal.show {
  display: flex !important;
  animation: fadeIn 0.3s ease;
}
.modal-content {
  background: #fff;
  padding: 25px 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 350px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  animation: popIn 0.4s cubic-bezier(.4,0,.2,1);
  position: relative;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-content button {
  margin-top: 10px;
  background: linear-gradient(90deg, #7f6aff, #00c3ff);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
}
.modal-content button:hover {
  opacity: 0.9;
}
.reward-modal .close-btn {
  position: absolute;
  top: 8px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #b799ff;
  transition: color 0.18s;
}
.reward-modal .close-btn:hover {
  color: #7f6aff;
}

/* === 加载指示器 === */
.loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
  padding: 12px;
  background: rgba(127, 106, 255, 0.1);
  border-radius: 8px;
  color: #7f6aff;
  font-size: 14px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(127, 106, 255, 0.3);
  border-top-color: #7f6aff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === 通知区域 === */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  max-width: 300px;
  animation: slideIn 0.3s ease;
  border-left: 4px solid #7f6aff;
}

.notification.success {
  border-left-color: #4CAF50;
}

.notification.error {
  border-left-color: #f44336;
}

.notification.warning {
  border-left-color: #ff9800;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* === TikTok直播引流区域 === */
.tiktok-section {
  margin: 20px 0;
  background: linear-gradient(135deg, #000 0%, #25F4EE 25%, #FE2C55 50%, #000 75%);
  border-radius: 16px;
  padding: 2px;
  animation: tiktok-glow 3s infinite alternate;
}

.tiktok-banner {
  background: #000;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.tiktok-icon {
  font-size: 48px;
  animation: tiktok-pulse 2s infinite;
}

.tiktok-content {
  flex: 1;
  color: white;
}

.tiktok-content h3 {
  margin: 0 0 8px 0;
  font-size: 1.4em;
  background: linear-gradient(90deg, #25F4EE, #FE2C55);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tiktok-content p {
  margin: 0 0 16px 0;
  opacity: 0.9;
  font-size: 0.95em;
}

.tiktok-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.tiktok-watch, .tiktok-follow {
  padding: 10px 20px;
  border: none;
  border-radius: 50px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.9em;
}

.tiktok-watch {
  background: linear-gradient(90deg, #25F4EE, #FE2C55);
  color: white;
}

.tiktok-follow {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.tiktok-watch:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 244, 238, 0.3);
}

.tiktok-follow:hover {
  background: rgba(255, 255, 255, 0.2);
}

.tiktok-hashtag {
  font-size: 1.1em;
  font-weight: bold;
  color: #25F4EE;
  text-align: center;
  padding: 8px;
  background: rgba(37, 244, 238, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(37, 244, 238, 0.3);
}

@keyframes tiktok-glow {
  0% { box-shadow: 0 0 20px rgba(37, 244, 238, 0.3); }
  50% { box-shadow: 0 0 30px rgba(254, 44, 85, 0.4); }
  100% { box-shadow: 0 0 20px rgba(37, 244, 238, 0.3); }
}

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

/* === 语言选择器 === */
.language-selector {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.lang-dropdown {
  position: relative;
}

.lang-current {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 8px 16px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
  transition: all 0.3s;
}

.lang-current:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lang-flag {
  font-size: 1.2em;
}

.lang-arrow {
  font-size: 0.8em;
  transition: transform 0.3s;
}

.lang-options {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 8px;
  min-width: 160px;
  display: none;
  backdrop-filter: blur(10px);
}

.lang-options.show {
  display: block;
}

.lang-option {
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: white;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lang-option.active {
  background: rgba(127, 106, 255, 0.3);
  color: #b399ff;
}

/* === 响应式适配 === */
@media (max-width:600px) {
  .challenge-container { padding:18px; }
  h1 { font-size:1.18em; }
  .spin-wheel { width:140px;height:140px; }
  .modal-content { padding:14px 6px; }
  .share-block, .share-buttons { gap: 4px; }
  .rewards-list { font-size: 13px; }
  .progress-info { font-size: 13px; }
  .reward-point { width: 14px; height: 14px; }
  .notification {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
  /* TikTok响应式 */
  .tiktok-banner {
    flex-direction: column;
    padding: 15px;
    gap: 15px;
  }
  
  .tiktok-icon {
    font-size: 36px;
  }
  
  .tiktok-actions {
    flex-direction: column;
  }
  
  .tiktok-watch, .tiktok-follow {
    width: 100%;
  }
  
  /* 语言选择器响应式 */
  .language-selector {
    top: 10px;
    right: 10px;
  }
  
  .lang-current {
    padding: 6px 12px;
    font-size: 0.8em;
  }
  
  .lang-options {
    min-width: 140px;
  }
}
/* === 响应式字体调整 === */
/* 移动端 */
@media (max-width: 768px) {
  :root {
    --text-display: 28px;
    --text-h1: 22px;
    --text-h2: 18px;
    --text-body: 14px;
    --text-body-small: 12px;
    --text-wheel: 14px;
    --text-button: 16px;
    --text-number: 18px;
  }
}

/* 小屏手机 */
@media (max-width: 480px) {
  :root {
    --text-display: 24px;
    --text-h1: 20px;
    --text-h2: 16px;
    --text-wheel: 12px;
    --text-button: 14px;
  }
}

/* 大屏优化 */
@media (min-width: 1200px) {
  :root {
    --text-display: 36px;
    --text-h1: 28px;
    --text-wheel: 18px;
    --text-number: 24px;
  }
}

@media (max-width: 600px) {
  .challenge-container {
    padding: 10px 5px;
    max-width: 98vw;
    border-radius: 10px;
  }
  h1 {
    font-size: 1.15em;
    margin-bottom: 14px;
  }
  .progress-section {
    margin: 12px 0;
  }
  .progress-bar-bg {
    height: 10px;
  }
  .reward-point {
    width: 12px;
    height: 12px;
    font-size: 12px;
  }
  .rewards-list {
    font-size: 13px;
    margin-top: 8px;
    line-height: 1.45;
  }
  .spin-wheel {
    width: 140px;
    height: 140px;
    margin: 12px auto 8px auto;
    border-width: 3px;
  }
  .spin-pointer {
    border-left-width: 10px;
    border-right-width: 10px;
    border-bottom-width: 14px;
    top: -14px;
  }
  #play-btn, .spin-area button {
    font-size: 15px;
    padding: 8px 12px;
    margin-top: 8px;
    border-radius: 7px;
  }
  .share-block, .share-buttons {
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 12px;
    justify-content: center;
  }
  .share-block button, .share-buttons button {
    min-width: 65px;
    font-size: 11px;
    padding: 6px 9px;
    border-radius: 4px;
  }
}
