/* ========================================
   Soul Age Test - Styles
   Primary: #4C1D95 (Deep Indigo/Violet)
   Dark mode first, Glassmorphism 2.0
   ======================================== */

/* ===== CSS Variables (Dark mode default) ===== */
:root {
  --primary: #4C1D95;
  --primary-light: #7C3AED;
  --primary-dark: #2E1065;
  --primary-glow: rgba(76, 29, 149, 0.4);
  --primary-glow-strong: rgba(76, 29, 149, 0.6);
  --primary-dim: rgba(76, 29, 149, 0.15);
  --bg: #0a0a14;
  --bg2: #0f0f1e;
  --surface: #1a1a30;
  --surface2: #252545;
  --surface-hover: #2d2d50;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border: rgba(255, 255, 255, 0.1);
  --border2: rgba(255, 255, 255, 0.15);
  --border-active: rgba(76, 29, 149, 0.5);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: 20px;
  --shadow: rgba(0, 0, 0, 0.4);
  --tier-infant: #fbbf24;
  --tier-young: #f97316;
  --tier-mature: #10b981;
  --tier-old: #6366f1;
  --tier-transcendent: #a78bfa;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;
}

/* ===== Light Mode ===== */
[data-theme="light"] {
  --bg: #f5f0ff;
  --bg2: #ede5ff;
  --surface: rgba(255, 255, 255, 0.8);
  --surface2: rgba(255, 255, 255, 0.9);
  --surface-hover: rgba(76, 29, 149, 0.08);
  --text: #1a1a2e;
  --text-muted: #4a4a6a;
  --text-dim: #8888a0;
  --border: rgba(0, 0, 0, 0.08);
  --border2: rgba(0, 0, 0, 0.12);
  --border-active: rgba(76, 29, 149, 0.4);
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.8);
  --shadow: rgba(76, 29, 149, 0.08);
  --primary-glow: rgba(76, 29, 149, 0.15);
  --primary-glow-strong: rgba(76, 29, 149, 0.25);
  --primary-dim: rgba(76, 29, 149, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', 'Noto Sans JP', 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

/* Background ambient glow */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(76, 29, 149, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(46, 16, 101, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(124, 58, 237, 0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(76, 29, 149, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(46, 16, 101, 0.05) 0%, transparent 50%);
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Skip Link (a11y) ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  z-index: 10001;
  text-decoration: none;
  font-weight: 600;
  transition: top var(--transition);
}

.skip-link:focus {
  top: 16px;
}

/* ===== App Loader ===== */
#app-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.4s ease;
}

#app-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-icon {
  font-size: 3rem;
  animation: loaderPulse 1.2s ease-in-out infinite;
}

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

/* ===== Theme Toggle ===== */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: all var(--transition);
  font-size: 1.1rem;
}

.theme-toggle:hover {
  background: var(--surface-hover);
  transform: scale(1.08);
  border-color: var(--primary-glow);
}

.theme-icon {
  line-height: 1;
}

/* ===== Language Selector ===== */
.lang-selector {
  position: fixed;
  top: 16px;
  right: 70px;
  z-index: 100;
}

.lang-btn {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-btn:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px var(--shadow);
  padding: 6px;
  min-width: 160px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 101;
}

.lang-dropdown.active {
  display: block;
  animation: fadeSlideDown 0.2s ease;
}

@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.lang-option {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}

.lang-option:hover {
  background: var(--primary-dim);
}

.lang-option.active {
  background: var(--primary-dim);
  color: var(--primary-light);
  font-weight: 600;
}

/* ===== Layout ===== */
main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 80px 16px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  text-align: center;
  margin-bottom: 24px;
}

.app-title {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--primary), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.app-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 6px;
}

.container {
  width: 100%;
  max-width: 560px;
}

/* ===== Glassmorphism Card ===== */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: 0 8px 32px var(--shadow);
  transition: all var(--transition);
}

/* ===== Start Screen ===== */
.start-content {
  text-align: center;
}

/* Animated Soul Orb */
.soul-orb {
  width: 140px;
  height: 140px;
  margin: 0 auto 28px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--primary-dark),
    var(--primary),
    var(--primary-light),
    #a78bfa,
    #8b5cf6,
    var(--primary),
    var(--primary-dark)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: orbRotate 6s linear infinite;
  box-shadow:
    0 0 30px var(--primary-glow),
    0 0 60px var(--primary-glow),
    inset 0 0 30px rgba(76, 29, 149, 0.2);
}

.soul-orb::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(
    from 180deg,
    transparent 0%,
    var(--primary-glow-strong) 25%,
    transparent 50%,
    var(--primary-glow-strong) 75%,
    transparent 100%
  );
  animation: orbRotate 4s linear infinite reverse;
  filter: blur(8px);
}

.soul-orb::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--bg);
}

.orb-inner {
  position: relative;
  z-index: 2;
  font-size: 3rem;
  animation: orbPulse 2.5s ease-in-out infinite;
}

@keyframes orbRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px var(--primary-glow)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 24px var(--primary-glow-strong)); }
}

.start-desc {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.btn-start {
  width: 100%;
  max-width: 280px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 20px var(--primary-glow-strong);
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.btn-start::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-start:hover::before {
  left: 100%;
}

.btn-start:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px var(--primary-glow-strong);
}

.btn-start:active {
  transform: translateY(-1px);
}

/* ===== Progress Bar ===== */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light), #a78bfa);
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 100%;
  background: rgba(255, 255, 255, 0.4);
  filter: blur(4px);
  animation: progressShine 1.5s ease-in-out infinite;
}

@keyframes progressShine {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

.progress-text {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
}

/* ===== Question Card ===== */
.question-card {
  text-align: center;
  animation: cardSlideIn 0.4s ease;
}

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.scenario-emoji {
  font-size: 2.8rem;
  margin-bottom: 16px;
  animation: emojiFloat 2s ease-in-out infinite;
}

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

.question-text {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 24px;
  color: var(--text);
}

/* ===== Options ===== */
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.option-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  transition: width 0.3s ease;
  opacity: 0.15;
  border-radius: var(--radius-sm);
}

.option-btn:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
  transform: translateX(4px);
  box-shadow: 0 2px 12px var(--primary-glow);
}

.option-btn:active {
  transform: translateX(2px) scale(0.99);
}

/* Selected states */
.option-btn.selected {
  pointer-events: none;
}

.option-btn.selected-infant {
  border-color: var(--tier-infant);
  background: rgba(251, 191, 36, 0.15);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}

.option-btn.selected-infant::before {
  width: 100%;
  background: var(--tier-infant);
}

.option-btn.selected-young {
  border-color: var(--tier-young);
  background: rgba(249, 115, 22, 0.15);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.2);
}

.option-btn.selected-young::before {
  width: 100%;
  background: var(--tier-young);
}

.option-btn.selected-mature {
  border-color: var(--tier-mature);
  background: rgba(16, 185, 129, 0.15);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.option-btn.selected-mature::before {
  width: 100%;
  background: var(--tier-mature);
}

.option-btn.selected-old {
  border-color: var(--tier-old);
  background: rgba(99, 102, 241, 0.15);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.option-btn.selected-old::before {
  width: 100%;
  background: var(--tier-old);
}

.option-btn.selected-transcendent {
  border-color: var(--tier-transcendent);
  background: rgba(167, 139, 250, 0.15);
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.2);
}

.option-btn.selected-transcendent::before {
  width: 100%;
  background: var(--tier-transcendent);
}

/* Disable other options after selecting */
.options.answered .option-btn:not([class*="selected"]) {
  opacity: 0.4;
  pointer-events: none;
}

.options.answered .option-btn {
  pointer-events: none;
}

/* ===== Result Screen ===== */
.result-card {
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: resultFadeIn 0.6s ease;
}

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

/* Mystical particles */
.result-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(2px 2px at 40% 70%, rgba(167, 139, 250, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 60% 20%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 80% 50%, rgba(124, 58, 237, 0.4), transparent),
    radial-gradient(1px 1px at 10% 80%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 70% 90%, rgba(167, 139, 250, 0.3), transparent),
    radial-gradient(2px 2px at 90% 10%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(124, 58, 237, 0.5), transparent);
  animation: sparkleFloat 6s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes sparkleFloat {
  from { transform: translateY(0) rotate(0deg); }
  to { transform: translateY(-20px) rotate(5deg); }
}

.result-card > * {
  position: relative;
  z-index: 1;
}

/* Tier Badge */
.result-tier-badge {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 2rem;
  margin-bottom: 16px;
}

/* ===== Soul Age Display ===== */
.soul-age-display {
  margin: 16px auto 8px;
  text-align: center;
}

.soul-age-number {
  font-size: 3.2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  transition: color 0.3s ease;
}

.soul-age-unit {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}

.soul-age-number.counting {
  animation: scoreCount 0.1s ease;
}

@keyframes scoreCount {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Tier-specific soul age colors */
.result-card.tier-infant .soul-age-number {
  color: var(--tier-infant);
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}
.result-card.tier-young .soul-age-number {
  color: var(--tier-young);
  text-shadow: 0 0 20px rgba(249, 115, 22, 0.3);
}
.result-card.tier-mature .soul-age-number {
  color: var(--tier-mature);
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}
.result-card.tier-old .soul-age-number {
  background: linear-gradient(135deg, #818cf8, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.4));
}
.result-card.tier-transcendent .soul-age-number {
  background: linear-gradient(135deg, #c4b5fd, #a78bfa, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 16px rgba(167, 139, 250, 0.5));
}

/* ===== Soul Meter ===== */
.soul-meter-container {
  margin: 16px auto 24px;
  max-width: 400px;
}

.soul-meter {
  width: 100%;
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.soul-meter-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  width: 0;
}

.result-card.tier-infant .soul-meter-fill {
  background: linear-gradient(90deg, #f59e0b, var(--tier-infant));
}
.result-card.tier-young .soul-meter-fill {
  background: linear-gradient(90deg, #ea580c, var(--tier-young));
}
.result-card.tier-mature .soul-meter-fill {
  background: linear-gradient(90deg, #059669, var(--tier-mature));
}
.result-card.tier-old .soul-meter-fill {
  background: linear-gradient(90deg, #4f46e5, var(--tier-old), #818cf8);
}
.result-card.tier-transcendent .soul-meter-fill {
  background: linear-gradient(90deg, #7c3aed, #a78bfa, #c4b5fd, #a78bfa);
  background-size: 200% 100%;
  animation: transcendentShimmer 2s ease-in-out infinite;
}

@keyframes transcendentShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.soul-meter-glow {
  position: absolute;
  top: -4px;
  right: 0;
  width: 24px;
  height: calc(100% + 8px);
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0;
  transition: opacity 1s ease 0.5s;
}

.result-card.tier-infant .soul-meter-glow { background: var(--tier-infant); }
.result-card.tier-young .soul-meter-glow { background: var(--tier-young); }
.result-card.tier-mature .soul-meter-glow { background: var(--tier-mature); }
.result-card.tier-old .soul-meter-glow { background: var(--tier-old); }
.result-card.tier-transcendent .soul-meter-glow { background: var(--tier-transcendent); }

.soul-meter.filled .soul-meter-glow {
  opacity: 0.8;
}

/* ===== Tier Name & Description ===== */
.result-tier-name {
  font-size: 1.6rem;
  font-weight: 800;
  margin-top: 16px;
  margin-bottom: 8px;
}

.result-card.tier-transcendent .result-tier-name {
  background: linear-gradient(135deg, #c4b5fd, #a78bfa, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-tier-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Soul Timeline ===== */
.soul-timeline {
  margin: 28px 0;
  text-align: left;
}

.soul-timeline h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-align: center;
}

.timeline-track {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 24px;
}

.timeline-track::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: transparent;
  border-radius: var(--radius-xs);
  font-size: 0.88rem;
  transition: all 0.3s ease;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -21px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  z-index: 1;
  transition: all 0.3s ease;
}

.timeline-item.active {
  background: var(--glass-bg);
  border: 1px solid var(--border2);
}

.timeline-item.active::before {
  border-color: var(--primary-light);
  background: var(--primary-light);
  box-shadow: 0 0 8px var(--primary-glow);
}

.timeline-item.passed::before {
  border-color: var(--text-dim);
  background: var(--text-dim);
}

.timeline-emoji {
  font-size: 1.2rem;
  margin-right: 10px;
  min-width: 24px;
  text-align: center;
}

.timeline-info {
  flex: 1;
}

.timeline-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.85rem;
}

.timeline-age {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.timeline-item.active .timeline-name {
  color: var(--primary-light);
}

.timeline-item.active .timeline-age {
  color: var(--text-muted);
}

.timeline-marker {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--primary-dim);
  color: var(--primary-light);
  white-space: nowrap;
}

/* ===== Share Section ===== */
.share-section {
  margin: 28px 0 20px;
}

.share-section h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.share-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-share {
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-twitter {
  background: #1d9bf0;
  color: #fff;
  border: none;
}

.btn-twitter:hover {
  background: #1a8cd8;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(29, 155, 240, 0.3);
}

.btn-copy {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border2);
}

.btn-copy:hover {
  border-color: var(--primary);
  background: var(--primary-dim);
  transform: translateY(-2px);
}

.btn-copy.copied {
  border-color: #10b981;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

/* ===== Percentile Stat ===== */
.percentile-stat {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 20px;
}

/* ===== Related Tests ===== */
.related-tests {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  width: 100%;
}

.related-tests h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.related-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.related-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--card-color, var(--primary));
}

.related-card:hover {
  transform: translateY(-2px);
  border-color: var(--card-color, var(--primary));
  box-shadow: 0 4px 16px var(--shadow);
}

.related-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.related-name {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

/* ===== Retake Button ===== */
.btn-retake {
  width: 100%;
  max-width: 280px;
  margin-top: 8px;
  background: transparent;
  color: var(--primary-light);
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  padding: 14px 32px;
}

.btn-retake:hover {
  background: var(--primary-dim);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-retake:active {
  transform: translateY(0);
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 30px 16px 40px;
  position: relative;
  z-index: 1;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: inline-block;
}

footer a:hover {
  color: var(--primary-light);
  background: var(--primary-dim);
}

/* ===== Tier-specific Card Borders ===== */
.result-card.tier-infant {
  border-color: rgba(251, 191, 36, 0.3);
}

.result-card.tier-young {
  border-color: rgba(249, 115, 22, 0.3);
}

.result-card.tier-mature {
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.result-card.tier-old {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.15);
}

.result-card.tier-transcendent {
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow:
    0 0 30px rgba(167, 139, 250, 0.15),
    0 0 60px rgba(167, 139, 250, 0.08);
  animation: resultFadeIn 0.6s ease, transcendentGlow 3s ease-in-out infinite;
}

@keyframes transcendentGlow {
  0%, 100% {
    box-shadow:
      0 0 30px rgba(167, 139, 250, 0.15),
      0 0 60px rgba(167, 139, 250, 0.08);
  }
  50% {
    box-shadow:
      0 0 40px rgba(167, 139, 250, 0.25),
      0 0 80px rgba(167, 139, 250, 0.12);
  }
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  main {
    padding: 70px 12px 32px;
  }

  .app-title {
    font-size: 1.5rem;
  }

  .card {
    padding: 24px 18px;
  }

  .soul-orb {
    width: 110px;
    height: 110px;
  }

  .orb-inner {
    font-size: 2.4rem;
  }

  .question-text {
    font-size: 1.05rem;
  }

  .option-btn {
    padding: 12px 14px;
    font-size: 0.9rem;
  }

  .soul-age-number {
    font-size: 2.6rem;
  }

  .result-tier-name {
    font-size: 1.35rem;
  }

  .share-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn-share {
    width: 100%;
    max-width: 240px;
  }

  .lang-selector {
    right: 62px;
  }

  .lang-btn {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  #currentLang {
    display: none;
  }
}

@media (max-width: 360px) {
  .app-title {
    font-size: 1.3rem;
  }

  .soul-orb {
    width: 90px;
    height: 90px;
  }

  .orb-inner {
    font-size: 2rem;
  }

  .scenario-emoji {
    font-size: 2.2rem;
  }
}

/* ===== Desktop enhancements ===== */
@media (min-width: 768px) {
  main {
    padding-top: 100px;
  }

  .app-title {
    font-size: 2.2rem;
  }

  .app-subtitle {
    font-size: 1.15rem;
  }

  .card {
    padding: 40px 36px;
  }

  .soul-orb {
    width: 160px;
    height: 160px;
  }

  .orb-inner {
    font-size: 3.5rem;
  }

  .option-btn:hover {
    transform: translateX(6px);
  }
}

/* ===== Utility: fade-in animation ===== */
.fade-in {
  animation: fadeIn 0.5s ease;
}

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

/* ===== Copy tooltip ===== */
.copy-tooltip {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 16px var(--shadow);
  border: 1px solid var(--border2);
  z-index: 1000;
  animation: tooltipFade 2s ease forwards;
}

@keyframes tooltipFade {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  85% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ===== ENGAGEMENT: Result Carousel ===== */
.result-carousel {
    position: relative;
    overflow: hidden;
    height: 52px;
    margin: 16px auto;
    max-width: 340px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
}
.carousel-track {
    display: flex;
    flex-direction: column;
    animation: carouselScroll 12s ease-in-out infinite;
}
.carousel-item {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    padding: 0 16px;
}
@keyframes carouselScroll {
    0%, 20% { transform: translateY(0); }
    25%, 45% { transform: translateY(-52px); }
    50%, 70% { transform: translateY(-104px); }
    75%, 95% { transform: translateY(-156px); }
    100% { transform: translateY(0); }
}

/* ===== ENGAGEMENT: Social Proof Badge ===== */
.social-proof-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(76, 29, 149, 0.12);
    border: 1px solid rgba(76, 29, 149, 0.25);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin: 8px auto 12px;
}

/* ===== ENGAGEMENT: Pulse CTA ===== */
.btn-pulse {
    animation: btnPulse 2s ease-in-out infinite;
}
@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(76, 29, 149, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(76, 29, 149, 0); }
}

/* ===== About / Collapsible Section ===== */
.about-section {
    max-width: 480px;
    margin: 24px auto;
    padding: 0 16px;
}
.about-section details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.about-section summary {
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.about-section summary::after {
    content: "+";
    font-size: 18px;
    color: var(--primary);
    transition: transform 0.2s;
}
.about-section details[open] summary::after {
    content: "\2212";
}
.about-section summary::-webkit-details-marker { display: none; }
.about-content {
    padding: 0 18px 18px;
}
.about-content h2 {
    font-size: 16px;
    color: var(--primary);
    margin: 16px 0 8px;
}
.about-content p {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.7;
}
