/* Your Life in Numbers Styles */
/* Primary Color: #00E5FF (Cyan) */

:root {
  --primary: #00E5FF;
  --primary-dark: #00B8D4;
  --primary-light: #18FFFF;
  --primary-glow: rgba(0, 229, 255, 0.3);
  --bg: #0a0a0f;
  --bg-card: rgba(255, 255, 255, 0.05);
  --text: #e8e8f0;
  --text-muted: #8888aa;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --radius: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f0f4f8;
    --bg-card: rgba(0, 0, 0, 0.03);
    --text: #1a1a2e;
    --text-muted: #666680;
    --border: rgba(0, 0, 0, 0.08);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --primary-glow: rgba(0, 229, 255, 0.15);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #000;
  padding: 8px 16px;
  border-radius: 0 0 8px 8px;
  z-index: 10001;
  text-decoration: none;
  transition: top var(--transition);
}
.skip-link:focus { top: 0; }

/* App Loader */
.app-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.4s ease;
}
.app-loader.hidden { opacity: 0; pointer-events: none; }
.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Stars Canvas */
#stars-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Container */
.container {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
  padding: 20px;
}

/* Screen */
.screen { display: none; }
.screen.active { display: block; }

/* Hero */
.hero {
  text-align: center;
  padding: 60px 0 30px;
}
.hero-icon {
  font-size: 64px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 20px var(--primary-glow));
}
.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}
.subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 400px;
  margin: 0 auto;
}

/* Card */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* Input Card */
.input-card {
  text-align: center;
  max-width: 400px;
  margin: 0 auto;
}
.input-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.date-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.1rem;
  border: 2px solid var(--border);
  border-radius: calc(var(--radius) / 2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  text-align: center;
  transition: border-color var(--transition);
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
}
.date-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 14px 28px;
  border: none;
  border-radius: calc(var(--radius) / 2);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  gap: 8px;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #000;
  width: 100%;
  margin-top: 20px;
  font-size: 1.1rem;
  box-shadow: 0 4px 20px var(--primary-glow);
}
.btn-primary:hover { box-shadow: 0 6px 30px var(--primary-glow); }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  width: 100%;
  margin-top: 20px;
}

/* Result Header */
.result-header {
  text-align: center;
  padding: 40px 0 20px;
}
.result-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
}
.age-summary {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 8px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  transition: all var(--transition);
  opacity: 0;
  transform: translateY(20px);
}
.stat-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.stat-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
  transform: translateY(-4px);
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  display: block;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  font-family: 'SF Mono', 'Fira Code', monospace;
  line-height: 1.2;
  word-break: break-all;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Disclaimer */
.disclaimer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 16px;
  margin-top: 16px;
}

/* Share Section */
.share-section {
  text-align: center;
  margin-top: 24px;
}
.share-section h3 {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.share-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) / 2);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 44px;
}
.share-btn:hover {
  border-color: var(--primary);
  background: rgba(0, 229, 255, 0.1);
}
.share-btn.kakao:hover { border-color: #FEE500; background: rgba(254, 229, 0, 0.1); }
.share-btn.twitter:hover { border-color: #1DA1F2; background: rgba(29, 161, 242, 0.1); }
.share-btn.facebook:hover { border-color: #1877F2; background: rgba(24, 119, 242, 0.1); }

/* Responsive */
@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .stat-value {
    font-size: 1.7rem;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 360px) {
  .share-btn span {
    display: none;
  }
  .share-btn {
    padding: 10px;
  }
}

/* Count-up animation */
@keyframes countPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.stat-card.counting .stat-value {
  animation: countPulse 0.3s ease;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .stat-card {
    opacity: 1;
    transform: none;
  }
}

/* ===== ENGAGEMENT: Result Carousel ===== */
.result-carousel {
    position: relative; overflow: hidden; height: 52px; margin: 16px auto;
    max-width: 340px; border-radius: 12px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
}
.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: #e0e0e8; 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); }
}
.social-proof-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(0, 229, 255, 0.12); border: 1px solid rgba(0, 229, 255, 0.25);
    color: var(--primary); padding: 6px 16px; border-radius: 20px;
    font-size: 13px; font-weight: 600; margin: 12px auto; text-align: center;
}
.btn-pulse { animation: btnPulse 2s ease-in-out infinite; }
@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(0, 229, 255, 0); }
}
.about-section { max-width: 480px; margin: 24px auto; padding: 0 16px; }
.about-section details { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; overflow: hidden; }
.about-section summary {
    padding: 14px 18px; cursor: pointer; font-weight: 600; font-size: 15px;
    color: #e0e0e8; 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: #a0a0b8; line-height: 1.7; }
