/* ============ RESET & BASE ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #08080f;
  --surface: #12121f;
  --surface-2: #1a1a2e;
  --border: #2a2a4a;
  --text: #e8e8f0;
  --text-dim: #8888aa;
  --accent: #c9a050;
  --accent-glow: #f0d080;
  --purple: #7b3ff0;
  --purple-glow: #9f6fff;
  --green: #3ecf8e;
  --red: #ef4444;
  --blue: #6090f0;
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: 'Orbitron', monospace;
  --font-body: 'Inter', -apple-system, sans-serif;
}

html, body {
  height: 100%;
  overflow-x: hidden;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ============ PARTICLES CANVAS ============ */
#particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ============ SCREEN MANAGEMENT ============ */
.screen {
  display: none;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 20px 40px;
  flex-direction: column;
}
.screen.active { display: flex; }

/* ============ LANDING SCREEN ============ */
.landing-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  text-align: center;
  gap: 20px;
  padding: 40px 0;
}

.landing-icon {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 8px;
}

.eye-outer {
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: eyePulse 3s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(201, 160, 80, 0.3), 0 0 60px rgba(201, 160, 80, 0.1);
}

.eye-inner {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), var(--accent));
  animation: eyeInner 3s ease-in-out infinite;
  box-shadow: 0 0 20px var(--accent-glow);
}

@keyframes eyePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(201, 160, 80, 0.3); }
  50% { transform: scale(1.05); box-shadow: 0 0 50px rgba(201, 160, 80, 0.5); }
}

@keyframes eyeInner {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.landing-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.2;
  font-weight: 900;
}

.title-line { display: block; color: var(--text); }
.title-line.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-subtitle {
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 400;
  max-width: 280px;
}

.landing-stats {
  display: flex;
  gap: 40px;
  margin: 8px 0;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple-glow), var(--accent-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 36px;
  border: none;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-start {
  background: linear-gradient(135deg, var(--purple), #5a20d0);
  color: #fff;
  font-size: 18px;
  padding: 18px 48px;
  box-shadow: 0 0 30px rgba(123, 63, 240, 0.4), 0 8px 32px rgba(123, 63, 240, 0.3);
  animation: btnGlow 2s ease-in-out infinite;
}

.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(123, 63, 240, 0.6), 0 12px 40px rgba(123, 63, 240, 0.4);
}

@keyframes btnGlow {
  0%, 100% { box-shadow: 0 0 30px rgba(123, 63, 240, 0.4), 0 8px 32px rgba(123, 63, 240, 0.3); }
  50% { box-shadow: 0 0 50px rgba(123, 63, 240, 0.6), 0 8px 40px rgba(123, 63, 240, 0.5); }
}

.landing-disclaimer {
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.5;
}

/* ============ QUIZ SCREEN ============ */
.quiz-header {
  padding: 8px 0 20px;
}

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--accent));
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}

.progress-text {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-dim);
  min-width: 48px;
  text-align: right;
}

.quiz-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}

/* Question card */
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  animation: fadeSlideIn 0.4s ease;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.question-number {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 12px;
}

.question-text {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}

.question-hint {
  font-size: 13px;
  color: var(--text-dim);
}

/* Visual preview area */
.question-visual {
  width: 100%;
  height: 140px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}

.question-visual.revealing {
  animation: visualReveal 0.6s ease;
}

@keyframes visualReveal {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.05); filter: brightness(2); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* Quiz visual animation keyframes */
@keyframes pulseOrb {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes burstReveal {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes coinSpin {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

@keyframes arrowWobble {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(6px); }
  75% { transform: translateX(-6px); }
}

@keyframes floatA {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes floatB {
  0%, 100% { transform: translateY(-8px); }
  50% { transform: translateY(0); }
}

@keyframes glitchGhost {
  0%, 100% { transform: translateX(0); opacity: 0.3; }
  20% { transform: translateX(-4px); opacity: 0.5; }
  40% { transform: translateX(4px); opacity: 0.3; }
  60% { transform: translateX(-3px); opacity: 0.4; }
  80% { transform: translateX(2px); opacity: 0.3; }
}

/* Answer options */
.answer-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.answer-options.single-col { grid-template-columns: 1fr; }
.answer-options.three-col { grid-template-columns: repeat(3, 1fr); }

.answer-btn {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 16px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  position: relative;
}

.answer-btn:hover {
  border-color: var(--purple);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.answer-btn:active {
  transform: scale(0.97);
}

.answer-btn.correct {
  border-color: var(--green) !important;
  background: rgba(62, 207, 142, 0.15) !important;
  box-shadow: 0 0 20px rgba(62, 207, 142, 0.2);
}

.answer-btn.wrong {
  border-color: var(--red) !important;
  background: rgba(239, 68, 68, 0.15) !important;
  opacity: 0.6;
}

.answer-btn.disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* Timer question special */
.timer-display {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--purple-glow), var(--accent-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.timer-btn {
  width: 100%;
  padding: 22px;
  font-size: 18px;
  background: var(--surface-2);
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timer-btn:hover {
  background: rgba(201, 160, 80, 0.1);
  box-shadow: 0 0 30px rgba(201, 160, 80, 0.2);
}

.timer-feedback {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  min-height: 36px;
}

.timer-feedback.perfect { color: var(--green); }
.timer-feedback.close { color: var(--accent); }
.timer-feedback.off { color: var(--red); }

/* ============ ANALYZING SCREEN ============ */
.analyzing-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  gap: 28px;
  text-align: center;
}

.analyzing-spinner {
  position: relative;
  width: 100px; height: 100px;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  animation: spin 1.2s linear infinite;
}

.spinner-ring.inner {
  inset: 16px;
  border-top-color: var(--purple);
  animation-direction: reverse;
  animation-duration: 0.8s;
}

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

.analyzing-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.analyzing-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analyze-step {
  font-size: 14px;
  color: var(--text-dim);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.analyze-step.visible {
  opacity: 1;
  color: var(--text);
}

/* ============ RESULTS SCREEN ============ */
.results-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 40px;
}

.results-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.results-label {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 3px;
}

.score-circle {
  position: relative;
  width: 160px; height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-circle svg {
  position: absolute;
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}

.score-bg {
  fill: none;
  stroke: var(--surface-2);
  stroke-width: 8;
}

.score-fill {
  fill: none;
  stroke: url(#scoreGradient);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s ease;
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
}

.score-number {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-glow), var(--purple-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.score-category {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.score-description {
  font-size: 14px;
  color: var(--text-dim);
  max-width: 320px;
  line-height: 1.6;
}

/* Radar chart */
.results-radar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.results-radar h3 {
  font-family: var(--font-display);
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
}

#radar-chart {
  width: 260px;
  height: 260px;
  margin: 0 auto;
  display: block;
}


/* Ranking */
.results-ranking {
  text-align: center;
  font-size: 14px;
  color: var(--text-dim);
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.results-ranking strong {
  color: var(--accent-glow);
  font-family: var(--font-display);
}

/* Premium CTA */
.results-cta {
  position: relative;
}

.cta-card {
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(201,160,80,0.05) 0%, transparent 70%);
  animation: ctaShimmer 4s ease-in-out infinite;
}

@keyframes ctaShimmer {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(10px, -10px); }
}

.cta-badge {
  font-family: var(--font-display);
  font-size: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-glow));
  color: #000;
  padding: 6px 16px;
  border-radius: 50px;
  letter-spacing: 2px;
  font-weight: 700;
}

.cta-card h3 {
  font-size: 18px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.cta-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.cta-features li {
  font-size: 14px;
  color: var(--text-dim);
  padding-left: 20px;
  position: relative;
}

.cta-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.btn-premium {
  background: linear-gradient(135deg, var(--accent), #b89020);
  color: #000;
  font-size: 17px;
  padding: 16px 40px;
  box-shadow: 0 0 30px rgba(201, 160, 80, 0.3);
  position: relative;
  z-index: 1;
}

.btn-premium:hover {
  box-shadow: 0 0 50px rgba(201, 160, 80, 0.5);
  transform: translateY(-2px);
}

.cta-guarantee {
  font-size: 12px;
  color: var(--text-dim);
  position: relative;
  z-index: 1;
}

/* Email collection form */
.email-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.email-input {
  padding: 14px 18px;
  border-radius: 50px;
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

.email-input:focus {
  border-color: var(--accent);
}

.email-input::placeholder {
  color: var(--text-dim);
}

.email-success {
  font-size: 14px;
  color: var(--green);
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.already-paid {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  position: relative;
  z-index: 1;
  margin-top: 8px;
}

.already-paid a {
  color: var(--accent);
  text-decoration: underline;
}

/* Ad placeholder */
.ad-placeholder {
  text-align: center;
  padding: 16px 0;
}

.ad-label {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 1px;
  display: block;
  margin-bottom: 8px;
}

.ad-box {
  width: 100%;
  height: 300px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* Share */
.results-share {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 2px solid var(--purple);
  border-radius: 50px;
  background: transparent;
  color: var(--purple-glow);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-share:hover {
  background: rgba(123, 63, 240, 0.1);
  box-shadow: 0 0 20px rgba(123, 63, 240, 0.2);
}

.btn-retry {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-retry:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

/* ============ SHARE MODAL ============ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px; right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-dim);
  cursor: pointer;
}

.modal-content h3 {
  font-family: var(--font-display);
  margin-bottom: 16px;
}

#share-card {
  width: 100%;
  max-width: 300px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.share-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-hint {
  font-size: 12px;
  color: var(--text-dim);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 380px) {
  .landing-title { font-size: 26px; }
  .question-text { font-size: 18px; }
  .answer-btn { padding: 14px 12px; font-size: 14px; }
  .score-number { font-size: 44px; }
  .score-circle { width: 140px; height: 140px; }
  .score-circle svg { width: 140px; height: 140px; }
}

@media (min-width: 768px) {
  .screen { padding: 40px 32px; }
  .question-visual { height: 180px; }
  .answer-options { gap: 16px; }
  .answer-btn { padding: 22px 20px; font-size: 18px; }
}
