/* ============================================
   AURA METER — Aesthetic Dark Theme
   ============================================ */

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

:root {
  --bg-primary: #0a0a0f;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --text-primary: #f0ece4;
  --text-secondary: rgba(240, 236, 228, 0.6);
  --text-muted: rgba(240, 236, 228, 0.35);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --aura-hue: 35;
  --aura-sat: 100%;
  --aura-light: 60%;

  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  height: 100%;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Screens ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen::-webkit-scrollbar {
  width: 3px;
}

.screen::-webkit-scrollbar-track {
  background: transparent;
}

.screen::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.screen.active {
  opacity: 1;
  visibility: visible;
}

/* ---------- Welcome Screen ---------- */
#screen-welcome {
  flex-direction: column;
  text-align: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(120, 80, 200, 0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 70%, rgba(255, 107, 53, 0.05) 0%, transparent 50%),
              var(--bg-primary);
}

.bg-orb {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(155, 89, 182, 0.12) 0%, transparent 70%);
  animation: orb-float 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes orb-float {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  33% { transform: translate(-45%, -55%) scale(1.05); }
  66% { transform: translate(-55%, -45%) scale(0.95); }
}

/* Particles */
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: particle-drift linear infinite;
}

@keyframes particle-drift {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

.welcome-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.logo {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(255, 107, 53, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  backdrop-filter: blur(10px);
}

.logo-icon {
  font-size: 36px;
  color: #f0ece4;
  animation: logo-spin 6s linear infinite;
}

@keyframes logo-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.title {
  font-family: 'Playfair Display', serif;
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #f0ece4 0%, #c4b5fd 50%, #f0ece4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: 0.04em;
}

.preview-row {
  display: flex;
  gap: 10px;
  margin: 8px 0;
}

.preview-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--dot-color);
  opacity: 0.6;
  animation: dot-pulse 2s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.3s);
}

.preview-dot:nth-child(1) { --i: 0; }
.preview-dot:nth-child(2) { --i: 1; }
.preview-dot:nth-child(3) { --i: 2; }
.preview-dot:nth-child(4) { --i: 3; }
.preview-dot:nth-child(5) { --i: 4; }
.preview-dot:nth-child(6) { --i: 5; }

@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.3); opacity: 0.9; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: 16px;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(155, 89, 182, 0.3), rgba(255, 107, 53, 0.3));
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.btn-primary:active {
  transform: scale(0.96);
  background: linear-gradient(135deg, rgba(155, 89, 182, 0.4), rgba(255, 107, 53, 0.4));
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

.btn-secondary:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- Quiz Screen ---------- */
#screen-quiz {
  background: var(--bg-primary);
}

.quiz-container {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Progress */
.progress-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.progress-track {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(155, 89, 182, 0.8), rgba(255, 107, 53, 0.8));
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 44px;
  text-align: right;
}

/* Question */
.question-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
}

.question-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.question-text {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--text-primary);
}

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

.option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.option-card:active {
  transform: scale(0.95);
}

.option-card.selected {
  background: rgba(155, 89, 182, 0.15);
  border-color: rgba(155, 89, 182, 0.4);
  box-shadow: 0 0 30px rgba(155, 89, 182, 0.1);
}

.option-card .option-emoji {
  font-size: 34px;
  line-height: 1;
}

.option-card .option-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
}

.option-card.selected .option-label {
  color: var(--text-primary);
}

.btn-next {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  background: linear-gradient(135deg, rgba(155, 89, 182, 0.25), rgba(255, 107, 53, 0.25));
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-height: 54px;
}

.btn-next.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.btn-next:active {
  transform: scale(0.97);
  background: linear-gradient(135deg, rgba(155, 89, 182, 0.35), rgba(255, 107, 53, 0.35));
}

/* ---------- Result Screen ---------- */
#screen-result {
  background: radial-gradient(ellipse at 50% 20%, color-mix(in srgb, var(--aura-color-1) 10%, transparent) 0%, transparent 60%),
              var(--bg-primary);
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 20px 48px;
  gap: 28px;
}

#screen-result::-webkit-scrollbar {
  width: 3px;
}

#screen-result::-webkit-scrollbar-track {
  background: transparent;
}

#screen-result::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.result-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
  max-width: 380px;
}

/* Aura Card */
.aura-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 9 / 13;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(
    145deg,
    var(--aura-color-1) 0%,
    color-mix(in srgb, var(--aura-color-1) 60%, var(--aura-color-2) 40%) 50%,
    var(--aura-color-2) 100%
  );
  box-shadow:
    0 0 80px color-mix(in srgb, var(--aura-color-1) 25%, transparent),
    0 0 160px color-mix(in srgb, var(--aura-color-2) 15%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  animation: card-appear 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: center;
}

@keyframes card-appear {
  0% { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}

.aura-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 35%,
    rgba(255, 255, 255, 0.15) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.aura-orb {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.25) 0%,
    transparent 70%
  );
  animation: orb-pulse 3s ease-in-out infinite;
}

.aura-orb-inner {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.4) 0%,
    transparent 70%
  );
  filter: blur(4px);
  animation: orb-inner-pulse 3s ease-in-out infinite reverse;
}

@keyframes orb-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.8; }
  50% { transform: translateX(-50%) scale(1.15); opacity: 1; }
}

@keyframes orb-inner-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
}

.aura-stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.aura-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: star-twinkle var(--duration, 2s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes star-twinkle {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.5); }
}

.aura-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  margin-top: 80px;
}

.aura-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
}

.aura-title {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  line-height: 1.15;
  margin-bottom: 4px;
}

.aura-meter-bar {
  width: 160px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}

.aura-meter-fill {
  height: 100%;
  width: 0%;
  background: white;
  border-radius: 4px;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
}

.aura-percent {
  font-size: 40px;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  line-height: 1;
  margin-bottom: 4px;
}

.aura-percent::after {
  content: '%';
  font-size: 20px;
  font-weight: 400;
  opacity: 0.7;
}

.aura-description {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);
  line-height: 1.5;
  max-width: 260px;
  margin-top: 4px;
}

.aura-footer {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
}

.aura-bot-tag {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.06em;
}

/* Result action buttons */
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 340px;
}

.result-actions .btn {
  justify-content: center;
  width: 100%;
  padding: 16px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 24px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Premium Badge ---------- */
.aura-premium-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(255, 165, 0, 0.15));
  border: 1px solid rgba(255, 215, 0, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
  animation: premium-badge-glow 2s ease-in-out infinite;
}

.aura-premium-badge span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #FFD700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

@keyframes premium-badge-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.1); }
  50% { box-shadow: 0 0 25px rgba(255, 215, 0, 0.25); }
}

/* Premium card golden frame */
.aura-card.premium {
  box-shadow:
    0 0 40px color-mix(in srgb, var(--aura-color-1) 20%, transparent),
    0 0 80px color-mix(in srgb, var(--aura-color-2) 15%, transparent),
    0 0 0 2px rgba(255, 215, 0, 0.3),
    0 0 0 5px rgba(255, 215, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: premium-card-pulse 3s ease-in-out infinite;
}

@keyframes premium-card-pulse {
  0%, 100% { box-shadow: 0 0 40px color-mix(in srgb, var(--aura-color-1) 20%, transparent), 0 0 80px color-mix(in srgb, var(--aura-color-2) 15%, transparent), 0 0 0 2px rgba(255, 215, 0, 0.3), 0 0 0 5px rgba(255, 215, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
  50% { box-shadow: 0 0 60px color-mix(in srgb, var(--aura-color-1) 25%, transparent), 0 0 120px color-mix(in srgb, var(--aura-color-2) 20%, transparent), 0 0 0 3px rgba(255, 215, 0, 0.4), 0 0 0 6px rgba(255, 215, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
}

/* Premium sparkle overlay */
.aura-card.premium::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(255, 215, 0, 0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(255, 215, 0, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 2;
}

/* ---------- Premium Upsell ---------- */
.premium-upsell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  animation: upsell-fade 0.5s ease 0.2s both;
}

@keyframes upsell-fade {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

.premium-divider {
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  margin: 4px 0;
}

.premium-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.premium-icon {
  font-size: 22px;
}

.premium-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--text-primary);
}

.premium-desc {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
}

/* Pricing Card */
.pricing-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(255, 165, 0, 0.05));
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.25s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.pricing-card:active {
  transform: scale(0.97);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(255, 165, 0, 0.08));
}

.pricing-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pricing-stars {
  font-size: 18px;
  font-weight: 700;
  color: #FFD700;
  letter-spacing: 0.02em;
}

.pricing-label {
  font-size: 12px;
  color: var(--text-muted);
}

.pricing-arrow {
  font-size: 20px;
  color: var(--text-secondary);
  transition: transform 0.25s ease;
}

.pricing-card:active .pricing-arrow {
  transform: translateX(4px);
}

.premium-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 2px;
}

/* Premium Loader */
.premium-loader {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.loader-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 215, 0, 0.2);
  border-top-color: #FFD700;
  border-radius: 50%;
  animation: loader-spin 0.8s linear infinite;
}

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

.premium-loader span {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Premium Already */
.premium-already {
  text-align: center;
  padding: 8px 0;
}

.premium-already p {
  font-size: 14px;
  color: #FFD700;
}

/* ---------- Responsive ---------- */
@media (max-width: 420px) {
  .title { font-size: 40px; }
  .question-text { font-size: 24px; }
  .option-card { padding: 16px 10px; }
  .option-card .option-emoji { font-size: 28px; }
  .aura-title { font-size: 26px; }
  .aura-percent { font-size: 34px; }
  .aura-card { padding: 24px 18px; }
}

@media (max-height: 640px) {
  .quiz-container { gap: 20px; }
  .question-area { min-height: 60px; }
  .option-card { padding: 12px 8px; }
  .option-card .option-emoji { font-size: 24px; }
}
