/* ============================================
   STYLES v4 — Production-Ready
   GPU-accelerated, mobile-first, zero-lag
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #6C63FF;
  --primary-light: #8B83FF;
  --primary-dark: #524AE0;
  --accent: #FF6B6B;
  --accent-light: #FF8E8E;
  --success: #51CF66;
  --warning: #FFA94D;
  --bg-dark: #0e0e24;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --text-primary: #ffffff;
  --text-secondary: #b0b0d0;
  --text-muted: #6b6b8d;
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: all 0.3s var(--ease);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  /* GPU layer for smooth scroll */
  -webkit-overflow-scrolling: touch;
}

#particleCanvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  will-change: contents;
}

.app-container {
  position: relative; z-index: 1;
  max-width: 680px; margin: 0 auto;
  padding: 16px; min-height: 100vh;
  min-height: 100dvh;
  contain: layout style;
}

/* ====== SPONSOR CTA BAR (text-only, dynamic) ====== */
.sponsor-bar {
  display: flex; align-items: center; justify-content: center;
  padding: 10px 16px; margin: -16px -16px 0 -16px;
  background: linear-gradient(90deg, rgba(108,99,255,0.06), rgba(139,92,246,0.06));
  border-bottom: 1px solid rgba(108,99,255,0.1);
}
.sponsor-cta-text {
  font-size: 12px; font-weight: 600;
  color: var(--primary-light);
  transition: opacity 0.3s, transform 0.3s;
  text-align: center;
  letter-spacing: 0.2px;
}

/* ====== HERO ====== */
.hero {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center; padding: 40px 20px;
  animation: heroFadeIn 0.8s ease-out;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(108,99,255,0.15); border: 1px solid rgba(108,99,255,0.3);
  padding: 8px 20px; border-radius: 50px;
  font-size: 13px; font-weight: 500; color: var(--primary-light);
  margin-bottom: 24px;
  animation: slideDown 0.6s ease-out 0.2s both;
}
.hero-emoji {
  font-size: 56px; margin-bottom: 20px;
  animation: bounceIn 0.8s ease-out 0.4s both;
  filter: drop-shadow(0 0 16px rgba(108,99,255,0.25));
}
.hero h1 {
  font-size: 30px; font-weight: 800; line-height: 1.2;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 0%, #c4b5fd 50%, #6C63FF 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: slideUp 0.6s ease-out 0.5s both;
}
.hero h1 .zmap-mark{
  display:inline-block;
  margin-right:4px;
  font-size:1.05em;
  letter-spacing:.02em;
  text-shadow:0 0 16px rgba(139,131,255,.55),0 0 28px rgba(255,107,107,.28);
}
.hero p {
  font-size: 15px; color: var(--text-secondary);
  max-width: 500px; margin-bottom: 28px;
  animation: slideUp 0.6s ease-out 0.6s both;
}
.hero-features {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin-bottom: 36px;
  animation: slideUp 0.6s ease-out 0.7s both;
}
.hero-feature {
  display: flex; align-items: center; gap: 6px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  padding: 7px 14px; border-radius: 50px;
  font-size: 12px; color: var(--text-secondary);
}
.hero-feature span { font-size: 14px; }

.btn-start {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 40px; font-size: 18px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #8B5CF6 100%);
  border: none; border-radius: 50px; cursor: pointer;
  transition: var(--transition);
  animation: slideUp 0.6s ease-out 0.9s both;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(108,99,255,0.35);
  -webkit-tap-highlight-color: transparent;
}
.btn-start:active { transform: scale(0.97); }
.btn-start span { position: relative; z-index: 1; }
.btn-start .btn-arrow { position: relative; z-index: 1; transition: transform 0.3s; }

/* Hero sponsor — single, subtle */
.hero-sponsor {
  display: flex; align-items: center; gap: 8px;
  margin-top: 28px; font-size: 11px; color: var(--text-muted);
  animation: slideUp 0.6s ease-out 1.1s both;
  opacity: 0.7;
}
.hero-sponsor-logo {
  height: 20px; width: auto;
  filter: brightness(1.1) saturate(0.8);
}

/* ====== SECTION ====== */
.section { display: none; animation: fadeIn 0.4s ease-out; }
.section.active { display: block; }

/* ====== PROGRESS ====== */
.progress-container {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,26,0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  padding: 14px 16px; margin: 0 -16px;
}
.progress-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.progress-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.progress-count { font-size: 12px; font-weight: 700; color: var(--primary-light); }
.progress-bar { height: 5px; background: rgba(255,255,255,0.08); border-radius: 10px; overflow: hidden; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #8B5CF6 50%, var(--accent) 100%);
  border-radius: 10px;
  transition: width 0.4s var(--ease);
  width: 0%; position: relative;
  will-change: width;
}
.progress-fill::after {
  content: ''; position: absolute; right: 0; top: -3px;
  width: 10px; height: 10px; background: #fff; border-radius: 50%;
  box-shadow: 0 0 8px var(--primary);
}

/* ====== QUIZ CARD ====== */
.quiz-card {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: 24px 20px; margin-top: 16px;
  box-shadow: var(--glass-shadow);
  animation: cardSlideIn 0.4s ease-out;
  contain: content;
}
.quiz-card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.quiz-emoji { font-size: 32px; animation: emojiPop 0.4s ease-out 0.1s both; flex-shrink: 0; }
.quiz-question-num { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--primary-light); margin-bottom: 4px; }
.quiz-question { font-size: 18px; font-weight: 700; line-height: 1.4; color: var(--text-primary); }

/* ======= CARDS GRID ======= */
.cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-option {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 20px 10px;
  background: rgba(255,255,255,0.03); border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius); cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  text-align: center; -webkit-tap-highlight-color: transparent;
  animation: cardSlideIn 0.35s ease-out both;
  will-change: transform;
}
.card-option:nth-child(1) { animation-delay: 0s; }
.card-option:nth-child(2) { animation-delay: 0.08s; }
.card-option:nth-child(3) { animation-delay: 0.16s; }
.card-option:nth-child(4) { animation-delay: 0.24s; }
.card-icon { font-size: 36px; transition: transform 0.2s; }
.card-text { font-size: 13px; font-weight: 600; color: var(--text-secondary); transition: color 0.2s; }
.card-option:active { transform: scale(0.96); }
.card-option.selected { background: rgba(108,99,255,0.14); border-color: var(--primary); box-shadow: 0 0 20px rgba(108,99,255,0.15); }
.card-option.selected .card-text { color: var(--text-primary); }
.card-option.selected .card-icon { transform: scale(1.08); }

/* ======= BUBBLES ======= */
.bubbles-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding: 8px 0; }
.bubble-option {
  width: 120px; height: 120px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  border: 2px solid rgba(255,255,255,0.1); cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  animation: bubbleFloat 0.5s ease-out both;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}
.bubble-icon { font-size: 30px; transition: transform 0.2s; }
.bubble-text { font-size: 10px; font-weight: 600; color: var(--text-secondary); text-align: center; padding: 0 6px; line-height: 1.3; }
.bubble-option:active { transform: scale(0.95); }
.bubble-option.selected { border-color: var(--primary); background: radial-gradient(circle at 30% 30%, rgba(108,99,255,0.2), rgba(108,99,255,0.08)); box-shadow: 0 0 24px rgba(108,99,255,0.2); transform: scale(1.03); }
.bubble-option.selected .bubble-icon { transform: scale(1.15); }
.bubble-option.selected .bubble-text { color: var(--text-primary); }

/* ======= VERSUS ======= */
.versus-container { display: flex; flex-direction: column; gap: 10px; }
.versus-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.versus-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 20px 10px;
  background: rgba(255,255,255,0.03); border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius); cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  text-align: center; -webkit-tap-highlight-color: transparent;
  animation: cardSlideIn 0.4s ease-out both;
  will-change: transform;
}
.versus-icon { font-size: 40px; transition: transform 0.2s; }
.versus-text { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.versus-subtitle { font-size: 10px; color: var(--text-muted); line-height: 1.4; }
.versus-card:active { transform: scale(0.96); }
.versus-card.selected { background: rgba(108,99,255,0.12); border-color: var(--primary); box-shadow: 0 4px 20px rgba(108,99,255,0.15); }
.versus-card.selected .versus-icon { transform: scale(1.1) rotate(3deg); }
.versus-divider { text-align: center; color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; padding: 2px 0; }
.versus-divider span { background: rgba(108,99,255,0.12); padding: 3px 14px; border-radius: 50px; }

/* ======= RANKING ======= */
.ranking-instruction { text-align: center; font-size: 12px; color: var(--text-muted); margin-bottom: 10px; font-weight: 500; }
.ranking-list { display: flex; flex-direction: column; gap: 8px; }
.ranking-item {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 14px;
  background: rgba(255,255,255,0.03); border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  animation: slideRight 0.35s ease-out both;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}
.ranking-item:nth-child(1) { animation-delay: 0s; }
.ranking-item:nth-child(2) { animation-delay: 0.08s; }
.ranking-item:nth-child(3) { animation-delay: 0.12s; }
.ranking-item:nth-child(4) { animation-delay: 0.16s; }
.ranking-icon { font-size: 28px; min-width: 36px; text-align: center; transition: transform 0.2s; }
.ranking-text { flex: 1; font-size: 15px; font-weight: 600; color: var(--text-secondary); transition: color 0.2s; }
.ranking-badge { font-size: 9px; font-weight: 800; color: var(--primary-light); background: rgba(108,99,255,0.15); padding: 3px 10px; border-radius: 50px; text-transform: uppercase; letter-spacing: 1px; transition: background 0.2s, color 0.2s; }
.ranking-item:active { transform: scale(0.98); }
.ranking-item.selected { background: rgba(108,99,255,0.1); border-color: var(--primary); }
.ranking-item.selected .ranking-text { color: var(--text-primary); }
.ranking-item.selected .ranking-icon { transform: scale(1.15) rotate(-3deg); }
.ranking-item.selected .ranking-badge { background: var(--primary); color: #fff; }

/* ======= SCENARIO ======= */
.scenario-scene { text-align: center; font-size: 15px; color: var(--text-muted); margin-bottom: 14px; padding: 14px; background: rgba(255,255,255,0.03); border-radius: var(--radius-sm); font-style: italic; animation: fadeIn 0.5s ease-out; }
.scenario-options { display: flex; flex-direction: column; gap: 8px; }
.scenario-option {
  padding: 14px;
  background: rgba(255,255,255,0.03); border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  animation: slideRight 0.35s ease-out both;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}
.scenario-option:nth-child(1) { animation-delay: 0.05s; }
.scenario-option:nth-child(2) { animation-delay: 0.1s; }
.scenario-option:nth-child(3) { animation-delay: 0.15s; }
.scenario-option:nth-child(4) { animation-delay: 0.2s; }
.scenario-option-header { display: flex; align-items: center; gap: 10px; margin-bottom: 3px; }
.scenario-icon { font-size: 22px; }
.scenario-text { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.scenario-detail { font-size: 11px; color: var(--text-muted); padding-left: 32px; line-height: 1.5; }
.scenario-option:active { transform: scale(0.98); }
.scenario-option.selected { background: rgba(108,99,255,0.1); border-color: var(--primary); }

/* ======= SLIDER ======= */
.slider-labels { display: flex; justify-content: space-between; margin-bottom: 14px; }
.slider-labels span { font-size: 11px; color: var(--text-muted); font-weight: 600; background: rgba(255,255,255,0.05); padding: 3px 10px; border-radius: 50px; }
.slider-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slider-option {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 18px 10px;
  background: rgba(255,255,255,0.03); border: 2px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  text-align: center; animation: fadeIn 0.35s ease-out both;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}
.slider-icon { font-size: 32px; transition: transform 0.2s; }
.slider-text { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.slider-option:active { transform: scale(0.96); }
.slider-option.selected { background: rgba(108,99,255,0.14); border-color: var(--primary); box-shadow: 0 0 16px rgba(108,99,255,0.15); }
.slider-option.selected .slider-icon { transform: scale(1.15); }
.slider-option.selected .slider-text { color: var(--text-primary); }

/* ====== STANDARD ANSWERS ====== */
.answers-list { display: flex; flex-direction: column; gap: 10px; }
.answer-option {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03); border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.answer-option:active { transform: scale(0.98); }
.answer-option.selected { background: rgba(108,99,255,0.12); border-color: var(--primary); }
.answer-radio { width: 20px; height: 20px; min-width: 20px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; transition: border-color 0.2s, background 0.2s; }
.answer-option.selected .answer-radio { border-color: var(--primary); background: var(--primary); }
.answer-option.selected .answer-radio::after { content: '✓'; color: #fff; font-size: 11px; font-weight: 700; }
.answer-label { display: inline-block; background: rgba(108,99,255,0.2); color: var(--primary-light); font-size: 11px; font-weight: 700; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 6px; min-width: 22px; }
.answer-text { font-size: 14px; color: var(--text-secondary); transition: color 0.2s; flex: 1; }
.answer-option.selected .answer-text { color: var(--text-primary); }

/* ====== INTEREST (Q11) ====== */
.interest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.interest-option {
  padding: 11px 12px;
  background: rgba(255,255,255,0.03); border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center; font-size: 12px; color: var(--text-secondary);
  -webkit-tap-highlight-color: transparent;
}
.interest-option:active { transform: scale(0.97); }
.interest-option.selected { background: rgba(108,99,255,0.14); border-color: var(--primary); color: var(--text-primary); font-weight: 600; }
.interest-subtitle { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; font-style: italic; }
.interest-custom { margin-top: 10px; }
.interest-custom input { width: 100%; padding: 12px 14px; background: rgba(255,255,255,0.05); border: 1.5px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm); color: var(--text-primary); font-family: var(--font); font-size: 14px; transition: border-color 0.2s; outline: none; }
.interest-custom input:focus { border-color: var(--primary); box-shadow: 0 0 12px rgba(108,99,255,0.15); }
.interest-custom input::placeholder { color: var(--text-muted); }

/* ====== NEXT BUTTON ====== */
.btn-next {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px; margin-top: 18px;
  font-size: 15px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--primary), #8B5CF6);
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  opacity: 0.35; pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-next.enabled { opacity: 1; pointer-events: auto; }
.btn-next.enabled:active { transform: scale(0.97); }

/* ====== ANALYSIS ====== */
.analysis-container { min-height: 60vh; min-height: 60dvh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 40px 20px; }
.analysis-brain { position: relative; margin-bottom: 28px; }
.brain-icon { font-size: 64px; display: block; animation: brainFloat 2s ease-in-out infinite; }
.brain-pulse { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 90px; height: 90px; border-radius: 50%; background: rgba(108,99,255,0.18); animation: pulse 1.5s ease-in-out infinite; will-change: transform, opacity; }
.analysis-title { font-size: 22px; font-weight: 700; margin-bottom: 22px; background: linear-gradient(90deg, var(--primary-light), var(--accent-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.analysis-progress { width: 100%; max-width: 300px; height: 7px; background: rgba(255,255,255,0.08); border-radius: 10px; overflow: hidden; margin-bottom: 22px; }
.analysis-progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 10px; width: 0%; transition: width 0.4s ease; will-change: width; }
.analysis-step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); min-height: 28px; }
.step-animate { animation: stepFadeIn 0.3s ease-out; }
.step-icon { font-size: 16px; }
.analysis-dots { display: flex; gap: 5px; margin-top: 18px; }
.analysis-dots span { width: 7px; height: 7px; background: var(--primary); border-radius: 50%; animation: dotBounce 1.4s ease-in-out infinite; will-change: transform; }
.analysis-dots span:nth-child(2) { animation-delay: 0.2s; }
.analysis-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ====== FORM ====== */
.form-section { padding: 20px 0; }
.form-header { text-align: center; margin-bottom: 28px; }
.form-header h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; background: linear-gradient(135deg, #fff, var(--primary-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.form-header p { font-size: 13px; color: var(--text-secondary); }
.form-lock-info { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; font-size: 11px; color: var(--text-muted); }
.form-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 22px 18px; }
.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }
.form-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 7px; }
.required-star { color: #FF6B6B; font-size: 16px; font-weight: 700; line-height: 1; }
.form-input { width: 100%; padding: 13px 14px; background: rgba(255,255,255,0.05); border: 1.5px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm); color: var(--text-primary); font-family: var(--font); font-size: 15px; transition: border-color 0.2s; outline: none; -webkit-appearance: none; }
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 12px rgba(108,99,255,0.15); }
.form-input::placeholder { color: var(--text-muted); }
.form-input.error { border-color: var(--accent); }
.form-error { font-size: 11px; color: var(--accent); margin-top: 5px; display: none; }
.form-error.show { display: block; animation: shakeX 0.35s ease-out; }

.interest-display-value { display: flex; align-items: center; gap: 8px; padding: 13px 14px; background: rgba(108,99,255,0.08); border: 1.5px solid rgba(108,99,255,0.2); border-radius: var(--radius-sm); color: var(--primary-light); font-size: 14px; font-weight: 600; }
.interest-check { color: var(--success); font-weight: 800; font-size: 16px; }

.btn-submit {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 15px; margin-top: 22px;
  font-size: 16px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--success), #40C057);
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
  box-shadow: 0 4px 18px rgba(81,207,102,0.25);
  -webkit-tap-highlight-color: transparent;
}
.btn-submit:active { transform: scale(0.97); }

/* ====== RESULT ====== */
.result-section { padding: 20px 0 40px; text-align: center; }
.result-header { margin-bottom: 24px; }
.result-header h2 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.result-header p { font-size: 13px; color: var(--text-secondary); }
.result-main-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 26px 20px; margin-bottom: 16px; text-align: center; animation: resultCardIn 0.6s ease-out; contain: content; }
.result-icon { font-size: 56px; display: block; margin-bottom: 14px; animation: emojiPop 0.5s ease-out 0.2s both; }
.result-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.result-subtitle { font-size: 13px; color: var(--primary-light); margin-bottom: 14px; font-weight: 500; }
.result-description { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 20px; }
.result-match { display: inline-flex; align-items: center; gap: 8px; background: rgba(108,99,255,0.1); border: 1px solid rgba(108,99,255,0.2); padding: 10px 22px; border-radius: 50px; margin-bottom: 20px; }
.result-match-label { font-size: 12px; color: var(--text-secondary); }
.result-match-value { font-size: 26px; font-weight: 800; color: var(--primary-light); }
.result-careers { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 14px; }
.career-tag { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); padding: 5px 12px; border-radius: 50px; font-size: 11px; color: var(--text-secondary); }
.result-stats { margin-top: 20px; }
.stat-item { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.stat-label { font-size: 11px; color: var(--text-secondary); min-width: 85px; text-align: left; }
.stat-bar-container { flex: 1; height: 7px; background: rgba(255,255,255,0.05); border-radius: 10px; overflow: hidden; }
.stat-bar { height: 100%; border-radius: 10px; transition: width 1.2s var(--ease); width: 0%; will-change: width; }
.stat-value { font-size: 12px; font-weight: 700; min-width: 36px; text-align: right; }
.result-others { margin-top: 16px; }
.result-others h3 { font-size: 15px; font-weight: 700; margin-bottom: 10px; text-align: left; }
.other-result-card { display: flex; align-items: center; gap: 10px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px; }
.other-icon { font-size: 24px; min-width: 32px; }
.other-info { flex: 1; text-align: left; }
.other-name { font-size: 13px; font-weight: 600; }
.other-desc { font-size: 10px; color: var(--text-muted); }
.other-percent { font-size: 15px; font-weight: 700; color: var(--primary-light); }
.result-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.meta-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: 14px; text-align: center; }
.meta-card-icon { font-size: 22px; display: block; margin-bottom: 6px; }
.meta-card-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 3px; }
.meta-card-value { font-size: 14px; font-weight: 700; }
/* btn-retake: unified in RESULT ACTION BUTTONS section below */

/* ====== SAVED BANNER ====== */
.saved-banner { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; margin-bottom: 18px; background: rgba(108,99,255,0.08); border: 1px solid rgba(108,99,255,0.18); border-radius: var(--radius-sm); font-size: 13px; color: var(--primary-light); font-weight: 500; animation: slideDown 0.4s ease-out; }

/* ====== RETAKE PROMPT ====== */
.retake-prompt { margin-top: 24px; padding: 22px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius); text-align: center; }
.retake-prompt p { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 14px; }
.btn-retake-new { display: inline-flex; align-items: center; gap: 8px; padding: 13px 30px; font-size: 14px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--primary), #8B5CF6); border: none; border-radius: 50px; cursor: pointer; transition: transform 0.15s; box-shadow: 0 4px 18px rgba(108,99,255,0.25); -webkit-tap-highlight-color: transparent; }
.btn-retake-new:active { transform: scale(0.97); }

/* ====== REVEAL — Airplane Delivery ====== */
.reveal-container { min-height: 60vh; min-height: 60dvh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 40px 20px; position: relative; overflow: hidden; }
.reveal-text { font-size: 15px; color: var(--text-secondary); margin-top: 18px; font-weight: 500; animation: fadeIn 0.5s ease-out; }
.reveal-done { font-size: 20px; font-weight: 800; color: var(--text-primary); }

/* Airplane flying */
.reveal-airplane { font-size: 56px; animation: airplaneFly 1.6s ease-in-out forwards; will-change: transform; filter: drop-shadow(0 4px 12px rgba(108,99,255,0.3)); }
@keyframes airplaneFly {
  0% { transform: translateX(-120px) translateY(40px) rotate(-15deg) scale(0.6); opacity: 0; }
  20% { opacity: 1; }
  50% { transform: translateX(20px) translateY(-10px) rotate(-5deg) scale(1.1); }
  80% { transform: translateX(10px) translateY(0px) rotate(0deg) scale(1); }
  100% { transform: translateX(0) translateY(0) rotate(0deg) scale(1); opacity: 1; }
}

/* Trail behind airplane */
.reveal-trail { position: absolute; top: 50%; left: 0; width: 60%; height: 2px; background: linear-gradient(90deg, transparent, rgba(108,99,255,0.3), transparent); animation: trailFade 1.6s ease-out forwards; will-change: opacity; }
@keyframes trailFade { 0% { opacity: 0; transform: translateX(-100%); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateX(50%); } }

/* Loading bar */
.reveal-loading-bar { width: 200px; height: 4px; background: rgba(255,255,255,0.08); border-radius: 10px; overflow: hidden; margin-top: 18px; }
.reveal-loading-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 10px; animation: loadingFill 1.6s ease-in-out forwards; will-change: width; }
@keyframes loadingFill { 0% { width: 0; } 100% { width: 100%; } }

/* Envelope arrives */
.reveal-envelope-arrive { font-size: 64px; animation: envelopeDrop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; will-change: transform; }
@keyframes envelopeDrop { 0% { transform: translateY(-60px) scale(0.5); opacity: 0; } 100% { transform: translateY(0) scale(1); opacity: 1; } }

/* Glow ring behind envelope */
.reveal-glow-ring { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -55%); width: 120px; height: 120px; border-radius: 50%; border: 2px solid rgba(108,99,255,0.2); animation: glowExpand 1s ease-out infinite; will-change: transform, opacity; }
@keyframes glowExpand { 0% { transform: translate(-50%,-55%) scale(0.8); opacity: 0.5; } 100% { transform: translate(-50%,-55%) scale(1.6); opacity: 0; } }

/* Flash */
.reveal-flash { position: fixed; inset: 0; background: rgba(108,99,255,0.1); animation: revealFlash 0.4s ease-out forwards; z-index: 9999; pointer-events: none; }
@keyframes revealFlash { 0% { opacity: 1; } 100% { opacity: 0; } }

/* Sparkle */
.reveal-sparkle { font-size: 72px; animation: bounceIn 0.5s ease-out; }

/* ====== FOOTER ====== */
.app-footer { padding: 24px 16px; margin-top: 16px; border-top: 1px solid rgba(255,255,255,0.06); text-align: center; }
.footer-sponsor { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; }
.footer-sponsor-logo { height: 28px; width: auto; opacity: 0.55; filter: brightness(1.1); }
.footer-sponsor span { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.footer-copyright { font-size: 11px; color: var(--text-muted); }
.footer-copyright a { color: var(--primary-light); text-decoration: none; font-weight: 600; transition: color 0.2s; }

/* ====== ENCOURAGE TOAST ====== */
.encourage-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(108,99,255,0.15); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(108,99,255,0.25); border-radius: 50px;
  padding: 10px 22px; font-size: 13px; font-weight: 600; color: var(--primary-light);
  z-index: 10001; pointer-events: none; opacity: 0;
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
  white-space: nowrap; max-width: 90vw; text-overflow: ellipsis; overflow: hidden;
  box-shadow: 0 4px 20px rgba(108,99,255,0.2);
}
.encourage-toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ====== POLICY CHECKBOX ====== */
.form-policy { margin-top: 14px; }
.policy-label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.policy-label input[type="checkbox"] { width: 16px; height: 16px; min-width: 16px; margin-top: 2px; accent-color: var(--primary); cursor: pointer; }
.policy-text { font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.policy-text a { color: var(--primary-light); text-decoration: underline; font-weight: 600; }

/* ====== POLICY POPUP ====== */
.policy-overlay { position: fixed; inset: 0; z-index: 20000; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; transition: opacity 0.3s ease; }
.policy-overlay.show { opacity: 1; }
.policy-popup { background: #1a1a3e; border: 1px solid rgba(108,99,255,0.2); border-radius: var(--radius); max-width: 500px; width: 100%; max-height: 80vh; overflow-y: auto; padding: 24px 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); transform: scale(0.9) translateY(20px); transition: transform 0.3s ease; }
.policy-overlay.show .policy-popup { transform: scale(1) translateY(0); }
.policy-popup-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.policy-popup-header h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.policy-close { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: background 0.2s; }
.policy-close:hover { background: rgba(255,255,255,0.1); }
.policy-popup-body { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.policy-popup-body p { margin-bottom: 10px; }
.policy-popup-body strong { color: var(--text-primary); font-weight: 600; }
.policy-popup-body a { color: var(--primary-light); text-decoration: underline; }
.policy-accept { display: block; width: 100%; padding: 12px; margin-top: 18px; font-size: 14px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--primary), #8B5CF6); border: none; border-radius: var(--radius-sm); cursor: pointer; transition: transform 0.15s; }
.policy-accept:active { transform: scale(0.97); }

/* ====== RESULT ACTION BUTTONS (unified) ====== */
.btn-share-fb, .btn-retake { display: inline-flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; padding: 13px 28px; font-size: 14px; font-weight: 700; color: #fff; border: none; border-radius: 50px; cursor: pointer; transition: transform 0.15s, box-shadow 0.2s, background 0.2s; -webkit-tap-highlight-color: transparent; width: 100%; max-width: 320px; }
.btn-share-fb { background: linear-gradient(135deg, #1877F2, #0d65d9); box-shadow: 0 4px 18px rgba(24,119,242,0.25); }
.btn-retake { background: linear-gradient(135deg, var(--primary), #8B5CF6); box-shadow: 0 4px 18px rgba(108,99,255,0.25); }
.btn-share-fb:active, .btn-retake:active { transform: scale(0.97); }
.btn-share-fb svg { flex-shrink: 0; }

/* ====== MOTIVATIONAL TEXT ====== */
.analysis-motivation, .reveal-motivation { margin-top: 18px; font-size: 14px; font-weight: 500; color: var(--primary-light); text-align: center; min-height: 24px; transition: opacity 0.3s ease, transform 0.3s ease; opacity: 0; line-height: 1.5; padding: 0 10px; }

.hidden { display: none !important; }

/* ====== KEYFRAMES ====== */
@keyframes heroFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideRight { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes bounceIn { 0% { opacity: 0; transform: scale(0.4); } 50% { transform: scale(1.08); } 70% { transform: scale(0.95); } 100% { opacity: 1; transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cardSlideIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes emojiPop { 0% { opacity: 0; transform: scale(0) rotate(-10deg); } 60% { transform: scale(1.15) rotate(3deg); } 100% { opacity: 1; transform: scale(1) rotate(0deg); } }
@keyframes brainFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse { 0% { transform: translate(-50%,-50%) scale(1); opacity: 0.4; } 100% { transform: translate(-50%,-50%) scale(1.8); opacity: 0; } }
@keyframes bubbleFloat { 0% { opacity: 0; transform: scale(0.6) translateY(16px); } 60% { transform: scale(1.03) translateY(-4px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes stepFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dotBounce { 0%,80%,100% { transform: translateY(0); } 40% { transform: translateY(-8px); } }
@keyframes confettiFall { 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 100% { transform: translateY(100vh) rotate(600deg); opacity: 0; } }
@keyframes shakeX { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@keyframes resultCardIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

.pulse-effect { animation: pulseEffect 0.5s ease-out; }
@keyframes pulseEffect { 0% { box-shadow: 0 0 0 0 rgba(108,99,255,0.35); } 100% { box-shadow: 0 0 0 12px rgba(108,99,255,0); } }

/* ====== MOBILE-FIRST RESPONSIVE ====== */
@media (max-width: 480px) {
  .app-container { padding: 10px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 14px; padding: 0 4px; }
  .hero-emoji { font-size: 48px; }
  .btn-start { padding: 14px 32px; font-size: 16px; }
  .quiz-question { font-size: 16px; }
  .quiz-card { padding: 18px 14px; margin-top: 12px; }
  .card-option { padding: 16px 8px; }
  .card-icon { font-size: 30px; }
  .card-text { font-size: 12px; }
  .bubble-option { width: 105px; height: 105px; }
  .bubble-icon { font-size: 24px; }
  .bubble-text { font-size: 9px; }
  .versus-icon { font-size: 34px; }
  .versus-text { font-size: 13px; }
  .versus-subtitle { font-size: 9px; }
  .ranking-icon { font-size: 24px; }
  .ranking-text { font-size: 13px; }
  .interest-option { font-size: 11px; padding: 9px 6px; }
  .result-title { font-size: 20px; }
  .result-icon { font-size: 48px; }
  .result-match-value { font-size: 22px; }
  .result-meta { grid-template-columns: 1fr; }
  .sponsor-cta-text { font-size: 11px; }
  .progress-container { padding: 12px 14px; }
  .form-card { padding: 18px 14px; }
  .reveal-countdown { font-size: 72px; }
  .envelope-body { font-size: 56px; }
}

@media (max-width: 360px) {
  .hero h1 { font-size: 22px; }
  .hero-emoji { font-size: 40px; }
  .cards-grid { gap: 6px; }
  .bubble-option { width: 90px; height: 90px; }
  .interest-grid { grid-template-columns: 1fr; }
  .hero-features { flex-direction: column; align-items: center; }
  .versus-row { grid-template-columns: 1fr; }
}

/* Hover only on non-touch devices */
@media (hover: hover) and (pointer: fine) {
  .card-option:hover { background: rgba(108,99,255,0.08); border-color: rgba(108,99,255,0.25); transform: translateY(-3px); }
  .card-option:hover .card-icon { transform: scale(1.1); }
  .bubble-option:hover { transform: scale(1.06); border-color: rgba(108,99,255,0.3); }
  .versus-card:hover { background: rgba(108,99,255,0.08); border-color: rgba(108,99,255,0.25); transform: translateY(-2px); }
  .ranking-item:hover { background: rgba(108,99,255,0.06); border-color: rgba(108,99,255,0.2); transform: translateX(4px); }
  .scenario-option:hover { background: rgba(108,99,255,0.06); border-color: rgba(108,99,255,0.2); transform: translateX(3px); }
  .slider-option:hover { background: rgba(108,99,255,0.08); border-color: rgba(108,99,255,0.25); transform: scale(1.02); }
  .btn-start:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(108,99,255,0.45); }
  .btn-next.enabled:hover { transform: translateY(-2px); box-shadow: 0 4px 18px rgba(108,99,255,0.35); }
  .btn-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(81,207,102,0.35); }
  .btn-retake:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
  .btn-retake-new:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(108,99,255,0.35); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 10px; }

/* Interactive elements */
button, .answer-option, .interest-option, .card-option, .bubble-option, .versus-card, .ranking-item, .scenario-option, .slider-option {
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}

/* Safe areas */
@supports(padding: max(0px)) {
  .app-container { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
