/* ============================================
   MYSTIC AI VAULT — Main Stylesheet
   Champagne Gold Premium Theme
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.cn/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ---- CSS Variables ---- */
:root {
  --champagne: #F7E9CC;
  --cream-gold: #D4AF6A;
  --ivory: #FFF7E8;
  --tech-blue: #5B8DEF;
  --btn-gold: #C98F3A;
  --title-dark: #7A6322;
  --text-body: #4A3F35;
  --text-emphasis: #5B8DEF;
  --card-bg: rgba(255, 252, 245, 0.9);
  --border-gold: rgba(212, 175, 106, 0.3);
  --border-gold-hover: rgba(212, 175, 106, 0.6);
  --shadow-gold: rgba(212, 175, 106, 0.15);
  --modal-overlay: rgba(74, 63, 53, 0.5);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --radius-card: 16px;
  --radius-btn: 12px;
  --radius-modal: 24px;
  --radius-input: 10px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--ivory);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  line-height: 1.6;
}

.font-display { font-family: var(--font-display); }

/* ---- Background Gradient ---- */
.bg-champagne {
  background: linear-gradient(160deg, #FFF7E8 0%, #F7E9CC 25%, #EDDBB3 50%, #F7E9CC 75%, #FFF7E8 100%);
  min-height: 100vh;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--ivory); }
::-webkit-scrollbar-thumb { background: var(--cream-gold); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--btn-gold); }

/* ============================================
   LOADING SCREEN
   ============================================ */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #FFF7E8 0%, #F7E9CC 40%, #EDDBB3 70%, #FFF7E8 100%);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loading-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--title-dark);
  letter-spacing: 0.15em;
  margin-bottom: 2rem;
}
.loading-ring-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 1.5rem;
}
.loading-ring {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}
.loading-ring-bg {
  fill: none;
  stroke: rgba(212, 175, 106, 0.2);
  stroke-width: 6;
}
.loading-ring-progress {
  fill: none;
  stroke: var(--cream-gold);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  animation: progressRing 2s ease-in-out forwards;
}
.loading-percent {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--title-dark);
}
.loading-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.loading-particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,106,0.6), transparent);
  animation: particleConverge 2s ease-in-out forwards;
}
.loading-text {
  font-size: 0.875rem;
  color: var(--title-dark);
  opacity: 0.7;
  letter-spacing: 0.05em;
}

/* ============================================
   FALLING LOGOS (Background)
   ============================================ */
#falling-logos {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.falling-logo {
  position: absolute;
  opacity: 0;
  animation: logoFloat linear forwards;
  will-change: transform, opacity;
}
.falling-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ambient-particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,106,0.4), transparent);
  animation: particleFloat ease-in-out infinite;
  will-change: transform, opacity;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.site-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--title-dark);
  letter-spacing: 0.1em;
}
.lang-switch {
  display: flex;
  gap: 0.25rem;
  background: rgba(255,252,245,0.8);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 0.25rem;
  backdrop-filter: blur(8px);
}
.lang-btn {
  padding: 0.375rem 0.75rem;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  color: var(--title-dark);
}
.lang-btn.active {
  background: linear-gradient(135deg, #D4AF6A, #C98F3A);
  color: white;
}

/* ============================================
   COUNTDOWN SECTION
   ============================================ */
.countdown-section {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}
.countdown-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--title-dark);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.countdown-subtitle {
  font-size: 1rem;
  color: var(--text-body);
  margin-bottom: 2.5rem;
  opacity: 0.85;
}
.countdown-ring-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 1.5rem;
}
.countdown-ring-svg {
  width: 180px;
  height: 180px;
  transform: rotate(-90deg);
}
.countdown-ring-bg {
  fill: none;
  stroke: rgba(212,175,106,0.2);
  stroke-width: 5;
}
.countdown-ring-progress {
  fill: none;
  stroke: var(--cream-gold);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}
.countdown-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--title-dark);
}
.countdown-number.pulse {
  animation: countdownPulse 0.5s ease;
}
.countdown-number.blink {
  animation: countdownBlink 0.5s ease;
}
.countdown-msg {
  font-size: 0.9rem;
  color: var(--text-body);
  min-height: 1.5em;
  opacity: 0.8;
  margin-bottom: 1.5rem;
  transition: opacity 0.3s;
}
.countdown-btn {
  display: inline-block;
  padding: 0.875rem 2.5rem;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  min-height: 48px;
}
.countdown-btn.waiting {
  background: linear-gradient(135deg, #D4C4A0, #C4B48A);
  color: rgba(255,255,255,0.7);
  cursor: not-allowed;
}
.countdown-btn.ready {
  background: linear-gradient(135deg, #D4AF6A, #C98F3A);
  color: white;
  box-shadow: 0 4px 20px rgba(201,143,58,0.3);
}
.countdown-btn.ready:hover {
  background: linear-gradient(135deg, #C98F3A, #B8802E);
  box-shadow: 0 6px 25px rgba(201,143,58,0.5);
  transform: translateY(-1px);
}

/* ============================================
   MARQUEE (Winners Ticker)
   ============================================ */
.marquee-wrapper {
  position: relative;
  z-index: 5;
  overflow: hidden;
  padding: 1rem 0;
  margin: 1rem 0 2rem;
  border-top: 1px solid var(--border-gold);
  border-bottom: 1px solid var(--border-gold);
  background: rgba(255,247,232,0.5);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 30s linear infinite;
}
.marquee-track.paused {
  animation-play-state: paused;
}
.marquee-item {
  flex-shrink: 0;
  padding: 0.5rem 1.5rem;
  margin: 0 0.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-gold);
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--title-dark);
  white-space: nowrap;
  font-weight: 500;
}
.marquee-item::before {
  content: '\2728';
  margin-right: 0.5rem;
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.content-wrapper {
  position: relative;
  z-index: 5;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}
.section-card {
  background: var(--card-bg);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-card);
  padding: 2rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}
.section-card:hover {
  border-color: var(--border-gold-hover);
  box-shadow: 0 8px 30px var(--shadow-gold);
  transform: translateY(-2px);
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--title-dark);
  margin-bottom: 1rem;
}
.section-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-body);
}
.section-text .highlight {
  color: var(--text-emphasis);
  font-weight: 600;
}

/* AI Tool Cards in Content */
.ai-tool-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.ai-tool-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}
.ai-tool-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ai-tool-body { flex: 1; }
.ai-tool-body h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--title-dark);
  margin-bottom: 0.5rem;
}
.ai-tool-body p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-body);
  margin-bottom: 0.75rem;
}
.ai-tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ai-tool-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: rgba(247,233,204,0.6);
  border: 1px solid var(--border-gold);
  border-radius: 100px;
  color: var(--title-dark);
  font-weight: 500;
}

/* Region Cards Grid */
.region-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.region-card {
  background: rgba(247,233,204,0.4);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 1.25rem;
}
.region-card h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--title-dark);
  margin-bottom: 0.5rem;
}
.region-card p {
  font-size: 0.8rem;
  color: var(--text-body);
  line-height: 1.6;
}

/* Steps */
.steps-list {
  list-style: none;
  counter-reset: step;
}
.steps-list li {
  counter-increment: step;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  font-size: 0.95rem;
  color: var(--text-body);
  border-bottom: 1px solid rgba(212,175,106,0.15);
}
.steps-list li:last-child { border-bottom: none; }
.steps-list li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D4AF6A, #C98F3A);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Rules */
.rules-list {
  list-style: none;
}
.rules-list li {
  padding: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-body);
  padding-left: 1.5rem;
  position: relative;
}
.rules-list li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: var(--cream-gold);
  font-weight: 700;
}

/* ============================================
   MODAL OVERLAY
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--modal-overlay);
  backdrop-filter: blur(8px);
  padding: 1rem;
  animation: modalOverlayIn 0.3s ease;
}
.modal-overlay.active {
  display: flex;
}
.modal-content {
  background: linear-gradient(160deg, #FFFDF5, #FFF7E8, #F7E9CC);
  border: 1px solid var(--border-gold-hover);
  border-radius: var(--radius-modal);
  padding: 2rem;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(122,99,34,0.2);
  animation: modalSlideUp 0.4s ease;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(212,175,106,0.15);
  color: var(--title-dark);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover {
  background: rgba(212,175,106,0.3);
}

/* Congratulations Header */
.congrats-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-gold);
}
.congrats-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, #D4AF6A, #C98F3A);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  animation: celebrationPulse 2s ease infinite;
}
.congrats-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--title-dark);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.congrats-subtitle {
  font-size: 0.85rem;
  color: var(--text-body);
  opacity: 0.85;
  line-height: 1.5;
}

/* AI Selection Cards */
.ai-select-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.ai-select-card {
  background: var(--card-bg);
  border: 2px solid var(--border-gold);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
}
.ai-select-card:hover {
  border-color: var(--border-gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--shadow-gold);
}
.ai-select-card.selected {
  border-color: var(--tech-blue);
  box-shadow: 0 0 0 2px var(--tech-blue), 0 4px 15px rgba(91,141,239,0.2);
  transform: scale(1.02);
}
.ai-select-card .check-mark {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--tech-blue);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}
.ai-select-card.selected .check-mark {
  display: flex;
}
.ai-select-card .card-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 0.5rem;
}
.ai-select-card .card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ai-select-card .card-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--title-dark);
  margin-bottom: 0.25rem;
}
.ai-select-card .card-desc {
  font-size: 0.7rem;
  color: var(--text-body);
  line-height: 1.4;
  opacity: 0.8;
}
.ai-select-card .card-tag {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  background: rgba(247,233,204,0.6);
  border-radius: 100px;
  color: var(--title-dark);
  font-weight: 600;
}

/* Modal Buttons */
.modal-btn {
  display: block;
  width: 100%;
  padding: 0.875rem;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  min-height: 48px;
}
.modal-btn.primary {
  background: linear-gradient(135deg, #D4AF6A, #C98F3A);
  color: white;
}
.modal-btn.primary:hover {
  background: linear-gradient(135deg, #C98F3A, #B8802E);
  box-shadow: 0 4px 20px rgba(201,143,58,0.4);
}
.modal-btn.primary:disabled {
  background: linear-gradient(135deg, #D4C4A0, #C4B48A);
  color: rgba(255,255,255,0.7);
  cursor: not-allowed;
}
.modal-btn.secondary {
  background: rgba(247,233,204,0.5);
  color: var(--title-dark);
  border: 1px solid var(--border-gold);
}
.modal-btn.secondary:hover {
  background: rgba(247,233,204,0.8);
}
.modal-btn-row {
  display: flex;
  gap: 0.75rem;
}
.modal-btn-row .modal-btn {
  flex: 1;
}

/* Form */
.form-group {
  margin-bottom: 1rem;
}
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--title-dark);
  margin-bottom: 0.375rem;
}
.form-label .required {
  color: #DC2626;
  margin-left: 0.25rem;
}
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-input);
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--text-body);
  background: rgba(255,255,255,0.8);
  transition: all 0.2s;
  min-height: 48px;
}
.form-input:focus {
  outline: none;
  border-color: var(--cream-gold);
  box-shadow: 0 0 0 3px rgba(212,175,106,0.2);
}
.form-input.error {
  border-color: #DC2626;
}
.form-hint {
  font-size: 0.75rem;
  color: var(--text-body);
  opacity: 0.7;
  margin-top: 0.25rem;
}
.form-error {
  font-size: 0.75rem;
  color: #DC2626;
  margin-top: 0.25rem;
  font-weight: 500;
}

/* Success Modal */
.success-content {
  text-align: center;
  padding: 1.5rem 0;
}
.success-checkmark {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  position: relative;
}
.success-checkmark svg {
  width: 80px;
  height: 80px;
}
.success-circle {
  fill: none;
  stroke: #10B981;
  stroke-width: 3;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: successCircle 0.6s ease forwards 0.2s;
}
.success-check {
  fill: none;
  stroke: #10B981;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: successCheck 0.4s ease forwards 0.6s;
}
.success-ripple {
  position: absolute;
  inset: -10px;
  border: 2px solid rgba(16,185,129,0.3);
  border-radius: 50%;
  animation: successRipple 1.5s ease infinite;
}
.success-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--title-dark);
  margin-bottom: 0.75rem;
}
.success-text {
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* Step visibility */
.modal-step { display: none; }
.modal-step.active { display: block; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes progressRing {
  from { stroke-dashoffset: 283; }
  to { stroke-dashoffset: 0; }
}
@keyframes particleConverge {
  0% { transform: scale(1.5) rotate(0deg); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: scale(0) rotate(360deg); opacity: 0; }
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes countdownPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
@keyframes countdownBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@keyframes logoFloat {
  0% { transform: translateY(-100px) rotate(0deg); opacity: 0; }
  10% { opacity: 0.2; }
  90% { opacity: 0.2; }
  100% { transform: translateY(calc(100vh + 100px)) rotate(360deg); opacity: 0; }
}
@keyframes particleFloat {
  0%, 100% { transform: translateY(0) translateX(0); opacity: 0.3; }
  25% { transform: translateY(-20px) translateX(10px); opacity: 0.6; }
  50% { transform: translateY(-10px) translateX(-10px); opacity: 0.4; }
  75% { transform: translateY(-30px) translateX(5px); opacity: 0.5; }
}
@keyframes modalOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes celebrationPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(212,175,106,0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 20px 10px rgba(212,175,106,0.1); }
}
@keyframes successCircle {
  to { stroke-dashoffset: 0; }
}
@keyframes successCheck {
  to { stroke-dashoffset: 0; }
}
@keyframes successRipple {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .site-header { padding: 1rem; }
  .site-brand { font-size: 1rem; }
  .countdown-section { padding: 2rem 1rem 1.5rem; }
  .countdown-title { font-size: 1.5rem; }
  .countdown-ring-wrapper { width: 150px; height: 150px; }
  .countdown-ring-svg { width: 150px; height: 150px; }
  .countdown-number { font-size: 2.5rem; }
  .content-wrapper { padding: 0 1rem 2rem; }
  .section-card { padding: 1.5rem; }
  .ai-tool-card { flex-direction: column; gap: 0.75rem; }
  .region-grid { grid-template-columns: 1fr; }
  .modal-content { padding: 1.5rem; border-radius: 20px; }
  .ai-select-grid { grid-template-columns: 1fr; }
  .congrats-title { font-size: 1.15rem; }
  .modal-btn-row { flex-direction: column; }
}
